Page MenuHomeWildfire Games

GUI should include entire directories instead of all files individually
ClosedPublic

Authored by elexis on Jun 9 2017, 10:42 PM.

Details

Summary

The greater GUI pages include many specific files. The inclusion code would be much shorter, more readable and better to extend for mods if it would just include the entire subdirectory.
This means some unused functions will be loaded, but that shouldn't be an issue at all.
The files may not overwrite each others functions to begin with.
When one GUI page is pushed on another GUI page, or if the user switches the GUI page potential states like in g_NetworkWarnings of network.js are lost anyway, so reloading it doesn't add any harm.

Also the common/init.xml is useless as it includes two common/ files which are already included by the GUI pages, so it should be deleted.

Test Plan

Search XML files for <script. Open each GUI page once.
Check that the common/music.js state doesn't bug.

Event Timeline

elexis created this revision.Jun 9 2017, 10:42 PM

prelobby, locale_advanced and load should be moved to a separate directory (just like gamesetup_mp was moved in D298)

binaries/data/mods/public/gui/summary/summary.xml
10

The summary page requires a specific load order, so it isn't changed in this patch.

Vulcan added a subscriber: Vulcan.Jun 10 2017, 1:58 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1521/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <objects>
|   4|   3| 
|   5|   4| 	<script directory="gui/common/"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|  16|  16| 			<object type="text" size="5 50 50% 75" style="ModernLabelText" text_align="left">
|  17|  17| 				<translatableAttribute id="caption">Language:</translatableAttribute>
|  18|  18| 			</object>
|  19|    |-			<object name="languageList"
|  20|    |-					type="dropdown"
|  21|    |-					style="ModernDropDown"
|  22|    |-					size="50%+10 50 100% 75">
|    |  19|+			<object name="languageList" type="dropdown" style="ModernDropDown" size="50%+10 50 100% 75">
|  23|  20| 			</object>
|  24|  21| 			<object type="text" size="5 80 50% 105" style="ModernLabelText" text_align="left">
|  25|  22| 				<translatableAttribute id="caption">Country:</translatableAttribute>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|  24|  24| 			<object type="text" size="5 80 50% 105" style="ModernLabelText" text_align="left">
|  25|  25| 				<translatableAttribute id="caption">Country:</translatableAttribute>
|  26|  26| 			</object>
|  27|    |-			<object name="countryList"
|  28|    |-					type="dropdown"
|  29|    |-					style="ModernDropDown"
|  30|    |-					size="50%+10 80 100% 105">
|    |  27|+			<object name="countryList" type="dropdown" style="ModernDropDown" size="50%+10 80 100% 105">
|  31|  28| 			</object>
|  32|  29| 
|  33|  30| 			<object type="text" size="5 108 50% 137" style="ModernLabelText" text_align="left">
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|  54|  54| 			<object type="text" size="5 228 50% 257" style="ModernLabelText" text_align="left">
|  55|  55| 				<translatableAttribute id="caption">Resulting locale:</translatableAttribute>
|  56|  56| 			</object>
|  57|    |-			<object name="resultingLocale" type="text" size="50%+10 230 100% 255" textcolor="white" />
|    |  57|+			<object name="resultingLocale" type="text" size="50%+10 230 100% 255" textcolor="white"/>
|  58|  58| 
|  59|  59| 			<object type="text" size="5 258 50% 290" style="ModernLabelText" text_align="left">
|  60|  60| 				<translatableAttribute id="caption">Dictionary files used:</translatableAttribute>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/locale/locale_advanced.xml
|  59|  59| 			<object type="text" size="5 258 50% 290" style="ModernLabelText" text_align="left">
|  60|  60| 				<translatableAttribute id="caption">Dictionary files used:</translatableAttribute>
|  61|  61| 			</object>
|  62|    |-			<object name="dictionaryFile" type="text" size="50%+10 260 100% 345" style="ModernText" />
|    |  62|+			<object name="dictionaryFile" type="text" size="50%+10 260 100% 345" style="ModernText"/>
|  63|  63| 
|  64|  64| 			<object type="button" size="0 100%-60 33% 100%-25" style="ModernButtonRed" hotkey="cancel">
|  65|  65| 				<translatableAttribute id="caption">Cancel</translatableAttribute>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <!--
|   4|   3| ==========================================
|   5|   4| - Options Window -
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|   5|   5| - Options Window -
|   6|   6| ==========================================
|   7|   7| -->
|   8|    |-
|   9|   8| <objects>
|  10|   9| 	<script directory="gui/options/"/>
|  11|  10| 
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <objects>
|   4|   3| 
|   5|   4| 	<script directory="gui/common/"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|  50|  50| 						<translatableAttribute id="caption">Civilization</translatableAttribute>
|  51|  51| 					</object>
|  52|  52| 
|  53|    |-					<object name="civInfoButton"
|  54|    |-						type="button"
|  55|    |-						style="IconButton"
|  56|    |-						sprite="iconInfoGold"
|  57|    |-						sprite_over="iconInfoWhite"
|  58|    |-						size="85%-37 0 85%-21 16"
|  59|    |-					>
|    |  53|+					<object name="civInfoButton" type="button" style="IconButton" sprite="iconInfoGold" sprite_over="iconInfoWhite" size="85%-37 0 85%-21 16">
|  60|  54| 						<translatableAttribute id="tooltip">View civilization info</translatableAttribute>
|  61|  55| 						<action on="Press"><![CDATA[
|  62|  56| 							Engine.PushGuiPage("page_civinfo.xml");
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|  63|  63| 						]]></action>
|  64|  64| 					</object>
|  65|  65| 
|  66|    |-					<object name="civResetButton"
|  67|    |-						type="button"
|  68|    |-						style="IconButton"
|  69|    |-						sprite="iconResetGold"
|  70|    |-						sprite_over="iconResetWhite"
|  71|    |-						size="85%-16 0 85% 16"
|  72|    |-					>
|    |  66|+					<object name="civResetButton" type="button" style="IconButton" sprite="iconResetGold" sprite_over="iconResetWhite" size="85%-16 0 85% 16">
|  73|  67| 						<translatableAttribute id="tooltip">Reset any civilizations that have been selected to the default (random)</translatableAttribute>
|  74|  68| 						<action on="Press">resetCivilizations();</action>
|  75|  69| 					</object>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/gamesetup.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/gamesetup/game

