aboutsummaryrefslogtreecommitdiff
path: root/game/menus/shop/ButtonBuySelectBubbleScript.cpp
diff options
context:
space:
mode:
authorheavydemon21 <48092678+heavydemon21@users.noreply.github.com>2025-01-10 14:44:59 +0100
committerGitHub <noreply@github.com>2025-01-10 14:44:59 +0100
commit798237b661e8e49284e78ffb1a16599cf6a46a6d (patch)
tree8f4881cf4abc58774625383620cf82fa55b9d1f0 /game/menus/shop/ButtonBuySelectBubbleScript.cpp
parentbb2db93bfb8dd7e080d2708548eae660e6b33913 (diff)
parentd1cebcca2018ed4ef47ad125e45aafd018a2ab2e (diff)
Merge pull request #125 from lonkaars/niels/game
missile alerts
Diffstat (limited to 'game/menus/shop/ButtonBuySelectBubbleScript.cpp')
-rw-r--r--game/menus/shop/ButtonBuySelectBubbleScript.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/game/menus/shop/ButtonBuySelectBubbleScript.cpp b/game/menus/shop/ButtonBuySelectBubbleScript.cpp
index 21dbe1a..741afde 100644
--- a/game/menus/shop/ButtonBuySelectBubbleScript.cpp
+++ b/game/menus/shop/ButtonBuySelectBubbleScript.cpp
@@ -17,19 +17,17 @@ void ButtonBuySelectBubbleScript::init() {
bool ButtonBuySelectBubbleScript::on_button_press(const ButtonPressEvent & e) {
SaveManager & save = this->get_save_manager();
- ValueBroker<int> buy_bullet = save.get<int>(BUY_BUBBLE_SAVE,0);
- if(!buy_bullet.get()){
- ValueBroker<int> coins = save.get<int>(TOTAL_COINS_GAME,0);
- if(coins.get() >= 1000)
- {
+ ValueBroker<int> buy_bullet = save.get<int>(BUY_BUBBLE_SAVE, 0);
+ if (!buy_bullet.get()) {
+ ValueBroker<int> coins = save.get<int>(TOTAL_COINS_GAME, 0);
+ if (coins.get() >= 1000) {
int coin = coins.get();
coin -= 1000;
- save.set(TOTAL_COINS_GAME,coin);
- save.set(BUY_BUBBLE_SAVE,1);
+ save.set(TOTAL_COINS_GAME, coin);
+ save.set(BUY_BUBBLE_SAVE, 1);
}
- }
- else {
- save.set(JETPACK_PARTICLES,1);
+ } else {
+ save.set(JETPACK_PARTICLES, 1);
}
this->trigger_event<ShopUpdate>();
return false;