[Scummvm-git-logs] scummvm master -> 41b1192b3b4354428bf83e7986985c8a8c262e7f

sev- noreply at scummvm.org
Thu May 2 19:01:54 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:
25dd77d22c DIRECTOR: DEBUGGER: Improve visuals for Control Panel
41b1192b3b DIRECTOR: DEBUGGER: Show control panel in the top right corner and added frame number to it


Commit: 25dd77d22c8f9779c5e7fd13876abf148e21df43
    https://github.com/scummvm/scummvm/commit/25dd77d22c8f9779c5e7fd13876abf148e21df43
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-02T20:23:14+02:00

Commit Message:
DIRECTOR: DEBUGGER: Improve visuals for Control Panel

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index abd7a7dbf03..18836cdcc7c 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -77,54 +77,62 @@ static void showControlPanel() {
 		ImDrawList *dl = ImGui::GetWindowDrawList();
 
 		ImU32 color = ImGui::GetColorU32(ImVec4(0.8f, 0.8f, 0.8f, 1.0f));
+		ImU32 bgcolor = ImGui::GetColorU32(ImVec4(0.2f, 0.2f, 1.0f, 1.0f));
 		ImVec2 p = ImGui::GetCursorScreenPos();
-		ImVec2 mid(p.x + 7, p.y + 7);
+		ImVec2 buttonSize(20, 14);
+		float bgX1 = -4.0f, bgX2 = 21.0f;
 
-		ImGui::InvisibleButton("Rewind", ImVec2(16, ImGui::GetFontSize()));
+		ImGui::InvisibleButton("Rewind", buttonSize);
 		if (ImGui::IsItemClicked(0)) {
 		}
+		if (ImGui::IsItemHovered())
+			dl->AddRectFilled(ImVec2(p.x + bgX1, p.y + bgX1), ImVec2(p.x + bgX2, p.y + bgX2), bgcolor, 3.0f, ImDrawFlags_RoundCornersAll);
 
-		dl->AddTriangleFilled(ImVec2(p.x, p.y + 7), ImVec2(p.x + 4, p.y + 3), ImVec2(p.x + 4, p.y + 11), color);
-		dl->AddTriangleFilled(ImVec2(p.x + 4, p.y + 7), ImVec2(p.x + 8, p.y + 3), ImVec2(p.x + 8, p.y + 11), color);
+		dl->AddTriangleFilled(ImVec2(p.x, p.y + 8), ImVec2(p.x + 8, p.y), ImVec2(p.x + 8, p.y + 16), color);
+		dl->AddTriangleFilled(ImVec2(p.x + 8, p.y + 8), ImVec2(p.x + 16, p.y), ImVec2(p.x + 16, p.y + 16), color);
 		ImGui::SetItemTooltip("Rewind");
 		ImGui::SameLine();
 
 		p = ImGui::GetCursorScreenPos();
-		mid = ImVec2(p.x + 7, p.y + 7);
-		ImGui::InvisibleButton("Step Back", ImVec2(16, ImGui::GetFontSize()));
+		ImGui::InvisibleButton("Step Back", ImVec2(18, 16));
 		if (ImGui::IsItemClicked(0)) {
 		}
-		dl->AddTriangleFilled(ImVec2(p.x, p.y + 7), ImVec2(p.x + 5, p.y + 3), ImVec2(p.x + 5, p.y + 11), color);
-		dl->AddRectFilled(ImVec2(p.x + 6, p.y + 3), ImVec2(p.x + 9, p.y + 11), color);
+		if (ImGui::IsItemHovered())
+			dl->AddRectFilled(ImVec2(p.x + bgX1, p.y + bgX1), ImVec2(p.x + bgX2, p.y + bgX2), bgcolor, 3.0f, ImDrawFlags_RoundCornersAll);
+		dl->AddTriangleFilled(ImVec2(p.x, p.y + 8), ImVec2(p.x + 9, p.y), ImVec2(p.x + 9, p.y + 16), color);
+		dl->AddRectFilled(ImVec2(p.x + 11, p.y), ImVec2(p.x + 17, p.y + 16), color);
 		ImGui::SetItemTooltip("Step Back");
 		ImGui::SameLine();
 
 		p = ImGui::GetCursorScreenPos();
-		mid = ImVec2(p.x + 7, p.y + 7);
-		ImGui::InvisibleButton("Stop", ImVec2(16, ImGui::GetFontSize()));
+		ImGui::InvisibleButton("Stop", buttonSize);
 		if (ImGui::IsItemClicked(0)) {
 		}
-		dl->AddRectFilled(ImVec2(p.x, p.y + 3), ImVec2(p.x + 8, p.y + 11), color);
+		if (ImGui::IsItemHovered())
+			dl->AddRectFilled(ImVec2(p.x + bgX1, p.y + bgX1), ImVec2(p.x + bgX2, p.y + bgX2), bgcolor, 3.0f, ImDrawFlags_RoundCornersAll);
+		dl->AddRectFilled(ImVec2(p.x, p.y), ImVec2(p.x + 16, p.y + 16), color);
 		ImGui::SetItemTooltip("Stop");
 		ImGui::SameLine();
 
 		p = ImGui::GetCursorScreenPos();
-		mid = ImVec2(p.x + 7, p.y + 7);
-		ImGui::InvisibleButton("Step", ImVec2(16, ImGui::GetFontSize()));
+		ImGui::InvisibleButton("Step", buttonSize);
 		if (ImGui::IsItemClicked(0)) {
 		}
-		dl->AddRectFilled(ImVec2(p.x, p.y + 3), ImVec2(p.x + 3, p.y + 11), color);
-		dl->AddTriangleFilled(ImVec2(p.x + 4, p.y + 4), ImVec2(p.x + 4, p.y + 10), ImVec2(p.x + 8, p.y + 7), color);
+		if (ImGui::IsItemHovered())
+			dl->AddRectFilled(ImVec2(p.x + bgX1, p.y + bgX1), ImVec2(p.x + bgX2, p.y + bgX2), bgcolor, 3.0f, ImDrawFlags_RoundCornersAll);
+		dl->AddRectFilled(ImVec2(p.x, p.y), ImVec2(p.x + 6, p.y + 16), color);
+		dl->AddTriangleFilled(ImVec2(p.x + 8, p.y + 2), ImVec2(p.x + 8, p.y + 14), ImVec2(p.x + 16, p.y + 8), color);
 		ImGui::SetItemTooltip("Step");
 		ImGui::SameLine();
 
 		p = ImGui::GetCursorScreenPos();
-		mid = ImVec2(p.x + 7, p.y + 7);
-		ImGui::InvisibleButton("Play", ImVec2(16, ImGui::GetFontSize()));
+		ImGui::InvisibleButton("Play", buttonSize);
 		if (ImGui::IsItemClicked(0)) {
 			warning("Play");
 		}
-		dl->AddTriangleFilled(ImVec2(p.x, p.y + 3), ImVec2(p.x, p.y + 11), ImVec2(p.x + 7, p.y + 7), color);
+		if (ImGui::IsItemHovered())
+			dl->AddRectFilled(ImVec2(p.x + bgX1, p.y + bgX1), ImVec2(p.x + bgX2, p.y + bgX2), bgcolor, 3.0f, ImDrawFlags_RoundCornersAll);
+		dl->AddTriangleFilled(ImVec2(p.x, p.y), ImVec2(p.x, p.y + 16), ImVec2(p.x + 14, p.y + 8), color);
 		ImGui::SetItemTooltip("Play");
 		ImGui::SameLine();
 	}


