From 8fc239d488046447df82860ea7e6b20a43f6fcdd Mon Sep 17 00:00:00 2001 From: Henning Waberg Date: Wed, 18 Mar 2020 14:49:30 +0100 Subject: [PATCH] Show stats menu item only for rpgo soldier class --- .../Classes/X2EventListener_StatUI.uc | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/XCOM2RPGOverhaul/Src/StatUpgradeUI/Classes/X2EventListener_StatUI.uc b/XCOM2RPGOverhaul/Src/StatUpgradeUI/Classes/X2EventListener_StatUI.uc index 33bb56d..07febc8 100644 --- a/XCOM2RPGOverhaul/Src/StatUpgradeUI/Classes/X2EventListener_StatUI.uc +++ b/XCOM2RPGOverhaul/Src/StatUpgradeUI/Classes/X2EventListener_StatUI.uc @@ -140,17 +140,20 @@ static function EventListenerReturn OnArmoryMainMenuUpdate(Object EventData, Obj UnitState = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(MainMenu.GetUnitRef().ObjectID)); UnitState.GetUnitValue('StatPoints', StatPointsValue); - StatUIButton = MainMenu.Spawn(class'UIListItemString', List.ItemContainer).InitListItem(class'UIBarMemorial_Details'.default.m_strSoldierStats); - StatUIButton.MCName = 'ArmoryMainMenu_StatUIButton'; - StatUIButton.ButtonBG.OnClickedDelegate = OnSoldierStats; - StatUIButton.NeedsAttention(StatPointsValue.fValue > 0); - - //if(NextOnSelectionChanged == none) - //{ - // NextOnSelectionChanged = List.OnSelectionChanged; - // List.OnSelectionChanged = OnSelectionChanged; - //} - List.MoveItemToBottom(FindDismissListItem(List)); + if (UnitState.GetSoldierClassTemplateName() == 'UniversalSoldier') + { + StatUIButton = MainMenu.Spawn(class'UIListItemString', List.ItemContainer).InitListItem(class'UIBarMemorial_Details'.default.m_strSoldierStats); + StatUIButton.MCName = 'ArmoryMainMenu_StatUIButton'; + StatUIButton.ButtonBG.OnClickedDelegate = OnSoldierStats; + StatUIButton.NeedsAttention(StatPointsValue.fValue > 0); + + //if(NextOnSelectionChanged == none) + //{ + // NextOnSelectionChanged = List.OnSelectionChanged; + // List.OnSelectionChanged = OnSelectionChanged; + //} + List.MoveItemToBottom(FindDismissListItem(List)); + } return ELR_NoInterrupt; }