HomeWildfire Games

Move the credits button on main menu

Description

Move the credits button on main menu

Patch By: Nescio
Comments By: Stan

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

Event Timeline

Nescio added a subscriber: Nescio.Tue, Jan 14, 4:40 PM

Thanks!
Any ideas on how to remove the unnecessary empty space between the logo and the “Learn To Play” button (red)?

Thanks!
Any ideas on how to remove the unnecessary empty space between the logo and the “Learn To Play” button (red)?

Why remove? Why not to center the logo there? Since we can stretch the place.

Removing the empty space above the buttons would make it look better at low resolution screens. This is how it currently looks on 1280×720:

elexis added a subscriber: elexis.Tue, Jan 14, 5:50 PM

Any ideas on how to remove the unnecessary empty space between the logo and the “Learn To Play” button (red)?

Index: binaries/data/mods/public/gui/pregame/menupanel.xml
===================================================================
--- binaries/data/mods/public/gui/pregame/menupanel.xml	(revision 23392)
+++ binaries/data/mods/public/gui/pregame/menupanel.xml	(working copy)
@@ -5,7 +5,7 @@
 
 	<object name="mainMenu" type="image" style="MainMenuPanel" size="60 -2 300 100%+2" z="50">
 
-		<object name="mainMenuButtons" size="8 156 100%-8 356">
+		<object name="mainMenuButtons" size="8 126 100%-8 326">
 			<repeat count="10">
 				<object name="mainMenuButton[n]" type="button" style="StoneButtonFancy" tooltip_style="pgToolTip"/>
 			</repeat>

Why remove? Why not to center the logo there? Since we can stretch the place.

That would implicitly remove that space as well if there isn't enough space.
And vertical centering would look better as well for larger resolutions I estimate.

I guess there is no vertical align option for GUI objects, but one should be able to code it with 5 lines:

let size = Engine.GetGUIObjectByName(mainMenuButtons).size;
size.top = logo.size.bottom
size.bottom = projectInformation.size.top;
Engine.GetGUIObjectByName(mainMenuButtons).size = size;

+ something like that +/- refactoring + consistent with the rest of the code

or this pattern (has the advantage of not hardcoding references to neighbors):

top = 50%-halfHeight
bottom = 50% + halfHeight
`

where 2 * halfHeight = buttons * buttonHeight

Stan added a subscriber: Stan.Tue, Jan 14, 5:54 PM

On a side note 720 < 768 minimum resolution.

On a side note 720 < 768 minimum resolution.

True, though 1280×720 is actually larger (and newer?) than 1024×768.