[Scummvm-git-logs] scummvm master -> 4d02f12e1a768f481291779e9577b320fabdea44
sev-
noreply at scummvm.org
Thu Apr 10 19:35:36 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
4d02f12e1a DIRECTOR: DT: Wrapping superlong variables when displaying
Commit: 4d02f12e1a768f481291779e9577b320fabdea44
https://github.com/scummvm/scummvm/commit/4d02f12e1a768f481291779e9577b320fabdea44
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-04-10T21:35:15+02:00
Commit Message:
DIRECTOR: DT: Wrapping superlong variables when displaying
Otherwise we could end up with like 15000 pixels wide window that
crashes window managers
Changed paths:
engines/director/debugger/dt-script-d2.cpp
engines/director/debugger/dt-script-d4.cpp
diff --git a/engines/director/debugger/dt-script-d2.cpp b/engines/director/debugger/dt-script-d2.cpp
index 1b9e8bbf9ca..4c06a05a996 100644
--- a/engines/director/debugger/dt-script-d2.cpp
+++ b/engines/director/debugger/dt-script-d2.cpp
@@ -521,7 +521,14 @@ public:
const Datum &val = g_lingo->_globalvars.getVal(*node->name);
ImGui::BeginTooltip();
ImGui::Text("Click to add to watches.");
- ImGui::Text("= %s", val.asString(true).c_str());
+ Common::String s = val.asString(true);
+ s.wordWrap(150);
+ if (s.size() > 4000) {
+ uint chop = s.size() - 4000;
+ s.chop(s.size() - 4000);
+ s += Common::String::format("... [chopped %d chars]", chop);
+ }
+ ImGui::Text("= %s", s.c_str());
ImGui::EndTooltip();
}
if (ImGui::IsItemClicked()) {
diff --git a/engines/director/debugger/dt-script-d4.cpp b/engines/director/debugger/dt-script-d4.cpp
index 91f28262766..35ba13ce20c 100644
--- a/engines/director/debugger/dt-script-d4.cpp
+++ b/engines/director/debugger/dt-script-d4.cpp
@@ -944,7 +944,14 @@ private:
const Datum &val = g_lingo->_globalvars.getVal(varName);
ImGui::BeginTooltip();
ImGui::Text("Click to add to watches.");
- ImGui::Text("= %s", val.asString(true).c_str());
+ Common::String s = val.asString(true);
+ s.wordWrap(150);
+ if (s.size() > 4000) {
+ uint chop = s.size() - 4000;
+ s.chop(s.size() - 4000);
+ s += Common::String::format("... [chopped %d chars]", chop);
+ }
+ ImGui::Text("= %s", s.c_str());
ImGui::EndTooltip();
}
if (ImGui::IsItemClicked()) {
More information about the Scummvm-git-logs
mailing list