add dictionary contents as message editor table column
This commit is contained in:
@@ -51,10 +51,6 @@ struct MessageData {
|
|||||||
return absl::StrFormat("%0X - %s", ID, ContentsParsed);
|
return absl::StrFormat("%0X - %s", ID, ContentsParsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GetDumpedContents() {
|
|
||||||
return absl::StrFormat("%000X : %s\r\n\r\n", ID, ContentsParsed);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string OptimizeMessageForDictionary(std::string messageString) {
|
std::string OptimizeMessageForDictionary(std::string messageString) {
|
||||||
std::stringstream protons;
|
std::stringstream protons;
|
||||||
bool command = false;
|
bool command = false;
|
||||||
@@ -78,6 +74,11 @@ struct MessageData {
|
|||||||
|
|
||||||
return finalString;
|
return finalString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetMessage(const std::string& message) {
|
||||||
|
RawString = message;
|
||||||
|
ContentsParsed = OptimizeMessageForDictionary(message);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TextElement {
|
struct TextElement {
|
||||||
|
|||||||
@@ -131,11 +131,12 @@ absl::Status MessageEditor::Update() {
|
|||||||
data_loaded_ = true;
|
data_loaded_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BeginTable("##MessageEditor", 3,
|
if (BeginTable("##MessageEditor", 4,
|
||||||
ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable)) {
|
ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable)) {
|
||||||
TableSetupColumn("List");
|
TableSetupColumn("List");
|
||||||
TableSetupColumn("Contents");
|
TableSetupColumn("Contents");
|
||||||
TableSetupColumn("Commands");
|
TableSetupColumn("Commands");
|
||||||
|
TableSetupColumn("Dictionary");
|
||||||
|
|
||||||
TableHeadersRow();
|
TableHeadersRow();
|
||||||
|
|
||||||
@@ -148,6 +149,26 @@ absl::Status MessageEditor::Update() {
|
|||||||
TableNextColumn();
|
TableNextColumn();
|
||||||
DrawTextCommands();
|
DrawTextCommands();
|
||||||
|
|
||||||
|
TableNextColumn();
|
||||||
|
if (ImGui::BeginChild("##DictionaryChild", ImVec2(0, 0), true,
|
||||||
|
ImGuiWindowFlags_AlwaysVerticalScrollbar)) {
|
||||||
|
if (BeginTable("##Dictionary", 2,
|
||||||
|
ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable)) {
|
||||||
|
TableSetupColumn("ID");
|
||||||
|
TableSetupColumn("Contents");
|
||||||
|
|
||||||
|
for (const auto& dictionary : AllDictionaries) {
|
||||||
|
TableNextColumn();
|
||||||
|
Text("%s", core::UppercaseHexWord(dictionary.ID).c_str());
|
||||||
|
TableNextColumn();
|
||||||
|
Text("%s", dictionary.Contents.c_str());
|
||||||
|
}
|
||||||
|
EndTable();
|
||||||
|
}
|
||||||
|
|
||||||
|
EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
EndTable();
|
EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user