Elaztek Developer Hub
Blamite Game Engine - blam!  00423.10.27.24.0533.blamite
The core library for the Blamite Game Engine.
ui.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Strings/components/resources/color/BlamColor.h>
4 #include <OGRE/Overlay/OgreTextAreaOverlayElement.h>
5 #include <OGRE/Overlay/OgreOverlayContainer.h>
6 #include <OGRE/Overlay/OgrePanelOverlayElement.h>
7 #include <OGRE/Overlay/OgreOverlay.h>
8 #include <OGRE/OgreManualObject2.h>
9 #include <OGRE/OgreSceneManager.h>
10 #include <vector>
11 #include <string>
12 
16 
17 #ifndef BLAM
18 #define BLAM
19 #endif
20 
21 class BlamUIWidget_Group;
26 
33 {
34  TopCenter,
35  Center,
36  BottomCenter,
37 
38  TopLeft,
39  CenterLeft,
40  BottomLeft,
41 
42  TopRight,
43  CenterRight,
44  BottomRight,
45 
46  TopFill,
47  LeftFill,
48  RightFill,
49  BottomFill,
50  Fill
51 };
52 
60 enum class BlamWidgetType
61 {
64  Basic_Line,
66  Text,
67  Group,
70 
71  Console,
72  UIDCypher,
75  DebugMenu,
77  CrashScreen,
78  DebugText2D,
79  DebugText3D,
80 
82 };
83 
90 {
91 private:
93  BlamWidgetAnchor anchor_position = BlamWidgetAnchor::Center;
94 
103  void ShowAnchorChangeButton(BlamWidgetAnchor new_anchor, int height_mul, int width_mul, bool text_multiline);
104 
105 protected:
106  BlamVector2 position_absolute = { 0, 0 };
107  BlamVector2 size_absolute = { 100, 100 };
108  bool update = false;
109  bool hidden = false;
110 
117  int GetAdjustedZIndex();
118 
119 public:
120  std::string display_name = "unnamed";
121  std::string description = "";
122 
123  BlamVector2 position = { 0, 0 };
124  BlamVector2 size = { 100, 100 };
125  float rotation = 0.0f;
126 
127  int z_index = 0;
128  float z_size = 1.0f;
129  bool auto_update = false;
130 
131  Ogre::HlmsDatablock* material = nullptr;
133  bool ignore_layout = false;
134  bool hide_in_layout = false;
135  bool ignore_scale_factor = false;
136 
143 
151 
152  virtual ~BlamUIWidget() {};
153 
157  virtual void Draw() {};
158 
162  virtual void ShowImGuiPropertyEditor();
163 
170  virtual void UpdateMetrics() {};
171 
178 
184  virtual void RefreshRelativePosition();
185 
193  void RefreshRelativePosition(int viewport_width, int viewport_height, BlamVector2 initial_position);
194 
200  void SetSize(BlamVector2 new_size);
201 
207  virtual void SetPosition(BlamVector2 new_position);
208 
214  void SetRotation(float new_rotation);
215 
221  void SetAnchorPosition(BlamWidgetAnchor new_anchor_position);
222 
226  void MarkForUpdate();
227 
233  BlamVector2 GetAbsolutePosition();
234 
241 
247  virtual void SetHidden(bool new_hidden);
248 
254  bool IsHidden();
255 };
256 
266 {
267 private:
268  BlamUIWidget_BasicRectangle* bounds_border = nullptr;
269  BlamImGuiWindow_BlamUIEditor* editor_window = nullptr;
270 
271 public:
272  std::vector<BlamUIWidget*> children = std::vector<BlamUIWidget*>();
273  bool show_bounds = false;
274 
281 
290 
291  void Draw() override;
292  void ShowImGuiPropertyEditor() override;
293  void RefreshRelativePosition() override;
294  void UpdateMetrics() override;
295  void SetHidden(bool new_hidden) override;
296 
300  void ShowImGuiEditorWindow();
301 
305  void ClearChildren();
306 };
307 
316 {
317 private:
318  int cached_child_count = 0;
319 
320 public:
321  BlamVector4 padding = { 0, 0, 0, 0 };
322  int item_spacing = 0;
323  bool auto_height = false;
324 
327 
328  void Draw() override;
329  void ShowImGuiPropertyEditor() override;
330  void RefreshRelativePosition() override;
331 };
332 
340 {
341 private:
348  void PreGenerateManualObject();
349 
356  void PostGenerateManualObject();
357 
363  void VerifyManualObjectValid();
364 
365 protected:
366  Ogre::ManualObject* manual_object = nullptr;
367  Ogre::HlmsUnlitDatablock* datablock = nullptr;
368  Ogre::SceneNode* node = nullptr;
369  bool last_hide_state = false;
370  bool needs_regen = true;
371 
372 public:
373  BlamColor color = BlamColor(255, 255, 255);
374 
383 
384  void Draw() override;
385  void ShowImGuiPropertyEditor() override;
386  void UpdateMetrics() override;
387  void SetHidden(bool new_hidden) override;
388 
395  virtual void GenerateManualObject() {};
396 };
397 
405 {
406 public:
407  bool solid = true;
408  int thickness = 1;
409 
411  void ShowImGuiPropertyEditor() override;
412  void GenerateManualObject() override;
413 };
414 
422 {
423 public:
424  bool solid = false;
425  int thickness = 1;
426  int resolution = 10;
427  BlamVector2 radius = { 10, 10 };
428 
430 
431  void ShowImGuiPropertyEditor() override;
432  void GenerateManualObject() override;
433 };
434 
441 {
442 public:
443  int thickness = 1;
444  BlamVector2 start = { 0, 0 };
445  BlamVector2 end = { 0, 0 };
446 
448 
449  void ShowImGuiPropertyEditor() override;
450  void GenerateManualObject() override;
451 };
452 
460 {
461 private:
462  void GenerateManualObject() override;
463 
464 public:
465  bool solid = false;
466  int thickness = 1;
467 
468  bool use_custom_points = false;
469  BlamVector2 point_x = { 0, 0 };
470  BlamVector2 point_y = { 0, 0 };
471  BlamVector2 point_z = { 0, 0 };
472 
474 
475  void ShowImGuiPropertyEditor() override;
476 };
477 
486 {
487 private:
488  Ogre::SceneNode* node = nullptr;
489  Ogre::ManualObject* manual_object = nullptr;
490 
491  std::string previous_text = "";
492  bool last_hide_state = false;
493  BlamColor last_color = BlamColor(255, 255, 255);
494  BlamColor last_shadow_color = BlamColor(0, 0, 0);
495 
496  std::vector<Ogre::HlmsDatablock*> datablocks = std::vector<Ogre::HlmsDatablock*>();
497  std::vector<Ogre::HlmsDatablock*> shadow_datablocks = std::vector<Ogre::HlmsDatablock*>();
498  bool needs_new_datablocks = true;
499 
503  void ReleaseOldDatablocks();
504 
508  void GenerateManualObject();
509 
518  void GenerateManualObjectSection(bool is_shadow);
519 
520 public:
521  bool auto_scale_shadow = true;
522  int character_height = 16;
523  BlamVector2 shadow_offset = { 1, 1 };
524  BlamColor color = BlamColor(255, 255, 255);
525  BlamColor shadow_color = BlamColor(0, 0, 0);
526  std::string font_name = "fixedsys";
528  std::string text = "blam!";
529 
532 
533  void Draw() override;
534  void ShowImGuiPropertyEditor() override;
535  void UpdateMetrics() override;
536  void SetHidden(bool new_hidden) override;
537 
544  void RebuildTextObject();
545 };
546 
550 namespace Blam::UI
551 {
555  BLAM bool Initialize();
556 
560  BLAM void Render();
561 
565  BLAM void Shutdown();
566 
573 
581  BLAM std::string GetWidgetAnchorLabel(BlamWidgetAnchor anchor_position);
582 
591  BLAM bool LoadFromCUIScreenTag(std::string tag_path, cui_screen* cusc_tag);
592 
599 
606 }
BlamUIWidget_Group::RefreshRelativePosition
void RefreshRelativePosition() override
Updates the relative position of the widget, relative to its parent.
Definition: group.cpp:140
BlamUIWidget_BasicLine::thickness
int thickness
The thickness of the line.
Definition: ui.h:443
BlamUIWidget::hidden
bool hidden
Whether or not the widget is hidden.
Definition: ui.h:109
ui.h
BlamUIWidget_BasicLine::end
BlamVector2 end
The ending point of the line.
Definition: ui.h:445
BlamWidgetType::DebugMenu
@ DebugMenu
Special widget. Used for the in-game debug menu.
BlamWidgetAnchor::BottomFill
@ BottomFill
The widget will fill the bottom of the screen, while height is left unchanged.
BlamUIWidget_BasicEllipse::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:425
BlamWidgetAnchor::CenterRight
@ CenterRight
The widget will be placed at the center-right of the screen.
BlamWidgetAnchor::Center
@ Center
The widget will be placed at the center of the screen.
BlamUIWidget::BlamUIWidget
BlamUIWidget(BlamWidgetType type)
Constructs a new UI widget.
Definition: BlamUIWidget.cpp:35
BlamUIWidget::update
bool update
Whether or not the widget needs to be updated before the next draw call.
Definition: ui.h:108
Blam::Logger::LogEvent
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
BlamUIWidget_VLayoutGroup::item_spacing
int item_spacing
The amount of space to display between items, in pixels.
Definition: ui.h:322
uid_cypher.h
BlamUIWidget::hide_in_layout
bool hide_in_layout
Whether or not this widget should be hidden within its layout.
Definition: ui.h:134
BlamUIWidget_Text::font_name
std::string font_name
The name of the font package to use for this text widget.
Definition: ui.h:526
BlamUIWidget_BasicTriangle
Class representing a basic triangle widget.
Definition: ui.h:459
BlamUIWidget_Group
Class representing a Group widget.
Definition: ui.h:265
BlamUIWidget::position
BlamVector2 position
The position of the widget, relative to its parent.
Definition: ui.h:123
BlamWidgetAnchor
BlamWidgetAnchor
Enumerator listing possible widget anchor positions.
Definition: ui.h:32
Blam::UI::GetWidgetAnchorLabel
BLAM std::string GetWidgetAnchorLabel(BlamWidgetAnchor anchor_position)
Retrieves a string representation of a widget anchor position.
Definition: ui.cpp:71
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:428
ImGui::Checkbox
IMGUI_API bool Checkbox(const char *label, bool *v)
Definition: imgui_widgets.cpp:974
logger.h
BlamUIWidget_VLayoutGroup::~BlamUIWidget_VLayoutGroup
~BlamUIWidget_VLayoutGroup()
Definition: vlayout.cpp:10
Blam::UI::GetUIRoot
BLAM BlamUIWidget_Group * GetUIRoot()
Retrieves the root UI group widget.
Definition: ui.cpp:66
console.h
BlamUIWidget::MarkForUpdate
void MarkForUpdate()
Marks the widget as needing to be updated on the next draw call.
Definition: BlamUIWidget.cpp:392
BlamUIWidget::parent
BlamUIWidget_Group * parent
The parent group of this widget, if applicable.
Definition: ui.h:132
BlamFontPackage
Class representing a Blamite font package.
Definition: fonts.h:86
BlamUIWidget_BasicTriangle::point_x
BlamVector2 point_x
The first point of the triangle. Only used when use_custom_points is set to true.
Definition: ui.h:469
BlamUIWidget::rotation
float rotation
The rotation of the widget, in degrees.
Definition: ui.h:125
BlamUIWidget_2DPrimitive::datablock
Ogre::HlmsUnlitDatablock * datablock
The datablock associated with this widget.
Definition: ui.h:367
BlamUIWidget_Text::font_package
BlamFontPackage * font_package
The font package being used for this text widget.
Definition: ui.h:527
BlamUIWidget_Group::show_bounds
bool show_bounds
Whether or not to display the debug bounding box around this widget.
Definition: ui.h:273
BlamUIWidget_Text::character_height
int character_height
The line height of this text widget, in pixels.
Definition: ui.h:522
BlamUIWidget_Text::shadow_offset
BlamVector2 shadow_offset
The offset of the text shadow, in pixels.
Definition: ui.h:523
imgui.h
BlamWidgetType::Text
@ Text
A text object, used to show text on-screen.
BlamUIWidget_BasicEllipse::resolution
int resolution
The number of faces that the ellipse should have. Higher numbers result in a smoother edge.
Definition: ui.h:426
BlamUIWidget_BasicTriangle::point_z
BlamVector2 point_z
The third point of the triangle. Only used when use_custom_points is set to true.
Definition: ui.h:471
BlamWidgetType::Basic_Rectangle
@ Basic_Rectangle
A basic filled or outline rectangle.
BlamUIWidget_2DPrimitive::color
BlamColor color
The color of the widget.
Definition: ui.h:373
BlamWidgetType::Basic_Ellipse
@ Basic_Ellipse
A basic filled or outline ellipse.
ImGui::InputText
IMGUI_API bool InputText(const char *label, char *buf, size_t buf_size, ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition: imgui_widgets.cpp:3068
world.h
BlamUIWidget_VLayoutGroup::padding
BlamVector4 padding
The padding around the layout group. Padding order is top, right, bottom, left.
Definition: ui.h:321
BlamVersionStringDisplayMode::Console
@ Console
Indicates the build string should be formatted for the in-game console.
BlamUIWidget_Group::ShowImGuiEditorWindow
void ShowImGuiEditorWindow()
Displays the separate ImGUI editor window for this group.
Definition: group.cpp:185
BlamWidgetAnchor::BottomLeft
@ BottomLeft
The widget will be placed at the bottom-left of the screen.
BlamWidgetType::Group_VLayout
@ Group_VLayout
A group widget which displays all items in a vertical list.
BlamUIWidget::z_size
float z_size
The Z size of the widget. Mostly unused.
Definition: ui.h:128
Blam::Globals::GetGlobalAsFloat
BLAM float * GetGlobalAsFloat(std::string name)
Retrieves a global's value as a float.
Definition: globals.cpp:403
cui_screen
Definition: cui_screen.h:42
uint8_t
unsigned char uint8_t
Definition: stdint.h:15
BlamTagFieldType::Unspecified
@ Unspecified
Indicates that the field's type is not specified. Fields with this type should be considered invalid.
BlamUIWidget_2DPrimitive::manual_object
Ogre::ManualObject * manual_object
The manual object associated with this widget.
Definition: ui.h:366
Blam::UI::GetDebugMenuWidget
BLAM BlamUIWidget_DebugMenu * GetDebugMenuWidget()
Retrieves the built-in debug menu widget.
Definition: ui.cpp:297
BlamUIWidget_Text::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: text.cpp:452
BlamUIWidget_BasicRectangle::solid
bool solid
Whether or not this primitive is solid, or an outline.
Definition: ui.h:407
BlamUIWidget_BasicRectangle::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:408
BlamWidgetAnchor::BottomRight
@ BottomRight
The widget will be placed at the bottom-right of the screen.
BlamUIWidget::GetAdjustedZIndex
int GetAdjustedZIndex()
Retrieves the adjusted Z-index of the widget.
Definition: BlamUIWidget.cpp:397
BlamUIWidget::GetType
BlamWidgetType GetType()
Retrieves the type of this widget.
Definition: BlamUIWidget.cpp:207
BlamUIWidget_2DPrimitive
Base class for 2D primitive widgets.
Definition: ui.h:339
imgui_stdlib.h
BlamUIWidget_Group::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: group.cpp:155
BlamUIWidget::size
BlamVector2 size
The size of the widget, relative to its parent.
Definition: ui.h:124
Blam::UI::GetCrashScreenWidget
BLAM BlamUIWidget_CrashScreen * GetCrashScreenWidget()
Retrieves the built-in crash screen widget.
Definition: ui.cpp:279
rendering.h
BlamWidgetAnchor::CenterLeft
@ CenterLeft
The widget will be placed at the center-left of the screen.
ImGui::DragInt
IMGUI_API bool DragInt(const char *label, int *v, float v_speed=1.0f, int v_min=0, int v_max=0, const char *format="%d")
Definition: imgui_widgets.cpp:2209
BlamUIWidget_Group::Draw
void Draw() override
Draws the widget on-screen.
Definition: group.cpp:51
BlamUIWidget_Text::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: text.cpp:71
BlamUIWidget::Draw
virtual void Draw()
Draws the widget on-screen.
Definition: ui.h:157
ImGui::SameLine
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f)
Definition: imgui.cpp:7147
BlamWidgetAnchor::TopCenter
@ TopCenter
The widget will be placed at the top-center of the screen.
BlamUIWidget::GetAnchorPosition
BlamWidgetAnchor GetAnchorPosition()
Retrieves the anchor position of the widget.
Definition: BlamUIWidget.cpp:410
BlamWidgetAnchor::BottomCenter
@ BottomCenter
The widget will be placed at the bottom-center of the screen.
Blam::UI::LoadFromCUIScreenTag
BLAM bool LoadFromCUIScreenTag(std::string tag_path, cui_screen *cusc_tag)
Creates a new UI widget from a cui_screen tag.
Definition: ui.cpp:136
BlamUIWidget::~BlamUIWidget
virtual ~BlamUIWidget()
Definition: ui.h:152
BlamUIWidget_VLayoutGroup::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: vlayout.cpp:26
BlamUIWidget_2DPrimitive::GenerateManualObject
virtual void GenerateManualObject()
Virtual method used to generate the manual object.
Definition: ui.h:395
BlamWidgetAnchor::RightFill
@ RightFill
The widget will fill the right of the screen, while width is left unchanged.
BlamWidgetType::UIDCypher
@ UIDCypher
Special widget. Used for the user ID cypher.
ImVec2
Definition: imgui.h:179
Blam::UI
Namespace containing functions relating to the Blamite UI system.
Definition: ui.h:550
BlamUIWidget_Group::~BlamUIWidget_Group
~BlamUIWidget_Group()
Definition: group.cpp:34
BlamUIWidget_Text::~BlamUIWidget_Text
~BlamUIWidget_Text()
Definition: text.cpp:35
ImGui::DragFloat
IMGUI_API bool DragFloat(const char *label, float *v, float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2164
BlamUIWidget::SetPosition
virtual void SetPosition(BlamVector2 new_position)
Sets the position of the widget.
Definition: BlamUIWidget.cpp:368
BlamUIWidget::ShowImGuiPropertyEditor
virtual void ShowImGuiPropertyEditor()
Displays an ImGUI-based property editor.
Definition: BlamUIWidget.cpp:57
cui_screen.h
BlamUIWidget_Group::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: group.cpp:98
BlamUIWidget::ignore_layout
bool ignore_layout
Whether or not this widget should ignore any layout positioning.
Definition: ui.h:133
BlamUIWidget_Text::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: text.cpp:97
ImGui::DragFloat2
IMGUI_API bool DragFloat2(const char *label, float v[2], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2169
ImGui::CollapsingHeader
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
Definition: imgui_widgets.cpp:5422
BlamImGuiWindow_BlamUIEditor
Class for the Blam UI Editor debug utility.
Definition: blam_ui_editor.hpp:11
BlamUIWidget_Text::Draw
void Draw() override
Draws the widget on-screen.
Definition: text.cpp:52
BlamWidgetAnchor::TopLeft
@ TopLeft
The widget will be placed at the top-left of the screen.
BlamUIWidget_Group::children
std::vector< BlamUIWidget * > children
The list of child widgets within this group.
Definition: ui.h:272
BlamUIWidget_FramerateDisplay
Class for the framerate display widget.
Definition: BlamUIWidget_FramerateDisplay.h:15
BlamUIWidget::display_name
std::string display_name
The display name of the widget.
Definition: ui.h:120
BlamUIWidget_BasicTriangle::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:466
BlamUIWidget_Text::color
BlamColor color
The text foreground color.
Definition: ui.h:524
BlamUIWidget_2DPrimitive::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: 2d_primitive.cpp:173
BlamUIWidget::SetHidden
virtual void SetHidden(bool new_hidden)
Sets the hidden state of the widget.
Definition: BlamUIWidget.cpp:415
Blam::UI::Render
BLAM void Render()
Renders all UI to the screen.
Definition: ui.cpp:43
BlamUIWidget::SetSize
void SetSize(BlamVector2 new_size)
Sets the size of the widget.
Definition: BlamUIWidget.cpp:361
BlamUIWidget_2DPrimitive::Draw
void Draw() override
Draws the widget on-screen.
Definition: 2d_primitive.cpp:88
BlamWidgetType::DebugMenuItem
@ DebugMenuItem
Special widget. Represents an item within the debug menu.
Blam::UI::Shutdown
BLAM void Shutdown()
Shuts down the UI system.
Definition: ui.cpp:57
BlamUIWidget_BasicLine::GenerateManualObject
void GenerateManualObject() override
Virtual method used to generate the manual object.
Definition: line.cpp:15
BlamWidgetAnchor::TopFill
@ TopFill
The widget will fill the top of the screen, while height is left unchanged.
ImGui::BeginCombo
IMGUI_API bool BeginCombo(const char *label, const char *preview_value, ImGuiComboFlags flags=0)
Definition: imgui_widgets.cpp:1416
BlamUIWidget::UpdateMetrics
virtual void UpdateMetrics()
Updates metrics for the widget.
Definition: ui.h:170
globals.h
BlamUIWidget_FramerateDisplay.h
BlamVersionStringDisplayMode::CrashScreen
@ CrashScreen
Indicates the build string should be formatted for the crash screen.
BlamUIWidget_VLayoutGroup::auto_height
bool auto_height
Whether or not to automatically adjust the layout height to match its children.
Definition: ui.h:323
BlamUIWidget_BasicTriangle::use_custom_points
bool use_custom_points
Whether or not to use custom points for each end of the triangle.
Definition: ui.h:468
material
Definition: material.h:52
BlamUIWidget_BasicTriangle::BlamUIWidget_BasicTriangle
BlamUIWidget_BasicTriangle(BlamUIWidget_Group *_parent)
Definition: triangle.cpp:10
BlamWidgetType::CrashScreen
@ CrashScreen
Special widget. Used for the in-game crash screen.
BlamUIWidget_2DPrimitive::node
Ogre::SceneNode * node
The scene node associated with this widget.
Definition: ui.h:368
BlamUIWidget_VLayoutGroup::Draw
void Draw() override
Draws the widget on-screen.
Definition: vlayout.cpp:15
BlamUIWidget_BasicTriangle::solid
bool solid
Whether or not this primitive is solid, or an outline.
Definition: ui.h:465
BlamWidgetType::Basic_Triangle
@ Basic_Triangle
A basic filled or outline triangle.
ogre_material_instance_data::instance_datablock
Ogre::HlmsDatablock * instance_datablock
The datablock used for this material instance.
Definition: rendering.h:44
BlamUIWidget_BasicRectangle
Class representing a basic rectangle widget.
Definition: ui.h:404
ogre_material_instance_data
Data structure used to store OGRE material instance data.
Definition: rendering.h:40
BlamUIWidget_VLayoutGroup::RefreshRelativePosition
void RefreshRelativePosition() override
Updates the relative position of the widget, relative to its parent.
Definition: vlayout.cpp:48
BlamUIWidget_BasicTriangle::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: triangle.cpp:61
BlamUIWidget_Text::BlamUIWidget_Text
BlamUIWidget_Text(BlamUIWidget_Group *_parent)
Definition: text.cpp:30
BlamWidgetType::Group_HLayout
@ Group_HLayout
A group widget which displays all items in a horizontal list.
BlamUIWidget
Base class for a UI widget.
Definition: ui.h:89
Blam::Rendering::GetRenderHeight
BLAM int GetRenderHeight()
Retrieves the current height of the OGRE viewport.
Definition: ogre.cpp:532
BlamUIWidget_UserIDCypher
UI widget for the user ID cypher display.
Definition: uid_cypher.h:21
BLAM
#define BLAM
Definition: ui.h:18
ImGui::InputTextMultiline
IMGUI_API bool InputTextMultiline(const char *label, char *buf, size_t buf_size, const ImVec2 &size=ImVec2(0, 0), ImGuiInputTextFlags flags=0, ImGuiInputTextCallback callback=NULL, void *user_data=NULL)
Definition: imgui_widgets.cpp:3074
BlamUIWidget_DebugText3D.h
BlamUIWidget_2DPrimitive::needs_regen
bool needs_regen
Whether or not the manual object needs to be regenerated.
Definition: ui.h:370
BlamUIWidget_BasicLine::BlamUIWidget_BasicLine
BlamUIWidget_BasicLine(BlamUIWidget_Group *_parent)
Definition: line.cpp:10
ImGui::EndCombo
IMGUI_API void EndCombo()
Definition: imgui_widgets.cpp:1522
BlamUIWidget_2DPrimitive::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: 2d_primitive.cpp:131
ui_root
BlamUIWidget_Group * ui_root
The UI root widget.
Definition: ui.cpp:14
BlamWidgetType::CoordinatesDisplay
@ CoordinatesDisplay
Special widget. Used for the coordinates display.
debug_menu.h
BlamUIWidget_DebugMenu
Class used for the Debug Menu UI.
Definition: debug_menu.h:119
BlamUIWidget_BasicEllipse::solid
bool solid
Whether or not this primitive is solid, or an outline.
Definition: ui.h:424
BlamWidgetAnchor::Fill
@ Fill
The widget will fill the entire screen.
BlamUIWidget_BasicEllipse::GenerateManualObject
void GenerateManualObject() override
Virtual method used to generate the manual object.
Definition: ellipse.cpp:15
BlamUIWidget_Text::text
std::string text
The text to display within this text widget.
Definition: ui.h:528
BlamUIWidget::RefreshRelativePosition
virtual void RefreshRelativePosition()
Updates the relative position of the widget, relative to its parent.
Definition: BlamUIWidget.cpp:212
BlamWidgetType::Group
@ Group
A group widget, which can be used to contain any number of other widgets.
BlamUIWidget::description
std::string description
An optional description of the widget.
Definition: ui.h:121
BlamUIWidget_BasicTriangle::point_y
BlamVector2 point_y
The second point of the triangle. Only used when use_custom_points is set to true.
Definition: ui.h:470
draw_fail_message_shown
bool draw_fail_message_shown
Whether or not the "draw failure" message has been displayed. Used to prevent spamming the log if the...
Definition: ui.cpp:15
BlamUIWidget_Text::shadow_color
BlamColor shadow_color
The text shadow color.
Definition: ui.h:525
BlamUIWidget_VLayoutGroup
Class representing a Vertical Layout Group widget.
Definition: ui.h:315
BlamWidgetType::FramerateDisplay
@ FramerateDisplay
Special widget. Used for the framerate display.
BlamUIWidget_2DPrimitive::BlamUIWidget_2DPrimitive
BlamUIWidget_2DPrimitive(BlamWidgetType _type, BlamUIWidget_Group *_parent)
Constructs a new 2D Primitive widget.
Definition: 2d_primitive.cpp:10
BlamWidgetType::Basic_Line
@ Basic_Line
A basic line.
BlamUIWidget_Group::ClearChildren
void ClearChildren()
Clears and destroys all child widgets within the group.
Definition: group.cpp:193
BlamUIWidget_Console
Class for the console UI widget.
Definition: console.h:54
BlamUIWidget_CrashScreen
Class used for the crash screen UI.
Definition: BlamUIWidget_CrashScreen.h:14
BlamWidgetType::DebugText3D
@ DebugText3D
Special widget. Used for generic 3D debug text.
BlamUIWidget_2DPrimitive::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: 2d_primitive.cpp:113
BlamUIWidget_BasicEllipse
Class representing a basic ellipse widget.
Definition: ui.h:421
BlamUIWidget_BasicLine::start
BlamVector2 start
The starting point of the line.
Definition: ui.h:444
BlamUIWidget::IsHidden
bool IsHidden()
Checks whether or not the widget is hidden.
Definition: BlamUIWidget.cpp:420
BlamUIWidget_BasicLine
Class representing a basic line widget.
Definition: ui.h:440
BlamUIWidget::material
Ogre::HlmsDatablock * material
The datablock used by the widget, if applicable.
Definition: ui.h:131
BlamUIWidget::z_index
int z_index
The Z index of the widget, where higher Z orders are drawn on top.
Definition: ui.h:127
BlamUIWidget_2DPrimitive::last_hide_state
bool last_hide_state
The last known hidden state. Used to automatically update the widget visibility.
Definition: ui.h:369
ImGui::Separator
IMGUI_API void Separator()
Definition: imgui_widgets.cpp:1284
BlamUIWidget_CoordinatesDisplay
Class used for the coordinates display UI.
Definition: BlamUIWidget_CoordinatesDisplay.h:15
BlamWidgetType
BlamWidgetType
Enumerator listing possible UI widget types.
Definition: ui.h:60
BlamUIWidget_CoordinatesDisplay.h
Blam::UI::Initialize
BLAM bool Initialize()
Initializes the UI system.
Definition: ui.cpp:17
BlamUIWidget::auto_update
bool auto_update
Whether or not the widget should always update every frame.
Definition: ui.h:129
BlamUIWidget_Group::BlamUIWidget_Group
BlamUIWidget_Group(BlamUIWidget_Group *_parent)
Constructs a new group widget.
Definition: group.cpp:8
BlamUIWidget::position_absolute
BlamVector2 position_absolute
The absolute position of the widget on-screen.
Definition: ui.h:106
Blam::Rendering::Materials::GetDatablockFromTag
BLAM Ogre::HlmsDatablock * GetDatablockFromTag(std::string tag_path)
Retrieves an OGRE datablock from a material tag path.
Definition: materials.cpp:915
BlamUIWidget_BasicRectangle::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: rectangle.cpp:57
fonts.h
BlamWorldObjectType::Group
@ Group
BlamUIWidget_BasicEllipse::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: ellipse.cpp:115
BlamUIWidget_Text::RebuildTextObject
void RebuildTextObject()
Regenerates the text object.
Definition: text.cpp:180
BlamUIWidget_CrashScreen.h
Blam::Rendering::Materials::GetDatablockInstanceFromTag
BLAM ogre_material_instance_data * GetDatablockInstanceFromTag(std::string tag_path, std::string referencing_tag_path)
Retrieves a datablock instance from a material tag path, and a referencing tag path.
Definition: materials.cpp:927
BlamUIWidget_BasicEllipse::BlamUIWidget_BasicEllipse
BlamUIWidget_BasicEllipse(BlamUIWidget_Group *_parent)
Definition: ellipse.cpp:10
BlamUIWidget::ignore_scale_factor
bool ignore_scale_factor
Whether or not this widget should ignore the UI scale factor settings.
Definition: ui.h:135
BlamUIWidget::size_absolute
BlamVector2 size_absolute
The absolute size of the widget on-screen.
Definition: ui.h:107
BlamUIWidget_BasicEllipse::radius
BlamVector2 radius
The radius of the ellipse.
Definition: ui.h:427
BlamUIWidget_Text::auto_scale_shadow
bool auto_scale_shadow
Whether or not to automatically scale the text shadow based on text size.
Definition: ui.h:521
BlamUIWidget_VLayoutGroup::BlamUIWidget_VLayoutGroup
BlamUIWidget_VLayoutGroup(BlamUIWidget_Group *_parent)
Definition: vlayout.cpp:5
BlamUIWidget_Group::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: group.cpp:170
BlamUIWidget_BasicRectangle::BlamUIWidget_BasicRectangle
BlamUIWidget_BasicRectangle(BlamUIWidget_Group *_parent)
Definition: rectangle.cpp:14
BlamWidgetAnchor::LeftFill
@ LeftFill
The widget will fill the left of the screen, while width is left unchanged.
BlamWidgetType::Unspecified
@ Unspecified
Indicates the widget is of an unspecified type. Will only appear when a widget is improperly construc...
ImGui::Button
IMGUI_API bool Button(const char *label, const ImVec2 &size=ImVec2(0, 0))
Definition: imgui_widgets.cpp:644
BlamWidgetAnchor::TopRight
@ TopRight
The widget will be placed at the top-right of the screen.
BlamUIWidget::GetAbsolutePosition
BlamVector2 GetAbsolutePosition()
Retrieves the absolute position of the widget.
Definition: BlamUIWidget.cpp:387
BlamUIWidget_Text
Class representing a Text widget.
Definition: ui.h:485
BlamUIWidget_BasicLine::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: line.cpp:26
BlamUIWidget_BasicRectangle::GenerateManualObject
void GenerateManualObject() override
Virtual method used to generate the manual object.
Definition: rectangle.cpp:19
BlamWidgetType::DebugText2D
@ DebugText2D
Special widget. Used for generic 2D debug text.
BlamUIWidget::SetAnchorPosition
void SetAnchorPosition(BlamWidgetAnchor new_anchor_position)
Sets the anchor position of the widget.
Definition: BlamUIWidget.cpp:381
BlamUIWidget::SetRotation
void SetRotation(float new_rotation)
Sets the rotation of the widget.
Definition: BlamUIWidget.cpp:375
BlamUIWidget_2DPrimitive::~BlamUIWidget_2DPrimitive
~BlamUIWidget_2DPrimitive()
Definition: 2d_primitive.cpp:16
BlamUIWidget_DebugText3D
Class used for 3D debug text.
Definition: BlamUIWidget_DebugText3D.h:14
Blam::Globals::GetGlobalAsInteger
BLAM int * GetGlobalAsInteger(std::string name)
Retrieves a global's value as an int.
Definition: globals.cpp:391
Blam::Rendering::GetRenderWidth
BLAM int GetRenderWidth()
Retrieves the current width of the OGRE viewport.
Definition: ogre.cpp:527