Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.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 
80 };
81 
88 {
89 private:
91  BlamWidgetAnchor anchor_position = BlamWidgetAnchor::Center;
92 
101  void ShowAnchorChangeButton(BlamWidgetAnchor new_anchor, int height_mul, int width_mul, bool text_multiline);
102 
103 protected:
104  BlamVector2 position_absolute = { 0, 0 };
105  BlamVector2 size_absolute = { 100, 100 };
106  bool update = false;
107  bool hidden = false;
108 
115  int GetAdjustedZIndex();
116 
117 public:
118  std::string display_name = "unnamed";
119  std::string description = "";
120 
121  BlamVector2 position = { 0, 0 };
122  BlamVector2 size = { 100, 100 };
123  float rotation = 0.0f;
124 
125  int z_index = 0;
126  float z_size = 1.0f;
127  bool auto_update = false;
128 
129  Ogre::HlmsDatablock* material = nullptr;
131  bool ignore_layout = false;
132  bool hide_in_layout = false;
133  bool ignore_scale_factor = false;
134 
141 
149 
150  virtual ~BlamUIWidget() {};
151 
155  virtual void Draw() {};
156 
160  virtual void ShowImGuiPropertyEditor();
161 
168  virtual void UpdateMetrics() {};
169 
176 
182  virtual void RefreshRelativePosition();
183 
191  void RefreshRelativePosition(int viewport_width, int viewport_height, BlamVector2 initial_position);
192 
198  void SetSize(BlamVector2 new_size);
199 
205  virtual void SetPosition(BlamVector2 new_position);
206 
212  void SetRotation(float new_rotation);
213 
219  void SetAnchorPosition(BlamWidgetAnchor new_anchor_position);
220 
224  void MarkForUpdate();
225 
231  BlamVector2 GetAbsolutePosition();
232 
239 
245  virtual void SetHidden(bool new_hidden);
246 
252  bool IsHidden();
253 };
254 
264 {
265 private:
266  BlamUIWidget_BasicRectangle* bounds_border = nullptr;
267  BlamImGuiWindow_BlamUIEditor* editor_window = nullptr;
268 
269 public:
270  std::vector<BlamUIWidget*> children = std::vector<BlamUIWidget*>();
271  bool show_bounds = false;
272 
279 
288 
289  void Draw() override;
290  void ShowImGuiPropertyEditor() override;
291  void RefreshRelativePosition() override;
292  void UpdateMetrics() override;
293  void SetHidden(bool new_hidden) override;
294 
298  void ShowImGuiEditorWindow();
299 
303  void ClearChildren();
304 };
305 
314 {
315 private:
316  int cached_child_count = 0;
317 
318 public:
319  BlamVector4 padding = { 0, 0, 0, 0 };
320  int item_spacing = 0;
321  bool auto_height = false;
322 
325 
326  void Draw() override;
327  void ShowImGuiPropertyEditor() override;
328  void RefreshRelativePosition() override;
329 };
330 
338 {
339 private:
346  void PreGenerateManualObject();
347 
354  void PostGenerateManualObject();
355 
361  void VerifyManualObjectValid();
362 
363 protected:
364  Ogre::ManualObject* manual_object = nullptr;
365  Ogre::HlmsUnlitDatablock* datablock = nullptr;
366  Ogre::SceneNode* node = nullptr;
367  bool last_hide_state = false;
368  bool needs_regen = true;
369 
370 public:
371  BlamColor color = BlamColor(255, 255, 255);
372 
381 
382  void Draw() override;
383  void ShowImGuiPropertyEditor() override;
384  void UpdateMetrics() override;
385  void SetHidden(bool new_hidden) override;
386 
393  virtual void GenerateManualObject() {};
394 };
395 
403 {
404 public:
405  bool solid = true;
406  int thickness = 1;
407 
409  void ShowImGuiPropertyEditor() override;
410  void GenerateManualObject() override;
411 };
412 
420 {
421 public:
422  bool solid = false;
423  int thickness = 1;
424  int resolution = 10;
425  BlamVector2 radius = { 10, 10 };
426 
428 
429  void ShowImGuiPropertyEditor() override;
430  void GenerateManualObject() override;
431 };
432 
439 {
440 public:
441  int thickness = 1;
442  BlamVector2 start = { 0, 0 };
443  BlamVector2 end = { 0, 0 };
444 
446 
447  void ShowImGuiPropertyEditor() override;
448  void GenerateManualObject() override;
449 };
450 
458 {
459 private:
460  void GenerateManualObject() override;
461 
462 public:
463  bool solid = false;
464  int thickness = 1;
465 
466  bool use_custom_points = false;
467  BlamVector2 point_x = { 0, 0 };
468  BlamVector2 point_y = { 0, 0 };
469  BlamVector2 point_z = { 0, 0 };
470 
472 
473  void ShowImGuiPropertyEditor() override;
474 };
475 
484 {
485 private:
486  Ogre::SceneNode* node = nullptr;
487  Ogre::ManualObject* manual_object = nullptr;
488 
489  std::string previous_text = "";
490  bool last_hide_state = false;
491  BlamColor last_color = BlamColor(255, 255, 255);
492  BlamColor last_shadow_color = BlamColor(0, 0, 0);
493 
494  std::vector<Ogre::HlmsDatablock*> datablocks = std::vector<Ogre::HlmsDatablock*>();
495  std::vector<Ogre::HlmsDatablock*> shadow_datablocks = std::vector<Ogre::HlmsDatablock*>();
496  bool needs_new_datablocks = true;
497 
501  void ReleaseOldDatablocks();
502 
506  void GenerateManualObject();
507 
516  void GenerateManualObjectSection(bool is_shadow);
517 
518 public:
519  bool auto_scale_shadow = true;
520  int character_height = 16;
521  BlamVector2 shadow_offset = { 1, 1 };
522  BlamColor color = BlamColor(255, 255, 255);
523  BlamColor shadow_color = BlamColor(0, 0, 0);
524  std::string font_name = "fixedsys";
526  std::string text = "blam!";
527 
530 
531  void Draw() override;
532  void ShowImGuiPropertyEditor() override;
533  void UpdateMetrics() override;
534  void SetHidden(bool new_hidden) override;
535 
542  void RebuildTextObject();
543 };
544 
548 namespace Blam::UI
549 {
553  BLAM bool Initialize();
554 
558  BLAM void Render();
559 
563  BLAM void Shutdown();
564 
571 
579  BLAM std::string GetWidgetAnchorLabel(BlamWidgetAnchor anchor_position);
580 
589  BLAM bool LoadFromCUIScreenTag(std::string tag_path, cui_screen* cusc_tag);
590 
597 
604 }
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:441
BlamUIWidget::hidden
bool hidden
Whether or not the widget is hidden.
Definition: ui.h:107
ui.h
BlamUIWidget_BasicLine::end
BlamVector2 end
The ending point of the line.
Definition: ui.h:443
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:423
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:106
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:320
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:132
BlamUIWidget_Text::font_name
std::string font_name
The name of the font package to use for this text widget.
Definition: ui.h:524
BlamUIWidget_BasicTriangle
Class representing a basic triangle widget.
Definition: ui.h:457
BlamUIWidget_Group
Class representing a Group widget.
Definition: ui.h:263
BlamUIWidget::position
BlamVector2 position
The position of the widget, relative to its parent.
Definition: ui.h:121
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:69
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:416
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:64
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:130
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:467
BlamUIWidget::rotation
float rotation
The rotation of the widget, in degrees.
Definition: ui.h:123
BlamUIWidget_2DPrimitive::datablock
Ogre::HlmsUnlitDatablock * datablock
The datablock associated with this widget.
Definition: ui.h:365
BlamUIWidget_Text::font_package
BlamFontPackage * font_package
The font package being used for this text widget.
Definition: ui.h:525
BlamUIWidget_Group::show_bounds
bool show_bounds
Whether or not to display the debug bounding box around this widget.
Definition: ui.h:271
BlamUIWidget_Text::character_height
int character_height
The line height of this text widget, in pixels.
Definition: ui.h:520
BlamUIWidget_Text::shadow_offset
BlamVector2 shadow_offset
The offset of the text shadow, in pixels.
Definition: ui.h:521
imgui.h
BlamWidgetType::Text
@ Text
A text object, used to show text on-screen.
console.h
BlamUIWidget_BasicEllipse::resolution
int resolution
The number of faces that the ellipse should have. Higher numbers result in a smoother edge.
Definition: ui.h:424
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:469
BlamWidgetType::Basic_Rectangle
@ Basic_Rectangle
A basic filled or outline rectangle.
BlamUIWidget_2DPrimitive::color
BlamColor color
The color of the widget.
Definition: ui.h:371
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:319
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:126
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:364
Blam::UI::GetDebugMenuWidget
BLAM BlamUIWidget_DebugMenu * GetDebugMenuWidget()
Retrieves the built-in debug menu widget.
Definition: ui.cpp:295
BlamUIWidget_Text::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: text.cpp:451
BlamUIWidget_BasicRectangle::solid
bool solid
Whether or not this primitive is solid, or an outline.
Definition: ui.h:405
BlamUIWidget_BasicRectangle::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:406
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:337
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:122
Blam::UI::GetCrashScreenWidget
BLAM BlamUIWidget_CrashScreen * GetCrashScreenWidget()
Retrieves the built-in crash screen widget.
Definition: ui.cpp:277
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:72
BlamUIWidget::Draw
virtual void Draw()
Draws the widget on-screen.
Definition: ui.h:155
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:134
BlamUIWidget::~BlamUIWidget
virtual ~BlamUIWidget()
Definition: ui.h:150
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:393
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:548
BlamUIWidget_Group::~BlamUIWidget_Group
~BlamUIWidget_Group()
Definition: group.cpp:34
BlamUIWidget_Text::~BlamUIWidget_Text
~BlamUIWidget_Text()
Definition: text.cpp:36
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:131
BlamUIWidget_Text::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: text.cpp:98
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:53
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:270
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:118
BlamUIWidget_BasicTriangle::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:464
BlamUIWidget_Text::color
BlamColor color
The text foreground color.
Definition: ui.h:522
BlamUIWidget_2DPrimitive::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: 2d_primitive.cpp:172
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:41
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:87
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:55
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:168
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:321
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:466
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.
globals.h
BlamUIWidget_2DPrimitive::node
Ogre::SceneNode * node
The scene node associated with this widget.
Definition: ui.h:366
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:463
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:36
BlamUIWidget_BasicRectangle
Class representing a basic rectangle widget.
Definition: ui.h:402
ogre_material_instance_data
Data structure used to store OGRE material instance data.
Definition: rendering.h:32
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:87
Blam::Rendering::GetRenderHeight
BLAM int GetRenderHeight()
Retrieves the current height of the OGRE viewport.
Definition: ogre.cpp:368
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_2DPrimitive::needs_regen
bool needs_regen
Whether or not the manual object needs to be regenerated.
Definition: ui.h:368
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:130
ui_root
BlamUIWidget_Group * ui_root
The UI root widget.
Definition: ui.cpp:13
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:422
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:526
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:119
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:468
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:14
BlamUIWidget_Text::shadow_color
BlamColor shadow_color
The text shadow color.
Definition: ui.h:523
BlamUIWidget_VLayoutGroup
Class representing a Vertical Layout Group widget.
Definition: ui.h:313
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:48
BlamUIWidget_CrashScreen
Class used for the crash screen UI.
Definition: BlamUIWidget_CrashScreen.h:14
BlamUIWidget_2DPrimitive::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: 2d_primitive.cpp:112
BlamUIWidget_BasicEllipse
Class representing a basic ellipse widget.
Definition: ui.h:419
BlamUIWidget_BasicLine::start
BlamVector2 start
The starting point of the line.
Definition: ui.h:442
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:438
BlamUIWidget::material
Ogre::HlmsDatablock * material
The datablock used by the widget, if applicable.
Definition: ui.h:129
BlamUIWidget::z_index
int z_index
The Z index of the widget, where higher Z orders are drawn on top.
Definition: ui.h:125
BlamUIWidget_2DPrimitive::last_hide_state
bool last_hide_state
The last known hidden state. Used to automatically update the widget visibility.
Definition: ui.h:367
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:16
BlamUIWidget::auto_update
bool auto_update
Whether or not the widget should always update every frame.
Definition: ui.h:127
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:104
Blam::Rendering::Materials::GetDatablockFromTag
BLAM Ogre::HlmsDatablock * GetDatablockFromTag(std::string tag_path)
Retrieves an OGRE datablock from a material tag path.
Definition: materials.cpp:884
BlamUIWidget_BasicRectangle::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: rectangle.cpp:57
fonts.h
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:181
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:896
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:133
BlamUIWidget::size_absolute
BlamVector2 size_absolute
The absolute size of the widget on-screen.
Definition: ui.h:105
BlamUIWidget_BasicEllipse::radius
BlamVector2 radius
The radius of the ellipse.
Definition: ui.h:425
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:519
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:483
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
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
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:363