Skip to content

Commit

Permalink
Antarctic Late Summer update (1.0.0.314)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurency committed Apr 3, 2019
1 parent efd507f commit f1ee755
Show file tree
Hide file tree
Showing 22 changed files with 215 additions and 189 deletions.
14 changes: 7 additions & 7 deletions Additions/CityPanelCulture.lua
Expand Up @@ -16,12 +16,6 @@ function OnRefresh()
return;
end

local playerID = Game.GetLocalPlayer();
local pPlayer = Players[playerID];
if (pPlayer == nil) then
return;
end

local pCity = UI.GetHeadSelectedCity();
if (pCity == nil) then
pCity = m_kEspionageViewManager:GetEspionageViewCity();
Expand All @@ -32,6 +26,12 @@ function OnRefresh()
m_kEspionageViewManager:ClearEspionageViewCity();
end

local playerID = pCity:GetOwner();
local pPlayer = Players[playerID];
if (pPlayer == nil) then
return;
end

if pPlayer == nil or pCity == nil then
return;
end
Expand Down Expand Up @@ -149,7 +149,7 @@ function OnRefresh()
totalLineInstance.LineValue:SetText(Locale.Lookup(pCulturalIdentity:GetLoyaltyPerTurnStatus()) .. " " .. Round(pCulturalIdentity:GetLoyaltyPerTurn(), 1));
Controls.IdentityBreakdownStack:CalculateSize();
Controls.BreakdownBox:SetSizeY(Controls.IdentityBreakdownStack:GetSizeY() + 15);
totalLineInstance.Top:SetColor(RGBAValuesToABGRHex(.3, .3, .3, .85));
totalLineInstance.Top:SetColor(UI.GetColorValue(.3, .3, .3, .85));
-- Identity Totals
if (loyaltyLevel < 3) then
Expand Down
2 changes: 1 addition & 1 deletion Additions/CityPanelCulture.xml
Expand Up @@ -41,7 +41,7 @@
<Stack Anchor="C,C" StackGrowth="Right" StackPadding="6">
<Stack StackPadding="2">
<Label Anchor="C,T" Style="FontNormal16" String="LOC_CULTURAL_IDENTITY_STATUS"/>
<Label ID="LoyaltyStatus" Anchor="C,T" Style="CityPanelText" WrapWidth="120"/>
<Label ID="LoyaltyStatus" Anchor="C,T" Align="Center" Style="CityPanelText" WrapWidth="115"/>
</Stack>
</Stack>
</Grid>
Expand Down
27 changes: 15 additions & 12 deletions Additions/EraCompletePopup.lua
Expand Up @@ -7,14 +7,14 @@
-- it will fire twice for a local player when starting at a later era.
-- ===========================================================================

include("PopupSupport");
include("PopupManager");


-- ===========================================================================
-- CONSTANTS
-- ===========================================================================
local debugTest:boolean = false; -- (false) when true run test on hotload
local RELOAD_CACHE_AND_LOCK_ID :string = "EraCompletePopup";
local debugTest :boolean = false; -- (false) when true run test on hotload
local RELOAD_CACHE_ID :string = "EraCompletePopup";

