Adapt for web
This commit is contained in:
1 parent
7418bbbe27
commit
9f82e7a2e6
14 files changed
+189
-40
No files matched your search
+33
-2
@@ -183,8 +183,8 @@ namespace ZL {
|
||||
}
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("multiplayerButton2", [this](const std::string& name) {
|
||||
std::cerr << "Multiplayer button pressed → opening multiplayer menu\n";
|
||||
uiManager.setButtonCallback("multiplayerButton2", [this, shipSelectionRoot, loadGameplayUI](const std::string& name) {
|
||||
/*std::cerr << "Multiplayer button pressed → opening multiplayer menu\n";
|
||||
|
||||
uiManager.startAnimationOnNode("playButton", "buttonsExit");
|
||||
uiManager.startAnimationOnNode("settingsButton", "buttonsExit");
|
||||
@@ -219,6 +219,37 @@ namespace ZL {
|
||||
}
|
||||
else {
|
||||
std::cerr << "Failed to load multiplayer menu\n";
|
||||
}*/
|
||||
std::cerr << "Single button pressed: " << name << " -> open ship selection UI\n";
|
||||
if (!shipSelectionRoot) {
|
||||
std::cerr << "Failed to load ship selection UI\n";
|
||||
return;
|
||||
}
|
||||
if (uiManager.pushMenuFromSavedRoot(shipSelectionRoot)) {
|
||||
uiManager.setButtonCallback("spaceshipButton", [this, loadGameplayUI](const std::string& btnName) {
|
||||
std::string nick = uiManager.getTextFieldValue("nicknameInput");
|
||||
if (nick.empty()) nick = "Player";
|
||||
int shipType = 0;
|
||||
uiManager.popMenu();
|
||||
loadGameplayUI();
|
||||
if (onSingleplayerPressed) onSingleplayerPressed(nick, shipType);
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("cargoshipButton", [this, loadGameplayUI](const std::string& btnName) {
|
||||
std::string nick = uiManager.getTextFieldValue("nicknameInput");
|
||||
if (nick.empty()) nick = "Player";
|
||||
int shipType = 1;
|
||||
uiManager.popMenu();
|
||||
loadGameplayUI();
|
||||
if (onSingleplayerPressed) onSingleplayerPressed(nick, shipType);
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("backButton", [this](const std::string& btnName) {
|
||||
uiManager.popMenu();
|
||||
});
|
||||
}
|
||||
else {
|
||||
std::cerr << "Failed to push ship selection menu\n";
|
||||
}
|
||||
});
|
||||
uiManager.setButtonCallback("exitButton", [](const std::string& name) {
|
||||
|
||||
Reference in new issue
Block a user