Commit: 41b1192b3b4354428bf83e7986985c8a8c262e7f
    https://github.com/scummvm/scummvm/commit/41b1192b3b4354428bf83e7986985c8a8c262e7f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-02T21:01:05+02:00

Commit Message:
DIRECTOR: DEBUGGER: Show control panel in the top right corner and added frame number to it

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index 18836cdcc7c..02634894d0a 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -70,8 +70,9 @@ static void showControlPanel() {
 	if (!_state->_showControlPanel)
 		return;
 
-	ImGui::SetNextWindowPos(ImVec2(20, 160), ImGuiCond_FirstUseEver);
-	ImGui::SetNextWindowSize(ImVec2(140, 120), ImGuiCond_FirstUseEver);
+	ImVec2 vp(ImGui::GetMainViewport()->Size);
+	ImGui::SetNextWindowPos(ImVec2(vp.x - 220.0f, 20.0f), ImGuiCond_FirstUseEver);
+	ImGui::SetNextWindowSize(ImVec2(200, 55), ImGuiCond_FirstUseEver);
 
 	if (ImGui::Begin("Control Panel", &_state->_showControlPanel)) {
 		ImDrawList *dl = ImGui::GetWindowDrawList();
@@ -135,6 +136,14 @@ static void showControlPanel() {
 		dl->AddTriangleFilled(ImVec2(p.x, p.y), ImVec2(p.x, p.y + 16), ImVec2(p.x + 14, p.y + 8), color);
 		ImGui::SetItemTooltip("Play");
 		ImGui::SameLine();
+
+		char buf[5];
+
+		snprintf(buf, 5, "%d", g_director->getCurrentMovie()->getScore()->getCurrentFrameNum());
+
+		ImGui::SetNextItemWidth(30);
+		ImGui::InputText("##frame", buf, 5, ImGuiInputTextFlags_CharsDecimal);
+		ImGui::SetItemTooltip("Frame");
 	}
 	ImGui::End();
 }




More information about the Scummvm-git-logs mailing list