aboutsummaryrefslogtreecommitdiff
path: root/game/menus
diff options
context:
space:
mode:
Diffstat (limited to 'game/menus')
-rw-r--r--game/menus/ButtonSubScene.cpp28
-rw-r--r--game/menus/ButtonSubScene.h9
-rw-r--r--game/menus/mainmenu/MainMenuScene.cpp3
3 files changed, 38 insertions, 2 deletions
diff --git a/game/menus/ButtonSubScene.cpp b/game/menus/ButtonSubScene.cpp
index 2c912b7..436ff5f 100644
--- a/game/menus/ButtonSubScene.cpp
+++ b/game/menus/ButtonSubScene.cpp
@@ -10,6 +10,7 @@
#include "../preview/PreviewReplaySubScript.h"
#include "../preview/PreviewStartRecSubScript.h"
#include "../preview/PreviewStopRecSubScript.h"
+#include "api/Asset.h"
#include "mainmenu/ButtonTransitionPreviewSubScript.h"
#include "../Config.h"
@@ -211,8 +212,31 @@ void ButtonSubScene::next_btn_overlay(crepe::GameObject & button_object, const D
void ButtonSubScene::btn_color_side(
crepe::GameObject & button_object, const vec2 & offset, const Data & data
) {
+ Asset * selected;
+ Asset blue = Asset("asset/ui/buttonSmallBlue.png");
+ Asset orange = Asset("asset/ui/buttonSmallOrange.png");
+ Asset purple = Asset("asset/ui/buttonSmallPurple.png");
+ Asset yellow = Asset("asset/ui/buttonSmallYellow.png");
+ switch (data.btn_side_color) {
+ case ButtonSideColor::BLUE:
+ selected = &blue;
+ break;
+ case ButtonSideColor::ORANGE:
+ selected = &orange;
+ break;
+ case ButtonSideColor::PURPLE:
+ selected = &purple;
+ break;
+ case ButtonSideColor::YELLOW:
+ selected = &yellow;
+ break;
+ case ButtonSideColor::NONE:
+ selected = &blue;
+ break;
+ }
+
button_object.add_component<Sprite>(
- Asset("asset/ui/buttonSmallBlue.png"),
+ *selected,
Sprite::Data {
.sorting_in_layer = STARTING_SORTING_IN_LAYER + 2 + data.sorting_layer_offset,
.size = SIDE_PANEL_SIZE,
@@ -221,7 +245,7 @@ void ButtonSubScene::btn_color_side(
}
);
button_object.add_component<Sprite>(
- Asset("asset/ui/buttonSmallBlue.png"),
+ *selected,
Sprite::Data {
.flip = {true, false},
.sorting_in_layer = STARTING_SORTING_IN_LAYER + 2 + data.sorting_layer_offset,
diff --git a/game/menus/ButtonSubScene.h b/game/menus/ButtonSubScene.h
index 29287b6..8f086f0 100644
--- a/game/menus/ButtonSubScene.h
+++ b/game/menus/ButtonSubScene.h
@@ -36,6 +36,14 @@ public:
NEXT,
LARGE,
};
+
+ enum class ButtonSideColor {
+ BLUE,
+ ORANGE,
+ PURPLE,
+ YELLOW,
+ NONE,
+ };
//data struct
struct Data {
const std::string & text = "NODATA";
@@ -51,6 +59,7 @@ public:
const bool color_side = true;
const std::string & tag = "";
const int sorting_layer_offset = 0;
+ const ButtonSideColor btn_side_color = ButtonSideColor::NONE;
};
public:
diff --git a/game/menus/mainmenu/MainMenuScene.cpp b/game/menus/mainmenu/MainMenuScene.cpp
index fba90ac..ff94e74 100644
--- a/game/menus/mainmenu/MainMenuScene.cpp
+++ b/game/menus/mainmenu/MainMenuScene.cpp
@@ -55,6 +55,7 @@ void MainMenuScene::load_scene() {
.text_width = 200,
.position = pos_btn,
.script_type = ButtonSubScene::ScriptSelect::PREVIEW,
+ .btn_side_color = ButtonSubScene::ButtonSideColor::PURPLE,
}
);
@@ -70,6 +71,7 @@ void MainMenuScene::load_scene() {
.icon_type = ButtonSubScene::IconSelect::SHOP,
.position = pos_btn,
.script_type = ButtonSubScene::ScriptSelect::SHOP,
+ .btn_side_color = ButtonSubScene::ButtonSideColor::ORANGE,
}
);
@@ -83,6 +85,7 @@ void MainMenuScene::load_scene() {
.text_width = 200,
.position = pos_btn,
.script_type = ButtonSubScene::ScriptSelect::CREDITS_SHOW,
+ .btn_side_color = ButtonSubScene::ButtonSideColor::BLUE,
}
);