http://jw:8080/job/phabricator_lint/164/ for more details.

elexis retitled this revision from GUI should include entire directories instead of all files individually and nuke gui/common/init.xml to GUI should include entire directories instead of all files individually.Jun 16 2017, 12:12 AM
elexis updated this revision to Diff 2574.Jun 16 2017, 12:23 AM

Rebase. init.xml was deleted in rP19780.

Not sure about including common/ in directores that only use one or two files of it.
For some directories useful, but maybe some can be left out.

Build has FAILED

Link to build: http://jw:8080/job/phabricator/1563/
See console output for more information: http://jw:8080/job/phabricator/1563/console

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <objects>
|   4|   3| 
|   5|   4| 	<script directory="gui/common/"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|  48|  48| 			</object>
|  49|  49| 
|  50|  50| 			<!-- Replay List in that left panel -->
|  51|    |-			<object name="replaySelection"
|  52|    |-				size="0 35 100% 100%-24"
|  53|    |-				style="ModernList"
|  54|    |-				type="olist"
|  55|    |-				sortable="true"
|  56|    |-				selected_column="months"
|  57|    |-				selected_column_order="-1"
|  58|    |-				sprite_asc="ModernArrowDown"
|  59|    |-				sprite_desc="ModernArrowUp"
|  60|    |-				sprite_not_sorted="ModernNotSorted"
|  61|    |-				font="sans-stroke-13"
|  62|    |-			>
|    |  51|+			<object name="replaySelection" size="0 35 100% 100%-24" style="ModernList" type="olist" sortable="true" selected_column="months" selected_column_order="-1" sprite_asc="ModernArrowDown" sprite_desc="ModernArrowUp" sprite_not_sorted="ModernNotSorted" font="sans-stroke-13">
|  63|  52| 
|  64|  53| 				<action on="SelectionChange">displayReplayDetails();</action>
|  65|  54| 				<action on="SelectionColumnChange">displayReplayList();</action>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|  98|  98| 		</object>
|  99|  99| 
| 100| 100| 		<!-- Right Panel: Compatibility Filter & Replay Details -->
| 101|    |-		<object name="rightPanel" size="100%-250 30 100%-20 100%-20" >
|    | 101|+		<object name="rightPanel" size="100%-250 30 100%-20 100%-20">
| 102| 102| 
| 103| 103| 			<!-- Compatibility Filter Checkbox -->
| 104| 104| 			<object name="compatibilityFilter" type="checkbox" checked="true" style="ModernTickBox" size="0 4 20 100%">
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
| 140| 140| 				<object name="sgMapName" size="0 5 100% 20" type="text" style="ModernLabelText"/>
| 141| 141| 
| 142| 142| 				<!-- Map Preview Image -->
| 143|    |-				<object name="sgMapPreview" size="5 25 100%-5 190"  type="image" sprite=""/>
|    | 143|+				<object name="sgMapPreview" size="5 25 100%-5 190" type="image" sprite=""/>
| 144| 144| 
| 145| 145| 				<!-- Separator Line -->
| 146| 146| 				<object size="5 194 100%-5 195" type="image" sprite="ModernWhiteLine" z="25"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
| 198| 198| 				<object type="image" sprite="ModernDarkBoxWhite" size="5 40%+175 100%-5 100%-30">
| 199| 199| 
| 200| 200| 					<!-- Number of Players -->
| 201|    |-					<object name="sgNbPlayers" size="0 3 100% 18" type="text" style="ModernLabelText" />
|    | 201|+					<object name="sgNbPlayers" size="0 3 100% 18" type="text" style="ModernLabelText"/>
| 202| 202| 
| 203| 203| 					<!-- Player Names -->
| 204| 204| 					<object name="sgPlayersNames" size="0 19 100% 100%-1" type="text" style="MapPlayerList"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
| 219| 219| 
| 220| 220| 
| 221| 221| 		<!-- Bottom Panel: Buttons. -->
| 222|    |-		<object name="bottomPanel" size="25 100%-55 100%-5 100%-25" >
|    | 222|+		<object name="bottomPanel" size="25 100%-55 100%-5 100%-25">
| 223| 223| 
| 224| 224| 			<!-- Main Menu Button -->
| 225| 225| 			<object type="button" style="StoneButton" size="25 0 17%+25 100%">
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/mod/gui/pregame/mainmenu.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/mod/gui/pregame/mainmenu.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <objects>
|   4|   3| 	<script directory="gui/pregame/"/>
|   5|   4| </objects>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <!--
|   4|   3| ==========================================
|   5|   4| - Options Window -
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/options/options.xml
|   5|   5| - Options Window -
|   6|   6| ==========================================
|   7|   7| -->
|   8|    |-
|   9|   8| <objects>
|  10|   9| 	<script directory="gui/common/"/>
|  11|  10| 	<script directory="gui/options/"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/summary/summary.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/summary/summary.xml
|   1|   1| <?xml version="1.0" encoding="utf-8"?>
|   2|    |-
|   3|   2| <objects>
|   4|   3| 	<script directory="gui/common/"/>
|   5|   4| 	<script file="gui/summary/counters.js"/>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/summary/summary.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/summary/summary.xml
|   8|   8| 	<!-- Needs the colors from summary.js -->
|   9|   9| 	<script file="gui/summary/layout.js"/>
|  10|  10| 
|  11|    |-	<object name="summaryWindow"
|  12|    |-		type="image"
|  13|    |-		style="ModernWindow"
|  14|    |-		size="0 0 100% 100%"
|  15|    |-	>
|    |  11|+	<object name="summaryWindow" type="image" style="ModernWindow" size="0 0 100% 100%">
|  16|  12| 		<object style="ModernLabelText" type="text" size="50%-128 4 50%+128 36">
|  17|  13| 			<translatableAttribute id="caption">Summary</translatableAttribute>
|  18|  14| 		</object>
|    | [INFO] XMLBear:
|    | XML can be formatted better.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/summary/summary.xml
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/summary/summary.xml
|  19|  19| 
|  20|  20| 		<object size="20 26 100%-20 92">
|  21|  21| 
|  22|    |-			<object name="summaryText"
|  23|    |-				type="text"
|  24|

