HomeWildfire Games

Remove GUI object setting values z="0", size="0 0 100% 100%", hidden="false" in…

Description

Remove GUI object setting values z="0", size="0 0 100% 100%", hidden="false" in XML page specifications that are redundant with the default style values.

Remove question by brian in single_details_area.xml from rP11976 which is answered by "because the style set it".
Delete BuildNameText style, because it specifies ghost="true" in both style and sole object using the style.
Don't touch progressbar and structree styles, because there is more to clean.

Differential Revision: https://code.wildfiregames.com/D2292

Event Timeline

elexis added inline comments.Sep 21 2019, 7:59 PM
/ps/trunk/binaries/data/mods/public/gui/session/session.xml
67

Problem:
As reported by Freagarach on IRC today, the top panel background not being drawn if the game is paused.
It was this z removal that results in the issue.

The reason for this issue is that CGUI::Xeromyces_ReadObject provides yet a different z default value.
So the default style z="0" value is a hoax!
And to blame is either the commit that introduced ManuallySetZ, or the one that added 'z="0"` to the default style, or both.
And this commit for not having known about this yet different place with default values.

So as a matter of fact, the entire assumption of the z removal now needs to be audited again, I will do that.

Notice there is another bug with Z order, subject of D148, might be related.

Tested all other z="0" occurrences and they all work fine, except the mentioned one if pause mode is enabled.
The network message overlay was tested by simulating lag, also pausing in multiplayermode.

Not forgotton, from http://irclogs.wildfiregames.com/2019-09/2019-09-22-QuakeNet-%230ad-dev.log

19:25 < Krinkle> https://usercontent.irccloud-cdn.com/file/FW6aWgxI/r22974-bug-diplomacy-zindex.png

(As mentioned the assumption that the z values were ineffective was wrong, same wrong as the default style specifying it)

Will have to investigate more cases (also have the distinct feeling I fixed this bug once before.).

As noted above and in rP22966, the z="0" values were actually not redundant with the values used, because first the CGUI loaded the default values, then it overwrites the Z value with a computed per-object Z default, then it applies the styles Z value.
This behavior is only the case for Z but none of the other values and the authors of the default style fell for it as well.

The session Z value changes are basically completely broken, as the session has different dialogs and overlays that all seem to conflict mutually.

This commit had the following hunks removing z="0":

For BackgroundTranslucent:

Index: /ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/civinfo/civinfo.xml	(revision 22957)
@@ -11,5 +11,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="BackgroundTranslucent"/>
+	<object type="image" sprite="BackgroundTranslucent"/>
 
 	<object type="image" style="ModernDialog" size="50%-500 50%-368 50%+500 50%+370">
Index: /ps/trunk/binaries/data/mods/public/gui/loadgame/load.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/loadgame/load.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/loadgame/load.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="BackgroundTranslucent"/>
+	<object type="image" sprite="BackgroundTranslucent"/>
 
 	<object type="image" style="ModernDialog" size="50%-460 50%-325 50%+460 50%+325">
Index: /ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/reference/structree/structree.xml	(revision 22957)
@@ -13,5 +13,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="BackgroundTranslucent"/>
+	<object type="image" sprite="BackgroundTranslucent"/>
 
 	<object type="image" style="ModernDialog" size="16 24 100%-16 100%-24">
Index: /ps/trunk/binaries/data/mods/public/gui/reference/viewer/viewer.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/reference/viewer/viewer.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/reference/viewer/viewer.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out whatever's behind this -->
-	<object type="image" z="0" sprite="BackgroundTranslucent"/>
+	<object type="image" sprite="BackgroundTranslucent"/>
 
 	<object type="image" sprite="ModernDialog" size="50%-250 50%-300 50%+250 50%+300">

For ModernFade:

Index: /ps/trunk/binaries/data/mods/mod/gui/modio/modio.xml
===================================================================
--- /ps/trunk/binaries/data/mods/mod/gui/modio/modio.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/mod/gui/modio/modio.xml	(revision 22957)
@@ -6,5 +6,5 @@
 	<script directory="gui/modio/"/>
 
-	<object type="image" sprite="ModernFade" z="0"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object name="modio" type="image" style="ModernDialog" size="10% 10% 90% 90%">
Index: /ps/trunk/binaries/data/mods/mod/gui/modmod/help/help.xml
===================================================================
--- /ps/trunk/binaries/data/mods/mod/gui/modmod/help/help.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/mod/gui/modmod/help/help.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object type="image" style="ModernDialog" size="50%-466 50%-316 50%+466 50%+316">
Index: /ps/trunk/binaries/data/mods/mod/gui/msgbox/msgbox.xml
===================================================================
--- /ps/trunk/binaries/data/mods/mod/gui/msgbox/msgbox.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/mod/gui/msgbox/msgbox.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Fade out the background because it's non-interactable -->
-	<object sprite="ModernFade" type="image" z="0"/>
+	<object sprite="ModernFade" type="image"/>
 	<object name="mbCancelHotkey" hotkey="cancel" />
 	<object name="mbMain"
