Przeglądaj źródła

Merge pull request #229 from djeada/copilot/fix-ui-overlay-cleanup

Fix UI overlay cleanup after map reload or skirmish restart
Adam Djellouli 2 miesięcy temu
rodzic
commit
c6e5f000a8
1 zmienionych plików z 12 dodań i 0 usunięć
  1. 12 0
      ui/qml/HUDVictory.qml

+ 12 - 0
ui/qml/HUDVictory.qml

@@ -13,6 +13,18 @@ Rectangle {
     visible: (typeof game !== 'undefined' && game.victoryState !== "")
     z: 100
 
+    // Reset overlay state when a new game starts
+    // This ensures no residual overlay remains after map reload or skirmish restart
+    Connections {
+        target: (typeof game !== 'undefined') ? game : null
+        function onVictoryStateChanged() {
+            if (typeof game !== 'undefined' && game.victoryState === "") {
+                showingSummary = false;
+                battleSummary.visible = false;
+            }
+        }
+    }
+
     Rectangle {
         id: initialOverlay