Skip to content

Commit 8c42763

Browse files
committed
advanced stripping remove weapon attachments
1 parent 33fdfcc commit 8c42763

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

IRTweaks/IRTweaks/IRTweaks.csproj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
<AssemblyTitle>IRTweaks</AssemblyTitle>
2727
<Product>IRTweaks</Product>
2828
<Copyright>Copyright © 2023</Copyright>
29-
<AssemblyVersion>2.2.2</AssemblyVersion>
30-
<FileVersion>2.2.2</FileVersion>
29+
<AssemblyVersion>2.2.3</AssemblyVersion>
30+
<FileVersion>2.2.3</FileVersion>
3131
<LangVersion>11</LangVersion>
3232
</PropertyGroup>
3333

@@ -66,6 +66,10 @@
6666
<Reference Include="AttackImprovementMod">
6767
<HintPath>$(DeployedModPath)\..\CustomAmmoCategories\AttackImprovementMod.dll</HintPath>
6868
<Private>False</Private>
69+
</Reference>
70+
<Reference Include="CustomComponents">
71+
<HintPath>$(DeployedModPath)\..\CustomComponents\CustomComponents.dll</HintPath>
72+
<Private>False</Private>
6973
</Reference>
7074
<Reference Include="CustomAmmoCategories">
7175
<HintPath>$(DeployedModPath)\..\CustomAmmoCategories\CustomAmmoCategories.dll</HintPath>

IRTweaks/IRTweaks/Modules/UI/MechBayChanges.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using BattleTech.UI.TMProWrapper;
2+
using CustomComponents;
23
using HBS;
34
using Localize;
45
using System;
56
using System.Collections.Generic;
7+
using System.Linq;
68
using UnityEngine;
79
using UnityEngine.Events;
810
using UnityEngine.EventSystems;
@@ -186,7 +188,7 @@ internal static void AdvancedStripping(this MechLabLocationWidget widget, MechLa
186188
for (int i = loclInv.Count - 1; i >= 0; i--)
187189
{
188190
MechLabItemSlotElement mechLabItemSlotElement = loclInv[i];
189-
if (!mechLabItemSlotElement.ComponentRef.IsFixed && (mechLabItemSlotElement.ComponentRef.Def is WeaponDef || mechLabItemSlotElement.ComponentRef.Def is AmmunitionBoxDef))
191+
if (!mechLabItemSlotElement.ComponentRef.IsFixed && (mechLabItemSlotElement.ComponentRef.Def is WeaponDef || mechLabItemSlotElement.ComponentRef.Def is AmmunitionBoxDef || mechLabItemSlotElement.componentRef.Def.GetComponents<Category>().Any(c => c.CategoryID == "WeaponAttachment")))
190192
{
191193
widget.OnRemoveItem(mechLabItemSlotElement, true);
192194
panel.ForceItemDrop(mechLabItemSlotElement);

0 commit comments

Comments
 (0)