Index: /ps/trunk/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml
===================================================================
--- /ps/trunk/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/mod/gui/termsdialog/termsdialog.xml	(revision 22957)
@@ -5,5 +5,5 @@
 	<script directory="gui/termsdialog/"/>
 
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object type="image" style="ModernDialog" size="50%-360 50%-290 50%+360 50%+290">
Index: /ps/trunk/binaries/data/mods/public/gui/credits/credits.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/credits/credits.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/credits/credits.xml	(revision 22957)
@@ -13,5 +13,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object type="image" style="ModernDialog" size="50%-473 24 50%+473 100%-24">
Index: /ps/trunk/binaries/data/mods/public/gui/locale/locale.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/locale/locale.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/locale/locale.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object type="image" style="ModernDialog" size="50%-210 50%-100 50%+210 50%+100">
Index: /ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/locale_advanced/locale_advanced.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 	<object type="image" style="ModernDialog" size="50%-220 50%-210 50%+220 50%+210">
 		<action on="Tick">onTick();</action>
Index: /ps/trunk/binaries/data/mods/public/gui/manual/manual.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/manual/manual.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/manual/manual.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object type="image" style="ModernDialog" size="50%-466 50%-316 50%+466 50%+316">
Index: /ps/trunk/binaries/data/mods/public/gui/prelobby/entrance/entrance.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/prelobby/entrance/entrance.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/prelobby/entrance/entrance.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object name="dialog" type="image" style="ModernDialog" size="50%-230 50%-130 50%+230 50%+130">
Index: /ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/splashscreen/splashscreen.xml	(revision 22957)
@@ -7,5 +7,5 @@
 
 	<!-- Add a translucent black background to fade out the menu page -->
-	<object type="image" z="0" sprite="ModernFade"/>
+	<object type="image" sprite="ModernFade"/>
 
 	<object type="image" style="ModernDialog" size="50%-274 50%-200 50%+274 50%+200">

Rest:

Index: /ps/trunk/binaries/data/mods/public/gui/session/session.xml
===================================================================
--- /ps/trunk/binaries/data/mods/public/gui/session/session.xml	(revision 22956)
+++ /ps/trunk/binaries/data/mods/public/gui/session/session.xml	(revision 22957)
@@ -50,5 +50,5 @@
 
 	<!-- Network status -->
-	<object name="netStatus" type="text" style="netStatus" z="0" hidden="true">
+	<object name="netStatus" type="text" style="netStatus" hidden="true">
 		<object type="button"
 			name="disconnectedExitButton"
@@ -56,22 +56,21 @@
 			size="50%-84 50%+128 50%+84 50%+160"
 			tooltip_style="sessionToolTip"
-			z="0"
 		>
 			<translatableAttribute id="caption">Exit</translatableAttribute>
 			<action on="Press">leaveGame();</action>
 		</object>
-		<object name="loadingClientsText" size="50%-300 50%+60 50%+300 50%+110" type="text" style="netStatusPlayersText" hidden="true" z="0"/>
+		<object name="loadingClientsText" size="50%-300 50%+60 50%+300 50%+110" type="text" style="netStatusPlayersText" hidden="true"/>
 	</object>
 
 	<!-- Pause Overlay -->
-	<object type="button" name="pauseOverlay" size="0 0 100% 100%" tooltip_style="sessionToolTip" hidden="true" z="0">
-		<object size="0 0 100% 100%" type="image" sprite="sessionOverlayBackground" ghost="true" z="0"/>
-		<object size="50%-128 40%-20 50%+128 40%+20" type="text" style="PauseText" ghost="true" z="0">
+	<object type="button" name="pauseOverlay" tooltip_style="sessionToolTip" hidden="true">
+		<object type="image" sprite="sessionOverlayBackground" ghost="true"/>
+		<object size="50%-128 40%-20 50%+128 40%+20" type="text" style="PauseText" ghost="true">
 			<translatableAttribute id="caption">Game Paused</translatableAttribute>
 		</object>
-		<object name="resumeMessage" size="50%-128 40%+20 50%+128 40%+40" type="text" style="ResumeMessageText" ghost="true" z="0">
+		<object name="resumeMessage" size="50%-128 40%+20 50%+128 40%+40" type="text" style="ResumeMessageText" ghost="true">
 			<translatableAttribute id="caption">Click to Resume Game</translatableAttribute>
 		</object>
-		<object name="pausedByText" size="30% 40%+50 70% 100%" type="text" style="netStatusPlayersText" ghost="true" hidden="true" z="0"/>
+		<object name="pausedByText" size="30% 40%+50 70% 100%" type="text" style="netStatusPlayersText" ghost="true" hidden="true"/>
 		<action on="Press">togglePause();</action>
 	</object>
@@ -79,9 +78,9 @@
 	<!-- Notification Area -->
 	<object name="notificationPanel" type="image" size="50%-300 60 50%+300 120" ghost="true">
-		<object name="notificationText" size="0 0 100% 100%" type="text" style="notificationPanel" ghost="true"/>
+		<object name="notificationText" type="text" style="notificationPanel" ghost="true"/>
 	</object>
 
 	<!-- Chat messages -->
-	<object name="chatPanel" size="0 130 100% 100%-240" type="image" ghost="true" z="0" absolute="true">
+	<object name="chatPanel" size="0 130 100% 100%-240" type="image" ghost="true" absolute="true">
 		<object name="chatText" size="3 1 100%-1 100%-1" type="text" style="chatPanelOverlay" ghost="true"/>
 	</object>

So it appears the rest = session values which are the ones experienced (at least by me) in various ways to be broken by this commit and thus have to be reverted.
rP22966 reverted only the "pauseOverlay" GUI Object.

I could not find the ModernFade or BackgroundTranslucent Z values to be relevant while testing, it displayed as intended.

elexis added a comment.Nov 4 2019, 3:01 PM

Objectives dialog after disconnect, the caption of the button is visible but the sprite of the button is not, this must be a C++ bug, like the one subject to D148.