33#pragma region static_functions
45#pragma region overriden_functions
49 return std::make_unique<Selector>(*
this);
53 auto onUpdate(
float dt) ->
void override;
60 auto load(
const Stream& stream) ->
void override;
61 auto save(
Stream& stream)
const ->
void override;
72#pragma region Selector_functions
84#pragma region messaging_functions
110#pragma region member_variables
117#pragma region helper_functions
124#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
Component(ComponentTypeEnum type, const char *typeName)
Definition Component.cpp:72
friend Entity
Definition GameObject.h:84
std::string typeName
the typeName of a GameObject.
Definition GameObject.h:545
GameObject(std::string typeName, gobj::Type parentType, gobj::Type type)
constructor for gameobject.
Definition GameObject.cpp:23
An indicator that loops through a parents' nodes children and can "select" them on keypress.
Definition Selector.h:31
friend auto from_json(const json &j, Selector &s) -> void
Definition Selector.cpp:121
auto moveRight(Menu *menu) -> void
Helper function that actually moves the selector right in a menu.
Definition Selector.cpp:178
virtual auto receiveRightKeyPressed(const Message *message) -> Message
Definition Selector.cpp:243
bool enabled
If the selector is disabled, it does not move around or select.
Definition Selector.h:112
auto moveToNewParent(Entity *newParent) -> void
Definition Selector.cpp:287
auto moveDown(Menu *menu) -> void
Helper function that actually moves the selector down in a menu.
Definition Selector.cpp:162
virtual auto linkMessages() -> void
Definition Selector.cpp:202
~Selector() override=default
auto select() -> void
Selects the button that the selector is hovering over.
Definition Selector.cpp:133
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:74
virtual auto receiveLeftKeyPressed(const Message *message) -> Message
Definition Selector.cpp:233
Selector()
Definition Selector.cpp:40
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:79
virtual auto isValidID(int id) -> bool
Virtual function used by FilteredSelector. Always returns true in Selector.
Definition Selector.cpp:197
auto endWindow() -> void override
currently unused, but intended to but was assumed to be necessary for a proper ImGui editor
Definition Selector.h:56
auto componentShowMenu() -> void override
Definition Selector.cpp:61
virtual auto receiveDownKeyPressed(const Message *message) -> Message
Definition Selector.cpp:263
virtual auto receiveUpKeyPressed(const Message *message) -> Message
Definition Selector.cpp:253
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 moveLeft(Menu *menu) -> void
Helper function that actually moves the selector left in a menu.
Definition Selector.cpp:170
auto moveUp(Menu *menu) -> void
Helper function that actually moves the selector up in a menu.
Definition Selector.cpp:154
virtual auto receiveSelectKeyPressed(const Message *message) -> Message
Definition Selector.cpp:273
auto onUpdate(float dt) -> void override
called once every frame.
Definition Selector.cpp:68
auto clone() const -> std::unique_ptr< GameObject > override
makes a copy a GameObject even if it's held polymorphically
Definition Selector.h:47
auto setEnabled(bool state) -> void
Definition Selector.h:77