 |
Blamite Game Engine - Blam (Core)
|
Go to the documentation of this file.
3 #include "../../debug_ui.h"
17 int active_tag_index = -1;
18 int active_class_index = 0;
19 std::string selected_class_label =
"<choose>";
21 bool show_create_popup =
false;
26 if (show_create_popup)
28 ImGui::OpenPopup(
"Create New Tag...");
29 if (ImGui::BeginPopupModal(
"Create New Tag...", &show_create_popup))
31 ImGui::PushItemWidth(90.0f);
32 if (ImGui::BeginCombo(
"tag class", selected_class_label.c_str()))
40 if (ImGui::Selectable(label.c_str()))
42 active_class_index = i;
47 ImGui::PopItemWidth();
49 if (ImGui::Button(
"OK"))
55 void* new_tag_address = NULL;
63 show_create_popup =
false;
68 if (ImGui::Button(
"Cancel"))
70 show_create_popup =
false;
89 if (ImGui::Begin(
"Tag Editor", &
show))
93 if (ImGui::Button(
"create new tag"))
95 show_create_popup =
true;
102 ImGui::SetColumnWidth(0, 200);
104 if (ImGui::ListBoxHeader(
"", ImVec2(ImGui::GetColumnWidth() - 15, -1)))
106 for (
int i = 0; i < tags->size(); i++)
110 bool is_active_item =
false;
112 if (i == active_tag_index)
114 is_active_item =
true;
117 if (ImGui::Selectable(data.
path, is_active_item))
119 active_tag_index = i;
122 if (ImGui::IsItemHovered())
124 ImGui::BeginTooltip();
125 ImGui::PushTextWrapPos(450.0f);
129 std::string tag_path =
"path: " + std::string(data.
path);
130 std::string tag_index =
"index: " + std::to_string(i);
132 std::string tag_class =
"class: " + data.
tag_class;
133 std::string tag_size =
"size: " + std::to_string(data.
size);
141 ImGui::PopTextWrapPos();
146 ImGui::ListBoxFooter();
151 if (active_tag_index < 0)
155 else if (active_tag_index > tags->size())
157 std::string message =
"selected index " + std::to_string(active_tag_index) +
158 " was too high (max is " + std::to_string(tags->size()) +
")";
166 if (ImGui::BeginTabBar(
"tag_editor_tabs"))
168 if (ImGui::BeginTabItem(
"tag information"))
170 std::string tag_path =
"path: " + std::string(data.
path);
171 std::string tag_index =
"index: " + std::to_string(active_tag_index);
173 std::string tag_class =
"class: " + data.
tag_class;
174 std::string tag_size =
"size: " + std::to_string(data.
size);
185 if (ImGui::BeginTabItem(
"meta editor"))
189 if (ImGui::Button(
"save to disk"))
196 if (ImGui::Button(
"reload from disk"))
BLAM HRESULT LoadTagFromFile(std::string tag_path)
Loads a tag from the engine's tag directory (default is '.
Definition: tags.cpp:156
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:33
std::string tag_class
The tag's short class name.
Definition: tags.h:45
void * address
The address pointing to the start of the tag's data.
Definition: tags.h:31
std::string class_name_long
The longer class name. Typically shown alongside short name for user-friendliness.
Definition: tagclass.h:33
std::string class_name_short
The short, 4-character name of the tag class.
Definition: tagclass.h:34
int size
The size of the tag's data in memory.
Definition: tags.h:32
@ UIDebug
Report file for all UI messages.
Definition: logger.h:81
TagOrigin origin
The origin of the tag.
Definition: tags.h:46
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: debug_ui.h:441
Class representing an ImGUI drawing group/draw list item.
Definition: debug_ui.h:408
void Draw()
Draws the tag editor window.
Definition: tag_editor.hpp:82
BLAM std::string RegisterCreatedTag(void *tag, std::string tag_class)
Definition: tags.cpp:45
Class representing a tag's data.
Definition: tags.h:28
void CreateNewTagModal()
Definition: tag_editor.hpp:24
Class representing a tag class.
Definition: tagclass.h:30
BLAM std::vector< tag_memory_data > * GetLoadedTags()
Retrieves the list of loaded tag data.
Definition: tags.cpp:507
Class for the realtime tag editor.
Definition: tag_editor.hpp:14
BLAM void ShowImPropertyEditor(void *tag, std::string tag_class)
Shows an ImGUI editor for a given tag.
Definition: tags.cpp:21
Legacy namespace to contain data for the legacy ImGUI console.
Definition: debug_ui.h:493
std::string BytesToString(void *bytes, int bytes_length)
Converts a series of bytes to a string.
Definition: converters.cpp:164
@ Text
Master text object that wraps around both BitmapText and DWText.
Definition: render_stack.h:73
BLAM std::vector< TagClass * > * GetRegisteredTagClasses()
Retrieves the list of all registered tag classes.
Definition: tagclass.cpp:72
#define WSV_WARNING
Macro for 'Warning' log seveirty. Original pre-enum value was 3.
Definition: logger.h:18
BLAM HRESULT SaveTag(void *tag_data, std::string tag_class, int tag_size, std::string tag_path)
Saves a tag data to a file.
Definition: tags.cpp:381
char path[256]
The tag's path.
Definition: tags.h:44