diff --git a/Assets/Text/cqui_text_settings.xml b/Assets/Text/cqui_text_settings.xml index 3c27482..27552e7 100644 --- a/Assets/Text/cqui_text_settings.xml +++ b/Assets/Text/cqui_text_settings.xml @@ -153,6 +153,21 @@ Remember: CQUI settings are attached to individual saves![NEWLINE]If you'd like to change a setting by default, please read the info in cqui_settings.sql file within the [MOD INSTALL DIRECTORY]/CQUI/Assets directory + + Tutorials + + + Show improvement recommendations + + + Show tech recommendations + + + Show production recommendations + + + Show tutorial info in the city panel + Units diff --git a/Assets/UI/Panels/citypaneloverview.lua b/Assets/UI/Panels/citypaneloverview.lua index 39068bb..96ba8f5 100644 --- a/Assets/UI/Panels/citypaneloverview.lua +++ b/Assets/UI/Panels/citypaneloverview.lua @@ -74,6 +74,8 @@ local m_isShowingPanel :boolean = false; -- ====================CQUI Cityview========================================== +local CQUI_Tutorial = false; --When true, shows tutorial UI + function CQUI_OnCityviewEnabled() OnShowOverviewPanel(true) end @@ -82,6 +84,9 @@ local m_isShowingPanel :boolean = false; OnShowOverviewPanel(false); end + function CQUI_OnSettingsUpdate() + CQUI_Tutorial = GameConfiguration.GetValue("CQUI_CityTutorial"); + end LuaEvents.CQUI_CityPanelOverview_CityviewEnable.Add( CQUI_OnCityviewEnabled); LuaEvents.CQUI_CityPanelOverview_CityviewDisable.Add( CQUI_OnCityviewDisabled); @@ -428,7 +433,7 @@ end function ViewPanelAmenities( data:table ) -- Only show the advisor bubbles during the tutorial - Controls.AmenitiesAdvisorBubble:SetHide( IsTutorialRunning() == false ); + Controls.AmenitiesAdvisorBubble:SetHide( not CQUI_Tutorial ); local colorName:string = GetHappinessColor(data.Happiness); Controls.AmenitiesConstructedLabel:SetText( Locale.Lookup( "LOC_HUD_CITY_AMENITY", data.AmenitiesNum) ); @@ -488,7 +493,7 @@ end -- =========================================================================== function ViewPanelHousing( data:table ) -- Only show the advisor bubbles during the tutorial - Controls.HousingAdvisorBubble:SetHide( IsTutorialRunning() == false ); + Controls.HousingAdvisorBubble:SetHide( not CQUI_Tutorial ); m_kHousingIM:ResetInstances(); @@ -919,5 +924,8 @@ function Initialize() Events.ResearchCompleted.Add( OnResearchCompleted ); Events.GovernmentPolicyChanged.Add( OnPolicyChanged ); Events.GovernmentPolicyObsoleted.Add( OnPolicyChanged ); + + LuaEvents.CQUI_SettingsUpdate.Add(CQUI_OnSettingsUpdate); + LuaEvents.CQUI_SettingsInitialized.Add(CQUI_OnSettingsUpdate); end Initialize(); diff --git a/Assets/UI/Panels/unitpanel.lua b/Assets/UI/Panels/unitpanel.lua index 6f772ec..cca2405 100644 --- a/Assets/UI/Panels/unitpanel.lua +++ b/Assets/UI/Panels/unitpanel.lua @@ -83,6 +83,17 @@ local pSpyInfo = GameInfo.Units["UNIT_SPY"]; local m_AttackHotkeyId = Input.GetActionId("Attack"); local m_DeleteHotkeyId = Input.GetActionId("DeleteUnit"); + +--CQUI Members +local CQUI_ImprovementTutorial = true; +local CQUI_AutoExpandUnitActions = false; + +function CQUI_OnSettingsUpdate() + CQUI_AutoExpandUnitActions = GameConfiguration.GetValue("CQUI_AutoExpandUnitActions"); + CQUI_ImprovementTutorial = GameConfiguration.GetValue("CQUI_ImprovementTutorial"); + OnRefresh(); +end + -- =========================================================================== -- FUNCTIONS -- =========================================================================== @@ -786,9 +797,8 @@ function View(data) Controls.RecommendedActionButton:ReprocessAnchoring(); Controls.RecommendedActionIcon:ReprocessAnchoring(); - bestBuildAction = nil; Controls.RecommendedActionFrame:SetHide( bestBuildAction == nil ); - if ( bestBuildAction ~= nil ) then + if ( bestBuildAction ~= nil and CQUI_ImprovementTutorial) then Controls.RecommendedActionButton:SetHide(false); Controls.BuildActionsPanel:SetSizeY( buildStackHeight + 20 + BUILD_PANEL_ART_PADDING_Y); Controls.BuildActionsStack:SetOffsetY(26); @@ -2085,7 +2095,7 @@ function Refresh(player, unitId) if(unit ~= nil) then ReadUnitData( unit, numUnits ); --CQUI auto-expando - if(GameConfiguration.GetValue("CQUI_AutoExpandUnitActions")) then + if(CQUI_AutoExpandUnitActions) then local isHidden:boolean = Controls.SecondaryActionsStack:IsHidden(); if isHidden then Controls.SecondaryActionsStack:SetHide(false); @@ -3719,6 +3729,9 @@ function Initialize() LuaEvents.UnitFlagManager_PointerExited.Add( OnUnitFlagPointerExited ); LuaEvents.PlayerChange_Close.Add( OnPlayerChangeClose ); + --CQUI Events + LuaEvents.CQUI_SettingsUpdate.Add(CQUI_OnSettingsUpdate); + -- Popup setup m_kPopupDialog = PopupDialog:new( "UnitPanelPopup" ); diff --git a/Assets/cqui_settingselement.lua b/Assets/cqui_settingselement.lua index bd45991..bd67698 100644 --- a/Assets/cqui_settingselement.lua +++ b/Assets/cqui_settingselement.lua @@ -270,6 +270,7 @@ function Initialize() {Controls.CityviewTab, Controls.CityviewOptions}, {Controls.LensesTab, Controls.LensesOptions}, {Controls.UnitsTab, Controls.UnitsOptions}, + {Controls.TutorialsTab, Controls.TutorialsOptions}, {Controls.HiddenTab, Controls.HiddenOptions} }; for i, tab in ipairs(m_tabs) do @@ -304,6 +305,10 @@ function Initialize() PopulateCheckBox(Controls.AutoExpandUnitActionsCheckbox, "CQUI_AutoExpandUnitActions"); PopulateCheckBox(Controls.AlwaysOpenTechTreesCheckbox, "CQUI_AlwaysOpenTechTrees"); PopulateCheckBox(Controls.SmartWorkIconCheckbox, "CQUI_SmartWorkIcon", Locale.Lookup("LOC_CQUI_CITYVIEW_SMARTWORKICON_TOOLTIP")); + PopulateCheckBox(Controls.ImprovementTutorialCheckbox, "CQUI_ImprovementTutorial"); + PopulateCheckBox(Controls.TechTutorialCheckbox, "CQUI_TechTutorial"); + PopulateCheckBox(Controls.ProductionTutorialCheckbox, "CQUI_ProductionTutorial"); + PopulateCheckBox(Controls.CityTutorialCheckbox, "CQUI_CityTutorial"); PopulateSlider(Controls.ProductionItemHeightSlider, Controls.ProductionItemHeightText, "CQUI_ProductionItemHeight", ProductionItemHeightConverter); PopulateSlider(Controls.MinimapSizeSlider, Controls.MinimapSizeText, "CQUI_MinimapSize", MinimapSizeConverter); diff --git a/Assets/cqui_settingselement.xml b/Assets/cqui_settingselement.xml index 3f61208..f750286 100644 --- a/Assets/cqui_settingselement.xml +++ b/Assets/cqui_settingselement.xml @@ -21,6 +21,7 @@ +