Skip to content

Commit

Permalink
Expose classes that can use the StatUI to XComStatUpgradeUI.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
Musashi1584 committed Mar 18, 2020
1 parent 8fc239d commit 5e5ff3d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions XCOM2RPGOverhaul/Config/StatUpgradeUI/XComStatUpgradeUI.ini
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ HealthBetaStrikeCostLamda = 24
HealthDeltaStrikeCostLamda = 15

[StatUpgradeUI.X2EventListener_StatUI]

+EnableClassForStatProgression=UniversalSoldier

DefaultStatPointsPerPromotion=15

; Class specific stat points override DefaultStatPointsPerPromotion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class X2EventListener_StatUI extends X2EventListener config(StatUpgradeUI);

var config int DefaultStatPointsPerPromotion;
var config array<ClassStatPoints> ClassStatPointsPerPromotion;
var config array<name> EnableClassForStatProgression;

var delegate<OnItemSelectedCallback> NextOnSelectionChanged;
delegate OnItemSelectedCallback(UIList _list, int itemIndex);
Expand Down Expand Up @@ -69,7 +70,7 @@ static function EventListenerReturn OnCompleteRespecSoldier(Object EventData, Ob

if (UnitState != none &&
UnitState.GetMyTemplateName() == 'Soldier' &&
UnitState.GetSoldierClassTemplateName() == 'UniversalSoldier'
default.EnableClassForStatProgression.Find(UnitState.GetSoldierClassTemplateName()) != INDEX_NONE
)
{
SpentSoldierSP = GetSpentSoldierSP(UnitState);
Expand Down Expand Up @@ -140,7 +141,7 @@ static function EventListenerReturn OnArmoryMainMenuUpdate(Object EventData, Obj
UnitState = XComGameState_Unit(`XCOMHISTORY.GetGameStateForObjectID(MainMenu.GetUnitRef().ObjectID));
UnitState.GetUnitValue('StatPoints', StatPointsValue);

if (UnitState.GetSoldierClassTemplateName() == 'UniversalSoldier')
if (default.EnableClassForStatProgression.Find(UnitState.GetSoldierClassTemplateName()) != INDEX_NONE)
{
StatUIButton = MainMenu.Spawn(class'UIListItemString', List.ItemContainer).InitListItem(class'UIBarMemorial_Details'.default.m_strSoldierStats);
StatUIButton.MCName = 'ArmoryMainMenu_StatUIButton';
Expand Down

0 comments on commit 5e5ff3d

Please sign in to comment.