Blamite Game Engine - Blam (Core)
BlamRendering::RenderStack::DebugMenuItem Class Reference

Stack item representing a single item within the debug menu. More...

#include <menu_item.hpp>

+ Inheritance diagram for BlamRendering::RenderStack::DebugMenuItem:

Public Member Functions

 DebugMenuItem ()
 Prepares the item for drawing. More...
 
 ~DebugMenuItem ()
 Deletes any resources used by the item. More...
 
void onTickEvent (Blam::Events::TickEvent *event)
 Called when the listener is subscribed to Key Press events, and a new TickEvent is fired. More...
 
void UpdateItemTextColor ()
 Updates the text color of the item based on the item type. More...
 
void SetDefaultBarDimensions (int _width, int _height)
 Sets the default size of the item. More...
 
void UpdateMetadata ()
 Refresh any data needed for the item. More...
 
void Draw ()
 Draws the item, as well as the field for the global value if the item represents a global editor. More...
 
void ShowImPropertyEditor ()
 Shows a set of ImGUI properties associated with the object. More...
 
void toggleVisibility ()
 Toggles the item's visibility. More...
 
void SetActive (bool _active)
 Sets whether or not this item should be displayed as the active item. More...
 
void HandleKeyLeft ()
 Called when the Left arrow is pressed. More...
 
void HandleKeyRight ()
 Called when the Right arrow is pressed. More...
 
void ItemTriggered ()
 Called when the item is activated, usually from the Enter key. More...
 
- Public Member Functions inherited from BlamRendering::RenderStack::StackObjectBase
 StackObjectBase ()
 Sets default values and provides a default ID to be used if none is provided. More...
 
 ~StackObjectBase ()
 Empty destructor. More...
 
virtual void HandleResize ()
 Called upon window resize events. More...
 
void SetArea (float new_area[4])
 Sets the area of the object. More...
 
void SetArea (float top, float bottom, float left, float right)
 Sets the area of the object. More...
 
void SetArea (D2D1_RECT_F new_area)
 Sets the area of the object. More...
 
void SetColor (float new_color[3])
 Sets the color of the object. More...
 
void SetColor (float r, float g, float b)
 Sets the color of the object. More...
 
void SetColor (float r, float g, float b, float a)
 Sets the color of the object. More...
 
void SetColor (D2D1::ColorF color)
 Sets the color of the object. More...
 
void SetZOrder (int z)
 Sets the Z-Order of the object. More...
 
void SetTranslation (float new_x, float new_y)
 Sets the translation of the object. More...
 
void PokeTranslation ()
 Updates the area of the object to account for any x/y coordinate changes. More...
 
void SetSize (float new_width, float new_height)
 Sets the size of the object. More...
 
void PokeSize ()
 Updates the area of the object to account for any width/height changes. More...
 
void ValidateSizeAndTranslation ()
 Validates X/Y coordinates and Width/Height sizes after the area has been modified. More...
 
std::string GetType ()
 Retrieves the type of item that this stack object is. More...
 
std::string GetDrawModeLabel ()
 Retrieves the current drawing mode of the object. More...
 
- Public Member Functions inherited from Blam::Events::EventListener
void Subscribe (EventType type)
 Subscribes to an event type. More...
 
 ~EventListener ()
 
std::vector< EventTypegetSubscribedEvents ()
 Retrieves the list of subscribed event types. More...
 
bool isSubscribed (EventType type)
 Determines whether or not the listener is subscribed to the specified event type. More...
 
void SetPriority (int new_priority)
 Sets the priority of the listener. More...
 
int GetPriority ()
 Retrieves the priority of the listener. More...
 
virtual void onCharacterInputEvent (Blam::Events::CharacterInputEvent *event)
 Called when the listener is subscribed to Character Input events, and a new CharacterInputEvent is fired. More...
 
virtual void onKeyPressEvent (Blam::Events::KeyPressEvent *event)
 Called when the listener is subscribed to Key Press events, and a new KeyPressEvent is fired. More...
 

Public Attributes

bool active = false
 Whether or not this item is active. More...
 
int menu_index_num = 0
 The index of this item in the menu. More...
 
bool lock = false
 Whether or not this item is locked. Used to prevent deletion while the item is being drawn. More...
 
bool deleting = false
 Whether or not this item is being deleted. Used to prevent drawing while the item is being deleted. More...
 
Blam::DebugMenu::MenuItem menu_item
 The data to use for this menu item. More...
 
bool useAlternateDebugMenuUnknownGlobalDisplay = false
 
- Public Attributes inherited from BlamRendering::RenderStack::StackObjectBase
D2D1_RECT_F area
 The area of the object. More...
 
