Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/messages.js
Context not available. | |||||
"diplomacy": msg => formatDiplomacyMessage(msg), | "diplomacy": msg => formatDiplomacyMessage(msg), | ||||
"tribute": msg => formatTributeMessage(msg), | "tribute": msg => formatTributeMessage(msg), | ||||
"barter": msg => formatBarterMessage(msg), | "barter": msg => formatBarterMessage(msg), | ||||
"attack": msg => formatAttackMessage(msg) | "attack": msg => formatAttackMessage(msg), | ||||
"phase": msg => formatPhaseMessage(msg) | |||||
}; | }; | ||||
/** | /** | ||||
Context not available. | |||||
"targetIsDomesticAnimal": notification.targetIsDomesticAnimal | "targetIsDomesticAnimal": notification.targetIsDomesticAnimal | ||||
}); | }); | ||||
}, | }, | ||||
"phase": function(notification, player) | |||||
{ | |||||
addChatMessage({ | |||||
"type": "phase", | |||||
"player": player, | |||||
"phaseName": notification.phaseName, | |||||
"phaseState": notification.phaseState | |||||
}); | |||||
}, | |||||
"dialog": function(notification, player) | "dialog": function(notification, player) | ||||
{ | { | ||||
if (player == Engine.GetPlayerID()) | if (player == Engine.GetPlayerID()) | ||||
Context not available. | |||||
}); | }); | ||||
} | } | ||||
function formatPhaseMessage(msg) | |||||
{ | |||||
let notifPhase = Engine.ConfigDB_GetValue("user", "gui.session.notifications.phase"); | |||||
elexis: notifPhase -> notifyPhase | |||||
if (notifPhase == "0" || (msg.player != g_ViewedPlayer && !g_IsObserver && !g_Players[msg.player].isMutualAlly[g_ViewedPlayer])) | |||||
elexisUnsubmitted Done Inline Actionsunneeded parenthesis, && binds stronger than ||, just like * and +, see JS operator precedence elexis: unneeded parenthesis, && binds stronger than ||, just like * and +, see JS operator precedence | |||||
return ""; | |||||
let message = ""; | |||||
if (msg.phaseState == "started" && notifPhase == "2") | |||||
message = translate("%(player)s is advancing to the %(phaseName)s."); | |||||
else if (msg.phaseState == "completed") | |||||
message = translate("%(player)s has reached the %(phaseName)s."); | |||||
Not Done Inline Actionscancelled -> canceled, as far as I can see, since we use american english, not british english elexis: cancelled -> canceled, as far as I can see, since we use american english, not british english | |||||
return sprintf(message, { | |||||
"player": colorizePlayernameByID(msg.player), | |||||
"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ)) | |||||
elexisUnsubmitted Done Inline ActionsReally nice that it displays Civ-specific phase name (Generic Name) elexis: Really nice that it displays Civ-specific phase name (Generic Name) | |||||
}); | |||||
} | |||||
function formatChatCommand(msg) | function formatChatCommand(msg) | ||||
{ | { | ||||
if (!msg.text) | if (!msg.text) | ||||
Context not available. |
Wildfire Games · Phabricator
notifPhase -> notifyPhase