Changeset View
Standalone View
binaries/data/mods/public/gui/session/messages.js
Show First 20 Lines • Show All 870 Lines • ▼ Show 20 Lines | function formatDiplomacyMessage(msg) | ||||
return sprintf(g_DiplomacyMessages[messageType][msg.status], { | return sprintf(g_DiplomacyMessages[messageType][msg.status], { | ||||
"player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer), | "player": colorizePlayernameByID(messageType == "active" ? msg.targetPlayer : msg.sourcePlayer), | ||||
"player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer) | "player2": colorizePlayernameByID(messageType == "active" ? msg.sourcePlayer : msg.targetPlayer) | ||||
}); | }); | ||||
} | } | ||||
function formatTributeMessage(msg) | function formatTributeMessage(msg) | ||||
{ | { | ||||
elexis: Optionally show...
no comma before "and", also "and" rather on the end of the previous line… | |||||
// Check observer first, since we also want to see if the selected player in the developer-overlay has sent tributes | // Show tributes sent between our allies, or all tributes sent if we are an observer | ||||
let message = ""; | let message = ""; | ||||
if (g_IsObserver) | if (msg.targetPlayer == Engine.GetPlayerID()) | ||||
message = translate("%(player)s has sent %(player2)s %(amounts)s."); | |||||
else if (msg.targetPlayer == Engine.GetPlayerID()) | |||||
message = translate("%(player)s has sent you %(amounts)s."); | message = translate("%(player)s has sent you %(amounts)s."); | ||||
else if (g_IsObserver || Engine.ConfigDB_GetValue("user", "gui.session.tributenotificationmessage") == "true" && | |||||
g_GameAttributes.settings.LockTeams && | |||||
Not Done Inline Actionsmessage = elexis: message = | |||||
g_Players[msg.sourcePlayer].isMutualAlly[Engine.GetPlayerID()] && | |||||
g_Players[msg.targetPlayer].isMutualAlly[Engine.GetPlayerID()]) | |||||
Done Inline ActionsThis also shows a notification if we sent resources to an ally? (Probably expected indeed). elexis: This also shows a notification if we sent resources to an ally? (Probably expected indeed).
But… | |||||
Done Inline ActionsIt is unexpected that the message is shown if we send tributes to an ally but not if we send tributes to an enemy. elexis: It is unexpected that the message is shown if we send tributes to an ally but not if we send… | |||||
message = translate("%(player)s has sent %(player2)s %(amounts)s."); | |||||
Not Done Inline ActionsGreat, this is not only more consistent from the logical pov and corresponds to the players expectations but also much better to read now! elexis: Great, this is not only more consistent from the logical pov and corresponds to the players… | |||||
return sprintf(message, { | return sprintf(message, { | ||||
"player": colorizePlayernameByID(msg.sourcePlayer), | "player": colorizePlayernameByID(msg.sourcePlayer), | ||||
"player2": colorizePlayernameByID(msg.targetPlayer), | "player2": colorizePlayernameByID(msg.targetPlayer), | ||||
"amounts": getLocalizedResourceAmounts(msg.amounts) | "amounts": getLocalizedResourceAmounts(msg.amounts) | ||||
}); | }); | ||||
} | } | ||||
function formatBarterMessage(msg) | function formatBarterMessage(msg) | ||||
{ | { | ||||
if (!g_IsObserver) | if (!g_IsObserver || Engine.ConfigDB_GetValue("user", "gui.session.barternotificationmessage") != "true") | ||||
Done Inline Actions!g_IsObserver is more often the case than having the option disabled (which is enabled by default), so might want to switch those terms elexis: `!g_IsObserver` is more often the case than having the option disabled (which is enabled by… | |||||
return ""; | return ""; | ||||
let amountsSold = {}; | let amountsSold = {}; | ||||
amountsSold[msg.resourceSold] = msg.amountsSold; | amountsSold[msg.resourceSold] = msg.amountsSold; | ||||
let amountsBought = {}; | let amountsBought = {}; | ||||
amountsBought[msg.resourceBought] = msg.amountsBought; | amountsBought[msg.resourceBought] = msg.amountsBought; | ||||
▲ Show 20 Lines • Show All 215 Lines • Show Last 20 Lines |
Optionally show...
no comma before "and", also "and" rather on the end of the previous line (similar to commas)