From 225e873c8ac9c4c08720a69b8f2c817d22cf0071 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Mon, 23 Dec 2024 21:17:45 +0100 Subject: made script reusable to switch scenes --- game/mainmenu/ButtonSubScene.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'game/mainmenu/ButtonSubScene.cpp') diff --git a/game/mainmenu/ButtonSubScene.cpp b/game/mainmenu/ButtonSubScene.cpp index e61613b..b415f74 100644 --- a/game/mainmenu/ButtonSubScene.cpp +++ b/game/mainmenu/ButtonSubScene.cpp @@ -1,6 +1,7 @@ #include "ButtonSubScene.h" #include "ButtonScript.h" -#include "ButtonStartScript.h" +#include "ShowPreviewScript.h" +#include "ShowStartScript.h" #include "MainMenuConfig.h" #include @@ -50,13 +51,10 @@ void ButtonSubScene::btn_text_middle(crepe::GameObject & button_object,const std void ButtonSubScene::set_script(crepe::GameObject & button_object,ScriptSelect script){ switch (script) { - case ScriptSelect::START: - button_object.add_component().set_script(); - break; case ScriptSelect::PREVIEW: - case ScriptSelect::SHOP: - button_object.add_component().set_script(); + button_object.add_component().set_script(); break; + case ScriptSelect::SHOP: case ScriptSelect::NONE: break; } -- cgit v1.2.3