Skip to content

Commit

Permalink
UI: Always use callback quant for interface message
Browse files Browse the repository at this point in the history
This should reduce amount of UI code being called from Logic
  • Loading branch information
IonAgorria committed Jun 7, 2024
1 parent 8e024bc commit fcbefb3
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions Source/UserInterface/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,23 +216,19 @@ int resultWNDID = -1;
terUniverseInterfaceMessage resultID = UNIVERSE_INTERFACE_MESSAGE_GAME_RESULT_UNDEFINED;

int goToResultQuant( float, float ) {
if (!gameShell->GameActive) {
return 0;
} else if (menuChangingDone) {
processInterfaceMessage(resultID, resultWNDID);
return 0;
}
return 1;
if (!gameShell->GameActive) {
return 0;
} else if (menuChangingDone || gameShell->currentSingleProfile.getLastGameType() != UserSingleProfile::MULTIPLAYER) {
processInterfaceMessage(resultID, resultWNDID);
return 0;
}
return 1;
}

void processInterfaceMessageLater(terUniverseInterfaceMessage id, int wndIDToHide = -1) {
if (gameShell->currentSingleProfile.getLastGameType() == UserSingleProfile::MULTIPLAYER) {
resultID = id;
resultWNDID = wndIDToHide;
_shellIconManager.AddDynamicHandler( goToResultQuant, CBCODE_QUANT );
} else {
processInterfaceMessage(id, wndIDToHide);
}
resultID = id;
resultWNDID = wndIDToHide;
_shellIconManager.AddDynamicHandler( goToResultQuant, CBCODE_QUANT );
}

void loadMapVector(
Expand Down

0 comments on commit fcbefb3

Please sign in to comment.