Changeset 25116
- Timestamp:
- Mar 25, 2021, 7:58:47 AM (3 years ago)
- Location:
- ps/trunk/binaries/data
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/binaries/data/config/default.cfg
r25070 r25116 411 411 defaultformation = "special/formations/box" ; For walking orders, automatically put units into this formation if they don't have one already. 412 412 formationwalkonly = "true" ; Formations are disabled when giving gather/attack/... orders. 413 413 414 414 415 [gui.session.minimap] -
ps/trunk/binaries/data/mods/public/gui/common/tooltips.js
r24989 r25116 4 4 "body": { "font": "sans-13" }, 5 5 "comma": { "font": "sans-12" }, 6 "name SpecificBig": { "font": "sans-bold-16" },7 "name SpecificSmall": { "font": "sans-bold-12" },8 "name Generic": { "font": "sans-bold-16" }6 "nameBig": { "font": "sans-bold-16" }, 7 "nameSmall": { "font": "sans-bold-12" }, 8 "name": { "font": "sans-bold-16" } 9 9 }; 10 11 12 13 14 15 16 17 18 19 20 10 21 11 22 /** … … 1047 1058 return template.name.specific; 1048 1059 1049 return sprintf(translate("%(specificName)s (%(genericName)s)"), { 1050 "specificName": template.name.specific, 1051 "genericName": template.name.generic 1060 let primaryName = g_SpecificNamesPrimary ? template.name.specific : template.name.generic; 1061 let secondaryName; 1062 if (g_ShowSecondaryNames) 1063 secondaryName = g_SpecificNamesPrimary ? template.name.generic : template.name.specific; 1064 1065 if (secondaryName) 1066 return sprintf(translate("%(primaryName)s (%(secondaryName)s)"), { 1067 "primaryName": primaryName, 1068 "secondaryName": secondaryName 1069 }); 1070 return sprintf(translate("%(primaryName)s"), { 1071 "primaryName": primaryName 1052 1072 }); 1053 1073 … … 1057 1077 { 1058 1078 if (!template.name.specific) 1059 return setStringTags(template.name.generic, g_TooltipTextFormats.nameSpecificBig); 1079 return setStringTags(template.name.generic, g_TooltipTextFormats.namePrimaryBig); 1080 1081 let primaryName = g_SpecificNamesPrimary ? template.name.specific : template.name.generic; 1082 let secondaryName; 1083 if (g_ShowSecondaryNames) 1084 secondaryName = g_SpecificNamesPrimary ? template.name.generic : template.name.specific; 1085 1086 if (!secondaryName || primaryName == secondaryName) 1087 return sprintf(translate("%(primaryName)s"), { 1088 "primaryName": 1089 setStringTags(primaryName[0], g_TooltipTextFormats.namePrimaryBig) + 1090 setStringTags(primaryName.slice(1).toUpperCase(), g_TooltipTextFormats.namePrimarySmall) 1091 }); 1060 1092 1061 1093 // Translation: Example: "Epibátēs Athēnaîos [font="sans-bold-16"](Athenian Marine)[/font]" 1062 return sprintf(translate("%(specificName)s %(fontStart)s(%(genericName)s)%(fontEnd)s"), { 1063 "specificName": getEntitySpecificNameFormatted(template), 1064 "genericName": template.name.generic, 1065 "fontStart": '[font="' + g_TooltipTextFormats.nameGeneric.font + '"]', 1066 "fontEnd": '[/font]' 1067 }); 1068 } 1069 1070 function getEntitySpecificNameFormatted(template) 1071 { 1072 if (!template.name.specific) 1073 return setStringTags(template.name.generic, g_TooltipTextFormats.nameSpecificBig); 1074 1075 return setStringTags(template.name.specific[0], g_TooltipTextFormats.nameSpecificBig) + 1076 setStringTags(template.name.specific.slice(1).toUpperCase(), g_TooltipTextFormats.nameSpecificSmall); 1094 return sprintf(translate("%(primaryName)s (%(secondaryName)s)"), { 1095 "primaryName": 1096 setStringTags(primaryName[0], g_TooltipTextFormats.namePrimaryBig) + 1097 setStringTags(primaryName.slice(1).toUpperCase(), g_TooltipTextFormats.namePrimarySmall), 1098 "secondaryName": setStringTags(secondaryName, g_TooltipTextFormats.nameSecondary) 1099 }); 1100 } 1101 1102 function getEntityPrimaryNameFormatted(template) 1103 { 1104 let primaryName = g_SpecificNamesPrimary ? template.name.specific : template.name.generic; 1105 if (!primaryName) 1106 return setStringTags(g_SpecificNamesPrimary ? template.name.generic : template.name.specific, g_TooltipTextFormats.namePrimaryBig); 1107 1108 return setStringTags(primaryName[0], g_TooltipTextFormats.namePrimaryBig) + 1109 setStringTags(primaryName.slice(1).toUpperCase(), g_TooltipTextFormats.namePrimarySmall); 1077 1110 } 1078 1111 -
ps/trunk/binaries/data/mods/public/gui/options/options.json
r24703 r25116 82 82 "tooltip": "Display the time at which a chat message was posted.", 83 83 "config": "chat.timestamp" 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 84 112 } 85 113 ] -
ps/trunk/binaries/data/mods/public/gui/reference/catafalque/Emblem.js
r24726 r25116 22 22 this.EmblemImage.sprite = "stretched:" + civData.Emblem; 23 23 this.EmblemImage.tooltip = getAurasTooltip(template); 24 this.EmblemCaption.caption = getEntity SpecificNameFormatted(template);24 this.EmblemCaption.caption = getEntityNameFormatted(template); 25 25 this.Emblem.hidden = false; 26 26 return true; -
ps/trunk/binaries/data/mods/public/gui/reference/structree/Boxes/EntityBox.js
r23808 r25116 27 27 28 28 let caption = this.gui.children[0]; 29 caption.caption = translate(this.template.name.specific); 29 caption.caption = g_SpecificNamesPrimary ? 30 translate(this.template.name.specific) : 31 translate(this.template.name.generic); 30 32 31 33 let icon = this.gui.children[1]; -
ps/trunk/binaries/data/mods/public/gui/reference/structree/Sections/Trainer/TrainerSection.xml
r23808 r25116 14 14 <repeat count="6" var="t"> 15 15 <object type="image" style="StructBox" name="trainer[t]"> 16 <object type="text" style="StructName Specific" name="trainer[t]_name"/>16 <object type="text" style="StructName" name="trainer[t]_name"/> 17 17 <object type="button" style="StructIcon" name="trainer[t]_icon"/> 18 18 <object name="trainer[t]_productionRows"> -
ps/trunk/binaries/data/mods/public/gui/reference/structree/Sections/Tree/TreeSection.xml
r23808 r25116 19 19 <repeat count="40" var="s"> 20 20 <object type="image" style="StructBox" name="structure[s]"> 21 <object type="text" style="StructName Specific" name="structure[s]_name"/>21 <object type="text" style="StructName" name="structure[s]_name"/> 22 22 <object type="button" style="StructIcon" name="structure[s]_icon"/> 23 23 <object name="structure[s]_productionRows"> -
ps/trunk/binaries/data/mods/public/gui/reference/structree/styles.xml
r23808 r25116 5 5 /> 6 6 7 <style name="StructName Specific"7 <style name="StructName" 8 8 font="sans-12" 9 9 size="0 0 100% 20" -
ps/trunk/binaries/data/mods/public/gui/reference/viewer/viewer.js
r23991 r25116 1 1 /** 2 * Override style so we can get a bigger specificname.2 * Override style so we can get a bigger name. 3 3 */ 4 g_TooltipTextFormats.name SpecificBig.font = "sans-bold-20";5 g_TooltipTextFormats.name SpecificSmall.font = "sans-bold-16";6 g_TooltipTextFormats.name Generic.font = "sans-bold-16";4 g_TooltipTextFormats.nameBig.font = "sans-bold-20"; 5 g_TooltipTextFormats.nameSmall.font = "sans-bold-16"; 6 g_TooltipTextFormats.name.font = "sans-bold-16"; 7 7 8 8 /** -
ps/trunk/binaries/data/mods/public/gui/session/PanelEntity.js
r24327 r25116 32 32 let entityState = GetEntityState(entityID); 33 33 let template = GetTemplateData(entityState.template); 34 this.nameTooltip = setStringTags( template.name.specific, this.NameTags) + "\n";34 this.nameTooltip = setStringTags(ic, this.NameTags) + "\n"; 35 35 36 36 Engine.GetGUIObjectByName("panelEntityHealthSection[" + buttonID + "]").hidden = !entityState.hitpoints; -
ps/trunk/binaries/data/mods/public/gui/session/selection_details.js
r25110 r25116 52 52 function displaySingle(entState) 53 53 { 54 // Get general unit and player data55 54 let template = GetTemplateData(entState.template); 56 let specificName = template.name.specific; 57 let genericName = template.name.generic; 58 // If packed, add that to the generic name (reduces template clutter) 59 if (genericName && template.pack && template.pack.state == "packed") 60 genericName = sprintf(translate("%(genericName)s — Packed"), { "genericName": genericName }); 55 56 let primaryName = g_SpecificNamesPrimary ? template.name.specific : template.name.generic; 57 let secondaryName; 58 if (g_ShowSecondaryNames) 59 secondaryName = g_SpecificNamesPrimary ? template.name.generic : template.name.specific; 60 61 // If packed, add that to the generic name (reduces template clutter). 62 if (template.pack && template.pack.state == "packed") 63 { 64 if (secondaryName && g_ShowSecondaryNames) 65 secondaryName = sprintf(translate("%(secondaryName)s — Packed"), { "secondaryName": secondaryName }); 66 else 67 secondaryName = sprintf(translate("Packed")); 68 } 61 69 let playerState = g_Players[entState.player]; 62 70 … … 289 297 } 290 298 291 Engine.GetGUIObjectByName("specific").caption = specificName;292 299 Engine.GetGUIObjectByName("player").caption = playerName; 293 300 … … 295 302 "color:" + g_DiplomacyColors.getPlayerColor(entState.player, 128); 296 303 297 Engine.GetGUIObjectByName("generic").caption = genericName == specificName ? "" : 298 sprintf(translate("(%(genericName)s)"), { 299 "genericName": genericName 304 Engine.GetGUIObjectByName("primary").caption = primaryName; 305 Engine.GetGUIObjectByName("secondary").caption = !secondaryName || primaryName == secondaryName ? "" : 306 sprintf(translate("(%(secondaryName)s)"), { 307 "secondaryName": secondaryName 300 308 }); 301 309 … … 333 341 let iconTooltips = []; 334 342 335 if (genericName) 336 iconTooltips.push("[font=\"sans-bold-16\"]" + genericName + "[/font]"); 337 343 iconTooltips.push(setStringTags(primaryName, g_TooltipTextFormats.namePrimaryBig)); 338 344 iconTooltips = iconTooltips.concat([ 339 345 getVisibleEntityClassesFormatted, -
ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js
r25110 r25116 1066 1066 if (!upgradingEntStates.length && upgradableEntStates.length) 1067 1067 { 1068 1069 1070 1071 1072 1068 1073 let tooltips = []; 1069 if (data.item.tooltip) 1070 tooltips.push(sprintf(translate("Upgrade to %(name)s. %(tooltip)s"), { 1071 "name": template.name.generic, 1072 "tooltip": translate(data.item.tooltip) 1073 })); 1074 if (g_ShowSecondaryNames) 1075 { 1076 if (data.item.tooltip) 1077 tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s (%(secondaryName)s). %(tooltip)s"), { 1078 "primaryName": primaryName, 1079 "secondaryName": secondaryName, 1080 "tooltip": translate(data.item.tooltip) 1081 })); 1082 else 1083 tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s (%(secondaryName)s)."), { 1084 "primaryName": primaryName, 1085 "secondaryName": secondaryName 1086 })); 1087 } 1074 1088 else 1075 tooltips.push(sprintf(translate("Upgrade to %(name)s."), { 1076 "name": template.name.generic 1077 })); 1089 { 1090 if (data.item.tooltip) 1091 tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s. %(tooltip)s"), { 1092 "primaryName": primaryName, 1093 "tooltip": translate(data.item.tooltip) 1094 })); 1095 else 1096 tooltips.push(sprintf(translate("Upgrade to a %(primaryName)s."), { 1097 "primaryName": primaryName 1098 })); 1099 } 1078 1100 1079 1101 tooltips.push( -
ps/trunk/binaries/data/mods/public/gui/session/selection_panels_middle/single_details_area.xml
r24028 r25116 98 98 <object size="0 92 100% 100%" name="statsArea" type="image" sprite="edgedPanelShader"> 99 99 100 <!-- Specific and genericnames. -->100 <!-- names. --> 101 101 <object z="30"> 102 <object size="0 2 100% 22" name=" specific" ghost="true" type="text" style="SpecificNameCentered"/>103 <object size="0 17 100% 37" name=" generic" ghost="true" type="text" style="GenericNameCentered"/>102 <object size="0 2 100% 22" name="NameCentered"/> 103 <object size="0 17 100% 37" name="NameCentered"/> 104 104 </object> 105 105 -
ps/trunk/binaries/data/mods/public/gui/session/session.js
r25083 r25116 304 304 305 305 initBatchTrain(); 306 306 307 initSelectionPanels(); 307 308 LoadModificationTemplates(); … … 778 779 779 780 /** 781 782 783 784 785 786 787 788 789 780 790 * Inverts the given configuration boolean and returns the current state. 781 791 * For example "silhouettes". -
ps/trunk/binaries/data/mods/public/gui/session/styles.xml
r24565 r25116 157 157 /> 158 158 159 <style name=" SpecificNameCentered"159 <style name="NameCentered" 160 160 font="sans-bold-stroke-13" 161 161 textcolor="gold" … … 165 165 /> 166 166 167 <style name=" GenericNameCentered"167 <style name="NameCentered" 168 168 font="sans-stroke-12" 169 169 textcolor="white"
Note:
See TracChangeset
for help on using the changeset viewer.