From 126c402548281f3a97e3a9e0ef60c45147c87fa0 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Mon, 6 Jan 2025 20:52:39 +0100 Subject: endgamesubscene finished --- game/menus/ButtonSubScene.cpp | 38 +++++-- game/menus/ButtonSubScene.h | 4 +- game/menus/FloatingWindowSubScene.cpp | 178 +++++++++++++++++++++++++++++ game/menus/FloatingWindowSubScene.h | 16 +++ game/menus/MenusConfig.h | 2 +- game/menus/endgame/EndGameSubScene.cpp | 199 ++++++++------------------------- game/menus/endgame/EndGameSubScene.h | 7 +- 7 files changed, 277 insertions(+), 167 deletions(-) create mode 100644 game/menus/FloatingWindowSubScene.cpp create mode 100644 game/menus/FloatingWindowSubScene.h (limited to 'game/menus') diff --git a/game/menus/ButtonSubScene.cpp b/game/menus/ButtonSubScene.cpp index d735d08..8574b9b 100644 --- a/game/menus/ButtonSubScene.cpp +++ b/game/menus/ButtonSubScene.cpp @@ -56,7 +56,7 @@ void ButtonSubScene::set_icon(crepe::GameObject & button_object,const Data & dat switch (data.icon_type) { case IconSelect::SHOP: button_object.add_component(Asset("asset/ui/buttonCoinsSmall.png"),Sprite::Data{ - .sorting_in_layer = STARTING_SORTING_IN_LAYER+3, + .sorting_in_layer = STARTING_SORTING_IN_LAYER+3 + data.sorting_layer_offset, .size = ICON_SIZE, .position_offset = data.icon_offset, .world_space = data.worldspace, @@ -64,7 +64,7 @@ void ButtonSubScene::set_icon(crepe::GameObject & button_object,const Data & dat break; case IconSelect::COINS: button_object.add_component(Asset("asset/ui/buttonCoinsSmall.png"),Sprite::Data{ - .sorting_in_layer = STARTING_SORTING_IN_LAYER+3, + .sorting_in_layer = STARTING_SORTING_IN_LAYER+3 + data.sorting_layer_offset, .size = ICON_SIZE, .position_offset = data.icon_offset, .world_space = data.worldspace, @@ -81,17 +81,17 @@ void ButtonSubScene::set_button_overlay(crepe::GameObject & button_object,const this->large_btn_overlay(button_object,data); break; case ButtonSelect::BACK: - this->small_btn_overlay(button_object,data); + this->back_btn_overlay(button_object,data); break; case ButtonSelect::NEXT: - this->small_btn_overlay(button_object,data); + this->next_btn_overlay(button_object,data); break; } } void ButtonSubScene::large_btn_overlay(crepe::GameObject & button_object,const Data & data){ button_object.add_component(Asset("asset/ui/buttonBacking.png"),Sprite::Data{ - .sorting_in_layer = STARTING_SORTING_IN_LAYER+1, + .sorting_in_layer = STARTING_SORTING_IN_LAYER+1 + data.sorting_layer_offset, .size = LARGE_OVERLAY_SIZE, .world_space = data.worldspace, }); @@ -100,15 +100,15 @@ void ButtonSubScene::large_btn_overlay(crepe::GameObject & button_object,const D this->btn_color_side(button_object,SIDE_PANEL_OFFSET,data); } -void ButtonSubScene::small_btn_overlay(crepe::GameObject & button_object,const Data & data){ +void ButtonSubScene::back_btn_overlay(crepe::GameObject & button_object,const Data & data){ button_object.add_component(Asset("asset/ui/backbuttonright.png"),Sprite::Data{ - .sorting_in_layer = STARTING_SORTING_IN_LAYER+1, + .sorting_in_layer = STARTING_SORTING_IN_LAYER+1+ data.sorting_layer_offset, .size = SMALL_OVERLAY_SIZE_RIGHT, .position_offset = {20,0}, .world_space = data.worldspace, }); button_object.add_component(Asset("asset/ui/backbuttonleft.png"),Sprite::Data{ - .sorting_in_layer = STARTING_SORTING_IN_LAYER+1, + .sorting_in_layer = STARTING_SORTING_IN_LAYER+1+ data.sorting_layer_offset, .size = SMALL_OVERLAY_SIZE_LEFT, .position_offset = {-80,0}, .world_space = data.worldspace, @@ -116,16 +116,34 @@ void ButtonSubScene::small_btn_overlay(crepe::GameObject & button_object,const D button_object.add_component