34#pragma region static_functions
51#pragma region overriden_functions
55 return std::make_unique<Selector>(*
this);
59 auto onUpdate(
float dt) ->
void override;
66 auto load(
const Stream& stream) ->
void override;
67 auto save(
Stream& stream)
const ->
void override;
78#pragma region Selector_functions
84 virtual auto select(
int id) -> void;
109#pragma region messaging_functions
122#pragma region protected_members
130#pragma region member_variables
136#pragma region helper_functions
141#pragma region static_variables
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
std::string typeName
the typeName of a GameObject.
Definition GameObject.h:562
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:24
An indicator that loops through a parents' nodes children and can "select" them on keypress.
Definition Selector.h:32
friend auto from_json(const json &j, Selector &s) -> void
Definition Selector.cpp:120
virtual auto receiveRightKeyPressed(const Message *message) -> Message
Definition Selector.cpp:271
auto highlight() -> void
Calls the highlight function on the currently hovered button.
Definition Selector.cpp:155
virtual auto linkMessages() -> void
Definition Selector.cpp:224
~Selector() override=default
auto select() -> void
Selects the button that the selector is hovering over.
Definition Selector.cpp:129
auto operator=(Selector &&other) noexcept -> Selector &=default
auto onEnterEngine() -> void override
hook that is called when a GameObject enters the Engine tree.
Definition Selector.cpp:70
auto undoHighlight() -> void
Calls the highlight function on the currently hovered button.
Definition Selector.cpp:163
auto moveWithoutHighlight(Entity *newParent) const -> void
Moves the selector without causing any highlighting.
Definition Selector.cpp:351
static auto bindLuaTypes(sol::state &lua) -> void
Definition Selector.h:35
virtual auto receiveLeftKeyPressed(const Message *message) -> Message
Definition Selector.cpp:255
Selector()
Definition Selector.cpp:42
auto operator=(const Selector &) -> Selector &=default
auto save(Stream &stream) const -> void override
Implementations will load the state of a GameObject to a th::Json object.
Definition Selector.cpp:108
auto onRender() -> void override
called every frame after update has been called for every object.
Definition Selector.cpp:75
virtual auto isValidID(int id) -> bool
Virtual function used by FilteredSelector. Always returns true in Selector.
Definition Selector.cpp:219
static auto getEnum() -> ComponentTypeEnum
Definition Selector.h:36
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Selector.h:62
auto componentShowMenu() -> void override
Definition Selector.cpp:60
auto moveLeft() -> void
Moves the selector left one Entity inside the Menu it's within.
Definition Selector.cpp:190
virtual auto receiveDownKeyPressed(const Message *message) -> Message
Definition Selector.cpp:303
virtual auto receiveUpKeyPressed(const Message *message) -> Message
Definition Selector.cpp:287
auto moveUp() -> void
Moves the selector up one Entity inside the Menu it's within.
Definition Selector.cpp:170
auto moveRight() -> void
Moves the selector right one Entity inside the Menu it's within.
Definition Selector.cpp:200
auto moveDown() -> void
Moves the selector down one Entity inside the Menu it's within.
Definition Selector.cpp:180
friend auto to_json(json &j, const Selector &s) -> void
Definition Selector.cpp:113
auto load(const Stream &stream) -> void override
Implementations will load the state of a GameObject from a th::Json Object.
Definition Selector.cpp:103
auto moveToNewParent(Entity *newParent) const -> void
Moves the selector while unhighlighting the old parent and highlighting the new one.
Definition Selector.cpp:330
virtual auto receiveSelectKeyPressed(const Message *message) -> Message
Definition Selector.cpp:319
auto onUpdate(float dt) -> void override
called once every frame.
Definition Selector.cpp:64
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Selector.h:53