Ticket #2898: userNotify.5.patch
File userNotify.5.patch, 5.8 KB (added by , 8 years ago) |
---|
-
binaries/data/config/default.cfg
237 237 milonly = Alt ; Add only military units to selection 238 238 idleonly = "I" ; Select only idle units 239 239 remove = Ctrl ; Remove units from selection 240 cancel = Esc ; Un-select all units and cancel building placement 240 cancel = Esc ; Un-select all units and cancel building placement 241 241 idleworker = Period ; Select next idle worker 242 242 idlewarrior = ForwardSlash ; Select next idle warrior 243 243 offscreen = Alt ; Include offscreen units in selection … … 381 381 actiongain = 0.7 382 382 uigain = 0.7 383 383 384 [sound.notify] 385 nick = true 386 384 387 [tinygettext] 385 388 debug = false ; Print error messages each time a translation for an English string is not found. 386 389 -
binaries/data/mods/public/gui/common/functions_utility.js
173 173 { 174 174 if (word.toLowerCase().indexOf(lastWord.toLowerCase()) != 0) 175 175 continue; 176 176 177 177 text = wordSplit.join(" "); 178 178 if (text.length > 0) 179 179 text += " "; … … 302 302 }); 303 303 }).join("\n\n"); 304 304 } 305 306 /** 307 * Plays a sound if user's nick is mentioned in chat 308 */ 309 function notifyUser(userName, msgText) 310 { 311 if (Engine.ConfigDB_GetValue("user", "sound.notify.nick") != "true" || 312 msgText.toLowerCase().indexOf(userName.toLowerCase()) == -1) 313 return; 314 315 let timeNow = new Date().getTime(); 316 317 if (!notifyUser.lastPing || timeNow > notifyUser.lastPing + 3000) 318 Engine.PlayUISound("audio/interface/select/resource/sel_metal_01.ogg", false); 319 320 notifyUser.lastPing = timeNow; 321 } -
binaries/data/mods/public/gui/credits/texts/programming.json
24 24 {"nick": "Alan", "name": "Alan Kemp"}, 25 25 {"nick": "aBothe", "name": "Alexander Bothe"}, 26 26 {"nick": "alpha123", "name": "Peter P. Cannici"}, 27 {"nick": "andy5995", "name": "Andy Alt"}, 27 28 {"nick": "Aurium", "name": "Aurélio Heckert"}, 28 29 {"nick": "badmadblacksad", "name": "Martin F"}, 29 30 {"name": "Mikołaj \"Bajter\" Korcz"}, -
binaries/data/mods/public/gui/gamesetup/gamesetup.js
1804 1804 1805 1805 function addChatMessage(msg) 1806 1806 { 1807 if (msg.text) 1808 { 1809 let userName = g_PlayerAssignments[Engine.GetPlayerGUID() || "local"].name; 1810 1811 if (userName != g_PlayerAssignments[msg.guid].name) 1812 notifyUser(userName, msg.text); 1813 } 1814 1807 1815 if (!g_FormatChatMessage[msg.type]) 1808 1816 return; 1809 1817 -
binaries/data/mods/public/gui/lobby/lobby.js
821 821 822 822 // Highlight local user's nick 823 823 if (g_Username != msg.from) 824 { 824 825 msg.text = msg.text.replace(g_Username, colorPlayerName(g_Username)); 826 notifyUser(g_Username, msg.text); 827 } 825 828 826 829 // Run spam test if it's not a historical message 827 830 if (!msg.datetime) -
binaries/data/mods/public/gui/options/options.json
165 165 { 166 166 "type": "boolean", 167 167 "label": "Water Refraction", 168 "tooltip": "Use a real water refraction map and not transparency", 168 "tooltip": "Use a real water refraction map and not transparency", 169 169 "parameters": { "config": "waterrefraction", "renderer": "WaterRefraction" } 170 170 }, 171 171 { … … 236 236 [ 237 237 { 238 238 "type": "number", 239 "label": "Chat Backlog", 240 "tooltip": "Number of backlogged messages to load when joining the lobby", 239 "label": "Chat Backlog", 240 "tooltip": "Number of backlogged messages to load when joining the lobby", 241 241 "parameters": { "config": "lobby.history", "min": "0" } 242 242 }, 243 243 { 244 244 "type": "boolean", 245 245 "label": "Chat Timestamp", 246 "tooltip": "Show time that messages are posted in the lobby chat", 246 "tooltip": "Show time that messages are posted in the lobby chat", 247 247 "parameters": { "config": "lobby.chattimestamp" } 248 }, 249 { 250 "type": "boolean", 251 "label": "Nick Notification", 252 "tooltip": "Receive audio notification when someone types your nick", 253 "parameters": { "config": "sound.notify.nick" } 248 254 } 249 255 ] 250 256 } -
binaries/data/mods/public/gui/session/messages.js
826 826 // Translate or escape text 827 827 if (!msg.text) 828 828 return ""; 829 829 830 if (msg.translate) 830 831 { 831 832 msg.text = translate(msg.text); … … 837 838 } 838 839 } 839 840 else 841 { 840 842 msg.text = escapeText(msg.text); 841 843 844 let userName = g_PlayerAssignments[Engine.GetPlayerGUID() || "local"].name; 845 846 if (userName != g_PlayerAssignments[msg.guid].name) 847 notifyUser(userName, msg.text); 848 } 849 842 850 // GUID for players, playerID for AIs 843 851 let coloredUsername = msg.guid != -1 ? colorizePlayernameByGUID(msg.guid) : colorizePlayernameByID(msg.player); 844 852