FuncDoodle
Loading...
Searching...
No Matches
FuncDoodle::PopupRegistry Class Reference

Stores all popups used in FuncDoodle. More...

#include <PopupRegistry.h>

Public Member Functions

 PopupRegistry ()=default
 ~PopupRegistry ()=default
void Register (std::string_view id)
 Registers a popup identifier in the registry.
void Open (std::string_view id)
 Marks a popup as open.
void Close (std::string_view id)
 Marks a popup as closed.
void Popup (std::string_view humanReadable, std::string_view id, double dt, std::function< void()> popup)
 Renders a popup using a lambda.
void Modal (std::string_view humanReadable, std::string_view id, double dt, std::function< void()> popup)
 Renders a popup MODAL using a lambda.
bool IsOpen (std::string_view id) const
 Returns whether a popup is currently open.
bool * Get (std::string_view id)
 Returns direct access to a popup open-state flag.
void CloseAll ()
 Closes every registered popup.
void CloseAllExcept (std::string_view exception)
 Closes every popup except one.

Private Attributes

std::unordered_map< std::string_view, PopupEntrym_Popups

Detailed Description

Stores all popups used in FuncDoodle.

Handles fetching and setting popup state.

See also
KeybindsRegistry

Constructor & Destructor Documentation

◆ PopupRegistry()

FuncDoodle::PopupRegistry::PopupRegistry ( )
default

◆ ~PopupRegistry()

FuncDoodle::PopupRegistry::~PopupRegistry ( )
default

Member Function Documentation

◆ Close()

void FuncDoodle::PopupRegistry::Close ( std::string_view id)

Marks a popup as closed.

Parameters
idPopup identifier to close.

◆ CloseAll()

void FuncDoodle::PopupRegistry::CloseAll ( )

Closes every registered popup.

◆ CloseAllExcept()

void FuncDoodle::PopupRegistry::CloseAllExcept ( std::string_view exception)

Closes every popup except one.

Parameters
exceptionPopup identifier to keep open.

◆ Get()

bool * FuncDoodle::PopupRegistry::Get ( std::string_view id)

Returns direct access to a popup open-state flag.

Parameters
idPopup identifier to query.
Returns
Pointer to the popup flag, or nullptr if missing.

◆ IsOpen()

bool FuncDoodle::PopupRegistry::IsOpen ( std::string_view id) const
nodiscard

Returns whether a popup is currently open.

Parameters
idPopup identifier to query.
Returns
Whether the popup is open.

◆ Modal()

void FuncDoodle::PopupRegistry::Modal ( std::string_view humanReadable,
std::string_view id,
double dt,
std::function< void()> popup )

Renders a popup MODAL using a lambda.

See also
Popup
Parameters
humanReadableThe part before #.
idThe part after #.
dtThe current deltaTime.
popupThe lambda to render with.

◆ Open()

void FuncDoodle::PopupRegistry::Open ( std::string_view id)

Marks a popup as open.

Parameters
idPopup identifier to open.

◆ Popup()

void FuncDoodle::PopupRegistry::Popup ( std::string_view humanReadable,
std::string_view id,
double dt,
std::function< void()> popup )

Renders a popup using a lambda.

Parameters
humanReadableThe part before #.
idThe part after #.
dtThe current deltaTime.
popupThe lambda to render with.

◆ Register()

void FuncDoodle::PopupRegistry::Register ( std::string_view id)

Registers a popup identifier in the registry.

Parameters
idPopup identifier to track.

Member Data Documentation

◆ m_Popups

std::unordered_map<std::string_view, PopupEntry> FuncDoodle::PopupRegistry::m_Popups
private

The documentation for this class was generated from the following files: