Ticket #3397: t3397_v2.patch

File t3397_v2.patch, 3.6 KB (added by Sergey Kushnirenko, 8 years ago)
Line 
1Index: binaries/data/config/default.cfg
2===================================================================
3--- binaries/data/config/default.cfg (revision 17717)
4+++ binaries/data/config/default.cfg (working copy)
5@@ -323,6 +323,7 @@
6 attacknotificationmessage = true ; Show attack notification messages
7 camerajump.threshold = 40 ; How close do we have to be to the actual location in order to jump back to the previous one?
8 timeelapsedcounter = false ; Show the game duration in the top right corner
9+objectstitle = 2 ;
10
11 [gui.session.minimap]
12 blinkduration = 1.7 ; The blink duration while pinging
13Index: binaries/data/mods/public/gui/common/functions_utility.js
14===================================================================
15--- binaries/data/mods/public/gui/common/functions_utility.js (revision 17717)
16+++ binaries/data/mods/public/gui/common/functions_utility.js (working copy)
17@@ -55,7 +55,70 @@
18 return 0;
19 }
20
21+function changeSpecificGenericNamesIfNeed(genericName,specificName)
22+{
23+ var titleType = Engine.ConfigDB_GetValue("user", "gui.session.objectstitle");
24+ if (titleType == "0")
25+ {
26+ specificName = genericName;
27+ }
28+ else if (titleType == "1")
29+ {
30+ genericName = specificName;
31+ }
32+
33+ return { "generic" : genericName, "specific" : specificName };
34+}
35+
36Index: binaries/data/mods/public/gui/common/tooltips.js
37===================================================================
38--- binaries/data/mods/public/gui/common/tooltips.js (revision 17717)
39+++ binaries/data/mods/public/gui/common/tooltips.js (working copy)
40@@ -506,9 +506,12 @@
41 function getEntityNamesFormatted(template)
42 {
43 let names = "";
44- let generic = template.name.generic;
45- let specific = template.name.specific;
46- if (specific)
47+
48+ var templates = changeSpecificGenericNamesIfNeed(template.name.generic,template.name.specific);
49+ let generic = templates.generic;
50+ let specific = templates.specific;
51+
52+ if (specific != generic)
53 {
54 // drop caps for specific name
55 names += '[font="sans-bold-16"]' + specific[0] + '[/font]' +
56Index: binaries/data/mods/public/gui/options/options.json
57===================================================================
58--- binaries/data/mods/public/gui/options/options.json (revision 17717)
59+++ binaries/data/mods/public/gui/options/options.json (working copy)
60@@ -54,6 +54,12 @@
61 "label": "Persist Match Settings",
62 "tooltip": "Save and restore match settings for quick reuse when hosting another game",
63 "parameters": { "config": "persistmatchsettings" }
64+ },
65+ {
66+ "type": "dropdown",
67+ "label": "Object title",
68+ "tooltip": "Object title",
69+ "parameters": { "list": [ "Generic", "Specific", "Both" ], "config": "gui.session.objectstitle" }
70 }
71 ],
72 "graphicsSetting":
73@@ -159,7 +165,6 @@
74 "label": "Graphics quality",
75 "tooltip": "Graphics quality. REQUIRES GAME RESTART",
76 "parameters": { "list": [ "Low", "Medium", "High" ], "config": "materialmgr.quality" }
77-
78 }
79 ],
80 "soundSetting":
81Index: binaries/data/mods/public/gui/session/selection_details.js
82===================================================================
83--- binaries/data/mods/public/gui/session/selection_details.js (revision 17717)
84+++ binaries/data/mods/public/gui/session/selection_details.js (working copy)
85@@ -232,6 +232,10 @@
86 }
87
88 // Set Player details
89+ var templates = changeSpecificGenericNamesIfNeed(genericName,specificName);
90+ genericName = templates.generic;
91+ specificName = templates.specific;
92+
93 Engine.GetGUIObjectByName("specific").caption = specificName;
94 Engine.GetGUIObjectByName("player").caption = playerName;
95 Engine.GetGUIObjectByName("playerColorBackground").sprite = "color: " + playerColor;