Ticket #3512: t3512_phaseNotif_WIP_v0.3.patch
File t3512_phaseNotif_WIP_v0.3.patch, 6.3 KB (added by , 8 years ago) |
---|
-
binaries/data/config/default.cfg
54 54 display = 0 55 55 56 56 ; Emulate right-click with Ctrl+Click on Mac mice 57 57 macmouse = false 58 58 59 ; Gameplay Settings 60 61 ; if true, receive automatic notifications from allies about their progress (currently only phasing notifications) 62 teamNotification = true 63 59 64 ; System settings: 60 65 61 66 ; if false, actors won't be rendered but anything entity will be. 62 67 renderactors = true 63 68 -
binaries/data/mods/public/gui/options/options.json
200 200 "label": "UI Gain", 201 201 "tooltip": "UI sound gain", 202 202 "parameters": { "config": "sound.uigain", "function": "SetUIGain", "min": "0" } 203 203 } 204 204 ], 205 "gameplaySetting": 206 [ 207 { 208 "type": "boolean", 209 "label": "Team Notifications", 210 "tooltip": "Receive automatically created messages from your allies about their progress (currently: only when they are phasing up)", 211 "parameters": { "config": "teamNotification" } 212 } 213 ], 205 214 "lobbySetting": 206 215 [ 207 216 { 208 217 "type": "number", 209 218 "label": "Chat Backlog", -
binaries/data/mods/public/gui/options/options.xml
41 41 <object name="graphicsSettingInput[n]" size="70% 0 100%-8 100%" type="input" style="ModernInput" hidden="true"/> 42 42 <object name="graphicsSettingDropdown[n]" size="70% 0 100%-8 100%" type="dropdown" style="ModernDropDown" hidden="true"/> 43 43 </object> 44 44 </repeat> 45 45 </object> 46 <object name="SoundSettings" type="image" sprite="ModernDarkBoxGold" size="620 16 916 50%-4">46 <object name="SoundSettings" type="image" sprite="ModernDarkBoxGold" size="620 16 916 40%-4"> 47 47 <object style="ModernLabelText" type="text" size="0 5 100% 25"> 48 48 <translatableAttribute id="caption">Sound Settings</translatableAttribute> 49 49 </object> 50 50 <repeat count="10"> 51 51 <object name="soundSetting[n]" size="0 25 100% 50" hidden="true"> … … 54 54 <object name="soundSettingInput[n]" size="70% 0 100%-8 100%" type="input" style="ModernInput" hidden="true"/> 55 55 <object name="soundSettingDropdown[n]" size="70% 0 100%-8 100%" type="dropdown" style="ModernDropDown" hidden="true"/> 56 56 </object> 57 57 </repeat> 58 58 </object> 59 <object name="LobbySettings" type="image" sprite="ModernDarkBoxGold" size="620 50%+4 916 100%-52"> 59 <object name="gameplaySetting" type="image" sprite="ModernDarkBoxGold" size="620 40%+4 916 70%-4"> 60 <object style="ModernLabelText" type="text" size="0 5 100% 25"> 61 <translatableAttribute id="caption">Gameplay Settings</translatableAttribute> 62 </object> 63 <repeat count="1"> 64 <object name="gameplaySetting[n]" size="0 25 100% 50" hidden="true"> 65 <object name="gameplaySettingLabel[n]" size="0 0 65% 100%" type="text" style="ModernLabelText" text_align="left"/> 66 <object name="gameplaySettingTickbox[n]" size="90% 5 100% 100%+5" type="checkbox" style="ModernTickBox" hidden="true"/> 67 <object name="gameplaySettingInput[n]" size="70% 0 100%-8 100%" type="input" style="ModernInput" hidden="true"/> 68 <object name="gameplaySettingDropdown[n]" size="70% 0 100%-8 100%" type="dropdown" style="ModernDropDown" hidden="true"/> 69 </object> 70 </repeat> 71 </object> 72 <object name="LobbySettings" type="image" sprite="ModernDarkBoxGold" size="620 70%+4 916 100%-52"> 60 73 <object style="ModernLabelText" type="text" size="0 5 100% 25"> 61 74 <translatableAttribute id="caption">Lobby Settings</translatableAttribute> 62 75 </object> 63 76 <repeat count="10"> 64 77 <object name="lobbySetting[n]" size="0 25 100% 50" hidden="true"> -
binaries/data/mods/public/gui/session/messages.js
181 181 } 182 182 } 183 183 184 184 addChatMessage(message); 185 185 }, 186 "AutoTeamMsg": function(notification, player) 187 { 188 // do not inform user of his own progress or if the option is not enabled 189 if (Engine.ConfigDB_GetValue("user", "teamNotification") != "true" )//|| notification.players == Engine.GetPlayerID()) 190 return; 191 192 let notification_message = ""; 193 if (notification.event == "advancing_phase_town") 194 notification_message = translate("I am advancing to the Town Phase."); 195 else if (notification.event == "advancing_phase_city") 196 mnotification_message = translate("I am advancing to the City Phase."); 197 // TODO: create messages for the events of phase reached, new civil center started, new market built, wonder 198 199 let message = { 200 "guid": findGuidForPlayerID(player) || -1, 201 "type": "message", 202 "text": "/allies " + notification_message, 203 "translate": true 204 }; 205 206 if (message.guid == -1) 207 message.player = player; 208 209 addChatMessage(message); 210 }, 186 211 "defeat": function(notification, player) 187 212 { 188 213 addChatMessage({ 189 214 "type": "defeat", 190 215 "guid": findGuidForPlayerID(player), -
binaries/data/mods/public/simulation/helpers/Commands.js
322 322 } 323 323 324 324 var queue = Engine.QueryInterface(cmd.entity, IID_ProductionQueue); 325 325 if (queue) 326 326 queue.AddBatch(cmd.template, "technology"); 327 328 // if the researched technology is phasing, send a notification to GUI 329 if (cmd.template == "phase_town" || cmd.template == "phase_city") 330 { 331 var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 332 cmpGuiInterface.PushNotification({ 333 "type": "AutoTeamMsg", 334 "players": [player], 335 "event": "advancing_" + cmd.template 336 }); 337 } 327 338 }, 328 339 329 340 "stop-production": function(player, cmd, data) 330 341 { 331 342 if (!CanControlUnit(cmd.entity, player, data.controlAllUnits))