Ticket #3501: 3501.patch
File 3501.patch, 2.9 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/session/messages.js
48 48 "clientlist": msg => getUsernameList(), 49 49 "message": msg => formatChatCommand(msg), 50 50 "defeat": msg => formatDefeatMessage(msg), 51 "resign": msg => formatResignMessage(msg), 51 52 "diplomacy": msg => formatDiplomacyMessage(msg), 52 53 "tribute": msg => formatTributeMessage(msg), 53 54 "attack": msg => formatAttackMessage(msg) … … 186 187 "defeat": function(notification, player) 187 188 { 188 189 addChatMessage({ 189 "type": "defeat",190 "type": !!notification.resign ? "resign" : "defeat", 190 191 "guid": findGuidForPlayerID(player), 191 192 "player": player 192 193 }); … … 661 662 }); 662 663 } 663 664 665 function formatResignMessage(msg) 666 { 667 // In singleplayer, the local player is "You". "You has" is incorrect. 668 if (!g_IsNetworked && msg.player == Engine.GetPlayerID()) 669 return translate("You have resigned."); 670 671 return sprintf(translate("%(player)s has resigned."), { 672 "player": colorizePlayernameByID(msg.player) 673 }); 674 } 675 664 676 function formatDiplomacyMessage(msg) 665 677 { 666 678 let messageType; -
binaries/data/mods/public/gui/session/session.js
426 426 427 427 Engine.PostNetworkCommand({ 428 428 "type": "defeat-player", 429 "playerId": Engine.GetPlayerID() 429 "playerId": Engine.GetPlayerID(), 430 "resign": true 430 431 }); 431 432 432 433 updateTopPanel(); -
binaries/data/mods/public/simulation/components/Player.js
671 671 var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 672 672 cmpGUIInterface.PushNotification({ 673 673 "type": "defeat", 674 "players": [this.playerID] 674 "players": [this.playerID], 675 "resign": !!msg.resign 675 676 }); 676 677 }; 677 678 -
binaries/data/mods/public/simulation/helpers/Commands.js
413 413 "defeat-player": function(player, cmd, data) 414 414 { 415 415 // Send "OnPlayerDefeated" message to player 416 Engine.PostMessage(data.playerEnt, MT_PlayerDefeated, { "playerId": player });416 Engine.PostMessage(data.playerEnt, MT_PlayerDefeated, { "playerId": player, "resign": !!cmd.resign }); 417 417 }, 418 418 419 419 "garrison": function(player, cmd, data)