Ticket #3501: 3501.diff
File 3501.diff, 3.0 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 }); … … 662 663 }); 663 664 } 664 665 666 function formatResignMessage(msg) 667 { 668 // In singleplayer, the local player is "You". "You has" is incorrect. 669 let message = !g_IsNetworked && msg.player == Engine.GetPlayerID() ? 670 translate("You have resigned.") : 671 translate("%(player)s has resigned."); 672 673 return sprintf(message, { 674 "player": colorizePlayernameByID(msg.player) 675 }); 676 } 677 665 678 function formatDiplomacyMessage(msg) 666 679 { 667 680 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.hasOwnProperty('resign') ? msg.resign : false 675 676 }); 676 677 }; 677 678 -
binaries/data/mods/public/simulation/helpers/Commands.js
412 412 413 413 "defeat-player": function(player, cmd, data) 414 414 { 415 let resigned = cmd.hasOwnProperty('resign') ? cmd.resign : false; 415 416 // Send "OnPlayerDefeated" message to player 416 Engine.PostMessage(data.playerEnt, MT_PlayerDefeated, { "playerId": player } );417 Engine.PostMessage(data.playerEnt, MT_PlayerDefeated, { "playerId": player, "resign": resigned } ); 417 418 }, 418 419 419 420 "garrison": function(player, cmd, data)