D2D1_COLOR_F color
 The color of the object. More...
 
int z_order = 0
 The Z-Order of the object. More...
 
StackType type_label = STACKTYPE_GENERIC
 The type of the object. More...
 
StackItemDrawMode draw_mode = DEFAULT_DRAWMODE
 The drawing mode of the object. More...
 
bool visible = true
 Whether or not the object is visible. More...
 
float x = 0
 The X coordinate of the object. More...
 
float y = 0
 The Y coordinate of the object. More...
 
float width = 100
 The width of the object. More...
 
float height = 100
 The height of the object. More...
 
std::string unique_id = ""
 The unique ID of this object. More...
 

Detailed Description

Stack item representing a single item within the debug menu.

For more details on the debug menu itself, see Blam::DebugMenu

Constructor & Destructor Documentation

◆ DebugMenuItem()

BlamRendering::RenderStack::DebugMenuItem::DebugMenuItem ( )
inline

Prepares the item for drawing.

◆ ~DebugMenuItem()

BlamRendering::RenderStack::DebugMenuItem::~DebugMenuItem ( )
inline

Deletes any resources used by the item.

Member Function Documentation

◆ Draw()

void BlamRendering::RenderStack::DebugMenuItem::Draw ( )
inlinevirtual

Draws the item, as well as the field for the global value if the item represents a global editor.

Reimplemented from BlamRendering::RenderStack::StackObjectBase.

◆ HandleKeyLeft()

void BlamRendering::RenderStack::DebugMenuItem::HandleKeyLeft ( )
inline

Called when the Left arrow is pressed.

◆ HandleKeyRight()

void BlamRendering::RenderStack::DebugMenuItem::HandleKeyRight ( )
inline

Called when the Right arrow is pressed.

◆ ItemTriggered()

void BlamRendering::RenderStack::DebugMenuItem::ItemTriggered ( )
inline

Called when the item is activated, usually from the Enter key.

◆ onTickEvent()

void BlamRendering::RenderStack::DebugMenuItem::onTickEvent ( Blam::Events::TickEvent event)
inlinevirtual

Called when the listener is subscribed to Key Press events, and a new TickEvent is fired.

Parameters
-The event that was fired.

Reimplemented from Blam::Events::EventListener.

◆ SetActive()

void BlamRendering::RenderStack::DebugMenuItem::SetActive ( bool  _active)
inline

Sets whether or not this item should be displayed as the active item.

Parameters
_active- Whether or not this item should be displayed as active.

◆ SetDefaultBarDimensions()

void BlamRendering::RenderStack::DebugMenuItem::SetDefaultBarDimensions ( int  _width,
int  _height 
)
inline

Sets the default size of the item.

Parameters
_width- The default width of the item.
_height- The default height of the item.

◆ ShowImPropertyEditor()

void BlamRendering::RenderStack::DebugMenuItem::ShowImPropertyEditor ( )
inlinevirtual

Shows a set of ImGUI properties associated with the object.

This will call functions to draw only the property controls for the item, and nothing else. The window/container for the properties must be handled externally.

Reimplemented from BlamRendering::RenderStack::StackObjectBase.

◆ toggleVisibility()

void BlamRendering::RenderStack::DebugMenuItem::toggleVisibility ( )
inline

Toggles the item's visibility.

◆ UpdateItemTextColor()

void BlamRendering::RenderStack::DebugMenuItem::UpdateItemTextColor ( )
inline

Updates the text color of the item based on the item type.

◆ UpdateMetadata()

void BlamRendering::RenderStack::DebugMenuItem::UpdateMetadata ( )
inline

Refresh any data needed for the item.

This function will determine the scale factor (and change its size accordingly), as well as alter how it displays based on the item type.

Member Data Documentation

◆ active

bool BlamRendering::RenderStack::DebugMenuItem::active = false

Whether or not this item is active.

◆ deleting

bool BlamRendering::RenderStack::DebugMenuItem::deleting = false

Whether or not this item is being deleted. Used to prevent drawing while the item is being deleted.

◆ lock

bool BlamRendering::RenderStack::DebugMenuItem::lock = false

Whether or not this item is locked. Used to prevent deletion while the item is being drawn.

◆ menu_index_num

int BlamRendering::RenderStack::DebugMenuItem::menu_index_num = 0

The index of this item in the menu.

◆ menu_item

Blam::DebugMenu::MenuItem BlamRendering::RenderStack::DebugMenuItem::menu_item

The data to use for this menu item.

◆ useAlternateDebugMenuUnknownGlobalDisplay

bool BlamRendering::RenderStack::DebugMenuItem::useAlternateDebugMenuUnknownGlobalDisplay = false

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