Ticket #3176: add_template_name_into_attack_notificaiton_r16544.diff
File add_template_name_into_attack_notificaiton_r16544.diff, 2.0 KB (added by , 9 years ago) |
---|
-
binaries/data/mods/public/gui/session/messages.js
119 119 addChatMessage({ 120 120 "type": "attack", 121 121 "player": player, 122 "attacker": notification.attacker 122 "attacker": notification.attacker, 123 "target": notification.target 123 124 }); 124 125 }, 125 126 "dialog": function(notification, player) … … 509 510 return; 510 511 511 512 [username, playerColor] = getUsernameAndColor(msg.attacker); 512 formatted = sprintf(translate("You have been attacked by %(attacker)s!"), { attacker: "[color=\"" + playerColor + "\"]" + username + "[/color]" }); 513 var targetEntState = GetEntityState(msg.target); 514 var targetTemplate = GetTemplateData(targetEntState.template); 515 formatted = sprintf(translate("Your %(target)s have been attacked by %(attacker)s!"), { 516 target: targetTemplate.name.specific, 517 attacker: "[color=\"" + playerColor + "\"]" + username + "[/color]" 518 }); 513 519 break; 514 520 case "message": 515 521 // May have been hidden by the 'team' command. -
binaries/data/mods/public/simulation/components/AttackDetection.js
78 78 this.AddSuppression(event); 79 79 Engine.PostMessage(this.entity, MT_AttackDetected, { "player": cmpPlayer.GetPlayerID(), "event": event }); 80 80 var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); 81 cmpGuiInterface.PushNotification({"type": "attack", "players": [cmpPlayer.GetPlayerID()], "attacker": cmpAttackerOwnership.GetOwner() });81 cmpGuiInterface.PushNotification({"type": "attack", "players": [cmpPlayer.GetPlayerID()], "attacker": cmpAttackerOwnership.GetOwner(), "target": target }); 82 82 PlaySound("attacked", target); 83 83 }; 84 84