Ticket #3501: 3501-4.patch
File 3501-4.patch, 5.0 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/credits/texts/programming.json
51 51 {"nick": "Dave", "name": "David Protasowski"}, 52 52 {"nick": "dax", "name": "Dacian Fiordean"}, 53 53 {"nick": "deebee", "name": "Deepak Anthony"}, 54 54 {"nick": "Deiz"}, 55 55 {"nick": "Dietger", "name": "Dietger van Antwerpen"}, 56 {"nick": "dpiquet", "name": "Damien Piquet"}, 56 57 {"nick": "dumbo"}, 57 58 {"nick": "dvangennip", "name": "Doménique"}, 58 59 {"nick": "Echelon9", "name": "Rhys Kidd"}, 59 60 {"nick": "eihrul", "name": "Lee Salzman"}, 60 61 {"nick": "elexis", "name": "Alexander Heinsius"}, -
binaries/data/mods/public/gui/session/messages.js
var g_FormatChatMessage = { 46 46 "disconnect": msg => sprintf(translate("%(player)s has left the game."), { "player": colorizePlayernameByGUID(msg.guid) }), 47 47 "rejoined": msg => sprintf(translate("%(player)s has rejoined the game."), { "player": colorizePlayernameByGUID(msg.guid) }), 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) 54 55 }; 55 56 … … var g_NotificationsTypes = 184 185 addChatMessage(message); 185 186 }, 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 }); 193 194 194 195 updateDiplomacy(); … … function colorizePlayernameHelper(userna 652 653 653 654 function formatDefeatMessage(msg) 654 655 { 655 656 // In singleplayer, the local player is "You". "You has" is incorrect. 656 657 if (!g_IsNetworked && msg.player == Engine.GetPlayerID()) 657 return translate("You have been defeated."); 658 return sprintf(translate("%(You)s have been defeated."), { 659 "You": colorizePlayernameByID(msg.player) 660 }); 658 661 659 662 return sprintf(translate("%(player)s has been defeated."), { 660 663 "player": colorizePlayernameByID(msg.player) 661 664 }); 662 665 } 663 666 667 function formatResignMessage(msg) 668 { 669 // In singleplayer, the local player is "You". "You has" is incorrect. 670 if (!g_IsNetworked && msg.player == Engine.GetPlayerID()) 671 return sprintf(translate("%(You)s have resigned."), { 672 "You": colorizePlayernameByID(msg.player) 673 }); 674 675 return sprintf(translate("%(player)s has resigned."), { 676 "player": colorizePlayernameByID(msg.player) 677 }); 678 } 679 664 680 function formatDiplomacyMessage(msg) 665 681 { 666 682 let messageType; 667 683 668 684 if (g_IsObserver) -
binaries/data/mods/public/gui/session/session.js
function resignGame(leaveGameAfterResign 424 424 if (g_IsObserver || g_Disconnected) 425 425 return; 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(); 433 434 434 435 global.music.setState(global.music.states.DEFEAT); -
binaries/data/mods/public/simulation/components/Player.js
Player.prototype.OnPlayerDefeated = func 669 669 670 670 // Send a chat message notifying of the player's defeat. 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 678 679 Player.prototype.OnResearchFinished = function(msg) 679 680 { -
binaries/data/mods/public/simulation/helpers/Commands.js
var g_Commands = { 411 411 }, 412 412 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) 420 420 { 421 421 // Verify that the building can be controlled by the player or is mutualAlly