http://jw:8080/job/phabricator_lint/200/ for more details.

elexis edited the test plan for this revision. (Show Details)Jul 9 2017, 3:47 PM
bb added a subscriber: bb.Oct 20 2017, 7:52 PM

Agree it look saner to include the directories of common and gui/foo/ for foo/foo.xml

binaries/data/mods/mod/gui/pregame/mainmenu.xml
4

poor naming but out of scope

binaries/data/mods/public/gui/lobby/lobby.xml
6

the prelobby moved to another directory so rebase this to a directory

binaries/data/mods/public/gui/lobby/prelobby.xml
6–7

comment same as above

binaries/data/mods/public/gui/locale/locale.xml
6

Noticed this is correct

binaries/data/mods/public/gui/structree/structree.xml
6

(we need to rebase)

binaries/data/mods/public/gui/summary/summary.xml
6–10

seems like all are included

Thanks for the comments.

Including the entire directory has the

  • disadvantage that unneeded common/ code is loaded. Hence it is not necessarily as clear to the reader which files are actually used. However looking at the directory contents, it seems everything in there is already useful for most GUI pages, so that distinction might not be relevant after all. The pages that are only useful in less cases might be moved elsewhere. colorFades.js contains session specific logic, so should be moved. The rest actually doesn't seem to hurt / not that much uncommon code.
  • advantage that the XML file doesn't have to be changed anymore by developers, but more importantly modders. For example someone wanting overwrite GUI functions (tooltips) or change global variables could just add a new file in the directory. With this patch, no further change will be needed in the XML file.