local ERA_DECO:table = {
"Frame_EraRollover_Classical",
Expand All @@ -27,8 +27,9 @@ local ERA_DECO:table = {
};

-- ===========================================================================
-- VARIABLES
-- MEMBERS
-- ===========================================================================
local m_kPopupMgr :table = ExclusivePopupManager:new("EraCompletePopupXP1");
local m_lastShownEraIndex :number = -1;
local m_isClosing :boolean = false;
local m_isLockMode :boolean = false; -- Does this lock engine processing during popup.
Expand Down Expand Up @@ -77,7 +78,7 @@ function StartEraShow()

-- Early out checks are done; safe to lock.
if m_isLockMode then
LockPopupSequence(RELOAD_CACHE_AND_LOCK_ID, PopupPriority.High);
m_kPopupMgr:Lock( ContextPtr, PopupPriority.High );
else
UIManager:QueuePopup(ContextPtr, PopupPriority.High);
end
Expand Down Expand Up @@ -150,8 +151,8 @@ end
-- ===========================================================================
function Close()
m_isClosing = true;
if IsLocked() then
UnlockPopupSequence();
if m_kPopupMgr:IsLocked() then
m_kPopupMgr:Unlock();
else
UIManager:DequeuePopup(ContextPtr);
end
Expand Down Expand Up @@ -218,6 +219,7 @@ function OnGameDebugReturn( context:string, contextTable:table )
end

m_lastShownEraIndex = contextTable["m_lastShownEraIndex"];
m_kPopupMgr.FromTable( contextTable["m_kPopupMgr"], ContextPtr );
if (contextTable["isHidden"]==false) then
StartEraShow()
end
Expand All @@ -229,19 +231,20 @@ end
-- ===========================================================================
function OnInit( isReload:boolean )
if isReload or debugTest then
LuaEvents.GameDebug_GetValues(RELOAD_CACHE_AND_LOCK_ID);
LuaEvents.GameDebug_GetValues(RELOAD_CACHE_ID);
end
end

-- ===========================================================================
-- UI Event Handler
-- ===========================================================================
function OnShutdown()
if IsLocked() then
UnlockPopupSequence();
if m_kPopupMgr:IsLocked() then
m_kPopupMgr:Unlock();
end
LuaEvents.GameDebug_AddValue(RELOAD_CACHE_AND_LOCK_ID, "isHidden", ContextPtr:IsHidden() );
LuaEvents.GameDebug_AddValue(RELOAD_CACHE_AND_LOCK_ID, "m_lastShownEraIndex", m_lastShownEraIndex );
LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "isHidden", ContextPtr:IsHidden() );
LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "m_lastShownEraIndex", m_lastShownEraIndex );
LuaEvents.GameDebug_AddValue(RELOAD_CACHE_ID, "m_kPopupMgr", m_kPopupMgr.ToTable() );
end

-- ===========================================================================
Expand Down
6 changes: 5 additions & 1 deletion Additions/EraProgressPanel.xml
Expand Up @@ -144,7 +144,11 @@
</Instance>

<ToolTipType Name="CivTooltip" >
<Container Style="CivTooltip"/>
<Grid ID="BG" Size="auto,auto" SliceCorner="10,10" SliceTextureSize="33,32" Texture="Controls_Tooltip" InnerPadding="25,25" InnerOffset="10,10" >
<Image ID="LeaderIcon" Offset="0,0" Size="55,55" Texture="Leaders55"/>
<Image ID="YouIndicator" Offset="0,0" Hidden="1" Size="55,55" Texture="Diplomacy_YouIndicatorSmall"/>
<Label ID="LeaderName" Anchor="L,C" Offset="65,0" Style="FontNormal16" Color="0,0,0,255"/>
</Grid>
</ToolTipType>

</Context>
10 changes: 7 additions & 3 deletions Additions/EraReviewPopup.xml
Expand Up @@ -84,8 +84,12 @@
</Image>
</Instance>

<ToolTipType Name="CivTooltip" >
<Container Style="CivTooltip"/>
</ToolTipType>
<ToolTipType Name="CivTooltip" >
<Grid ID="BG" Size="auto,auto" SliceCorner="10,10" SliceTextureSize="33,32" Texture="Controls_Tooltip" InnerPadding="25,25" InnerOffset="10,10" >
<Image ID="LeaderIcon" Offset="0,0" Size="55,55" Texture="Leaders55"/>
<Image ID="YouIndicator" Offset="0,0" Hidden="1" Size="55,55" Texture="Diplomacy_YouIndicatorSmall"/>
<Label ID="LeaderName" Anchor="L,C" Offset="65,0" Style="FontNormal16" Color="0,0,0,255"/>
</Grid>
</ToolTipType>

