@@ -83,6 +83,17 @@ local pSpyInfo = GameInfo.Units["UNIT_SPY"];
8383local m_AttackHotkeyId = Input .GetActionId (" Attack" );
8484local m_DeleteHotkeyId = Input .GetActionId (" DeleteUnit" );
8585
86+
87+ -- CQUI Members
88+ local CQUI_ImprovementTutorial = true ;
89+ local CQUI_AutoExpandUnitActions = false ;
90+
91+ function CQUI_OnSettingsUpdate ()
92+ CQUI_AutoExpandUnitActions = GameConfiguration .GetValue (" CQUI_AutoExpandUnitActions" );
93+ CQUI_ImprovementTutorial = GameConfiguration .GetValue (" CQUI_ImprovementTutorial" );
94+ OnRefresh ();
95+ end
96+
8697-- ===========================================================================
8798-- FUNCTIONS
8899-- ===========================================================================
@@ -786,9 +797,8 @@ function View(data)
786797 Controls .RecommendedActionButton :ReprocessAnchoring ();
787798 Controls .RecommendedActionIcon :ReprocessAnchoring ();
788799
789- bestBuildAction = nil ;
790800 Controls .RecommendedActionFrame :SetHide ( bestBuildAction == nil );
791- if ( bestBuildAction ~= nil ) then
801+ if ( bestBuildAction ~= nil and CQUI_ImprovementTutorial ) then
792802 Controls .RecommendedActionButton :SetHide (false );
793803 Controls .BuildActionsPanel :SetSizeY ( buildStackHeight + 20 + BUILD_PANEL_ART_PADDING_Y );
794804 Controls .BuildActionsStack :SetOffsetY (26 );
@@ -2085,7 +2095,7 @@ function Refresh(player, unitId)
20852095 if (unit ~= nil ) then
20862096 ReadUnitData ( unit , numUnits );
20872097 -- CQUI auto-expando
2088- if (GameConfiguration . GetValue ( " CQUI_AutoExpandUnitActions" ) ) then
2098+ if (CQUI_AutoExpandUnitActions ) then
20892099 local isHidden :boolean = Controls .SecondaryActionsStack :IsHidden ();
20902100 if isHidden then
20912101 Controls .SecondaryActionsStack :SetHide (false );
@@ -3719,6 +3729,9 @@ function Initialize()
37193729 LuaEvents .UnitFlagManager_PointerExited .Add ( OnUnitFlagPointerExited );
37203730 LuaEvents .PlayerChange_Close .Add ( OnPlayerChangeClose );
37213731
3732+ -- CQUI Events
3733+ LuaEvents .CQUI_SettingsUpdate .Add (CQUI_OnSettingsUpdate );
3734+
37223735 -- Popup setup
37233736 m_kPopupDialog = PopupDialog :new ( " UnitPanelPopup" );
37243737
0 commit comments