binaries/data/mods/public/gui/locale/locale.xml
6

That GUI page needs some attention, it has some GUI fields that have no function implemented, possibly the page should be split into two.

Besides the disadvantage that it isn't as clear to the reader anymore which common files are actually used, it also has the disadvantage of a greater memory footprint. I believe that should be less than 1MB however, so seems negligible and outweighed by the advantage for modders.
The gui/common/ code contains state globals, but including it doesn't execute any code.

network.js is only useful for exactly session and gamesetup. So not too happy about including that one, but seems tolerable.
gamedescription.js is useful for lobby, session, gamesetup, save, load, so sounds reasonable to include it by default.
settings.js same.
tooltips.js kind of same.
music.js definitely global.
l10n.js doesn't exist anymore because it only contained tooltips code, but I believe we should move the GUI only translate functions to this place to prevent globalscripts and simulation doing something they would regret deeply.

Perhaps it would make sense to split that to gui/common/ and gui/common_game/. Not fully convinced. I propose to do further splits and moves separately.

I agree with your proposal to rename pregame, possibly to mainmenu (the session has a mainmenu too, but shouldn't be an issue).

There was already one mod on the forums that would have benefited from this patch.
In general our GUI mod support is adding globals that can be modified in external files. So mods should be encouraged to add new files that inevitably have to be included, thus the patch is evidently useful for mods in general.

If there are GUI pages that mandate not having a JS file included, they did something wrong (those are usually intended to be two different GUI pages. For intsance prelobby and lobby, gamesetup and gamesetup_mp were previously in the same directory).

Thanks for your proofreading of the patch bb!

So future diffs:

  1. Split directories into exactly one directory per GUI page (load/save, locale)
  2. Move settings.js init to GUI page init
  3. Fix summary screen init order
  4. Possibly minimze includes by moving things from common/ to a subdirectory that contains slightly less common files.
  5. Possibly rename pregame and gamesetup_mp
binaries/data/mods/public/gui/lobby/lobby.xml
12

All these g_Settings comments actually have the same design issue that the code execution order should not rely on the file include order, like the summary screen.

The comments come from the introduction of settings.js (which was a preparation for the visual replay menu #3258. These setting strings were copied to each GUI page, so the replay menu shouldn't introduce yet more copies.

The offending line is const g_Settings = loadSettingsValues();. It could be considered a hack, because every other data loading is done on init or upload loading of the GUI page otherwise.

I can fix that independently by just moving that line to the GUI page.

binaries/data/mods/public/gui/savedgames/load.xml
6

This one bugs too in fact if we would include the entire directory.
This looks like a candidate for splitting into load + save dialog.

binaries/data/mods/public/gui/savedgames/save.xml
6

This file actually supports loading of the savedgame directory, but was, in this iteration of the patch, left out because the other GUI page in this directory left it out as well.

binaries/data/mods/public/gui/summary/summary.xml
6–10

All are included, but the summary page decided it was a good idea to have the code execution order depend on the file inclusion order. This happens when trying to replace the file includes with a directory include.

ERROR: JavaScript error: gui/summary/layout.js line 215
ReferenceError: g_SummaryTypes is not defined
  getColoredTypeTranslation@gui/summary/layout.js:215:2
  @gui/summary/layout.js:37:22
  showReplaySummary@gui/replaymenu/replay_actions.js:124:1
  __eventhandler112 (press)@summaryButton press:0:1
TIMER| summary/summary.xml: 116.765 ms
ERROR: JavaScript error: gui/summary/summary.js line 146
TypeError: g_ScorePanelsData is undefined
  selectPanel@gui/summary/summary.js:146:37
  init@gui/summary/summary.js:488:2
  showReplaySummary@gui/replaymenu/replay_actions.js:124:1
  __eventhandler112 (press)@summaryButton press:0:1
ERROR: GUI page 'page_summary.xml': Failed to call init() function
This revision was automatically updated to reflect the committed changes.

It was mentioned in this forum thread:
https://wildfiregames.com/forum/index.php?/topic/22638-hyrule-conquest/&page=20&tab=comments#comment-340516

iirc leper mentioned it in some other thread in chronological proximity as well, but I couldn't find it quickly.

ffffffff added a subscriber: ffffffff.

ty!

moremoremoremore