[Scummvm-git-logs] scummvm master -> 9e5534e53cf8ad5387ee4a44c425b01ef8b8198a

sev- noreply at scummvm.org
Wed May 1 10:38:40 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
9e5534e53c DIRECTOR: Improvements to the Channel window


Commit: 9e5534e53cf8ad5387ee4a44c425b01ef8b8198a
    https://github.com/scummvm/scummvm/commit/9e5534e53cf8ad5387ee4a44c425b01ef8b8198a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-01T12:31:59+02:00

Commit Message:
DIRECTOR: Improvements to the Channel window

* Set window size to viewport size
* Process factories (not yet properly tested)

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index e978e02823b..73b48a59edd 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -19,6 +19,7 @@
  *
  */
 
+#define IMGUI_DEFINE_MATH_OPERATORS
 #include "backends/imgui/imgui.h"
 
 #include "director/director.h"
@@ -93,8 +94,11 @@ static void showChannels() {
 	if (!_state->_showChannels)
 		return;
 
-	ImGui::SetNextWindowPos(ImVec2(20, 160), ImGuiCond_FirstUseEver);
-	ImGui::SetNextWindowSize(ImVec2(240, 240), ImGuiCond_FirstUseEver);
+	ImVec2 pos(40, 40);
+	ImGui::SetNextWindowPos(pos, ImGuiCond_FirstUseEver);
+
+	ImVec2 windowSize = ImGui::GetMainViewport()->Size - pos - pos;
+	ImGui::SetNextWindowSize(windowSize, ImGuiCond_FirstUseEver);
 
 	if (ImGui::Begin("Channels", &_state->_showChannels)) {
 		Score *score = g_director->getCurrentMovie()->getScore();
@@ -233,15 +237,10 @@ static bool showScript(CastMemberID &id) {
 			for (auto &handler : ctx->_functionHandlers)
 				ImGui::Text("%s\n", lingo->formatFunctionBody(handler._value).c_str());
 		} else if (cast->_lingoArchive->factoryContexts.contains(id.member)) {
-			ImGui::Text("[Factory]");
-#if 0
 			for (auto &it : *cast->_lingoArchive->factoryContexts.getVal(id.member)) {
-				Common::String prefix = Common::String::format("%s:", it._key.c_str());
-				Common::String handler = funcName.substr(prefix.size());
-				if (it._value->_functionHandlers.contains(handler))
-					ImGui::Text("%s\n", lingo->formatFunctionBody(it._value->_functionHandlers[handler]).c_str());
+				for (auto &handler : it._value->_functionHandlers)
+					ImGui::Text("%s\n", lingo->formatFunctionBody(handler._value).c_str());
 			}
-#endif
 		} else {
 			ImGui::Text("[Nothing]");
 		}




More information about the Scummvm-git-logs mailing list