Skip to content

Commit

Permalink
Issue #55 - Display inventory slot to which the ability is attached to
Browse files Browse the repository at this point in the history
  • Loading branch information
Iridar authored Jul 30, 2021
1 parent ec02cf7 commit aa3d960
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[X2WOTCCommunityPromotionScreen.CPS_MCM_Defaults]
VERSION_CFG=2
VERSION_CFG=3

; SHOW_UNREACHED_PERKS=false
; DISABLE_TRAINING_CENTER_REQUIREMENT=false
; DISABLE_NEWCLASS_POPUPS=false
; DISABLE_COMINT_POPUPS=false
; ABILITY_TREE_PLANNER_MODE = 0
; SHOW_INVENTORY_SLOT=false
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ GroupHeader="General Settings"
SHOW_UNREACHED_PERKS_Label = "Display perks from unreached ranks"
SHOW_UNREACHED_PERKS_Tip = "Normally you cannot preview perks from soldiers' future ranks. You can remove this restriction here."

SHOW_INVENTORY_SLOT_Label = "Display inventory slot"
SHOW_INVENTORY_SLOT_Tip = "Toggles the display of the inventory slot to which the ability is attached to. Keep in mind the ability being attached to a slot does not always mean the ability will work only with items in that inventory slot."

DISABLE_TRAINING_CENTER_REQUIREMENT_Label = "Disable Training Center requirement"
DISABLE_TRAINING_CENTER_REQUIREMENT_Tips = "Normally regular soldier classes can unlock more than one perk per rank only if the player has the Training Center facility. You can disable this requirement here."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ GroupHeader="Общие настройки"
SHOW_UNREACHED_PERKS_Label = "Показывать способности на недостигнутых рангах"
SHOW_UNREACHED_PERKS_Tip = "Обычно вы не можете знать способности бойцов заранее. Эта опция позволяет убрать это ограничение."

SHOW_INVENTORY_SLOT_Label = "Показывать слот экипировки"
SHOW_INVENTORY_SLOT_Tip = "Переключает отображение слота экипировки к которому привязана способность. Имейте в виду, что привязка способности не всегда означает что способность работает только с предметами в этом слоте."

DISABLE_TRAINING_CENTER_REQUIREMENT_Label = "Отключить требование постройки центра подготовки"
DISABLE_TRAINING_CENTER_REQUIREMENT_Tips = "Обычные солдаты могут приобретать дополнительные способности только после постройки центра подготовки. Эта опция позволяет убрать это требование."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class CPS_MCM_Defaults extends object config(X2WOTCCommunityPromotionScreen_DEFA

var config int VERSION_CFG;

var config bool SHOW_INVENTORY_SLOT;
var config bool SHOW_UNREACHED_PERKS;
var config bool DISABLE_TRAINING_CENTER_REQUIREMENT;
var config bool DISABLE_NEWCLASS_POPUPS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var localized string GroupHeader;

`include(X2WOTCCommunityPromotionScreen\Src\ModConfigMenuAPI\MCM_API_Includes.uci)

`MCM_API_AutoCheckBoxVars(SHOW_INVENTORY_SLOT);
`MCM_API_AutoCheckBoxVars(SHOW_UNREACHED_PERKS);
`MCM_API_AutoCheckBoxVars(DISABLE_TRAINING_CENTER_REQUIREMENT);
`MCM_API_AutoCheckBoxVars(DISABLE_NEWCLASS_POPUPS);
Expand All @@ -16,6 +17,7 @@ var localized string GroupHeader;

`include(X2WOTCCommunityPromotionScreen\Src\ModConfigMenuAPI\MCM_API_CfgHelpers.uci)

`MCM_API_AutoCheckBoxFns(SHOW_INVENTORY_SLOT, 3);
`MCM_API_AutoCheckBoxFns(SHOW_UNREACHED_PERKS, 1);
`MCM_API_AutoCheckBoxFns(DISABLE_TRAINING_CENTER_REQUIREMENT, 1);
`MCM_API_AutoCheckBoxFns(DISABLE_NEWCLASS_POPUPS, 1);
Expand Down Expand Up @@ -45,6 +47,7 @@ simulated function ClientModCallback(MCM_API_Instance ConfigAPI, int GameMode)
// Issue #53
Group.AddDropdown('ABILITY_TREE_PLANNER_MODE', ABILITY_TREE_PLANNER_MODE_Label, ABILITY_TREE_PLANNER_MODE_Tip, ABILITY_TREE_PLANNER_MODE_Strings, ABILITY_TREE_PLANNER_MODE_Strings[ABILITY_TREE_PLANNER_MODE], ABILITY_TREE_PLANNER_MODE_SaveHandler).SetEditable(SHOW_UNREACHED_PERKS);

`MCM_API_AutoAddCheckBox(Group, SHOW_INVENTORY_SLOT);
`MCM_API_AutoAddCheckBox(Group, DISABLE_TRAINING_CENTER_REQUIREMENT);
`MCM_API_AutoAddCheckBox(Group, DISABLE_NEWCLASS_POPUPS);
`MCM_API_AutoAddCheckBox(Group, DISABLE_COMINT_POPUPS);
Expand All @@ -63,6 +66,7 @@ simulated function SHOW_UNREACHED_PERKS_ChangeHandler(MCM_API_Setting _Setting,

simulated function LoadSavedSettings()
{
SHOW_INVENTORY_SLOT = `GETMCMVAR(SHOW_INVENTORY_SLOT);
SHOW_UNREACHED_PERKS = `GETMCMVAR(SHOW_UNREACHED_PERKS);
DISABLE_TRAINING_CENTER_REQUIREMENT = `GETMCMVAR(DISABLE_TRAINING_CENTER_REQUIREMENT);
DISABLE_NEWCLASS_POPUPS = `GETMCMVAR(DISABLE_NEWCLASS_POPUPS);
Expand All @@ -72,6 +76,7 @@ simulated function LoadSavedSettings()

simulated function ResetButtonClicked(MCM_API_SettingsPage Page)
{
`MCM_API_AutoReset(SHOW_INVENTORY_SLOT);
`MCM_API_AutoReset(SHOW_UNREACHED_PERKS);
`MCM_API_AutoReset(DISABLE_TRAINING_CENTER_REQUIREMENT);
`MCM_API_AutoReset(DISABLE_NEWCLASS_POPUPS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,9 @@ function PreviewAbility(int Rank, int Branch)
// Variable for Issue #128
local string MutuallyExclusiveNames;

// Variable for Issue #55
local string SlotName;

// NPSBDP Patch
Branch += Position;

Expand Down Expand Up @@ -1294,6 +1297,15 @@ function PreviewAbility(int Rank, int Branch)
AbilityDesc $= "\n" $ class'UIUtilities_Text'.static.GetColoredText(DisabledReason, eUIState_Warning);
}

// Issue #55
if (`GETMCMVAR(SHOW_INVENTORY_SLOT))
{
SlotName = class'UIArmory_loadout'.default.m_strInventoryLabels[AbilityTree[Branch].ApplyToWeaponSlot];
if (SlotName != "")
{
AbilityName $= " (" $ Locs(SlotName) $ ")";
}
}
AS_SetDescriptionData(AbilityIcon, AbilityName, AbilityDesc, "", CostLabel, AbilityCost, APLabel);
}

Expand Down

0 comments on commit aa3d960

Please sign in to comment.