[Scummvm-git-logs] scummvm master -> f63e00f8ba862049ea5f345d7b792b4b794a03af
sev-
noreply at scummvm.org
Thu May 30 00:25:14 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
fff73c3cac DIRECTOR: DEBUGGER: Moved Settings menu item to the bottom
f63e00f8ba DIRECTOR: DEBUGGER: Initial code for list of watched variables
Commit: fff73c3cac268c5eb6ff2519bd6980050c82eced
https://github.com/scummvm/scummvm/commit/fff73c3cac268c5eb6ff2519bd6980050c82eced
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-30T02:08:43+02:00
Commit Message:
DIRECTOR: DEBUGGER: Moved Settings menu item to the bottom
Changed paths:
engines/director/debugtools.cpp
diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index 458d6439567..c042e4c84a9 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -3536,7 +3536,6 @@ void onImGuiRender() {
ImGui::MenuItem("CallStack", NULL, &_state->_w.callStack);
ImGui::MenuItem("Breakpoints", NULL, &_state->_w.bpList);
ImGui::MenuItem("Vars", NULL, &_state->_w.vars);
- ImGui::MenuItem("Settings", NULL, &_state->_w.settings);
ImGui::MenuItem("Logger", NULL, &_state->_w.logger);
ImGui::MenuItem("Archive", NULL, &_state->_w.archive);
@@ -3545,6 +3544,8 @@ void onImGuiRender() {
}
if (ImGui::MenuItem("Load state")) {
}
+ ImGui::Separator();
+ ImGui::MenuItem("Settings", NULL, &_state->_w.settings);
ImGui::EndMenu();
}
Commit: f63e00f8ba862049ea5f345d7b792b4b794a03af
https://github.com/scummvm/scummvm/commit/f63e00f8ba862049ea5f345d7b792b4b794a03af
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-30T02:24:41+02:00
Commit Message:
DIRECTOR: DEBUGGER: Initial code for list of watched variables
Changed paths:
engines/director/debugtools.cpp
diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index c042e4c84a9..2fc667f5b28 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -110,6 +110,7 @@ typedef struct ImGuiWindows {
bool settings = false;
bool logger = false;
bool archive = false;
+ bool watchedVars = false;
} ImGuiWindows;
static bool toggleButton(const char *label, bool *p_value, bool inverse = false) {
@@ -2196,7 +2197,7 @@ static void showCast() {
ImGui::End();
}
-static void displayVariable(Common::String &name) {
+static void displayVariable(const Common::String &name) {
const ImU32 var_color = ImGui::GetColorU32(ImVec4(0.9f, 0.9f, 0.0f, 1.0f));
const ImU32 disp_color_disabled = ImGui::GetColorU32(ImVec4(0.9f, 0.08f, 0.0f, 0.0f));
@@ -3470,6 +3471,37 @@ void onLog(LogMessageType::Type type, int level, uint32 debugChannels, const cha
}
}
+static void showWatchedVars() {
+ if (!_state->_w.watchedVars)
+ return;
+
+ if ((g_director->getTotalPlayTime() - _state->_vars._lastTimeRefreshed) > 500) {
+ if (g_lingo->_state->localVars) {
+ _state->_vars._locals = *g_lingo->_state->localVars;
+ } else {
+ _state->_vars._locals.clear();
+ }
+
+ _state->_vars._globals = g_lingo->_globalvars;
+ _state->_vars._lastTimeRefreshed = g_director->getTotalPlayTime();
+ }
+
+ ImGui::SetNextWindowPos(ImVec2(20, 20), ImGuiCond_FirstUseEver);
+ ImGui::SetNextWindowSize(ImVec2(300, 250), ImGuiCond_FirstUseEver);
+ if (ImGui::Begin("Watched Vars", &_state->_w.watchedVars)) {
+ for (auto &v : _state->_variables) {
+ Datum name(v._key);
+ name.type = VARREF;
+ Datum val = g_lingo->varFetch(name, true);
+
+ displayVariable(v._key);
+ ImGui::SameLine();
+ ImGui::Text(" - [%s] %s", val.type2str(), formatStringForDump(val.asString(true)).c_str());
+ }
+ }
+ ImGui::End();
+}
+
void onImGuiInit() {
ImGuiIO &io = ImGui::GetIO();
io.Fonts->AddFontDefault();
@@ -3536,6 +3568,7 @@ void onImGuiRender() {
ImGui::MenuItem("CallStack", NULL, &_state->_w.callStack);
ImGui::MenuItem("Breakpoints", NULL, &_state->_w.bpList);
ImGui::MenuItem("Vars", NULL, &_state->_w.vars);
+ ImGui::MenuItem("Watched Vars", NULL, &_state->_w.watchedVars);
ImGui::MenuItem("Logger", NULL, &_state->_w.logger);
ImGui::MenuItem("Archive", NULL, &_state->_w.archive);
@@ -3565,6 +3598,7 @@ void onImGuiRender() {
showBreakpointList();
showSettings();
showArchive();
+ showWatchedVars();
_state->_logger.draw("Logger", &_state->_w.logger);
}
More information about the Scummvm-git-logs
mailing list