Brunot
Loading...
Searching...
No Matches
HelpScene.h
Go to the documentation of this file.
1
11// ____ __ __ __
12// /\__ _\/\ \ /\ \/\ \
13// \/_/\ \/\ \ \___ __ \ \ \_\ \ ___ __ __ ____ __
14// \ \ \ \ \ _ `\ /'__`\ \ \ _ \ / __`\/\ \/\ \ /',__\ /'__`\
15// \ \ \ \ \ \ \ \/\ __/ \ \ \ \ \/\ \L\ \ \ \_\ \/\__, `\/\ __/
16// \ \_\ \ \_\ \_\ \____\ \ \_\ \_\ \____/\ \____/\/\____/\ \____\
17// \/_/ \/_/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/___/ \/____/
18
19#pragma once
20#include "Sprite.h"
21#include "Framework/Component.h"
23
24class HelpScene : public Component
25{
26public:
27#pragma region static_functions
28 static auto bindLuaTypes(sol::state& lua) -> void {}
29 static auto getEnum() -> ComponentTypeEnum
30 {
31 return cHelpScene;
32 }
33
34#pragma endregion
35
36 HelpScene();
37 HelpScene(const HelpScene&);
38 auto operator=(const HelpScene&) -> HelpScene& = default;
39 ~HelpScene() override = default;
40 HelpScene(HelpScene&& other) noexcept;
41 auto operator=(HelpScene&& other) noexcept -> HelpScene& = default;
42
43#pragma region overriden_functions
44
45 auto clone() const -> std::unique_ptr<GameObject> override
46 {
47 return std::make_unique<HelpScene>(*this);
48 }
49
50 /* Only override componentShowMenu if you have something to display
51 auto componentShowMenu() -> void override
52 {
53 } // for debug ImGUI
54 */
55 auto onUpdate(float dt) -> void override;
56
57 auto endWindow() -> void override
58 {
59 } // for debug ImGUI
60 auto onRender() -> void override;
61 auto onEnterEngine() -> void override;
62 auto load(const Stream& stream) -> void override;
63 auto save(Stream& stream) const -> void override;
64
65 friend auto to_json(json& j, const HelpScene& n) -> void;
66 friend auto from_json(const json& j, HelpScene& n) -> void;
67
68
69#pragma endregion
70
71#pragma region HelpScene_functions
72
73 auto changeImage() -> void;
74 auto changeArrows(Entity* ent) -> void;
75
76#pragma endregion
77
78#pragma region messaging_functions
79 auto linkMessages() -> void;
80
81 auto leftButtonPressed(const Message* message) -> Message;
82 auto rightButtonPressed(const Message* message) -> Message;
83
84 auto getHelpScale() -> std::pair<Vector4D, Vector4D>;
85#pragma endregion
86
87private:
88#pragma region member_variables
89
91 std::vector<gfx::Texture*> textures;
94
95#pragma endregion
96
97#pragma region helper_functions
98
99 auto disableHelpPopUp(const Message* message) -> Message;
100
101#pragma endregion
102
103#pragma region static_variables
104
105#pragma endregion
106
107};
sys::Json Stream
Definition AudioObject.h:20
The base class for components, holding all of their shared All components should inherit from this.
nlohmann::json json
Definition Json.cpp:19
ComponentTypeEnum
This enum lists out every type of component we have.
Definition Component.h:39
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
Definition Entity.h:41
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
Definition HelpScene.h:25
std::vector< gfx::Texture * > textures
The images used in help.
Definition HelpScene.h:91
auto operator=(const HelpScene &) -> HelpScene &=default
auto changeArrows(Entity *ent) -> void
Definition HelpScene.cpp:115
auto operator=(HelpScene &&other) noexcept -> HelpScene &=default
friend auto from_json(const json &j, HelpScene &n) -> void
Definition HelpScene.cpp:98
auto leftButtonPressed(const Message *message) -> Message
Definition HelpScene.cpp:199
HelpScene()
Definition HelpScene.cpp:41
static auto bindLuaTypes(sol::state &lua) -> void
Definition HelpScene.h:28
friend auto to_json(json &j, const HelpScene &n) -> void
Definition HelpScene.cpp:90
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition HelpScene.cpp:80
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition HelpScene.cpp:71
auto disableHelpPopUp(const Message *message) -> Message
Definition HelpScene.cpp:240
auto onUpdate(float dt) -> void override
called once every frame.
Definition HelpScene.cpp:62
auto changeImage() -> void
Definition HelpScene.cpp:107
static auto getEnum() -> ComponentTypeEnum
Definition HelpScene.h:29
auto onRender() -> void override
called every frame after update has been called for every object.
Definition HelpScene.cpp:67
~HelpScene() override=default
auto rightButtonPressed(const Message *message) -> Message
Definition HelpScene.cpp:215
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition HelpScene.h:57
auto getHelpScale() -> std::pair< Vector4D, Vector4D >
Definition HelpScene.cpp:231
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition HelpScene.h:45
int currentTexture
An index to keep track of which image was highlighted last.
Definition HelpScene.h:93
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition HelpScene.cpp:85
auto linkMessages() -> void
Definition HelpScene.cpp:151
Definition Message.h:35