Ticket #3501: 3501-3.patch
File 3501-3.patch, 3.4 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 }); … … 652 653 653 654 function formatDefeatMessage(msg) 654 655 { 656 let defeatMsg; 657 655 658 // In singleplayer, the local player is "You". "You has" is incorrect. 656 659 if (!g_IsNetworked && msg.player == Engine.GetPlayerID()) 657 return translate("You have been defeated."); 660 defeatMsg = "%(player)s have been defeated."; 661 else 662 defeatMsg = "%(player)s has been defeated."; 658 663 659 return sprintf(translate( "%(player)s has been defeated."), {664 return sprintf(translate(defeatMsg), { 660 665 "player": colorizePlayernameByID(msg.player) 661 666 }); 662 667 } 663 668 669 function formatResignMessage(msg) 670 { 671 let resignMsg; 672 673 // In singleplayer, the local player is "You". "You has" is incorrect. 674 if (!g_IsNetworked && msg.player == Engine.GetPlayerID()) 675 resignMsg = "%(player)s have resigned"; 676 else 677 resignMsg = "%(player)s has resigned"; 678 679 return sprintf(translate(resignMsg), { 680 "player": colorizePlayernameByID(msg.player) 681 }); 682 } 683 664 684 function formatDiplomacyMessage(msg) 665 685 { 666 686 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)