EmperorFool
Deity
I merged in the queue-handling portion of this mod since it was fairly simple. I made a few alterations along the way:
- Works in the city screen and map view.
- Closes once the queue is full (six items).
- Click to append. CTRL-Click to insert. ALT-Click to replace the whole queue.
- Removed the "Show Queue" checkbox entirely.
Code:
diff -rupN v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.lua installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.lua
--- v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.lua 2012-02-19 13:21:50.206993600 -0800
+++ installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.lua 2012-02-20 17:40:39.860036300 -0800
@@ -243,7 +243,7 @@ local wonderHeadingOpen = true;
local specialistBuildingHeadingOpen = true;
local marketplaceBuildingHeadingOpen = true;
local buildingHeadingOpen = true;
-local productionQueueOpen = false;
+local productionQueueOpen = true;
function OnSlackersSelected()
local pCity = UI.GetHeadSelectedCity();
@@ -804,16 +804,6 @@ function OnCityViewUpdate()
--Update suffix to use correct plurality.
Controls.CityPopulationLabelSuffix:LocalizeAndSetText("TXT_KEY_CITYVIEW_CITIZENS_TEXT", cityPopulation);
-
- -------------------------------------------
- -- Deal with the production queue buttons
- -------------------------------------------
- local qLength = pCity:GetOrderQueueLength();
- if qLength > 0 then
- Controls.HideQueueButton:SetHide( false );
- else
- Controls.HideQueueButton:SetHide( true );
- end
-- hide the queue buttons
Controls.b1number:SetHide( true );
@@ -830,6 +820,7 @@ function OnCityViewUpdate()
Controls.ProductionPortraitButton:SetHide( false );
local panelSize = Controls.ProdQueueBackground:GetSize();
+ local qLength = pCity:GetOrderQueueLength();
if productionQueueOpen and qLength > 0 then
panelSize.y = 470;
Controls.ProductionButtonLabel:SetText( Locale.ConvertTextKey( "TXT_KEY_CITYVIEW_QUEUE_PROD") );
@@ -2514,15 +2505,6 @@ Controls.ProductionPortraitButton:Regist
----------------------------------------------------------------
-----------------------------------------------------------------
-function OnHideQueue( bIsChecked )
- productionQueueOpen = bIsChecked;
- OnCityViewUpdate();
-end
-Controls.HideQueueButton:RegisterCheckHandler( OnHideQueue );
-
-
-----------------------------------------------------------------
----------------------------------------------------------------
function FocusChanged( focus )
diff -rupN v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.xml installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.xml
--- v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.xml 2012-02-19 13:21:50.207993700 -0800
+++ installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView.xml 2012-02-20 17:39:19.711452100 -0800
@@ -179,10 +179,6 @@
<Label Anchor="C,C" Offset="0,0" String="TXT_KEY_CITYVIEW_QUEUE_PROD" ColorSet="Beige_Black_Alpha" Font="TwCenMT18" FontStyle="Shadow" ID="ProductionButtonLabel"/>
</GridButton>
</Stack>
- <!-- Queue Button -->
-
- <Image Anchor="L,B" Offset="40,76" TextureOffset="30.0" Texture="bar500x2.dds" Size="440.1" Color="White.128" Hidden="0"/>
- <CheckBox Style="SquareCheck" Anchor="R,B" Offset="44,44" TextAnchor="L,C" Font="TwCenMT18" String="TXT_KEY_CITYVIEW_QUEUE_O" IsChecked="0" ToolTip="TXT_KEY_CITYVIEW_QUEUE_O_TT" ID="HideQueueButton"/>
</Grid>
<Image Anchor="R,B" Offset="0,28" Texture="assets\UI\Art\WorldView\citytrimright.dds" Size="141.78" Hidden="0"/>
diff -rupN v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView_small.xml installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView_small.xml
--- v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView_small.xml 2012-02-19 13:21:50.208993800 -0800
+++ installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/CityView_small.xml 2012-02-20 17:38:56.136103600 -0800
@@ -181,9 +181,6 @@
<Button Anchor="R,B" Size="18,18" Offset="0.2" TextureOffset="0,0" Texture="assets\UI\Art\Controls\9 Grids\NewX.dds" ToolTip="TXT_KEY_CITYVIEW_Q_X_TEXT" ID="b6remove"/>
</Box>
</Stack>
- <!-- Queue Button -->
- <!--<Box Anchor="L,B" Color="27.53.64.255" Offset="20,74" Size="362,1"/>-->
- <CheckBox Style="SquareCheck" Anchor="R,B" Offset="44,44" TextAnchor="L,C" Font="TwCenMT18" String="TXT_KEY_CITYVIEW_QUEUE_O" IsChecked="0" ToolTip="TXT_KEY_CITYVIEW_QUEUE_O_TT" ID="HideQueueButton"/>
</Grid>
<!-- BUILDINGS -->
<Instance Name="BuildingInstance">
diff -rupN v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/ProductionPopup.lua installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/ProductionPopup.lua
--- v131/CiVUP - Civ V Unofficial Patch/Core/Misc UI/ProductionPopup.lua 2012-02-19 13:21:50.216994200 -0800
+++ installed/CiVUP - Civ V Unofficial Patch/Core/Misc UI/ProductionPopup.lua 2012-02-20 17:18:22.870564900 -0800
@@ -184,10 +184,19 @@ function ProductionSelected( eOrder, iDa
local city = g_currentCity;
local player = Players[city:GetOwner()]
-
- if g_IsProductionMode then
- Game.CityPushOrder(city, eOrder, iData, false, not g_append, true);
- else
+
+ if g_IsProductionMode then
+ -- no modifier to append; ctrl to insert at front; alt to replace full queue
+ if UIManager:GetAlt() then
+ Game.CityPushOrder(city, eOrder, iData, false, true, false);
+ elseif city:GetOrderQueueLength() < 6 then
+ if UIManager:GetControl() then
+ Game.CityPushOrder(city, eOrder, iData, false, false, false);
+ else
+ Game.CityPushOrder(city, eOrder, iData, false, false, true);
+ end
+ end
+ else
local bSomethingPurchased = false;
if (eOrder == OrderTypes.ORDER_TRAIN) then
Game.CityPurchaseUnit(city, iData);
@@ -222,7 +231,7 @@ function ProductionSelected( eOrder, iDa
Events.SpecificCityInfoDirty( player, cityID, CityUpdateTypes.CITY_UPDATE_TYPE_BANNER);
Events.SpecificCityInfoDirty( player, cityID, CityUpdateTypes.CITY_UPDATE_TYPE_PRODUCTION);
- if not g_append or not g_IsProductionMode then
+ if not g_IsProductionMode or city:GetOrderQueueLength() >= 6 then
OnClose();
end
end
@@ -276,7 +285,7 @@ function UpdateWindow( city )
return;
end
- local qMode = g_append and g_IsProductionMode;
+ local qMode = g_IsProductionMode;
if qMode then
local qLength = city:GetOrderQueueLength();
@@ -879,7 +888,7 @@ function UpdateWindow( city )
end
Controls.ProductionQueueBox:SetHide(false);
else
- Controls.ProductionQueueBox:SetHide(true);
+ Controls.ProductionQueueBox:SetHide(false);
end
Controls.UnitButtonStack:CalculateSize();