From 6a3063e6012bae44457b668ce48c48b8af90a95d Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Sat, 28 Dec 2024 12:36:26 +0100 Subject: improved naming --- game/mainmenu/ButtonTransitionPreviewScript.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 game/mainmenu/ButtonTransitionPreviewScript.cpp (limited to 'game/mainmenu/ButtonTransitionPreviewScript.cpp') diff --git a/game/mainmenu/ButtonTransitionPreviewScript.cpp b/game/mainmenu/ButtonTransitionPreviewScript.cpp new file mode 100644 index 0000000..d73c0f3 --- /dev/null +++ b/game/mainmenu/ButtonTransitionPreviewScript.cpp @@ -0,0 +1,24 @@ +#include "ButtonTransitionPreviewScript.h" +#include "MainMenuConfig.h" +#include "iostream" + +using namespace crepe; +using namespace std; + + +void ButtonTransitionPreviewScript::init(){ + cout << "script init" << endl; + IButtonScript::init(); + this->subscribe([this](const ButtonPressEvent& e) { return this->on_button_press(e); }); +} + +bool ButtonTransitionPreviewScript::on_button_press(const ButtonPressEvent& e){ + if(!this->transition) this->transition = true; + cout << "Start triggered:" << e.metadata.game_object_id << std::endl; + return false; +} + +const char* ButtonTransitionPreviewScript::get_scene_name() const { + // Provide the next scene defined in MainMenuConfig + return MainMenuConfig::PREVIEW_SCENE; +} -- cgit v1.2.3