Closed PsychoCoffee closed 2 years ago
I believe the error is either that I can't stack 2 PopupModal windows, or that it's a syntax error I can't find anywhere.
It is neither. There's a bug with your logic:
if (ImGui::Button("Start new game", ImVec2(130, 0))) {
ImGui::CloseCurrentPopup();
ImGui::OpenPopup("##LoadGame");
LoadingGameDialog();
}
You are only calling the loading popup logic for a single frame when the button is clicked.
You should probably move the LoadingGameDialog()
call in the same location as the newGame()
call.
See #5684 for the same issue with a more thorough explanation.
Wow! Thank you and the OP very much. I got it to work.
I did a slight modification:
if (ImGui::Button("Start new game", ImVec2(130, 0))) {
isLoadingDialog = true;
}
//At the end of the method for drawing main menu I did:
if (isLoadingDialog) {
ImGui::OpenPopup("##LoadGame");
}
LoadingGameDialog();
Hello.
After calling PopupModalWindow that lets you select what save you want to play, I want to call another PopupModalWindow that shows you the progress of loading the level.
But, the LoadingGameDialog(); PopupModal never appears on the screen, no matter what I tried to change around. No errors come up when I call the function.
This code is extremely un-clean and I agree, since I am a beginner at side of game development. I believe the error is either that I can't stack 2 PopupModal windows, or that it's a syntax error I can't find anywhere.
So the order is: Main Menu Buttons (Basic Window) > Start New Game Screen (PopupModal) > Loading Game Dialog (PopupModal)
What I tried: