diff options
| author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-08 13:40:20 +0100 | 
|---|---|---|
| committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-08 13:40:20 +0100 | 
| commit | aa8bf26452157f81f72b6d6759e461ff2ca24568 (patch) | |
| tree | c8b69948708410dac3282ab5d3e7f9cde4cce22f /game/menus/mainmenu/CreditsSubScript.cpp | |
| parent | c001bfe4e82cecc880700b6f2a434371d818a473 (diff) | |
updated preview and added credits button
Diffstat (limited to 'game/menus/mainmenu/CreditsSubScript.cpp')
| -rw-r--r-- | game/menus/mainmenu/CreditsSubScript.cpp | 46 | 
1 files changed, 46 insertions, 0 deletions
| diff --git a/game/menus/mainmenu/CreditsSubScript.cpp b/game/menus/mainmenu/CreditsSubScript.cpp new file mode 100644 index 0000000..5326594 --- /dev/null +++ b/game/menus/mainmenu/CreditsSubScript.cpp @@ -0,0 +1,46 @@ +#include "CreditsSubScript.h" + +#include "../../Events.h" +#include "../IFloatingWindowScript.h" +#include "../ButtonReplaySubScript.h" + +#include <string> + +#include <crepe/api/Button.h> +#include <crepe/api/Sprite.h> +#include <crepe/api/Text.h> +#include <crepe/types.h> + +using namespace crepe; + +CreditsSubScript::CreditsSubScript(const std::string & tag) { this->tag = tag; } + +void CreditsSubScript::init() { +	this->disable_all(); +} + +bool CreditsSubScript::disable_all() { +	IFloatingWindowScript::disable_all_sprites(); +	RefVector<Button> buttons = this->get_components_by_tag<Button>(this->tag); +	for (Button & button : buttons) { +		button.active = false; +	} +	RefVector<Text> texts = this->get_components_by_tag<Text>(this->tag); +	for (Text & text : texts) { +		text.active = false; +	} +	return false; +} + +bool CreditsSubScript::enable_all() { +	IFloatingWindowScript::enable_all_sprites(); +	RefVector<Button> buttons = this->get_components_by_tag<Button>(this->tag); +	for (Button & button : buttons) { +		button.active = true; +	} +	RefVector<Text> texts = this->get_components_by_tag<Text>(this->tag); +	for (Text & text : texts) { +		text.active = true; +	} +	return false; +} |