Merge remote-tracking branch 'origin/main' into spark
This commit is contained in:
commit
6fe10eacfc
38 files changed
+1231
-147
No files matched your search
+36
-4
@@ -188,13 +188,16 @@ namespace ZL {
|
||||
state = GameState::Gameplay;
|
||||
uiManager.replaceRoot(gameplayRoot);
|
||||
|
||||
uiManager.findButton("minusButton")->state = ButtonState::Disabled;
|
||||
if (auto btn = uiManager.findButton("takeButton")) btn->state = ButtonState::Disabled;
|
||||
|
||||
|
||||
/*
|
||||
auto velocityTv = uiManager.findTextView("velocityText");
|
||||
if (velocityTv) {
|
||||
velocityTv->rect.x = 10.0f;
|
||||
velocityTv->rect.y = static_cast<float>(Environment::height) - velocityTv->rect.h - 10.0f;
|
||||
}
|
||||
|
||||
uiManager.startAnimationOnNode("backgroundNode", "bgScroll");
|
||||
}*/
|
||||
|
||||
uiManager.setButtonPressCallback("shootButton", [this](const std::string&) {
|
||||
if (onFirePressed) onFirePressed();
|
||||
@@ -205,20 +208,49 @@ namespace ZL {
|
||||
uiManager.setButtonPressCallback("plusButton", [this](const std::string&) {
|
||||
int newVel = Environment::shipState.selectedVelocity + 1;
|
||||
if (newVel > 4) newVel = 4;
|
||||
uiManager.findButton("minusButton")->state = ButtonState::Normal;
|
||||
if (newVel == 4)
|
||||
{
|
||||
uiManager.findButton("plusButton")->state = ButtonState::Disabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
uiManager.findButton("plusButton")->state = ButtonState::Normal;
|
||||
}
|
||||
if (onVelocityChanged) onVelocityChanged(newVel);
|
||||
});
|
||||
uiManager.setButtonPressCallback("minusButton", [this](const std::string&) {
|
||||
int newVel = Environment::shipState.selectedVelocity - 1;
|
||||
if (newVel < 0) newVel = 0;
|
||||
uiManager.findButton("plusButton")->state = ButtonState::Normal;
|
||||
if (newVel == 0)
|
||||
{
|
||||
uiManager.findButton("minusButton")->state = ButtonState::Disabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
uiManager.findButton("minusButton")->state = ButtonState::Normal;
|
||||
}
|
||||
if (onVelocityChanged) onVelocityChanged(newVel);
|
||||
});
|
||||
|
||||
uiManager.setButtonPressCallback("takeButton", [this](const std::string&) {
|
||||
if (onTakeButtonPressed) onTakeButtonPressed();
|
||||
});
|
||||
|
||||
uiManager.setButtonCallback("showPlayersButton", [this](const std::string&) {
|
||||
if (onShowPlayersPressed) onShowPlayersPressed();
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
uiManager.setSliderCallback("velocitySlider", [this](const std::string&, float value) {
|
||||
int newVel = static_cast<int>(roundf(value * 10));
|
||||
if (newVel > 2) newVel = 2;
|
||||
if (newVel != Environment::shipState.selectedVelocity) {
|
||||
if (onVelocityChanged) onVelocityChanged(newVel);
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
// ── State: GameOver ──────────────────────────────────────────────────────
|
||||
|
||||
Reference in new issue
Block a user