From aa8bf26452157f81f72b6d6759e461ff2ca24568 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Wed, 8 Jan 2025 13:40:20 +0100 Subject: updated preview and added credits button --- game/menus/mainmenu/CreditsSubScene.cpp | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 game/menus/mainmenu/CreditsSubScene.cpp (limited to 'game/menus/mainmenu/CreditsSubScene.cpp') diff --git a/game/menus/mainmenu/CreditsSubScene.cpp b/game/menus/mainmenu/CreditsSubScene.cpp new file mode 100644 index 0000000..9a49257 --- /dev/null +++ b/game/menus/mainmenu/CreditsSubScene.cpp @@ -0,0 +1,68 @@ + +#include "CreditsSubScene.h" +#include "CreditsSubScript.h" +#include "EndGameSubScript.h" + +#include "../../Config.h" +#include "../ButtonSubScene.h" +#include "../FloatingWindowSubScene.h" + +#include + +#include +#include +#include +#include + +using namespace crepe; +using namespace std; + +void CreditsSubScene::create(Scene & scn) { + + const std::string TAG = "end_game_tag"; + GameObject script = scn.new_object("script"); + script.add_component().set_script(TAG); + + // Window + FloatingWindowSubScene window; + window.create( + scn, + FloatingWindowSubScene::Data { + .group_tag = TAG, + .width = 500, + .offset = {0, -50}, + .width_middle_offset = -2, + } + ); + + // Titel + const string TITEL_STRING = "Credits"; + GameObject titel = scn.new_object("titel", TAG); + crepe::vec2 size = {200, (200.0f / TITEL_STRING.size()) * 2}; + titel.add_component( + size, FONT, + Text::Data { + .world_space = false, + .text_color = Color::WHITE, + }, + vec2 {0, -207} + FONTOFFSET, TITEL_STRING + ); + + // Buttons + vec2 button_position = {190, 190}; + ButtonSubScene button; + button.create( + scn, + ButtonSubScene::Data { + .text = "Back", + .text_width = 150, + .position = {-button_position.x, button_position.y}, + //.script_type = ButtonSubScene::ScriptSelect::REPLAY, + //.button_type = ButtonSubScene::ButtonSelect::BACK, + .scale = 0.6, + .worldspace = false, + .tag = TAG, + .sorting_layer_offset = 20, + } + ); +} -- cgit v1.2.3 From 3b6081d03300d353434fd4f6e91237fc8f1a4390 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Wed, 8 Jan 2025 14:40:37 +0100 Subject: added credit window --- game/CMakeLists.txt | 3 +++ game/menus/ButtonShowCreditsSubScript.cpp | 20 ++++++++++++++++++++ game/menus/ButtonShowCreditsSubScript.h | 14 ++++++++++++++ game/menus/ButtonSubScene.cpp | 10 ++++++++++ game/menus/ButtonSubScene.h | 2 ++ game/menus/mainmenu/CreditsSubScene.cpp | 13 ++++++------- game/menus/mainmenu/CreditsSubScript.cpp | 14 ++++++++++++++ game/menus/mainmenu/CreditsSubScript.h | 6 +++++- game/menus/mainmenu/MainMenuScene.cpp | 6 +++++- 9 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 game/menus/ButtonShowCreditsSubScript.cpp create mode 100644 game/menus/ButtonShowCreditsSubScript.h (limited to 'game/menus/mainmenu/CreditsSubScene.cpp') diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 1f9b8cf..f81850d 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -37,11 +37,14 @@ add_executable(main menus/ButtonNextMainMenuSubScript.cpp menus/FloatingWindowSubScene.cpp menus/IFloatingWindowScript.cpp + menus/ButtonShowCreditsSubScript.cpp menus/shop/ShopMenuScene.cpp menus/mainmenu/ButtonTransitionPreviewSubScript.cpp menus/mainmenu/ITransitionScript.cpp menus/mainmenu/MainMenuScene.cpp menus/mainmenu/TransitionStartSubScript.cpp + menus/mainmenu/CreditsSubScene.cpp + menus/mainmenu/CreditsSubScript.cpp menus/endgame/EndGameSubScene.cpp menus/endgame/EndGameSubScript.cpp coins/CoinSubScene.cpp diff --git a/game/menus/ButtonShowCreditsSubScript.cpp b/game/menus/ButtonShowCreditsSubScript.cpp new file mode 100644 index 0000000..ec0e980 --- /dev/null +++ b/game/menus/ButtonShowCreditsSubScript.cpp @@ -0,0 +1,20 @@ +#include "ButtonShowCreditsSubScript.h" +#include "MenusConfig.h" +#include "mainmenu/CreditsSubScript.h" +#include +#include + +using namespace crepe; +using namespace std; + +void ButtonShowCreditsSubScript::init() { + IButtonScript::init(); + this->subscribe([this](const ButtonPressEvent & e) { + return this->on_button_press(e); + }); +} + +bool ButtonShowCreditsSubScript::on_button_press(const ButtonPressEvent & e) { + this->trigger_event(); + return false; +} diff --git a/game/menus/ButtonShowCreditsSubScript.h b/game/menus/ButtonShowCreditsSubScript.h new file mode 100644 index 0000000..3c73c44 --- /dev/null +++ b/game/menus/ButtonShowCreditsSubScript.h @@ -0,0 +1,14 @@ +#pragma once + +#include "IButtonScript.h" + +#include + +class ButtonShowCreditsSubScript : public IButtonScript { +public: + void init() override; + bool on_button_press(const crepe::ButtonPressEvent & e); + +protected: + bool transition = false; +}; diff --git a/game/menus/ButtonSubScene.cpp b/game/menus/ButtonSubScene.cpp index 2fb4c38..d657be9 100644 --- a/game/menus/ButtonSubScene.cpp +++ b/game/menus/ButtonSubScene.cpp @@ -3,12 +3,14 @@ #include "ButtonReplaySubScript.h" #include "ButtonSetMainMenuSubScript.h" #include "ButtonSetShopSubScript.h" +#include "ButtonShowCreditsSubScript.h" #include "IButtonScript.h" #include "MenusConfig.h" #include "mainmenu/ButtonTransitionPreviewSubScript.h" #include "../Config.h" +#include "mainmenu/CreditsSubScript.h" #include #include @@ -63,6 +65,14 @@ void ButtonSubScene::set_script(crepe::GameObject & button_object, const Data & button_object.add_component() .set_script(); break; + case ScriptSelect::CREDITS_BACK: + button_object.add_component() + .set_script(data.tag); + break; + case ScriptSelect::CREDITS_SHOW: + button_object.add_component() + .set_script(); + break; case ScriptSelect::NONE: button_object.add_component().set_script(); break; diff --git a/game/menus/ButtonSubScene.h b/game/menus/ButtonSubScene.h index ba6d1f7..74f9464 100644 --- a/game/menus/ButtonSubScene.h +++ b/game/menus/ButtonSubScene.h @@ -17,6 +17,8 @@ public: MAINMENU, NEXT, REPLAY, + CREDITS_SHOW, + CREDITS_BACK, NONE, }; //icon enum diff --git a/game/menus/mainmenu/CreditsSubScene.cpp b/game/menus/mainmenu/CreditsSubScene.cpp index 9a49257..df4616e 100644 --- a/game/menus/mainmenu/CreditsSubScene.cpp +++ b/game/menus/mainmenu/CreditsSubScene.cpp @@ -1,7 +1,6 @@ #include "CreditsSubScene.h" #include "CreditsSubScript.h" -#include "EndGameSubScript.h" #include "../../Config.h" #include "../ButtonSubScene.h" @@ -19,7 +18,7 @@ using namespace std; void CreditsSubScene::create(Scene & scn) { - const std::string TAG = "end_game_tag"; + const std::string TAG = "credits_tag"; GameObject script = scn.new_object("script"); script.add_component().set_script(TAG); @@ -30,7 +29,7 @@ void CreditsSubScene::create(Scene & scn) { FloatingWindowSubScene::Data { .group_tag = TAG, .width = 500, - .offset = {0, -50}, + .offset = {150, -50}, .width_middle_offset = -2, } ); @@ -45,7 +44,7 @@ void CreditsSubScene::create(Scene & scn) { .world_space = false, .text_color = Color::WHITE, }, - vec2 {0, -207} + FONTOFFSET, TITEL_STRING + vec2 {150, -207} + FONTOFFSET, TITEL_STRING ); // Buttons @@ -56,9 +55,9 @@ void CreditsSubScene::create(Scene & scn) { ButtonSubScene::Data { .text = "Back", .text_width = 150, - .position = {-button_position.x, button_position.y}, - //.script_type = ButtonSubScene::ScriptSelect::REPLAY, - //.button_type = ButtonSubScene::ButtonSelect::BACK, + .position = {-button_position.x+150, button_position.y}, + .script_type = ButtonSubScene::ScriptSelect::CREDITS_BACK, + .button_type = ButtonSubScene::ButtonSelect::BACK, .scale = 0.6, .worldspace = false, .tag = TAG, diff --git a/game/menus/mainmenu/CreditsSubScript.cpp b/game/menus/mainmenu/CreditsSubScript.cpp index 5326594..ce74ba4 100644 --- a/game/menus/mainmenu/CreditsSubScript.cpp +++ b/game/menus/mainmenu/CreditsSubScript.cpp @@ -13,9 +13,18 @@ using namespace crepe; + CreditsSubScript::CreditsSubScript(const std::string & tag) { this->tag = tag; } void CreditsSubScript::init() { + IButtonScript::init(); + this->subscribe([this](const ButtonPressEvent & e) { + return this->on_button_press(e); + }); + this->subscribe([this](const ShowCreditsEvent & e) { + this->enable_all(); + return false; + }); this->disable_all(); } @@ -44,3 +53,8 @@ bool CreditsSubScript::enable_all() { } return false; } + +bool CreditsSubScript::on_button_press(const ButtonPressEvent & e) { + return this->disable_all(); +} + diff --git a/game/menus/mainmenu/CreditsSubScript.h b/game/menus/mainmenu/CreditsSubScript.h index 08e1f91..e411202 100644 --- a/game/menus/mainmenu/CreditsSubScript.h +++ b/game/menus/mainmenu/CreditsSubScript.h @@ -1,14 +1,18 @@ #pragma once #include "../IFloatingWindowScript.h" +#include "../IButtonScript.h" #include #include -class CreditsSubScript : public IFloatingWindowScript { +struct ShowCreditsEvent : public crepe::Event {}; + +class CreditsSubScript : public IFloatingWindowScript, public IButtonScript { public: CreditsSubScript(const std::string & tag); void init() override; bool disable_all(); bool enable_all(); + bool on_button_press(const crepe::ButtonPressEvent & e); }; diff --git a/game/menus/mainmenu/MainMenuScene.cpp b/game/menus/mainmenu/MainMenuScene.cpp index 743fe43..fba90ac 100644 --- a/game/menus/mainmenu/MainMenuScene.cpp +++ b/game/menus/mainmenu/MainMenuScene.cpp @@ -1,5 +1,6 @@ #include "MainMenuScene.h" +#include "CreditsSubScene.h" #include "MainMenuConfig.h" #include "TransitionStartSubScript.h" @@ -81,7 +82,7 @@ void MainMenuScene::load_scene() { .text_offset = {0, 0}, .text_width = 200, .position = pos_btn, - //.script_type = ButtonSubScene::ScriptSelect::SHOP, + .script_type = ButtonSubScene::ScriptSelect::CREDITS_SHOW, } ); @@ -123,6 +124,9 @@ void MainMenuScene::load_scene() { .tag = MENU_INFO_TAG, } ); + + CreditsSubScene creditscene; + creditscene.create(*this); } string MainMenuScene::get_name() const { return MAINMENU_SCENE; } -- cgit v1.2.3 From 1dbf6855eb8fcafb411c92257cd10af13e3562f1 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Wed, 8 Jan 2025 14:58:54 +0100 Subject: filled credits --- game/menus/mainmenu/CreditsSubScene.cpp | 59 +++++++++++++++++++++++++++++++++ game/menus/shop/ShopMenuScene.cpp | 2 ++ 2 files changed, 61 insertions(+) (limited to 'game/menus/mainmenu/CreditsSubScene.cpp') diff --git a/game/menus/mainmenu/CreditsSubScene.cpp b/game/menus/mainmenu/CreditsSubScene.cpp index df4616e..bdd6fa0 100644 --- a/game/menus/mainmenu/CreditsSubScene.cpp +++ b/game/menus/mainmenu/CreditsSubScene.cpp @@ -64,4 +64,63 @@ void CreditsSubScene::create(Scene & scn) { .sorting_layer_offset = 20, } ); + + const float SIZE_CHAR_NAMES = 10; + const float Y_OFFSET_NAMES_BEGIN = 100; + const float Y_OFFSET_NAMES = 30; + const string LOEK = "Loek Le Blansch"; + crepe::vec2 size_loek = {LOEK.size()*SIZE_CHAR_NAMES, (LOEK.size()*SIZE_CHAR_NAMES / LOEK.size()) * 2}; + titel.add_component( + size_loek, FONT, + Text::Data { + .world_space = false, + .text_color = Color::WHITE, + }, + vec2 {150, -207+Y_OFFSET_NAMES+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, LOEK + ); + + const string WOUTER = "Wouter Boerenkamps"; + crepe::vec2 size_wouter = {WOUTER.size()*SIZE_CHAR_NAMES, (WOUTER.size()*SIZE_CHAR_NAMES / WOUTER.size()) * 2}; + titel.add_component( + size_wouter, FONT, + Text::Data { + .world_space = false, + .text_color = Color::WHITE, + }, + vec2 {150, -207+Y_OFFSET_NAMES*2+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, WOUTER + ); + + const string JARO = "Jaro Rutjes"; + crepe::vec2 size_jaro = {JARO.size()*SIZE_CHAR_NAMES, (JARO.size()*SIZE_CHAR_NAMES / JARO.size()) * 2}; + titel.add_component( + size_jaro, FONT, + Text::Data { + .world_space = false, + .text_color = Color::WHITE, + }, + vec2 {150, -207+Y_OFFSET_NAMES*3+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, JARO + ); + + const string MAX = "Max Smits"; + crepe::vec2 size_max = {MAX.size()*SIZE_CHAR_NAMES, (MAX.size()*SIZE_CHAR_NAMES / MAX.size()) * 2}; + titel.add_component( + size_max, FONT, + Text::Data { + .world_space = false, + .text_color = Color::WHITE, + }, + vec2 {150, -207+Y_OFFSET_NAMES*4+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, MAX + ); + + const string NIELS = "Niels Stunnebrink"; + crepe::vec2 size_niels = {NIELS.size()*SIZE_CHAR_NAMES, (NIELS.size()*SIZE_CHAR_NAMES / NIELS.size()) * 2}; + titel.add_component( + size_niels, FONT, + Text::Data { + .world_space = false, + .text_color = Color::WHITE, + }, + vec2 {150, -207+Y_OFFSET_NAMES*5+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, NIELS + ); + } diff --git a/game/menus/shop/ShopMenuScene.cpp b/game/menus/shop/ShopMenuScene.cpp index 21e3f02..42755d6 100644 --- a/game/menus/shop/ShopMenuScene.cpp +++ b/game/menus/shop/ShopMenuScene.cpp @@ -50,6 +50,8 @@ void ShopMenuScene::load_scene() { .scale = 0.8 } ); + + // } string ShopMenuScene::get_name() const { return SHOP_SCENE; } -- cgit v1.2.3 From 14d2398b776d7be3c404af5f4e983b435efaf1d1 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 8 Jan 2025 15:03:34 +0100 Subject: `make format` --- game/hud/SpeedScript.cpp | 4 ++-- game/menus/ButtonReplaySubScript.cpp | 5 ++--- game/menus/ButtonReplaySubScript.h | 1 + game/menus/ButtonSubScene.cpp | 7 +++---- game/menus/endgame/EndGameSubScript.cpp | 2 +- game/menus/mainmenu/CreditsSubScene.cpp | 30 ++++++++++++++++++------------ game/menus/mainmenu/CreditsSubScript.cpp | 4 +--- game/menus/mainmenu/CreditsSubScript.h | 2 +- 8 files changed, 29 insertions(+), 26 deletions(-) (limited to 'game/menus/mainmenu/CreditsSubScene.cpp') diff --git a/game/hud/SpeedScript.cpp b/game/hud/SpeedScript.cpp index 29d4193..906a38f 100644 --- a/game/hud/SpeedScript.cpp +++ b/game/hud/SpeedScript.cpp @@ -26,11 +26,11 @@ void SpeedScript::init() { void SpeedScript::fixed_update(crepe::duration_t dt) { LoopTimerManager & lp = this->get_loop_timer(); if (this->get_key_state(Keycode::PAGE_UP)) { - if(lp.get_time_scale() >= 2) return; + if (lp.get_time_scale() >= 2) return; lp.set_time_scale(lp.get_time_scale() + 0.1); } if (this->get_key_state(Keycode::PAGE_DOWN)) { - if(lp.get_time_scale() <= 0.5) return; + if (lp.get_time_scale() <= 0.5) return; lp.set_time_scale(lp.get_time_scale() - 0.1); } } diff --git a/game/menus/ButtonReplaySubScript.cpp b/game/menus/ButtonReplaySubScript.cpp index 26cb8ee..9308350 100644 --- a/game/menus/ButtonReplaySubScript.cpp +++ b/game/menus/ButtonReplaySubScript.cpp @@ -1,9 +1,9 @@ #include "ButtonReplaySubScript.h" #include "MenusConfig.h" +#include "../Events.h" #include #include -#include "../Events.h" using namespace crepe; using namespace std; @@ -19,13 +19,12 @@ void ButtonReplaySubScript::init() { replay.record_start(); } - bool ButtonReplaySubScript::on_button_press(const ButtonPressEvent & e) { replay.play(this->recording); return false; } -bool ButtonReplaySubScript::set_recording(){ +bool ButtonReplaySubScript::set_recording() { this->recording = replay.record_end(); return false; } diff --git a/game/menus/ButtonReplaySubScript.h b/game/menus/ButtonReplaySubScript.h index 7e63d06..bfc684d 100644 --- a/game/menus/ButtonReplaySubScript.h +++ b/game/menus/ButtonReplaySubScript.h @@ -8,6 +8,7 @@ class ButtonReplaySubScript : public IButtonScript { public: void init() override; bool on_button_press(const crepe::ButtonPressEvent & e); + private: crepe::recording_t recording = 0; bool set_recording(); diff --git a/game/menus/ButtonSubScene.cpp b/game/menus/ButtonSubScene.cpp index d657be9..30646f1 100644 --- a/game/menus/ButtonSubScene.cpp +++ b/game/menus/ButtonSubScene.cpp @@ -62,12 +62,11 @@ void ButtonSubScene::set_script(crepe::GameObject & button_object, const Data & .set_script(); break; case ScriptSelect::REPLAY: - button_object.add_component() - .set_script(); + button_object.add_component().set_script(); break; case ScriptSelect::CREDITS_BACK: - button_object.add_component() - .set_script(data.tag); + button_object.add_component().set_script(data.tag + ); break; case ScriptSelect::CREDITS_SHOW: button_object.add_component() diff --git a/game/menus/endgame/EndGameSubScript.cpp b/game/menus/endgame/EndGameSubScript.cpp index 08a9f8c..6edfe7b 100644 --- a/game/menus/endgame/EndGameSubScript.cpp +++ b/game/menus/endgame/EndGameSubScript.cpp @@ -1,8 +1,8 @@ #include "EndGameSubScript.h" #include "../../Events.h" -#include "../IFloatingWindowScript.h" #include "../ButtonReplaySubScript.h" +#include "../IFloatingWindowScript.h" #include diff --git a/game/menus/mainmenu/CreditsSubScene.cpp b/game/menus/mainmenu/CreditsSubScene.cpp index bdd6fa0..65576ee 100644 --- a/game/menus/mainmenu/CreditsSubScene.cpp +++ b/game/menus/mainmenu/CreditsSubScene.cpp @@ -55,7 +55,7 @@ void CreditsSubScene::create(Scene & scn) { ButtonSubScene::Data { .text = "Back", .text_width = 150, - .position = {-button_position.x+150, button_position.y}, + .position = {-button_position.x + 150, button_position.y}, .script_type = ButtonSubScene::ScriptSelect::CREDITS_BACK, .button_type = ButtonSubScene::ButtonSelect::BACK, .scale = 0.6, @@ -69,58 +69,64 @@ void CreditsSubScene::create(Scene & scn) { const float Y_OFFSET_NAMES_BEGIN = 100; const float Y_OFFSET_NAMES = 30; const string LOEK = "Loek Le Blansch"; - crepe::vec2 size_loek = {LOEK.size()*SIZE_CHAR_NAMES, (LOEK.size()*SIZE_CHAR_NAMES / LOEK.size()) * 2}; + crepe::vec2 size_loek + = {LOEK.size() * SIZE_CHAR_NAMES, (LOEK.size() * SIZE_CHAR_NAMES / LOEK.size()) * 2}; titel.add_component( size_loek, FONT, Text::Data { .world_space = false, .text_color = Color::WHITE, }, - vec2 {150, -207+Y_OFFSET_NAMES+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, LOEK + vec2 {150, -207 + Y_OFFSET_NAMES + Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, LOEK ); const string WOUTER = "Wouter Boerenkamps"; - crepe::vec2 size_wouter = {WOUTER.size()*SIZE_CHAR_NAMES, (WOUTER.size()*SIZE_CHAR_NAMES / WOUTER.size()) * 2}; + crepe::vec2 size_wouter + = {WOUTER.size() * SIZE_CHAR_NAMES, + (WOUTER.size() * SIZE_CHAR_NAMES / WOUTER.size()) * 2}; titel.add_component( size_wouter, FONT, Text::Data { .world_space = false, .text_color = Color::WHITE, }, - vec2 {150, -207+Y_OFFSET_NAMES*2+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, WOUTER + vec2 {150, -207 + Y_OFFSET_NAMES * 2 + Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, WOUTER ); const string JARO = "Jaro Rutjes"; - crepe::vec2 size_jaro = {JARO.size()*SIZE_CHAR_NAMES, (JARO.size()*SIZE_CHAR_NAMES / JARO.size()) * 2}; + crepe::vec2 size_jaro + = {JARO.size() * SIZE_CHAR_NAMES, (JARO.size() * SIZE_CHAR_NAMES / JARO.size()) * 2}; titel.add_component( size_jaro, FONT, Text::Data { .world_space = false, .text_color = Color::WHITE, }, - vec2 {150, -207+Y_OFFSET_NAMES*3+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, JARO + vec2 {150, -207 + Y_OFFSET_NAMES * 3 + Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, JARO ); const string MAX = "Max Smits"; - crepe::vec2 size_max = {MAX.size()*SIZE_CHAR_NAMES, (MAX.size()*SIZE_CHAR_NAMES / MAX.size()) * 2}; + crepe::vec2 size_max + = {MAX.size() * SIZE_CHAR_NAMES, (MAX.size() * SIZE_CHAR_NAMES / MAX.size()) * 2}; titel.add_component( size_max, FONT, Text::Data { .world_space = false, .text_color = Color::WHITE, }, - vec2 {150, -207+Y_OFFSET_NAMES*4+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, MAX + vec2 {150, -207 + Y_OFFSET_NAMES * 4 + Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, MAX ); const string NIELS = "Niels Stunnebrink"; - crepe::vec2 size_niels = {NIELS.size()*SIZE_CHAR_NAMES, (NIELS.size()*SIZE_CHAR_NAMES / NIELS.size()) * 2}; + crepe::vec2 size_niels + = {NIELS.size() * SIZE_CHAR_NAMES, (NIELS.size() * SIZE_CHAR_NAMES / NIELS.size()) * 2 + }; titel.add_component( size_niels, FONT, Text::Data { .world_space = false, .text_color = Color::WHITE, }, - vec2 {150, -207+Y_OFFSET_NAMES*5+Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, NIELS + vec2 {150, -207 + Y_OFFSET_NAMES * 5 + Y_OFFSET_NAMES_BEGIN} + FONTOFFSET, NIELS ); - } diff --git a/game/menus/mainmenu/CreditsSubScript.cpp b/game/menus/mainmenu/CreditsSubScript.cpp index ce74ba4..4224dc8 100644 --- a/game/menus/mainmenu/CreditsSubScript.cpp +++ b/game/menus/mainmenu/CreditsSubScript.cpp @@ -1,8 +1,8 @@ #include "CreditsSubScript.h" #include "../../Events.h" -#include "../IFloatingWindowScript.h" #include "../ButtonReplaySubScript.h" +#include "../IFloatingWindowScript.h" #include @@ -13,7 +13,6 @@ using namespace crepe; - CreditsSubScript::CreditsSubScript(const std::string & tag) { this->tag = tag; } void CreditsSubScript::init() { @@ -57,4 +56,3 @@ bool CreditsSubScript::enable_all() { bool CreditsSubScript::on_button_press(const ButtonPressEvent & e) { return this->disable_all(); } - diff --git a/game/menus/mainmenu/CreditsSubScript.h b/game/menus/mainmenu/CreditsSubScript.h index e411202..81f941a 100644 --- a/game/menus/mainmenu/CreditsSubScript.h +++ b/game/menus/mainmenu/CreditsSubScript.h @@ -1,7 +1,7 @@ #pragma once -#include "../IFloatingWindowScript.h" #include "../IButtonScript.h" +#include "../IFloatingWindowScript.h" #include #include -- cgit v1.2.3