Index: ps/trunk/binaries/data/mods/public/gui/session/diplomacy/playercontrols/DiplomacyPlayerText.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/diplomacy/playercontrols/DiplomacyPlayerText.js (revision 23096) +++ ps/trunk/binaries/data/mods/public/gui/session/diplomacy/playercontrols/DiplomacyPlayerText.js (revision 23097) @@ -1,84 +1,84 @@ /** * This class is concerned with updating the labels and icons in the diplomacy dialog that don't provide player interaction. */ DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText = class { constructor(playerID) { this.playerID = playerID; let id = "[" + (playerID - 1) + "]"; this.diplomacyPlayer = Engine.GetGUIObjectByName("diplomacyPlayer" + id); this.diplomacyPlayerCiv = Engine.GetGUIObjectByName("diplomacyPlayerCiv" + id); this.diplomacyPlayerName = Engine.GetGUIObjectByName("diplomacyPlayerName" + id); this.diplomacyPlayerTeam = Engine.GetGUIObjectByName("diplomacyPlayerTeam" + id); this.diplomacyPlayerTheirs = Engine.GetGUIObjectByName("diplomacyPlayerTheirs" + id); this.diplomacyPlayerOutcome = Engine.GetGUIObjectByName("diplomacyPlayerOutcome" + id); this.init(); } init() { // TODO: Atlas should pass this - if (!g_GameAttributes.settings) + if (Engine.IsAtlasRunning()) return; this.diplomacyPlayerCiv.caption = g_CivData[g_Players[this.playerID].civ].Name; this.diplomacyPlayerName.tooltip = translateAISettings(g_GameAttributes.settings.PlayerData[this.playerID]); // Apply offset let rowSize = DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.getRowHeight(); let size = this.diplomacyPlayer.size; size.top = rowSize * (this.playerID - 1); size.bottom = rowSize * this.playerID; this.diplomacyPlayer.size = size; this.diplomacyPlayer.hidden = false; } update() { setOutcomeIcon(g_Players[this.playerID].state, this.diplomacyPlayerOutcome); this.diplomacyPlayer.sprite = "color:" + g_DiplomacyColors.getPlayerColor(this.playerID, 32); this.diplomacyPlayerName.caption = colorizePlayernameByID(this.playerID); this.diplomacyPlayerTeam.caption = g_Players[this.playerID].team >= 0 ? g_Players[this.playerID].team + 1 : translateWithContext("team", this.NoTeam); this.diplomacyPlayerTheirs.caption = this.playerID == g_ViewedPlayer ? "" : g_Players[this.playerID].isAlly[g_ViewedPlayer] ? translate(this.Ally) : g_Players[this.playerID].isNeutral[g_ViewedPlayer] ? translate(this.Neutral) : translate(this.Enemy); } }; DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.getRowHeight = function() { let diplomacyPlayer = Engine.GetGUIObjectByName("diplomacyPlayer[0]").size; return diplomacyPlayer.bottom - diplomacyPlayer.top; }; DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.getHeightOffset = function() { return (g_Players.length - 1) * DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.getRowHeight(); }; DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.prototype.NoTeam = markForTranslationWithContext("team", "None"); DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.prototype.Ally = markForTranslation("Ally"); DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.prototype.Neutral = markForTranslation("Neutral"); DiplomacyDialogPlayerControl.prototype.DiplomacyPlayerText.prototype.Enemy = markForTranslation("Enemy"); Index: ps/trunk/binaries/data/mods/public/gui/session/objectives/ObjectivesDialog.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/objectives/ObjectivesDialog.js (revision 23096) +++ ps/trunk/binaries/data/mods/public/gui/session/objectives/ObjectivesDialog.js (revision 23097) @@ -1,59 +1,59 @@ class ObjectivesDialog { constructor(playerViewControl) { this.gameDescription = Engine.GetGUIObjectByName("gameDescription"); this.objectivesPlayerstate = Engine.GetGUIObjectByName("objectivesPlayerstate"); this.objectivesPanel = Engine.GetGUIObjectByName("objectivesPanel"); this.objectivesTitle = Engine.GetGUIObjectByName("objectivesTitle"); // TODO: atlas should support this - if (g_GameAttributes.settings) + if (!Engine.IsAtlasRunning()) Engine.GetGUIObjectByName("gameDescriptionText").caption = getGameDescription(); Engine.GetGUIObjectByName("closeObjectives").onPress = this.close.bind(this); registerPlayersInitHandler(this.rebuild.bind(this)); registerPlayersFinishedHandler(this.rebuild.bind(this)); playerViewControl.registerPlayerIDChangeHandler(this.rebuild.bind(this)); } open() { this.objectivesPanel.hidden = false; } close() { this.objectivesPanel.hidden = true; } isOpen() { return !this.objectivesPanel.hidden; } toggle() { let open = this.isOpen(); closeOpenDialogs(); if (!open) this.open(); } rebuild() { let player = g_Players[Engine.GetPlayerID()]; let playerState = player && player.state; let isActive = !playerState || playerState == "active"; this.objectivesPlayerstate.hidden = isActive; this.objectivesPlayerstate.caption = g_PlayerStateMessages[playerState] || ""; let size = this.gameDescription.size; size.top = (isActive ? this.objectivesTitle : this.objectivesPlayerstate).size.bottom; this.gameDescription.size = size; } }