Ticket #2898: userNotify.3.patch
File userNotify.3.patch, 6.6 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 (g_LastNickNotification == -1 || timeNow > g_LastNickNotification + 3000) 318 Engine.PlayUISound("audio/interface/select/resource/sel_metal_01.ogg", false); 319 320 g_LastNickNotification = 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
203 203 var g_ChatMessages = []; 204 204 205 205 /** 206 * Used by notifyUser() to limit the number of pings 207 */ 208 var g_LastNickNotification = -1; 209 210 /** 206 211 * Cache containing the mapsettings for scenario/skirmish maps. Just-in-time loading. 207 212 */ 208 213 var g_MapData = {}; … … 1804 1809 1805 1810 function addChatMessage(msg) 1806 1811 { 1812 if (msg.text) 1813 { 1814 let userName = g_PlayerAssignments[Engine.GetPlayerGUID() || "local"].name; 1815 1816 if (userName != g_PlayerAssignments[msg.guid].name) 1817 notifyUser(userName, msg.text); 1818 } 1819 1807 1820 if (!g_FormatChatMessage[msg.type]) 1808 1821 return; 1809 1822 -
binaries/data/mods/public/gui/lobby/lobby.js
97 97 var g_SpamMonitor = {}; 98 98 99 99 /** 100 * Used by notifyUser() to limit the number of pings 101 */ 102 var g_LastNickNotification = -1; 103 104 /** 100 105 * Used to restore the selection after updating the playerlist. 101 106 */ 102 107 var g_SelectedPlayer = ""; … … 821 826 822 827 // Highlight local user's nick 823 828 if (g_Username != msg.from) 829 { 824 830 msg.text = msg.text.replace(g_Username, colorPlayerName(g_Username)); 831 notifyUser(g_Username, msg.text); 832 } 825 833 826 834 // Run spam test if it's not a historical message 827 835 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
25 25 var g_ChatTimers = []; 26 26 27 27 /** 28 * Used by notifyUser() to limit the number of pings 29 */ 30 var g_LastNickNotification = -1; 31 32 /** 28 33 * Handle all netmessage types that can occur. 29 34 */ 30 35 var g_NetMessageTypes = { … … 826 831 // Translate or escape text 827 832 if (!msg.text) 828 833 return ""; 834 829 835 if (msg.translate) 830 836 { 831 837 msg.text = translate(msg.text); … … 837 843 } 838 844 } 839 845 else 846 { 840 847 msg.text = escapeText(msg.text); 841 848 849 let userName = g_PlayerAssignments[Engine.GetPlayerGUID() || "local"].name; 850 851 if (userName != g_PlayerAssignments[msg.guid].name) 852 notifyUser(userName, msg.text); 853 } 854 842 855 // GUID for players, playerID for AIs 843 856 let coloredUsername = msg.guid != -1 ? colorizePlayernameByGUID(msg.guid) : colorizePlayernameByID(msg.player); 844 857