GigaPasjans
Loading...
Searching...
No Matches
GameSettingsScreen.h
1// Plik utworzony przez Piotra Chudzińskiego w dniu 6.05.2025
2#pragma once
3#include <andromenda/Components/TextComponent.h>
4#include <game/Solitaire.h>
5#include <phosphorus/GameBootstrapper.h>
6#include <phosphorus/Languages.h>
7#include "game/Screens/Settings/SettingsScreen.h"
8
9namespace Game
10{
14 class GameSettingsScreen : public SettingsScreen
15 {
16 private:
17 Andromenda::TextComponent *m_SwitchLanguageInformationEn, *m_SwitchLanguageInformationPl;
18
19 public:
20 GameSettingsScreen() :
21 SettingsScreen(nullptr), m_SwitchLanguageInformationEn(new Andromenda::TextComponent(
22 L"To fully reload language you have to restart the game. Remember to "
23 L"close the game through the menu.")),
24 m_SwitchLanguageInformationPl(
25 new Andromenda::TextComponent(L"Aby w pełni załadować wybrany język musisz zrestartować grę. "
26 L"Pamiętaj żeby zamknąć grę przez menu."))
27 {
28 }
29
33 void Build(Andromenda::Surface &surface) override
34 {
35 m_GameObject = Phosphorus::GetGameAs<Solitaire>()->GameSettings;
36 SettingsScreen::Build(surface);
37
38
39 m_SwitchLanguageInformationEn->SetPosition(Int2{COMPONENT_CENTER_X, 10});
40 m_SwitchLanguageInformationPl->SetPosition(Int2{COMPONENT_CENTER_X, 11});
41
42 surface.RegisterComponent("Settings::NotifyPL", m_SwitchLanguageInformationPl);
43 surface.RegisterComponent("Settings::NotifyEN", m_SwitchLanguageInformationEn);
44 }
45
47 void Repose() override
48 {
50 Phosphorus::GetGameAs<Solitaire>()->GetSettings()->Language.GetEnum());
51 }
52 };
53} // namespace Game
The renderer of component registry.
Definition Surface.h:28
void RegisterComponent(const String &name, Component *component) override
Registers given component to given unique name.
Definition Surface.cpp:334
Text component that can't be selectable.
Definition TextComponent.h:13
void Repose() override
Event called when this screen is being closed.
Definition GameSettingsScreen.h:47
void Build(Andromenda::Surface &surface) override
Builds the game settings screen UI by initializing with the current game settings object.
Definition GameSettingsScreen.h:33
Phosphorus::GameObject * m_GameObject
GameObject instance that holds setting parameters.
Definition SettingsScreen.h:34
void Build(Andromenda::Surface &surface) override
Builds the UI components for the settings screen.
Definition SettingsScreen.cpp:37
static void SetLanguage(TELang lang)
Sets current language.
Definition Languages.h:38
Represents a two component vector. Components are 32-bit and they are signed.
Definition Int2.h:11