</Context>
7 changes: 5 additions & 2 deletions Additions/GovernorAssignmentChooser.lua
Expand Up @@ -109,6 +109,9 @@ function AddGovernorInstance(governorInst:table, governor:table, governorDef:tab
-- Governor Icon
UpdateGovernorIcon(governorInst, governor);

--This is one area where we do not want the tooltip
governorInst.GovernorIcon:SetToolTipString("");

-- Culture Identity Pressure
governorInst.IdentityPressureContainer:SetHide(true);
if (city ~= nil and Game.GetLocalPlayer() ~= nil) then
Expand Down Expand Up @@ -219,8 +222,8 @@ function AddCityInstance( city:table, bDisabled:boolean, sFailureText:string )

-- Get colors
local backColor:number, frontColor:number = UI.GetPlayerColors(cityOwner);
local darkerBackColor:number = DarkenLightenColor(backColor,(-85),238);
local brighterBackColor:number = DarkenLightenColor(backColor,90,255);
local darkerBackColor:number = UI.DarkenLightenColor(backColor,(-85),238);
local brighterBackColor:number = UI.DarkenLightenColor(backColor,90,255);

-- Update colors
instance.BannerBase:SetColor( backColor );
Expand Down
3 changes: 3 additions & 0 deletions Additions/GovernorPanel.lua
Expand Up @@ -179,8 +179,11 @@ function AddGovernorCandidate(governorDef:table, canAppoint:boolean)
governorInstance.AppointButton:SetVoid1( governorDef.Index );
governorInstance.AppointButton:RegisterCallback( Mouse.eLClick, OnAppointGovernor );
governorInstance.AppointButton:SetDisabled(false);
governorInstance.AppointButton:SetToolTipString("");
else
governorInstance.AppointButton:SetDisabled(true);
governorInstance.AppointButton:SetToolTipString(Locale.Lookup("LOC_NO_GOVERNORS_TITLE_AVAILABLE"));

end

SetGovernorStatus(governorInstance, governorDef);
Expand Down
1 change: 1 addition & 0 deletions Additions/WorldCrisisPopup.lua
Expand Up @@ -401,6 +401,7 @@ function Initialize()
LuaEvents.GameDebug_Return.Add(OnGameDebugReturn);
LuaEvents.NotificationPanel_EmergencyClicked.Add( OnCrisisReceived );
LuaEvents.WorldCrisisTracker_EmergencyClicked.Add( OnCrisisReceived );
LuaEvents.DiploScene_SceneOpened.Add(OnClose);

if debugForceRaiseCrisis then
OnCrisisReceived();
Expand Down
5 changes: 4 additions & 1 deletion Additions/WorldCrisisPopup.xml
Expand Up @@ -48,7 +48,10 @@
<Line Color="150,153,157,35" Anchor="C,L" Offset="0,4" Start="0,0" End="554,0" Width="2"/>
<Label Style="FontFlair16" Align="center" Anchor="C,T" Offset="0,3" SmallCapsType="EveryWord" SmallCaps="22" FontSize="18" String="LOC_EMERGENCY_PARTICIPANTS" FontStyle="glow" Color0="225,225,225,250" Color1="255,255,255,70"/>
<Box ID="LeaderBar" Offset="0,10" Anchor="C,T" Color="232,68,9,0" Size="557,35">
<ScrollPanel ID="LeaderBarScrollPanel" Anchor="L,T" Offset="11,1" Size="parent-21,155" Vertical="0">
<ScrollPanel ID="LeaderBarScrollPanel" Anchor="L,T" Offset="11,1" Size="parent-21,50" Vertical="0">
<ScrollBar Anchor="C,B" Offset="0,0" Size="parent,4" Style="ScrollHorizontalBackingAlt">
<Thumb Style="ScrollThumbHAlt" />
</ScrollBar>
<Stack ID="LeaderIconStack" Offset="0,-8" Anchor="C,T" Padding="5" StackGrowth="Right"/>
</ScrollPanel>
</Box>
Expand Down
12 changes: 6 additions & 6 deletions Additions/WorldCrisisTracker.lua
Expand Up @@ -7,12 +7,12 @@ include("SupportFunctions");
-- ===========================================================================
-- CONSTANTS
-- ===========================================================================
local COLOR_TARGETED_PRIMARY = RGBAValuesToABGRHex ( 1, .176, .207, 1);
local COLOR_TARGETED_SECONDARY = RGBAValuesToABGRHex ( .384, .411, .447, 1);
local COLOR_JOINED_PRIMARY = RGBAValuesToABGRHex ( .835, .835, .835, 1);
local COLOR_JOINED_SECONDARY = RGBAValuesToABGRHex ( .384, .411, .447, 1);
local COLOR_INVITED_PRIMARY = RGBAValuesToABGRHex ( .415, .427, .450, 1);
local COLOR_INVITED_SECONDARY = RGBAValuesToABGRHex ( .415, .427, .450, 1);
local COLOR_TARGETED_PRIMARY = UI.GetColorValue(1, .176, .207, 1);
local COLOR_TARGETED_SECONDARY = UI.GetColorValue(.384, .411, .447, 1);
local COLOR_JOINED_PRIMARY = UI.GetColorValue(.835, .835, .835, 1);
local COLOR_JOINED_SECONDARY = UI.GetColorValue( .384, .411, .447, 1);
local COLOR_INVITED_PRIMARY = UI.GetColorValue( .415, .427, .450, 1);
local COLOR_INVITED_SECONDARY = UI.GetColorValue(.415, .427, .450, 1);


-- ===========================================================================
Expand Down
2 changes: 1 addition & 1 deletion Additions/WorldCrisisTracker.xml
Expand Up @@ -25,7 +25,7 @@
<Image ID="TargetIcon" Anchor="C,C" Texture="EmergenciesPanel_Target" Color="255,0,0,255" Size="38,38" Offset="0,0" />
</Container>
<Label ID="CrisisTitle" Offset="58,7" Color="255,255,255,255" Style="PanelHeaderText" SmallCapsType="EveryWord"/>
<Label ID="CrisisProgress" Color="255,255,255,255" Offset="58,24" FontSize="12" Style="FontNormal10"/>
<Label ID="CrisisProgress" Color="255,255,255,255" Offset="58,24" FontSize="12" Style="FontNormal10" TruncateWidth="200" TruncatedTooltip="1"/>
<Label ID="TurnsRemaining" Anchor="R,C" Offset="5,0" Color="102,109,115,255" String="??? [ICON_Turn]" Style="FontNormal12"/>
<Image ID="CompletedBox" Size="71,40" Offset="0,0" Anchor="R,C"/>
</GridButton>
Expand Down
1 change: 1 addition & 0 deletions InGame.xml
Expand Up @@ -91,6 +91,7 @@
<LuaContext ID="WonderBuiltPopup" FileName="WonderBuiltPopup" Hidden="1"/>
<LuaContext ID="ProjectBuiltPopup" FileName="ProjectBuiltPopup" Hidden="1"/>
<LuaContext ID="MapPinPopup" FileName="MapPinPopup" Hidden="1"/>
<LuaContext ID="PBCNotificationPopup" FileName="PBCNotificationPopup" Hidden="1"/>
<LuaContext ID="RazeCity" FileName="RazeCity" Hidden="1"/>
<LuaContext ID="BoostUnlockedPopup" FileName="BoostUnlockedPopup" Hidden="1"/>
<LuaContext ID="TechCivicCompletedPopup" FileName="TechCivicCompletedPopup" Hidden="1"/>
Expand Down
8 changes: 4 additions & 4 deletions Replacements/ActionPanel_Expansion1.lua
Expand Up @@ -83,21 +83,21 @@ function OnRefresh()
local goldenAgeThreshold = gameEras:GetPlayerGoldenAgeThreshold(ePlayer);
local ageIconName = "[ICON_GLORY_NORMAL_AGE]";
Controls.TurnTimerMeterWarning:SetHide(true);
Controls.AgeLabelCurrent:SetColor(RGBAValuesToABGRHex(.7, .7, .7, 1));
Controls.AgeLabelCurrent:SetColorByName("Age_Normal");
if score >= darkAgeThreshold then
--We are working towards, or scored Golden age
ageIconName = gameEras:HasDarkAge(ePlayer) and "[ICON_GLORY_GOLDEN_AGE]" or "[ICON_GLORY_SUPER_GOLDEN_AGE]";
if score >= goldenAgeThreshold then
--Just working toward a golden age
Controls.TurnTimerMeterGolden:SetTexture("ActionPanel_AgeMeterFill_Golden");
Controls.AgeLabelCurrent:SetColor(RGBAValuesToABGRHex(.8, .8, 0, 1));
Controls.AgeLabelCurrent:SetColorByName("Age_Golden");
end
else
--Is the age ending? If so, show the red warning
local eraCountdown = gameEras:GetNextEraCountdown() + 1; -- 0 turns remaining is the last turn, shift by 1 to make sense to non-programmers
if eraCountdown ~= nil and eraCountdown ~= 0 then
Controls.TurnTimerMeterWarning:SetHide(false);
Controls.AgeLabelCurrent:SetColor(RGBAValuesToABGRHex(.8, .1, .1, 1));
Controls.AgeLabelCurrent:SetColorByName("Age_Warning");
ageIconName = "[ICON_GLORY_DARK_AGE]";
end
end
Expand Down Expand Up @@ -128,7 +128,7 @@ function OnRefresh()
Controls.TurnTimerMeterWarning:SetHide(true);
Controls.AgeLabelTotal:SetHide(true);
Controls.AgeLabelDivider:SetHide(true);
Controls.AgeLabelCurrent:SetColor(RGBAValuesToABGRHex(.7, .7, .7, 1));
Controls.AgeLabelCurrent:SetColorByName("Age_Normal");
if gameEras:HasDarkAge() then
Controls.AgeLabelCurrent:SetText("[ICON_GLORY_DARK_AGE]" .. score);
elseif gameEras:HasGoldenAge() then
Expand Down
16 changes: 8 additions & 8 deletions Replacements/CityStates.xml
Expand Up @@ -244,19 +244,19 @@
</Instance>

<Instance Name="BonusCityHeaderInstance">
<Container ID="Top" Anchor="L,C" Size="parent,16" >
<Grid Anchor="C,C" Size="parent,8" Texture="Controls_Div2" SliceCorner="27,4" SliceTextureSize="54,8" Color="27,40,48,255" />
<Image Anchor="C,C" Size="parent,16" Texture="Controls_Glow" Color="0,0,0,255" StretchMode="Fill" />
<Label ID="CityName" Anchor="C,C" String="$City$" Style="FontFlair14" SmallCaps="18" SmallCapsType="EveryWord" Color="255,255,255,120" />
<Container ID="Top" Anchor="L,C" Size="parent,20" >
<Grid Anchor="C,C" Offset="0,4" Size="parent,8" Texture="Controls_Div2" SliceCorner="27,4" SliceTextureSize="54,8" Color="27,40,48,255" />
<Image Anchor="C,C" Offset="0,4" Size="parent,16" Texture="Controls_Glow" Color="0,0,0,255" StretchMode="Fill" />
<Label ID="CityName" Anchor="C,C" Offset="0,4" String="$City$" Style="FontFlair14" SmallCaps="18" SmallCapsType="EveryWord" Color="255,255,255,120" />
</Container>
</Instance>

<Instance Name="BonusItemOnInstance">
<Grid ID="Top" Anchor="L,T" Size="parent,72" Texture="CityState_BonusFrameOn" SliceCorner="65,29" SliceTextureSize="74,58" >
<Grid ID="Top" Anchor="L,T" Size="parent,auto" Texture="CityState_BonusFrameOn" SliceCorner="65,29" SliceTextureSize="74,58" Padding="0,5" >
<Image ID="Icon" Anchor="L,T" Offset="4,5" Size="50,50" Texture="EnvoyBonuses50" />
<Label ID="Title" Anchor="L,T" Offset="70,6" Style="FontNormal14" String="$BonusTitle$ - GameCore does not expose this yet." />
<Container Offset="55,0" Size="parent-55,parent" >
<Label ID="Details" Anchor="L,T" Offset="25,24" WrapWidth="320" Style="FontNormal14" String="$Details$ - GameCore does not expose this yet." ColorSet="CityStateCS" />
<Container Offset="55,0" Size="parent-55,auto" >
<Label ID="Details" Anchor="L,T" Offset="25,24" WrapWidth="315" Style="FontNormal14" String="$Details$ - GameCore does not expose this yet." ColorSet="CityStateCS" />
</Container>
<Label ID="Check" Anchor="R,T" Offset="8,10" String="[ICON_Checkmark]" Hidden="1" />
</Grid>
Expand Down
3 changes: 1 addition & 2 deletions Replacements/DiplomacyRibbon_Expansion1.lua
@@ -1,7 +1,6 @@
-- Copyright 2017-2018, Firaxis Games.-- ===========================================================================
-- Copyright 2017-2018, Firaxis Games.

-- Base File
-- ===========================================================================
include("DiplomacyRibbon");

-- ===========================================================================
Expand Down
10 changes: 8 additions & 2 deletions Replacements/Expansion1_InGameTopOptionsMenu.lua
Expand Up @@ -6,7 +6,13 @@ function OnExpansionIntro()
end

function Initialize()
Controls.ExpansionNewFeatures:RegisterCallback( Mouse.eLClick, OnExpansionIntro );
Controls.ExpansionNewFeatures:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end);
local bWorldBuilder = WorldBuilder and WorldBuilder:IsActive();
if(bWorldBuilder) then
Controls.ExpansionNewFeatures:SetHide(true);
else
Controls.ExpansionNewFeatures:SetHide(false);
Controls.ExpansionNewFeatures:RegisterCallback( Mouse.eLClick, OnExpansionIntro );
Controls.ExpansionNewFeatures:RegisterCallback( Mouse.eMouseEnter, function() UI.PlaySound("Main_Menu_Mouse_Over"); end);
end
end
Initialize();

0 comments on commit f1ee755

Please sign in to comment.