Move summary screen and credits page Tab button styles to the Modern theme.

Expect that future tab pages reuse these themes.
Fix the selected tab button style of the credits page.
The last line of the former ForegroundBox overwrote the previous three
lines, which made the button appear with white text on light-golden
background.
Delete now empty theme files for the time being.

Differential Revision: https://code.wildfiregames.com/D786
Approach agreed with: Vladislav, bb

This was SVN commit r20002.
This commit is contained in:
elexis 2017-08-19 19:00:26 +00:00
parent 8df36bace4
commit f8d53d8f7b
11 changed files with 75 additions and 83 deletions

View file

@ -549,6 +549,58 @@
</sprite>
<!--
==========================================
- Horizontal Tabs -
==========================================
-->
<sprite name="ModernTabHorizontalForeground">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<!-- Left, Top, Right Edge -->
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="2 0 100%-2 2"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
</sprite>
<sprite name="ModernTabHorizontalBackground">
<image backcolor="50 35 0 120" size="0 0 100% 100%"/>
<!-- Left, Top, Right Edge -->
<image backcolor="gold" size="0 0 1 100%"/>
<image backcolor="gold" size="1 0 100%-1 1"/>
<image backcolor="gold" size="100%-1 0 100% 100%"/>
</sprite>
<sprite name="ModernTabHorizontalSpacer">
<image backcolor="gold" size="0 0 100% 100%"/>
</sprite>
<sprite name="ModernTabHorizontalFrame">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<!-- Left, Right, Bottom Edge -->
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
<image backcolor="gold" size="2 100%-2 100%-2 100%"/>
</sprite>
<!--
==========================================
- Vertical Tabs -
==========================================
-->
<sprite name="ModernTabVerticalBackground">
<image backcolor="50 35 0 120" size="0 0 100% 100%"/>
<!-- Left, Top, Right, Bottom Edge -->
<image backcolor="gold" size="0 0 1 100%"/>
<image backcolor="gold" size="1 0 100%-1 1"/>
<image backcolor="gold" size="100%-1 0 100% 100%"/>
<image backcolor="gold" size="0 100%-1 100% 100%"/>
</sprite>
<sprite name="ModernTabVerticalForeground">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<!-- Left, Top, Right, Bottom Edge -->
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="2 0 100%-2 2"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
<image backcolor="gold" size="2 100%-2 100%-2 100%"/>
</sprite>
<!--
==========================================
- Basic. -
==========================================
-->

View file

@ -166,4 +166,12 @@
text_valign="center"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernTabButtonHorizontal"
sprite="ModernTabHorizontalBackground"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
<style name="ModernTabButtonVertical"
sprite="ModernTabHorizontalBackground"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
</styles>

View file

