aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/ButtonTransitionPreviewScript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'game/mainmenu/ButtonTransitionPreviewScript.cpp')
-rw-r--r--game/mainmenu/ButtonTransitionPreviewScript.cpp24
1 files changed, 24 insertions, 0 deletions
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<ButtonPressEvent>([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;
+}