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);
|
||||
}
|
||||
|
||||
std::string GetDumpedContents() {
|
||||
return absl::StrFormat("%000X : %s\r\n\r\n", ID, ContentsParsed);
|
||||
}
|
||||
|
||||
std::string OptimizeMessageForDictionary(std::string messageString) {
|
||||
std::stringstream protons;
|
||||
bool command = false;
|
||||
@@ -78,6 +74,11 @@ struct MessageData {
|
||||
|
||||
return finalString;
|
||||
}
|
||||
|
||||
void SetMessage(const std::string& message) {
|
||||
RawString = message;
|
||||
ContentsParsed = OptimizeMessageForDictionary(message);
|
||||
}
|
||||
};
|
||||
|
||||
struct TextElement {
|
||||
|
||||
@@ -131,11 +131,12 @@ absl::Status MessageEditor::Update() {
|
||||
data_loaded_ = true;
|
||||
}
|
||||
|
||||
if (BeginTable("##MessageEditor", 3,
|
||||
if (BeginTable("##MessageEditor", 4,
|
||||
ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable)) {
|
||||
TableSetupColumn("List");
|
||||
TableSetupColumn("Contents");
|
||||
TableSetupColumn("Commands");
|
||||
TableSetupColumn("Dictionary");
|
||||
|
||||
TableHeadersRow();
|
||||
|
||||
@@ -148,6 +149,26 @@ absl::Status MessageEditor::Update() {
|
||||
TableNextColumn();
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user