Index: ps/trunk/binaries/data/config/default.cfg
===================================================================
--- ps/trunk/binaries/data/config/default.cfg
+++ ps/trunk/binaries/data/config/default.cfg
@@ -329,7 +329,6 @@
limitfps = true ; Limit FPS in the menus and loading screen
[gui.session]
-attacknotificationmessage = true ; Show attack notification messages
camerajump.threshold = 40 ; How close do we have to be to the actual location in order to jump back to the previous one?
timeelapsedcounter = false ; Show the game duration in the top right corner
batchtrainingsize = 5 ; Number of units to be trained per batch (when pressing the hotkey)
@@ -338,6 +337,11 @@
blinkduration = 1.7 ; The blink duration while pinging
pingduration = 50.0 ; The duration for which an entity will be pinged after an attack notification
+[gui.session.notifications]
+attack = true ; Show a chat notification if you are attacked by another player
+tribute = true ; Show a chat notification if an ally tributes resources to another team member if teams are locked, and all tributes in observer mode
+barter = true ; Show a chat notification to observers when a player bartered resources
+
[gui.splashscreen]
enable = true ; Enable/disable the splashscreen
version = 0 ; Splashscreen version (date of last modification). By default, 0 to force splashscreen to appear at first launch
Index: ps/trunk/binaries/data/mods/public/gui/options/options.json
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/options/options.json
+++ ps/trunk/binaries/data/mods/public/gui/options/options.json
@@ -88,7 +88,7 @@
{
"type": "number",
"label": "Observer Limit",
- "tooltip": "Prevent further observer from joining if the limit is reached",
+ "tooltip": "Prevent further observers from joining if the limit is reached",
"parameters": { "config": "network.observerlimit", "min": 0, "max": 32 }
},
{
@@ -258,5 +258,26 @@
"tooltip": "Number of backlogged messages to load when joining the lobby",
"parameters": { "config": "lobby.history", "min": "0" }
}
+ ],
+ "notificationSetting":
+ [
+ {
+ "type": "boolean",
+ "label": "Attack",
+ "tooltip": "Show a chat notification if you are attacked by another player",
+ "parameters": { "config": "gui.session.notifications.attack" }
+ },
+ {
+ "type": "boolean",
+ "label": "Tribute",
+ "tooltip": "Show a chat notification if an ally tributes resources to another team member if teams are locked, and all tributes in observer mode",
+ "parameters": { "config": "gui.session.notifications.tribute" }
+ },
+ {
+ "type": "boolean",
+ "label": "Barter",
+ "tooltip": "Show a chat notification to observers when a player bartered resources",
+ "parameters": { "config": "gui.session.notifications.barter" }
+ }
]
}
Index: ps/trunk/binaries/data/mods/public/gui/options/options.xml
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/options/options.xml
+++ ps/trunk/binaries/data/mods/public/gui/options/options.xml
@@ -43,7 +43,7 @@
-
-
+ Lobby Settings
-
+
@@ -69,6 +69,19 @@
+
+
+ Chat Notification Settings
+
+
+
+
+
+
+
+
+
+ ResetResets user settings to their game default
Index: ps/trunk/binaries/data/mods/public/gui/session/messages.js
===================================================================
--- ps/trunk/binaries/data/mods/public/gui/session/messages.js
+++ ps/trunk/binaries/data/mods/public/gui/session/messages.js
@@ -368,7 +368,7 @@
g_Selection.addList([notification.target]);
}
- if (Engine.ConfigDB_GetValue("user", "gui.session.attacknotificationmessage") !== "true")
+ if (Engine.ConfigDB_GetValue("user", "gui.session.notifications.attack") !== "true")
return;
addChatMessage({
@@ -875,14 +875,22 @@
});
}
+/**
+ * Optionally show all tributes sent in observer mode and tributes sent between allied players.
+ * Otherwise, only show tributes sent directly to us, and tributes that we send.
+ */
function formatTributeMessage(msg)
{
- // Check observer first, since we also want to see if the selected player in the developer-overlay has sent tributes
let message = "";
- if (g_IsObserver)
- message = translate("%(player)s has sent %(player2)s %(amounts)s.");
- else if (msg.targetPlayer == Engine.GetPlayerID())
+ if (msg.targetPlayer == Engine.GetPlayerID())
message = translate("%(player)s has sent you %(amounts)s.");
+ else if (msg.sourcePlayer == Engine.GetPlayerID())
+ message = translate("You have sent %(player2)s %(amounts)s.")
+ else if (Engine.ConfigDB_GetValue("user", "gui.session.notifications.tribute") == "true" &&
+ (g_IsObserver || g_GameAttributes.settings.LockTeams &&
+ g_Players[msg.sourcePlayer].isMutualAlly[Engine.GetPlayerID()] &&
+ g_Players[msg.targetPlayer].isMutualAlly[Engine.GetPlayerID()]))
+ message = translate("%(player)s has sent %(player2)s %(amounts)s.");
return sprintf(message, {
"player": colorizePlayernameByID(msg.sourcePlayer),
@@ -893,7 +901,7 @@
function formatBarterMessage(msg)
{
- if (!g_IsObserver)
+ if (!g_IsObserver || Engine.ConfigDB_GetValue("user", "gui.session.notifications.barter") != "true")
return "";
let amountsSold = {};