aboutsummaryrefslogtreecommitdiff
path: root/game/mainmenu/ButtonTransitionPreviewScript.cpp
blob: d73c0f3a7237d40d31a710a0bb3d16c94b0eeb8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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;
}