From 7532c4633c83daf1bd1b082f97b4ba72be6961c6 Mon Sep 17 00:00:00 2001 From: elexis Date: Thu, 2 Mar 2017 18:02:59 +0000 Subject: [PATCH] Add a GUI notification when the ceasefire ended so that devs and modders can do fancy things with that event and use it to fix an oversight in rP19257 (the diplomacy dialog wasn't updated). Differential Revision: https://code.wildfiregames.com/D181 Reviewed By: mimo git-svn-id: http://svn.wildfiregames.com/public/ps/trunk@19260 3db68df2-c116-0410-a063-a993310a9797 --- binaries/data/mods/public/gui/session/messages.js | 5 ++++- binaries/data/mods/public/simulation/components/CeasefireManager.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/binaries/data/mods/public/gui/session/messages.js b/binaries/data/mods/public/gui/session/messages.js index 541cdec220..df18c1ca53 100644 --- a/binaries/data/mods/public/gui/session/messages.js +++ b/binaries/data/mods/public/gui/session/messages.js @@ -330,7 +330,10 @@ var g_NotificationsTypes = "targetPlayer": notification.targetPlayer, "status": notification.status }); - + updatePlayerData(); + }, + "ceasefire-ended": function(notification, player) + { updatePlayerData(); }, "tribute": function(notification, player) diff --git a/binaries/data/mods/public/simulation/components/CeasefireManager.js b/binaries/data/mods/public/simulation/components/CeasefireManager.js index b67ce2b85a..fc974b4312 100644 --- a/binaries/data/mods/public/simulation/components/CeasefireManager.js +++ b/binaries/data/mods/public/simulation/components/CeasefireManager.js @@ -124,6 +124,11 @@ CeasefireManager.prototype.StopCeasefire = function() this.diplomacyBeforeCeasefire = []; Engine.PostMessage(SYSTEM_ENTITY, MT_CeasefireEnded); + + cmpGuiInterface.PushNotification({ + "type": "ceasefire-ended", + "players": [-1] // processed globally + }); }; Engine.RegisterSystemComponentType(IID_CeasefireManager, "CeasefireManager", CeasefireManager); -- 2.11.4.GIT