Implement States for ControlGuide.

This commit is contained in:
J-D-K
2025-11-15 11:49:00 -05:00
parent 785b51c455
commit 30ffa86b65
2 changed files with 71 additions and 11 deletions

View File

@@ -31,6 +31,15 @@ namespace ui
void reset() noexcept;
private:
/// @brief States the guide can be in.
enum class State : uint8_t
{
Opening,
Opened,
Hiding,
Hidden
};
/// @brief Stores the pointer to the guide string.
const char *m_guide{};
@@ -46,10 +55,19 @@ namespace ui
/// @brief Transition for the guide string.
ui::Transition m_transition{};
/// @brief Current state of the control guide.
ControlGuide::State m_state{};
/// @brief This is shared by all instances.
static inline sdl::SharedTexture sm_controlCap{};
/// @brief Ensures the control guide cap is loaded for all instances.
void initialize_static_members();
/// @brief Updates the position of the guide.
void update_position_state() noexcept;
/// @brief Updates the current state of the control guide.
void update_state(bool hasFocus) noexcept;
};
}