Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.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 <bgfx/bgfx.h>
11 #include <vector>
12 #include <string>
13 
17 
18 #ifndef BLAM
19 #define BLAM
20 #endif
21 
22 class BlamUIWidget_Group;
29 
36 {
37  TopCenter,
38  Center,
39  BottomCenter,
40 
41  TopLeft,
42  CenterLeft,
43  BottomLeft,
44 
45  TopRight,
46  CenterRight,
47  BottomRight,
48 
49  TopFill,
50  LeftFill,
51  RightFill,
52  BottomFill,
53  Fill
54 };
55 
59 enum class BlamWidgetType
60 {
63  Basic_Line,
65  Text,
66  Group,
69 
70  Custom,
72 };
73 
82 {
83 private:
85  BlamWidgetAnchor anchor_position = BlamWidgetAnchor::Center;
86  bool update = false;
87  bool hidden = false;
88  std::string custom_type_name = "UNSPECIFIED";
89 
98  void ShowAnchorChangeButton(BlamWidgetAnchor new_anchor, int height_mul, int width_mul, bool text_multiline);
99 
100 protected:
101  BlamVector2 position_absolute = { 0, 0 };
102  BlamVector2 size_absolute = { 100, 100 };
103 
110  int GetAdjustedZIndex();
111 
112 public:
113  std::string display_name = "unnamed";
114  std::string description = "";
115 
116  BlamVector2 position = { 0, 0 };
117  BlamVector2 size = { 100, 100 };
118  float rotation = 0.0f;
119 
120  int z_index = 0;
121  float z_size = 1.0f;
122  bool auto_update = false;
123 
124  Ogre::HlmsDatablock* material = nullptr;
126  bool ignore_layout = false;
127  bool hide_in_layout = false;
128  bool ignore_scale_factor = false;
129 
136 
144 
150  BlamUIWidget(std::string type);
151 
158  BlamUIWidget(std::string type, BlamUIWidget_Group* _parent);
159 
160  virtual ~BlamUIWidget() {};
161 
165  virtual void Draw();
166 
170  virtual void ShowImGuiPropertyEditor();
171 
181  virtual void UpdateMetrics() {};
182 
189 
195  virtual void RefreshRelativePosition();
196 
204  void RefreshRelativePosition(int viewport_width, int viewport_height, BlamVector2 initial_position);
205 
211  void SetSize(BlamVector2 new_size);
212 
218  virtual void SetPosition(BlamVector2 new_position);
219 
225  void SetRotation(float new_rotation);
226 
232  void SetAnchorPosition(BlamWidgetAnchor new_anchor_position);
233 
237  void MarkForUpdate();
238 
239  bool IsMarkedForUpdate();
240 
241  void SetMarkedForUpdate(bool _update);
242 
248  BlamVector2 GetAbsolutePosition();
249 
256 
262  virtual void SetHidden(bool new_hidden);
263 
269  bool IsHidden();
270 
276  std::string GetCustomType();
277 };
278 
288 {
289 private:
290  BlamUIWidget_BasicRectangle* bounds_border = nullptr;
291  BlamImGuiWindow_BlamUIEditor* editor_window = nullptr;
292 
293 public:
294  std::vector<BlamUIWidget*> children = std::vector<BlamUIWidget*>();
295  bool show_bounds = false;
296 
303 
311 
318  BlamUIWidget_Group(std::string _type, BlamUIWidget_Group* _parent);
320 
321  void Draw() override;
322  void ShowImGuiPropertyEditor() override;
323  void RefreshRelativePosition() override;
324  void UpdateMetrics() override;
325  void SetHidden(bool new_hidden) override;
326 
330  void ShowImGuiEditorWindow();
331 
335  void ClearChildren();
336 };
337 
346 {
347 private:
348  int cached_child_count = 0;
349 
350 public:
351  BlamVector4 padding = { 0, 0, 0, 0 };
352  int item_spacing = 0;
353  bool auto_height = false;
354 
357 
358  void Draw() override;
359  void ShowImGuiPropertyEditor() override;
360  void RefreshRelativePosition() override;
361 };
362 
370 {
371 protected:
372 #pragma pack(push, 1)
374  {
375  BlamVector3 position;
376  BlamVector4 color;
377  BlamVector3 uv;
378  };
379 
381  {
385  };
386 
387  struct Blam2DLine
388  {
391  };
392 #pragma pack(pop)
393 
394 private:
401  void PreGenerateManualObject();
402 
409  void PostGenerateManualObject();
410 
416  void VerifyManualObjectValid();
417 
418 protected:
419  bgfx::VertexLayout vertex_layout;
420  std::vector<Blam2DVertex> vertices = std::vector<Blam2DVertex>();
421  std::vector<Blam2DTriangle> triangles = std::vector<Blam2DTriangle>();
422  std::vector<Blam2DLine> lines = std::vector<Blam2DLine>();
423  bgfx::VertexBufferHandle vertex_buffer = { bgfx::kInvalidHandle };
424  bgfx::IndexBufferHandle index_buffer = { bgfx::kInvalidHandle };
426 
427  Ogre::ManualObject* manual_object = nullptr;
428  Ogre::HlmsUnlitDatablock* datablock = nullptr;
429  Ogre::SceneNode* node = nullptr;
430  bool last_hide_state = false;
431  bool needs_regen = true;
432 
433  void AddVertex(float x, float y, float z);
435  void AddLine(uint16_t x, uint16_t y);
436 
437 public:
438  BlamColor color = BlamColor(255, 255, 255);
439 
448 
449  void Draw() override;
450  void ShowImGuiPropertyEditor() override;
451  void UpdateMetrics() override;
452  void SetHidden(bool new_hidden) override;
453 
460  virtual void GenerateManualObject() {};
461 };
462 
470 {
471 public:
472  bool solid = true;
473  int thickness = 1;
474 
476  void ShowImGuiPropertyEditor() override;
477  void GenerateManualObject() override;
478 };
479 
487 {
488 public:
489  bool solid = false;
490  int thickness = 1;
491  int resolution = 10;
492  BlamVector2 radius = { 10, 10 };
493 
495 
496  void ShowImGuiPropertyEditor() override;
497  void GenerateManualObject() override;
498 };
499 
506 {
507 public:
508  int thickness = 1;
509  BlamVector2 start = { 0, 0 };
510  BlamVector2 end = { 0, 0 };
511 
513 
514  void ShowImGuiPropertyEditor() override;
515  void GenerateManualObject() override;
516 };
517 
525 {
526 private:
527  void GenerateManualObject() override;
528 
529 public:
530  bool solid = false;
531  int thickness = 1;
532 
533  bool use_custom_points = false;
534  BlamVector2 point_x = { 0, 0 };
535  BlamVector2 point_y = { 0, 0 };
536  BlamVector2 point_z = { 0, 0 };
537 
539 
540  void ShowImGuiPropertyEditor() override;
541 };
542 
551 {
552 private:
553 #pragma pack(push, 1)
554  struct Blam2DTextVertex
555  {
556  BlamVector3 position;
557  BlamVector4 color;
558  BlamVector3 uv;
559  };
560 
561  struct Blam2DTextTriangle
562  {
563  uint16_t idx;
564  uint16_t idy;
565  uint16_t idz;
566  };
567 #pragma pack(pop)
568 
569  bgfx::VertexLayout vertex_layout;
570  std::vector<Blam2DTextVertex> vertices = std::vector<Blam2DTextVertex>();
571  std::vector<Blam2DTextTriangle> triangles = std::vector<Blam2DTextTriangle>();
572  bgfx::VertexBufferHandle vertex_buffer = { bgfx::kInvalidHandle };
573  bgfx::IndexBufferHandle index_buffer = { bgfx::kInvalidHandle };
574  uint64_t state_flags = 0;
575 
576  Ogre::SceneNode* node = nullptr;
577  Ogre::ManualObject* manual_object = nullptr;
578 
579  std::string previous_text = "";
580  bool last_hide_state = false;
581  BlamColor last_color = BlamColor(255, 255, 255);
582  BlamColor last_shadow_color = BlamColor(0, 0, 0);
583 
584  std::vector<Ogre::HlmsDatablock*> datablocks = std::vector<Ogre::HlmsDatablock*>();
585  std::vector<Ogre::HlmsDatablock*> shadow_datablocks = std::vector<Ogre::HlmsDatablock*>();
586  bool needs_new_datablocks = true;
587 
591  void ReleaseOldDatablocks();
592 
596  void GenerateManualObject();
597 
606  void GenerateManualObjectSection(bool is_shadow);
607 
608  void GenerateManualObjectSection_bgfx(bool is_shadow);
609 
610  void AddVertex(float x, float y, float uvx, float uvy, bool is_shadow = false);
611  void AddTriangle(uint16_t x, uint16_t y, uint16_t z);
612 
613 public:
614  bool debug_region = false;
615  bool auto_scale_shadow = true;
616  int character_height = 16;
617  BlamVector2 shadow_offset = { 1, 1 };
618  BlamColor color = BlamColor(255, 255, 255);
619  BlamColor shadow_color = BlamColor(0, 0, 0);
620  std::string font_name = "fixedsys";
622  std::string text = "blam!";
623 
626 
627  void Draw() override;
628  void ShowImGuiPropertyEditor() override;
629  void UpdateMetrics() override;
630  void SetHidden(bool new_hidden) override;
631 
638  void RebuildTextObject();
639 };
640 
644 namespace Blam::UI
645 {
649  BLAM bool Initialize();
650 
654  BLAM void Render();
655 
659  BLAM void Shutdown();
660 
667 
675  BLAM std::string GetWidgetAnchorLabel(BlamWidgetAnchor anchor_position);
676 
685  BLAM bool LoadFromCUIScreenTag(std::string tag_path, cui_screen* cusc_tag);
686 
693 
700 
707 
714 }
BlamUIWidget_Group::RefreshRelativePosition
void RefreshRelativePosition() override
Updates the relative position of the widget, relative to its parent.
Definition: group.cpp:159
BlamUIWidget_BasicLine::thickness
int thickness
The thickness of the line.
Definition: ui.h:508
ui.h
BlamUIWidget_BasicLine::end
BlamVector2 end
The ending point of the line.
Definition: ui.h:510
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:490
BlamUIWidget_DefaultLoadScreen.h
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
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:352
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:127
BlamUIWidget_Text::font_name
std::string font_name
The name of the font package to use for this text widget.
Definition: ui.h:620
BlamUIWidget_2DPrimitive::Blam2DVertex
Definition: ui.h:373
BlamUIWidget_BasicTriangle
Class representing a basic triangle widget.
Definition: ui.h:524
BlamUIWidget_2DPrimitive::AddVertex
void AddVertex(float x, float y, float z)
Definition: 2d_primitive.cpp:272
BlamUIWidget_2DPrimitive::Blam2DTriangle::idy
uint16_t idy
Definition: ui.h:383
BlamUIWidget_2DPrimitive::Blam2DVertex::color
BlamVector4 color
Definition: ui.h:376
BlamUIWidget_Group
Class representing a Group widget.
Definition: ui.h:287
BlamUIWidget::position
BlamVector2 position
The position of the widget, relative to its parent.
Definition: ui.h:116
BlamWidgetAnchor
BlamWidgetAnchor
Enumerator listing possible widget anchor positions.
Definition: ui.h:35
Blam::UI::GetWidgetAnchorLabel
BLAM std::string GetWidgetAnchorLabel(BlamWidgetAnchor anchor_position)
Retrieves a string representation of a widget anchor position.
Definition: ui.cpp:92
color
BlamColor color
Typedef for a color field, used in tag definitions.
Definition: tags.h:447
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:87
BlamUIWidget::MarkForUpdate
void MarkForUpdate()
Marks the widget as needing to be updated on the next draw call.
Definition: BlamUIWidget.cpp:436
entry
Definition: imgui.h:36
BlamUIWidget::parent
BlamUIWidget_Group * parent
The parent group of this widget, if applicable.
Definition: ui.h:125
BlamFontPackage
Class representing a Blamite font package.
Definition: fonts.h:89
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:534
BlamUIWidget::rotation
float rotation
The rotation of the widget, in degrees.
Definition: ui.h:118
BlamUIWidget_2DPrimitive::datablock
Ogre::HlmsUnlitDatablock * datablock
The datablock associated with this widget.
Definition: ui.h:428
BlamUIWidget_Text::font_package
BlamFontPackage * font_package
The font package being used for this text widget.
Definition: ui.h:621
BlamUIWidget_Group::show_bounds
bool show_bounds
Whether or not to display the debug bounding box around this widget.
Definition: ui.h:295
BlamUIWidget_Text::character_height
int character_height
The line height of this text widget, in pixels.
Definition: ui.h:616
BlamUIWidget_Text::shadow_offset
BlamVector2 shadow_offset
The offset of the text shadow, in pixels.
Definition: ui.h:617
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:491
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:536
BlamWidgetType::Basic_Rectangle
@ Basic_Rectangle
A basic filled or outline rectangle.
BlamUIWidget_2DPrimitive::color
BlamColor color
The color of the widget.
Definition: ui.h:438
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
BlamUIWidget_2DPrimitive::triangles
std::vector< Blam2DTriangle > triangles
Definition: ui.h:421
CWT_DEBUG_MENU
#define CWT_DEBUG_MENU
Definition: debug_menu.h:11
Blam::RenderingBGFX::GetRenderHeight
BLAM int GetRenderHeight()
Retrieves the current height of the viewport.
Definition: bgfx.cpp:428
world.h
BlamUIWidget_2DPrimitive::Blam2DLine
Definition: ui.h:387
BlamUIWidget_VLayoutGroup::padding
BlamVector4 padding
The padding around the layout group. Padding order is top, right, bottom, left.
Definition: ui.h:351
BlamUIWidget_Group::ShowImGuiEditorWindow
void ShowImGuiEditorWindow()
Displays the separate ImGUI editor window for this group.
Definition: group.cpp:206
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:121
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:44
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.
UsingBgfx
bool UsingBgfx()
Definition: bgfx.cpp:63
BlamUIWidget_2DPrimitive::manual_object
Ogre::ManualObject * manual_object
The manual object associated with this widget.
Definition: ui.h:427
Blam::UI::GetDebugMenuWidget
BLAM BlamUIWidget_DebugMenu * GetDebugMenuWidget()
Retrieves the built-in debug menu widget.
Definition: ui.cpp:318
BlamUIWidget_Text::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: text.cpp:678
BlamUIWidget_BasicRectangle::solid
bool solid
Whether or not this primitive is solid, or an outline.
Definition: ui.h:472
BlamUIWidget_BasicRectangle::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:473
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:451
BlamUIWidget::GetType
BlamWidgetType GetType()
Retrieves the type of this widget.
Definition: BlamUIWidget.cpp:244
BlamUIWidget_DefaultLoadScreen
Definition: BlamUIWidget_DefaultLoadScreen.h:7
BlamUIWidget_2DPrimitive
Base class for 2D primitive widgets.
Definition: ui.h:369
imgui_stdlib.h
BlamUIWidget_Group::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: group.cpp:174
BlamUIWidget::size
BlamVector2 size
The size of the widget, relative to its parent.
Definition: ui.h:117
Blam::UI::GetCrashScreenWidget
BLAM BlamUIWidget_CrashScreen * GetCrashScreenWidget()
Retrieves the built-in crash screen widget.
Definition: ui.cpp:300
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:64
BlamUIWidget_Text::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: text.cpp:119
BlamUIWidget::Draw
virtual void Draw()
Draws the widget on-screen.
Definition: BlamUIWidget.cpp:81
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:464
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:157
BlamUIWidget::~BlamUIWidget
virtual ~BlamUIWidget()
Definition: ui.h:160
BlamUIWidget_2DPrimitive::vertex_layout
bgfx::VertexLayout vertex_layout
The vertex layout used for 2D primitives.
Definition: ui.h:419
BlamUIWidget_VLayoutGroup::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: vlayout.cpp:28
BlamUIWidget_2DPrimitive::GenerateManualObject
virtual void GenerateManualObject()
Virtual method used to generate the manual object.
Definition: ui.h:460
BlamWidgetAnchor::RightFill
@ RightFill
The widget will fill the right of the screen, while width is left unchanged.
ImVec2
Definition: imgui.h:179
Blam::UI
Namespace containing functions relating to the Blamite UI system.
Definition: ui.h:644
BlamUIWidget_Group::~BlamUIWidget_Group
~BlamUIWidget_Group()
Definition: group.cpp:47
BlamUIWidget_Text::~BlamUIWidget_Text
~BlamUIWidget_Text()
Definition: text.cpp:47
uint64_t
unsigned long long uint64_t
Definition: stdint.h:18
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:412
BlamUIWidget::ShowImGuiPropertyEditor
virtual void ShowImGuiPropertyEditor()
Displays an ImGUI-based property editor.
Definition: BlamUIWidget.cpp:94
BlamUIWidget_2DPrimitive::Blam2DLine::idy
uint16_t idy
Definition: ui.h:390
cui_screen.h
BlamUIWidget_Group::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: group.cpp:113
BlamUIWidget::ignore_layout
bool ignore_layout
Whether or not this widget should ignore any layout positioning.
Definition: ui.h:126
BlamUIWidget_Text::UpdateMetrics
void UpdateMetrics() override
Updates metrics for the widget.
Definition: text.cpp:147
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:67
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:294
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:113
Blam::BuildInfo::IsConsoleEnabled
BLAM bool IsConsoleEnabled()
Checks whether or not the in-game console is enabled.
Definition: engine_definitions.cpp:227
BlamUIWidget_BasicTriangle::thickness
int thickness
The thickness of the primitive. Only used when solid is set to false.
Definition: ui.h:531
BlamUIWidget_Text::color
BlamColor color
The text foreground color.
Definition: ui.h:618
BlamUIWidget_2DPrimitive::SetHidden
void SetHidden(bool new_hidden) override
Sets the hidden state of the widget.
Definition: 2d_primitive.cpp:254
y
font DisplayOffset y
Definition: README.txt:68
BlamUIWidget::SetHidden
virtual void SetHidden(bool new_hidden)
Sets the hidden state of the widget.
Definition: BlamUIWidget.cpp:469
Blam::UI::Render
BLAM void Render()
Renders all UI to the screen.
Definition: ui.cpp:64
BlamUIWidget::SetSize
void SetSize(BlamVector2 new_size)
Sets the size of the widget.
Definition: BlamUIWidget.cpp:405
BlamUIWidget_2DPrimitive::Draw
void Draw() override
Draws the widget on-screen.
Definition: 2d_primitive.cpp:131
Blam::UI::Shutdown
BLAM void Shutdown()
Shuts down the UI system.
Definition: ui.cpp:78
BlamWidgetType::Custom
@ Custom
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:181
globals.h
BlamUIWidget_FramerateDisplay.h
BlamUIWidget_2DPrimitive::vertex_buffer
bgfx::VertexBufferHandle vertex_buffer
Definition: ui.h:423
BlamUIWidget_VLayoutGroup::auto_height
bool auto_height
Whether or not to automatically adjust the layout height to match its children.
Definition: ui.h:353
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:533
material
Definition: material.h:54
BlamUIWidget_BasicTriangle::BlamUIWidget_BasicTriangle
BlamUIWidget_BasicTriangle(BlamUIWidget_Group *_parent)
Definition: triangle.cpp:10
BlamUIWidget_InfoDisplay
Definition: BlamUIWidget_InfoDisplay.h:11
BlamUIWidget_2DPrimitive::state_flags
uint64_t state_flags
Definition: ui.h:425
BlamUIWidget_2DPrimitive::node
Ogre::SceneNode * node
The scene node associated with this widget.
Definition: ui.h:429
Blam::UI::GetInfoDisplayWidget
BLAM BlamUIWidget_InfoDisplay * GetInfoDisplayWidget()
Retrieves the built-in info display widget.
Definition: ui.cpp:354
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:530
BlamUIWidget_2DPrimitive::Blam2DVertex::uv
BlamVector3 uv
Definition: ui.h:377
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:86
BlamUIWidget_BasicRectangle
Class representing a basic rectangle widget.
Definition: ui.h:469
CWT_CRASH_SCREEN
#define CWT_CRASH_SCREEN
Definition: BlamUIWidget_CrashScreen.h:5
ogre_material_instance_data
Data structure used to store OGRE material instance data.
Definition: rendering.h:82
BlamUIWidget_VLayoutGroup::RefreshRelativePosition
void RefreshRelativePosition() override
Updates the relative position of the widget, relative to its parent.
Definition: vlayout.cpp:50
BlamUIWidget_BasicTriangle::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: triangle.cpp:110
BlamUIWidget_2DPrimitive::vertices
std::vector< Blam2DVertex > vertices
Definition: ui.h:420
debug_menu.h
BlamUIWidget_Text::BlamUIWidget_Text
BlamUIWidget_Text(BlamUIWidget_Group *_parent)
Definition: text.cpp:32
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:81
Blam::Rendering::GetRenderHeight
BLAM int GetRenderHeight()
Retrieves the current height of the OGRE viewport.
Definition: ogre.cpp:685
BlamUIWidget_UserIDCypher
UI widget for the user ID cypher display.
Definition: uid_cypher.h:21
BLAM
#define BLAM
Definition: ui.h:19
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
engine_definitions.h
BlamUIWidget_2DPrimitive::needs_regen
bool needs_regen
Whether or not the manual object needs to be regenerated.
Definition: ui.h:431
BlamUIWidget::SetMarkedForUpdate
void SetMarkedForUpdate(bool _update)
Definition: BlamUIWidget.cpp:446
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:207
ui_root
BlamUIWidget_Group * ui_root
The UI root widget.
Definition: ui.cpp:16
BlamUIWidget_DebugMenu
Class used for the Debug Menu UI.
Definition: debug_menu.h:122
BlamUIWidget_BasicEllipse::solid
bool solid
Whether or not this primitive is solid, or an outline.
Definition: ui.h:489
BlamWidgetAnchor::Fill
@ Fill
The widget will fill the entire screen.
BlamUIWidget::IsMarkedForUpdate
bool IsMarkedForUpdate()
Definition: BlamUIWidget.cpp:441
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:622
BlamUIWidget_2DPrimitive::lines
std::vector< Blam2DLine > lines
Definition: ui.h:422
BlamUIWidget::RefreshRelativePosition
virtual void RefreshRelativePosition()
Updates the relative position of the widget, relative to its parent.
Definition: BlamUIWidget.cpp:249
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:114
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:535
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:17
BlamUIWidget_Text::shadow_color
BlamColor shadow_color
The text shadow color.
Definition: ui.h:619
BlamUIWidget_2DPrimitive::Blam2DLine::idx
uint16_t idx
Definition: ui.h:389
BlamUIWidget_VLayoutGroup
Class representing a Vertical Layout Group widget.
Definition: ui.h:345
BlamUIWidget_2DPrimitive::BlamUIWidget_2DPrimitive
BlamUIWidget_2DPrimitive(BlamWidgetType _type, BlamUIWidget_Group *_parent)
Constructs a new 2D Primitive widget.
Definition: 2d_primitive.cpp:13
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:214
BlamUIWidget_Console
Class for the console UI widget.
Definition: console.h:56
BlamUIWidget_Text::debug_region
bool debug_region
Definition: ui.h:614
BlamUIWidget_CrashScreen
Class used for the crash screen UI.
Definition: BlamUIWidget_CrashScreen.h:16
CWT_INFO_DISPLAY
#define CWT_INFO_DISPLAY
Definition: BlamUIWidget_InfoDisplay.h:9
CWT_LOAD_SCREEN
#define CWT_LOAD_SCREEN
Definition: BlamUIWidget_DefaultLoadScreen.h:5
BlamUIWidget_2DPrimitive::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: 2d_primitive.cpp:189
console.h
BlamUIWidget_BasicEllipse
Class representing a basic ellipse widget.
Definition: ui.h:486
BlamUIWidget_BasicLine::start
BlamVector2 start
The starting point of the line.
Definition: ui.h:509
BlamUIWidget::IsHidden
bool IsHidden()
Checks whether or not the widget is hidden.
Definition: BlamUIWidget.cpp:475
BlamUIWidget_BasicLine
Class representing a basic line widget.
Definition: ui.h:505
BlamUIWidget::material
Ogre::HlmsDatablock * material
The datablock used by the widget, if applicable.
Definition: ui.h:124
BlamUIWidget_2DPrimitive::Blam2DTriangle::idx
uint16_t idx
Definition: ui.h:382
BlamUIWidget::z_index
int z_index
The Z index of the widget, where higher Z orders are drawn on top.
Definition: ui.h:120
BlamUIWidget_2DPrimitive::Blam2DVertex::position
BlamVector3 position
Definition: ui.h:375
BlamUIWidget_2DPrimitive::Blam2DTriangle::idz
uint16_t idz
Definition: ui.h:384
BlamUIWidget_2DPrimitive::last_hide_state
bool last_hide_state
The last known hidden state. Used to automatically update the widget visibility.
Definition: ui.h:430
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:59
BlamUIWidget_CoordinatesDisplay.h
Blam::UI::Initialize
BLAM bool Initialize()
Initializes the UI system.
Definition: ui.cpp:19
x
config GlyphExtraSpacing x
Definition: README.txt:30
Blam::BuildInfo::DebugToolsEnabled
BLAM bool DebugToolsEnabled()
Checks whether or not debug tools are enabled.
Definition: engine_definitions.cpp:209
BlamUIWidget::auto_update
bool auto_update
Whether or not the widget should always update every frame.
Definition: ui.h:122
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:101
Blam::Rendering::Materials::GetDatablockFromTag
BLAM Ogre::HlmsDatablock * GetDatablockFromTag(std::string tag_path)
Retrieves an OGRE datablock from a material tag path.
Definition: materials.cpp:950
BlamUIWidget_BasicRectangle::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: rectangle.cpp:92
fonts.h
BlamWorldObjectType::Group
@ Group
BlamUIWidget_BasicEllipse::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: ellipse.cpp:208
BlamUIWidget_Text::RebuildTextObject
void RebuildTextObject()
Regenerates the text object.
Definition: text.cpp:255
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:962
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:128
BlamUIWidget::size_absolute
BlamVector2 size_absolute
The absolute size of the widget on-screen.
Definition: ui.h:102
BlamUIWidget_BasicEllipse::radius
BlamVector2 radius
The radius of the ellipse.
Definition: ui.h:492
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:615
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:189
BlamUIWidget_2DPrimitive::AddLine
void AddLine(uint16_t x, uint16_t y)
Definition: 2d_primitive.cpp:282
BlamUIWidget_BasicRectangle::BlamUIWidget_BasicRectangle
BlamUIWidget_BasicRectangle(BlamUIWidget_Group *_parent)
Definition: rectangle.cpp:14
uint16_t
unsigned short uint16_t
Definition: stdint.h:16
Blam::RenderingBGFX::GetRenderWidth
BLAM int GetRenderWidth()
Retrieves the current width of the viewport.
Definition: bgfx.cpp:423
BlamUIWidget_2DPrimitive::Blam2DTriangle
Definition: ui.h:380
BlamUIWidget_InfoDisplay.h
Blam::UI::GetLoadScreenWidget
BLAM BlamUIWidget_DefaultLoadScreen * GetLoadScreenWidget()
Retrieves the built-in load screen widget.
Definition: ui.cpp:336
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:431
BlamUIWidget_Text
Class representing a Text widget.
Definition: ui.h:550
BlamUIWidget_BasicLine::ShowImGuiPropertyEditor
void ShowImGuiPropertyEditor() override
Displays an ImGUI-based property editor.
Definition: line.cpp:42
BlamUIWidget_BasicRectangle::GenerateManualObject
void GenerateManualObject() override
Virtual method used to generate the manual object.
Definition: rectangle.cpp:19
BlamUIWidget_2DPrimitive::index_buffer
bgfx::IndexBufferHandle index_buffer
Definition: ui.h:424
BlamUIWidget::SetAnchorPosition
void SetAnchorPosition(BlamWidgetAnchor new_anchor_position)
Sets the anchor position of the widget.
Definition: BlamUIWidget.cpp:425
BlamUIWidget::SetRotation
void SetRotation(float new_rotation)
Sets the rotation of the widget.
Definition: BlamUIWidget.cpp:419
BlamUIWidget::GetCustomType
std::string GetCustomType()
Retrieves the custom type name of this widget.
Definition: BlamUIWidget.cpp:485
BlamUIWidget_2DPrimitive::AddTriangle
void AddTriangle(uint16_t x, uint16_t y, uint16_t z)
Definition: 2d_primitive.cpp:277
BlamUIWidget_2DPrimitive::~BlamUIWidget_2DPrimitive
~BlamUIWidget_2DPrimitive()
Definition: 2d_primitive.cpp:33
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:680