Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge 'remotes/trunk'
  • Loading branch information
KieranP committed Apr 24, 2017
2 parents b05f51f + 725ddd8 commit 5c9c600
Show file tree
Hide file tree
Showing 28 changed files with 471 additions and 336 deletions.
1 change: 1 addition & 0 deletions binaries/data/config/default.cfg
Expand Up @@ -345,6 +345,7 @@ pingduration = 50.0 ; The duration for which an entity will be pin
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
phase = 1 ; Show a chat notification if you or an ally have started, aborted or completed a new phase, and phases of all players in observer mode (0 = disable, 1 = completed phase only and 2 = display all)

[gui.splashscreen]
enable = true ; Enable/disable the splashscreen
Expand Down
21 changes: 0 additions & 21 deletions binaries/data/mods/public/art/actors/structures/hellenes/wall.xml

This file was deleted.

20 changes: 0 additions & 20 deletions binaries/data/mods/public/art/actors/structures/mauryans/wall.xml

This file was deleted.

20 changes: 0 additions & 20 deletions binaries/data/mods/public/art/actors/structures/persians/wall.xml

This file was deleted.

20 changes: 0 additions & 20 deletions binaries/data/mods/public/art/actors/structures/ptolemies/wall.xml

This file was deleted.

114 changes: 0 additions & 114 deletions binaries/data/mods/public/art/meshes/structural/pers_wall.dae

This file was deleted.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions binaries/data/mods/public/gui/options/options.json
Expand Up @@ -278,6 +278,12 @@
"label": "Barter",
"tooltip": "Show a chat notification to observers when a player bartered resources",
"parameters": { "config": "gui.session.notifications.barter" }
},
{
"type": "dropdown",
"label": "Phase",
"tooltip": "Show a chat notification if you or an ally have started, aborted or completed a new phase, and phases of all players in observer mode",
"parameters": { "config": "gui.session.notifications.phase", "list": [ "Disable", "Completed", "All displayed" ] }
}
]
}
2 changes: 1 addition & 1 deletion binaries/data/mods/public/gui/options/options.xml
Expand Up @@ -78,7 +78,7 @@
<object name="notificationSettingLabel[n]" size="0 0 65% 100%" type="text" style="ModernLabelText" text_align="left"/>
<object name="notificationSettingTickbox[n]" size="90% 5 100% 100%+5" type="checkbox" style="ModernTickBox" hidden="true"/>
<object name="notificationSettingInput[n]" size="70% 0 100%-8 100%" type="input" style="ModernInput" hidden="true"/>
<object name="notificationSettingDropdown[n]" size="70% 0 100%-8 100%" type="dropdown" style="ModernDropDown" hidden="true"/>
<object name="notificationSettingDropdown[n]" size="50% 0 100%-8 100%" type="dropdown" style="ModernDropDown" hidden="true"/>
</object>
</repeat>
</object>
Expand Down
35 changes: 34 additions & 1 deletion binaries/data/mods/public/gui/session/messages.js
Expand Up @@ -128,7 +128,8 @@ var g_FormatChatMessage = {
"diplomacy": msg => formatDiplomacyMessage(msg),
"tribute": msg => formatTributeMessage(msg),
"barter": msg => formatBarterMessage(msg),
"attack": msg => formatAttackMessage(msg)
"attack": msg => formatAttackMessage(msg),
"phase": msg => formatPhaseMessage(msg)
};

/**
Expand Down Expand Up @@ -394,6 +395,15 @@ var g_NotificationsTypes =
"targetIsDomesticAnimal": notification.targetIsDomesticAnimal
});
},
"phase": function(notification, player)
{
addChatMessage({
"type": "phase",
"player": player,
"phaseName": notification.phaseName,
"phaseState": notification.phaseState
});
},
"dialog": function(notification, player)
{
if (player == Engine.GetPlayerID())
Expand Down Expand Up @@ -950,6 +960,29 @@ function formatAttackMessage(msg)
});
}

function formatPhaseMessage(msg)
{
let notifyPhase = Engine.ConfigDB_GetValue("user", "gui.session.notifications.phase");
if (notifyPhase == 0 || msg.player != g_ViewedPlayer && !g_IsObserver && !g_Players[msg.player].isMutualAlly[g_ViewedPlayer])
return "";

let message = "";
if (notifyPhase == 2)
{
if (msg.phaseState == "started")
message = translate("%(player)s is advancing to the %(phaseName)s.");
else if (msg.phaseState == "aborted")
message = translate("The %(phaseName)s of %(player)s has been aborted.");
}
if (msg.phaseState == "completed")
message = translate("%(player)s has reached the %(phaseName)s.");

return sprintf(message, {
"player": colorizePlayernameByID(msg.player),
"phaseName": getEntityNames(GetTechnologyData(msg.phaseName, g_Players[msg.player].civ))
});
}

function formatChatCommand(msg)
{
if (!msg.text)
Expand Down

0 comments on commit 5c9c600

Please sign in to comment.