Move tooltips on gamesetup dropdowns from xml to js, since by current gamestup design that is the way all tooltips are added.

While add it add some periods


Patch By: Polakrity
Differential Revision: https://code.wildfiregames.com/D594
This was SVN commit r22188.
This commit is contained in:
bb
2019-04-14 20:29:08 +00:00
parent 53bb9fa367
commit a2e522edcb
2 changed files with 10 additions and 13 deletions
@@ -724,6 +724,7 @@ var g_Dropdowns = {
*/
var g_PlayerDropdowns = {
"playerAssignment": {
"tooltip": (playerIdx) => translate("Select player."),
"labels": (playerIdx) => g_PlayerAssignmentList.Name || [],
"colors": (playerIdx) => g_PlayerAssignmentList.Color || [],
"ids": (playerIdx) => g_PlayerAssignmentList.Choice || [],
@@ -758,6 +759,7 @@ var g_PlayerDropdowns = {
"autocomplete": 100,
},
"playerTeam": {
"tooltip": (playerIdx) => translate("Select player's team."),
"labels": (playerIdx) => g_PlayerTeamList.label,
"ids": (playerIdx) => g_PlayerTeamList.id,
"default": (playerIdx) => 0,
@@ -769,7 +771,7 @@ var g_PlayerDropdowns = {
"enabled": () => g_GameAttributes.mapType != "scenario",
},
"playerCiv": {
"tooltip": (hoverIdx, playerIdx) => g_PlayerCivList.tooltip[hoverIdx] || translate("Choose the civilization for this player"),
"tooltip": (hoverIdx, playerIdx) => g_PlayerCivList.tooltip[hoverIdx] || translate("Choose the civilization for this player."),
"labels": (playerIdx) => g_PlayerCivList.name,
"colors": (playerIdx) => g_PlayerCivList.color,
"ids": (playerIdx) => g_PlayerCivList.code,
@@ -783,6 +785,7 @@ var g_PlayerDropdowns = {
"autocomplete": 90,
},
"playerColorPicker": {
"tooltip": (playerIdx) => translate("Pick a color."),
"labels": (playerIdx) => g_PlayerColorPickerList.map(color => "■"),
"colors": (playerIdx) => g_PlayerColorPickerList.map(color => rgbToGuiColor(color)),
"ids": (playerIdx) => g_PlayerColorPickerList.map((color, index) => index),
@@ -1027,7 +1030,7 @@ var g_MiscControls = {
!g_IsNetworked || Object.keys(g_PlayerAssignments).every(guid =>
g_PlayerAssignments[guid].status || g_PlayerAssignments[guid].player == -1) ?
translate("Start a new game with the current settings.") :
translate("Start a new game with the current settings (disabled until all players are ready)"),
translate("Start a new game with the current settings (disabled until all players are ready)."),
"enabled": () => !g_GameStarted && (
!g_IsController ||
Object.keys(g_PlayerAssignments).every(guid => g_PlayerAssignments[guid].status ||
@@ -79,7 +79,7 @@
sprite_over="iconResetWhite"
size="85%-16 0 85% 16"
>
<translatableAttribute id="tooltip">Reset any civilizations that have been selected to the default (random)</translatableAttribute>
<translatableAttribute id="tooltip">Reset any civilizations that have been selected to the default (random).</translatableAttribute>
<action on="Press">resetCivilizations();</action>
</object>
@@ -104,19 +104,13 @@
<object name="playerBox[n]" size="0 0 100% 32">
<object name="playerColor[n]" type="image" size="0 0 100% 100%"/>
<object name="playerName[n]" type="text" style="ModernLabelText" size="0 2 22% 30"/>
<object name="playerColorPicker[n]" type="dropdown" style="ModernDropDown" size="22%+5 2 22%+33 30" sprite="" scrollbar="false" button_width="22" font="sans-stroke-14" tooltip_style="onscreenToolTip">
<translatableAttribute id="tooltip">Pick a color.</translatableAttribute>
</object>
<object name="playerAssignment[n]" type="dropdown" style="ModernDropDown" size="22%+37 2 50%+35 30" tooltip_style="onscreenToolTip">
<translatableAttribute id="tooltip">Select player.</translatableAttribute>
</object>
<object name="playerColorPicker[n]" type="dropdown" style="ModernDropDown" size="22%+5 2 22%+33 30" sprite="" scrollbar="false" button_width="22" font="sans-stroke-14" tooltip_style="onscreenToolTip"/>
<object name="playerAssignment[n]" type="dropdown" style="ModernDropDown" size="22%+37 2 50%+35 30" tooltip_style="onscreenToolTip"/>
<object name="playerAssignmentText[n]" type="text" style="ModernLabelText" size="22%+5 0 50%+35 30"/>
<object name="playerConfig[n]" type="button" style="StoneButton" size="50%+40 4 50%+64 28" tooltip_style="onscreenToolTip" font="sans-bold-stroke-12" sprite="ModernGear" sprite_over="ModernGearHover" sprite_pressed="ModernGearPressed"/>
<object name="playerCiv[n]" type="dropdown" style="ModernDropDown" size="50%+69 2 85% 30" tooltip_style="onscreenToolTip" dropdown_size="424"/>
<object name="playerCivText[n]" type="text" style="ModernLabelText" size="50%+65 0 85% 30"/>
<object name="playerTeam[n]" type="dropdown" style="ModernDropDown" size="85%+5 2 100%-5 30" tooltip_style="onscreenToolTip">
<translatableAttribute id="tooltip">Select player's team.</translatableAttribute>
</object>
<object name="playerTeam[n]" type="dropdown" style="ModernDropDown" size="85%+5 2 100%-5 30" tooltip_style="onscreenToolTip"/>
<object name="playerTeamText[n]" type="text" style="ModernLabelText" size="85%+5 0 100%-5 100%"/>
</object>
</repeat>
@@ -128,7 +122,7 @@
<object size="4 10 28 34" type="image" sprite="ModernGear"/>
<object name="aiTips" size="32 0 100%-20 100%-32" type="text" style="ModernLeftLabelText"/>
<object size="30 100%-30 100% 100%-8" type="text" style="ModernLeftLabelText">
<translatableAttribute id="caption">Show this message in the future</translatableAttribute>
<translatableAttribute id="caption">Show this message in the future.</translatableAttribute>
</object>
<object name="displaySPTips" size="8 100%-30 28 100%-8" type="checkbox" style="ModernTickBox">
<action on="Press">saveSettingAndWriteToUserConfig("gui.gamesetup.enabletips", String(this.checked));</action>