aboutsummaryrefslogtreecommitdiff
path: root/game/menus
diff options
context:
space:
mode:
authorJAROWMR <jarorutjes07@gmail.com>2025-01-06 17:57:50 +0100
committerJAROWMR <jarorutjes07@gmail.com>2025-01-06 17:57:50 +0100
commit4c83562ef39a0364cd01f1f3615eb7672ca9f4a2 (patch)
tree2f7b72c538e7a30c741939d339f6ec2ddadfa129 /game/menus
parent07615060da6c211e08a3d7f2e1bb9e99ffc05364 (diff)
corrected includes
Diffstat (limited to 'game/menus')
-rw-r--r--game/menus/BannerSubScene.cpp2
-rw-r--r--game/menus/BannerSubScene.h2
-rw-r--r--game/menus/ButtonSetMainMenuScript.cpp3
-rw-r--r--game/menus/ButtonSetMainMenuScript.h1
-rw-r--r--game/menus/ButtonSetShopScript.cpp3
-rw-r--r--game/menus/ButtonSetShopScript.h1
-rw-r--r--game/menus/ButtonSubScene.cpp8
-rw-r--r--game/menus/ButtonSubScene.h1
-rw-r--r--game/menus/IButtonScript.cpp12
-rw-r--r--game/menus/MenusConfig.h3
-rw-r--r--game/menus/mainmenu/ButtonTransitionPreviewScript.cpp5
-rw-r--r--game/menus/mainmenu/ButtonTransitionPreviewScript.h3
-rw-r--r--game/menus/mainmenu/ITransitionScript.cpp8
-rw-r--r--game/menus/mainmenu/MainMenuConfig.h2
-rw-r--r--game/menus/mainmenu/MainMenuScene.cpp19
-rw-r--r--game/menus/mainmenu/MainMenuScene.h1
-rw-r--r--game/menus/mainmenu/TransitionStartScript.cpp7
-rw-r--r--game/menus/mainmenu/TransitionStartScript.h1
-rw-r--r--game/menus/shop/ShopMenuScene.cpp6
-rw-r--r--game/menus/shop/ShopMenuScene.h3
20 files changed, 43 insertions, 48 deletions
diff --git a/game/menus/BannerSubScene.cpp b/game/menus/BannerSubScene.cpp
index 638b330..ea43c69 100644
--- a/game/menus/BannerSubScene.cpp
+++ b/game/menus/BannerSubScene.cpp
@@ -1,7 +1,7 @@
#include "BannerSubScene.h"
#include "MenusConfig.h"
-#include "../Config.h"
+#include "../Config.h"
#include <crepe/api/Sprite.h>
#include <crepe/api/Scene.h>
diff --git a/game/menus/BannerSubScene.h b/game/menus/BannerSubScene.h
index 341943d..888897d 100644
--- a/game/menus/BannerSubScene.h
+++ b/game/menus/BannerSubScene.h
@@ -1,6 +1,6 @@
#pragma once
-#include "types.h"
+#include <crepe/types.h>
#include <crepe/api/GameObject.h>
namespace crepe {
diff --git a/game/menus/ButtonSetMainMenuScript.cpp b/game/menus/ButtonSetMainMenuScript.cpp
index 74773a0..12b7256 100644
--- a/game/menus/ButtonSetMainMenuScript.cpp
+++ b/game/menus/ButtonSetMainMenuScript.cpp
@@ -1,19 +1,16 @@
#include "ButtonSetMainMenuScript.h"
#include "MenusConfig.h"
-#include "iostream"
using namespace crepe;
using namespace std;
void ButtonSetMainMenuScript::init(){
- cout << "script init" << endl;
IButtonScript::init();
this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent& e) { return this->on_button_press(e); });
}
bool ButtonSetMainMenuScript::on_button_press(const ButtonPressEvent& e){
this->set_next_scene(MAINMENU_SCENE);
- cout << "Start triggered:" << e.metadata.game_object_id << std::endl;
return false;
}
diff --git a/game/menus/ButtonSetMainMenuScript.h b/game/menus/ButtonSetMainMenuScript.h
index 44c21aa..13a33bf 100644
--- a/game/menus/ButtonSetMainMenuScript.h
+++ b/game/menus/ButtonSetMainMenuScript.h
@@ -1,6 +1,7 @@
#pragma once
#include "IButtonScript.h"
+
#include <crepe/api/Script.h>
class ButtonSetMainMenuScript : public IButtonScript {
diff --git a/game/menus/ButtonSetShopScript.cpp b/game/menus/ButtonSetShopScript.cpp
index 035419f..88639bd 100644
--- a/game/menus/ButtonSetShopScript.cpp
+++ b/game/menus/ButtonSetShopScript.cpp
@@ -1,19 +1,16 @@
#include "ButtonSetShopScript.h"
-#include "iostream"
#include "MenusConfig.h"
using namespace crepe;
using namespace std;
void ButtonSetShopScript::init(){
- cout << "script init" << endl;
IButtonScript::init();
this->subscribe<ButtonPressEvent>([this](const ButtonPressEvent& e) { return this->on_button_press(e); });
}
bool ButtonSetShopScript::on_button_press(const ButtonPressEvent& e){
this->set_next_scene(SHOP_SCENE);
- cout << "Start triggered:" << e.metadata.game_object_id << std::endl;
return false;
}
diff --git a/game/menus/ButtonSetShopScript.h b/game/menus/ButtonSetShopScript.h
index 51db928..434abc0 100644
--- a/game/menus/ButtonSetShopScript.h
+++ b/game/menus/ButtonSetShopScript.h
@@ -1,6 +1,7 @@
#pragma once
#include "IButtonScript.h"
+
#include <crepe/api/Script.h>
class ButtonSetShopScript : public IButtonScript {
diff --git a/game/menus/ButtonSubScene.cpp b/game/menus/ButtonSubScene.cpp
index 3d68657..6aad352 100644
--- a/game/menus/ButtonSubScene.cpp
+++ b/game/menus/ButtonSubScene.cpp
@@ -1,17 +1,19 @@
#include "ButtonSubScene.h"
#include "ButtonSetMainMenuScript.h"
#include "ButtonSetShopScript.h"
-#include "mainmenu/ButtonTransitionPreviewScript.h"
#include "IButtonScript.h"
-#include "../Config.h"
-#include "api/Color.h"
#include "MenusConfig.h"
+#include "mainmenu/ButtonTransitionPreviewScript.h"
+
+#include "../Config.h"
+
#include <crepe/api/BehaviorScript.h>
#include <crepe/api/Sprite.h>
#include <crepe/api/Scene.h>
#include <crepe/api/Button.h>
#include <crepe/api/Text.h>
+#include <crepe/api/Color.h>
using namespace crepe;
using namespace std;
diff --git a/game/menus/ButtonSubScene.h b/game/menus/ButtonSubScene.h
index 06006ac..5609ecb 100644
--- a/game/menus/ButtonSubScene.h
+++ b/game/menus/ButtonSubScene.h
@@ -1,6 +1,7 @@
#pragma once
#include <crepe/api/GameObject.h>
+
#include <string>
namespace crepe {
diff --git a/game/menus/IButtonScript.cpp b/game/menus/IButtonScript.cpp
index ab907c4..da535ca 100644
--- a/game/menus/IButtonScript.cpp
+++ b/game/menus/IButtonScript.cpp
@@ -1,13 +1,14 @@
#include "IButtonScript.h"
-#include "api/Sprite.h"
-#include "iostream"
+
#include "system/InputSystem.h"
-#include "types.h"
+
+#include <crepe/types.h>
+#include <crepe/api/Sprite.h>
+
using namespace crepe;
using namespace std;
void IButtonScript::init(){
- cout << "script init" << endl;
this->subscribe<ButtonExitEvent>([this](const ButtonExitEvent& e) { return this->on_button_exit(e); });
this->subscribe<ButtonEnterEvent>([this](const ButtonEnterEvent& e) { return this->on_button_enter(e); });
}
@@ -17,8 +18,6 @@ bool IButtonScript::on_button_exit(const ButtonExitEvent& e){
{
sprite.data.color = Color{255,255,255,255};
}
-
- cout << "button triggered:" << e.metadata.game_object_id << std::endl;
return false;
}
bool IButtonScript::on_button_enter(const ButtonEnterEvent& e){
@@ -27,7 +26,6 @@ bool IButtonScript::on_button_enter(const ButtonEnterEvent& e){
{
sprite.data.color = Color{200,200,200,255};
}
- cout << "button Enter:" << e.metadata.game_object_id << std::endl;
return false;
}
diff --git a/game/menus/MenusConfig.h b/game/menus/MenusConfig.h
index 692a4d2..ffcbc34 100644
--- a/game/menus/MenusConfig.h
+++ b/game/menus/MenusConfig.h
@@ -1,6 +1,5 @@
#pragma once
-#include "types.h"
-
+#include <crepe/types.h>
//generic menu config
static constexpr unsigned int STARTING_SORTING_IN_LAYER = 7;
diff --git a/game/menus/mainmenu/ButtonTransitionPreviewScript.cpp b/game/menus/mainmenu/ButtonTransitionPreviewScript.cpp
index c702260..084d02b 100644
--- a/game/menus/mainmenu/ButtonTransitionPreviewScript.cpp
+++ b/game/menus/mainmenu/ButtonTransitionPreviewScript.cpp
@@ -1,20 +1,17 @@
#include "ButtonTransitionPreviewScript.h"
+
#include "../MenusConfig.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;
}
diff --git a/game/menus/mainmenu/ButtonTransitionPreviewScript.h b/game/menus/mainmenu/ButtonTransitionPreviewScript.h
index 26a778a..5973dbf 100644
--- a/game/menus/mainmenu/ButtonTransitionPreviewScript.h
+++ b/game/menus/mainmenu/ButtonTransitionPreviewScript.h
@@ -1,8 +1,9 @@
#pragma once
-#include "../IButtonScript.h"
#include "ITransitionScript.h"
+#include "../IButtonScript.h"
+
class ButtonTransitionPreviewScript : public ITransitionScript, public IButtonScript {
public:
void init() override;
diff --git a/game/menus/mainmenu/ITransitionScript.cpp b/game/menus/mainmenu/ITransitionScript.cpp
index 07360a0..9e547e6 100644
--- a/game/menus/mainmenu/ITransitionScript.cpp
+++ b/game/menus/mainmenu/ITransitionScript.cpp
@@ -1,9 +1,11 @@
#include "ITransitionScript.h"
-#include "api/Transform.h"
-#include <crepe/api/Camera.h>
#include "MainMenuConfig.h"
+
#include "../MenusConfig.h"
-#include "types.h"
+
+#include <crepe/types.h>
+#include <crepe/api/Transform.h>
+#include <crepe/api/Camera.h>
using namespace crepe;
using namespace std;
diff --git a/game/menus/mainmenu/MainMenuConfig.h b/game/menus/mainmenu/MainMenuConfig.h
index 7227f84..01995f0 100644
--- a/game/menus/mainmenu/MainMenuConfig.h
+++ b/game/menus/mainmenu/MainMenuConfig.h
@@ -1,5 +1,5 @@
#pragma once
-#include "types.h"
+#include <crepe/types.h>
//main menu config
static constexpr float STARTMAP_OFFSET = 50;
diff --git a/game/menus/mainmenu/MainMenuScene.cpp b/game/menus/mainmenu/MainMenuScene.cpp
index f6f8220..fcbd43f 100644
--- a/game/menus/mainmenu/MainMenuScene.cpp
+++ b/game/menus/mainmenu/MainMenuScene.cpp
@@ -1,17 +1,20 @@
#include "MainMenuScene.h"
-#include "../ButtonSubScene.h"
#include "TransitionStartScript.h"
-#include "api/BehaviorScript.h"
-#include "api/Camera.h"
+#include "MainMenuConfig.h"
+
+#include "../ButtonSubScene.h"
+#include "../MenusConfig.h"
+
#include "../../background/StartSubScene.h"
#include "../../background/HallwaySubScene.h"
-#include "MainMenuConfig.h"
-#include "api/GameObject.h"
-#include "api/Sprite.h"
-#include "manager/SaveManager.h"
#include "../../Config.h"
-#include "../MenusConfig.h"
+
+#include <crepe/api/BehaviorScript.h>
+#include <crepe/api/GameObject.h>
+#include <crepe/api/Sprite.h>
+#include <crepe/api/Camera.h>
+#include <crepe/manager/SaveManager.h>
using namespace crepe;
using namespace std;
diff --git a/game/menus/mainmenu/MainMenuScene.h b/game/menus/mainmenu/MainMenuScene.h
index f7319cb..1eea90e 100644
--- a/game/menus/mainmenu/MainMenuScene.h
+++ b/game/menus/mainmenu/MainMenuScene.h
@@ -6,6 +6,5 @@
class MainMenuScene : public crepe::Scene {
public:
void load_scene();
-
std::string get_name() const;
};
diff --git a/game/menus/mainmenu/TransitionStartScript.cpp b/game/menus/mainmenu/TransitionStartScript.cpp
index d03adf0..9b395de 100644
--- a/game/menus/mainmenu/TransitionStartScript.cpp
+++ b/game/menus/mainmenu/TransitionStartScript.cpp
@@ -1,15 +1,10 @@
#include "TransitionStartScript.h"
+
#include "../MenusConfig.h"
-#include "iostream"
using namespace crepe;
using namespace std;
-
-void TransitionStartScript::init(){
- cout << "script init" << endl;
-}
-
void TransitionStartScript::fixed_update(crepe::duration_t dt){
if(this->get_key_state(Keycode::ENTER) && this->transition == false) this->transition = true;
}
diff --git a/game/menus/mainmenu/TransitionStartScript.h b/game/menus/mainmenu/TransitionStartScript.h
index 76f532e..c6df1b9 100644
--- a/game/menus/mainmenu/TransitionStartScript.h
+++ b/game/menus/mainmenu/TransitionStartScript.h
@@ -4,7 +4,6 @@
class TransitionStartScript : public ITransitionScript {
public:
- void init() override;
void fixed_update(crepe::duration_t dt) override;
const char* get_scene_name() const override;
};
diff --git a/game/menus/shop/ShopMenuScene.cpp b/game/menus/shop/ShopMenuScene.cpp
index c0a5a72..d35d296 100644
--- a/game/menus/shop/ShopMenuScene.cpp
+++ b/game/menus/shop/ShopMenuScene.cpp
@@ -1,11 +1,13 @@
#include "ShopMenuScene.h"
+
#include "../ButtonSubScene.h"
-#include "api/Camera.h"
#include "../MenusConfig.h"
-#include "api/Sprite.h"
#include "../BannerSubScene.h"
+#include <crepe/api/Camera.h>
+#include <crepe/api/Sprite.h>
+
using namespace crepe;
using namespace std;
diff --git a/game/menus/shop/ShopMenuScene.h b/game/menus/shop/ShopMenuScene.h
index 7178372..34c05ff 100644
--- a/game/menus/shop/ShopMenuScene.h
+++ b/game/menus/shop/ShopMenuScene.h
@@ -1,8 +1,9 @@
#pragma once
-#include <crepe/api/Scene.h>
#include <string>
+#include <crepe/api/Scene.h>
+
class ShopMenuScene : public crepe::Scene {
public:
void load_scene();