@ -84,7 +84,7 @@ function parseHelper(list)
function selectPanel(i)
{
Engine.GetGUIObjectByName("creditsPanelButtons").children.forEach((button, j) => {
button.sprite = i == j ? "ForegroundBox" : "BackgroundBox";
button.sprite = i == j ? "ModernTabVerticalForeground" : "ModernTabVerticalBackground";
});
Engine.GetGUIObjectByName("creditsText").caption = g_PanelTexts[g_PanelNames[i]];

View file

@ -20,7 +20,7 @@
<object name="creditsPanelButtons" type="image" size="20 30 210 100%-54">
<repeat count="20">
<object name="creditsPanelButton[n]" type="button" sprite="BackgroundBox" sound_pressed="audio/interface/ui/ui_button_click.ogg" size="0 0 190 30" hidden="true">
<object name="creditsPanelButton[n]" type="button" style="ModernTabButtonVertical" size="0 0 190 30" hidden="true">
<object type="text" name="creditsPanelButtonText[n]" style="ModernLabelText" ghost="true">
</object>
</object>

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<sprites>
<sprite name="BackgroundBox">
<image backcolor="50 35 0 120" size="0 0 100% 100%"/>
<image backcolor="gold" size="0 0 1 100%"/>
<image backcolor="gold" size="1 0 100%-1 1"/>
<image backcolor="gold" size="100%-1 0 100% 100%"/>
<image backcolor="gold" size="0 100%-1 100% 100%"/>
</sprite>
<sprite name="ForegroundBox">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="2 100%-2 100%-2 100%"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
<image backcolor="gold" size="0 0 100% 100%"/>
</sprite>
</sprites>

View file

@ -6,6 +6,5 @@
<include>common/global.xml</include>
<include>credits/sprites.xml</include>
<include>credits/credits.xml</include>
</page>

View file

@ -6,7 +6,5 @@
<include>common/global.xml</include>
<include>summary/styles.xml</include>
<include>summary/summary.xml</include>
<include>summary/sprites.xml</include>
</page>

View file

@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<sprites>
<sprite name="TabSpacer">
<image backcolor="gold" size="0 0 100% 100%"/>
</sprite>
<sprite name="ForegroundTab">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="2 0 100%-2 2"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
</sprite>
<sprite name="BackgroundTab">
<image backcolor="50 35 0 120" size="0 0 100% 100%"/>
<image backcolor="gold" size="0 0 1 100%"/>
<image backcolor="gold" size="1 0 100%-1 1"/>
<image backcolor="gold" size="100%-1 0 100% 100%"/>
</sprite>
<sprite name="ForegroundBody">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="2 100%-2 100%-2 100%"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
</sprite>
<sprite name="ForegroundBox">
<image backcolor="255 255 255 40" size="0 0 100% 100%"/>
<image backcolor="gold" size="0 0 2 100%"/>
<image backcolor="gold" size="2 100%-2 100%-2 100%"/>
<image backcolor="gold" size="100%-2 0 100% 100%"/>
<image backcolor="gold" size="0 0 100% 100%"/>
</sprite>
</sprites>

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<styles>
<style name="TabButton"
sound_pressed="audio/interface/ui/ui_button_click.ogg"
/>
</styles>

View file

@ -121,9 +121,9 @@ function selectPanel(panel)
for (let button of Engine.GetGUIObjectByName("summaryWindow").children)
if (button.name.endsWith("PanelButton"))
button.sprite = "BackgroundTab";
button.sprite = "ModernTabHorizontalBackground";
panel.sprite = "ForegroundTab";
panel.sprite = "ModernTabHorizontalForeground";
adjustTabDividers(panel.size);

View file

@ -55,59 +55,59 @@
</object>
<object name="tabDividerLeft" type="image" sprite="TabSpacer" size="172 120 174 122"/>
<object name="tabDividerRight" type="image" sprite="TabSpacer" size="328 120 330 122"/>
<object name="tabDividerLeft" type="image" sprite="ModernTabHorizontalSpacer" size="172 120 174 122"/>
<object name="tabDividerRight" type="image" sprite="ModernTabHorizontalSpacer" size="328 120 330 122"/>
<object name="scorePanelButton" type="button" sprite="ForegroundTab" style="TabButton" size="20 92 136 120">
<object name="scorePanelButton" type="button" style="ModernTabButtonHorizontal" size="20 92 136 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Score</translatableAttribute>
</object>
</object>
<object name="buildingsPanelButton" type="button" sprite="BackgroundTab" style="TabButton" size="142 92 260 120">
<object name="buildingsPanelButton" type="button" style="ModernTabButtonHorizontal" size="142 92 260 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Buildings</translatableAttribute>
</object>
</object>
<object name="unitsPanelButton" type="button" sprite="BackgroundTab" style="TabButton" size="266 92 384 120">
<object name="unitsPanelButton" type="button" style="ModernTabButtonHorizontal" size="266 92 384 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Units</translatableAttribute>
</object>
</object>
<object name="resourcesPanelButton" type="button" sprite="BackgroundTab" style="TabButton" size="390 92 508 120">
<object name="resourcesPanelButton" type="button" style="ModernTabButtonHorizontal" size="390 92 508 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Resources</translatableAttribute>
</object>
</object>
<object name="marketPanelButton" type="button" sprite="BackgroundTab" style="TabButton" size="514 92 632 120">
<object name="marketPanelButton" type="button" style="ModernTabButtonHorizontal" size="514 92 632 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Market</translatableAttribute>
</object>
</object>
<object name="miscPanelButton" type="button" sprite="BackgroundTab" style="TabButton" size="638 92 756 120">
<object name="miscPanelButton" type="button" style="ModernTabButtonHorizontal" size="638 92 756 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Miscellaneous</translatableAttribute>
</object>
</object>
<object name="chartsPanelButton" type="button" sprite="BackgroundTab" style="TabButton" size="762 92 880 120">
<object name="chartsPanelButton" type="button" style="ModernTabButtonHorizontal" size="762 92 880 120">
<action on="Press">selectPanel(this);</action>
<object type="text" style="ModernLabelText" ghost="true">
<translatableAttribute id="caption">Charts</translatableAttribute>
</object>
</object>
<object name="generalPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-54">
<object name="generalPanel" type="image" sprite="ModernTabHorizontalFrame" size="20 120 100%-20 100%-54">
<object size="0 0 100% 100%-50">
<object name="playerNameHeading" type="text" style="ModernLeftTopLabelText">
<translatableAttribute id="caption">Player name</translatableAttribute>
@ -156,7 +156,7 @@
</object>
</object>
<object name="chartsPanel" type="image" sprite="ForegroundBody" size="20 120 100%-20 100%-54">
<object name="chartsPanel" type="image" sprite="ModernTabHorizontalFrame" size="20 120 100%-20 100%-54">
<repeat count="2" var="k">
<object name="chart[k]Part" size="15 0 50%-10 100%-35">
<object type="text" style="ModernLeftLabelText" size="1 6 145 26">