unload ammo/mag, 1.7.0
This commit is contained in:
@@ -31,11 +31,6 @@ namespace UIFixes
|
||||
|
||||
public static void Toggle(GridItemView itemView)
|
||||
{
|
||||
if (!itemView.IsInteractable)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SelectedItemViews.ContainsKey(itemView))
|
||||
{
|
||||
Deselect(itemView);
|
||||
@@ -57,9 +52,9 @@ namespace UIFixes
|
||||
|
||||
public static void Select(GridItemView itemView)
|
||||
{
|
||||
if (itemView.IsInteractable && !SelectedItemViews.ContainsKey(itemView))
|
||||
if (itemView.IsSelectable() && !SelectedItemViews.ContainsKey(itemView))
|
||||
{
|
||||
ItemContextClass itemContext = new ItemContextClass(itemView.ItemContext, itemView.ItemRotation);
|
||||
ItemContextClass itemContext = new(itemView.ItemContext, itemView.ItemRotation);
|
||||
itemContext.GClass2813_0.OnDisposed += RugPull;
|
||||
itemContext.OnDisposed += RugPull;
|
||||
|
||||
@@ -159,4 +154,12 @@ namespace UIFixes
|
||||
selectedBackground?.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public static class MultiSelectExtensions
|
||||
{
|
||||
public static bool IsSelectable(this ItemView itemView)
|
||||
{
|
||||
return itemView.IsInteractable && itemView.IsSearched && itemView.RemoveError.Value == null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ namespace UIFixes
|
||||
public class MultiSelectDebug : MonoBehaviour
|
||||
{
|
||||
private GUIStyle guiStyle;
|
||||
private Rect guiRect = new(20, 20, 0, 0);
|
||||
private Rect guiRect = new(20, 70, 0, 0);
|
||||
|
||||
GUIContent guiContent;
|
||||
|
||||
|
@@ -34,53 +34,60 @@ namespace UIFixes
|
||||
return;
|
||||
}
|
||||
|
||||
var interactions = __instance.GetItemContextInteractions(itemContext, null);
|
||||
if (Settings.InspectKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.Inspect);
|
||||
interactions.ExecuteInteraction(EItemInfoButton.Inspect);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.OpenKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.Open);
|
||||
interactions.ExecuteInteraction(EItemInfoButton.Open);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.TopUpKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.TopUp);
|
||||
interactions.ExecuteInteraction(EItemInfoButton.TopUp);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.UseKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.Use);
|
||||
interactions.ExecuteInteraction(EItemInfoButton.Use);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.UseAllKeyBind.Value.IsDown())
|
||||
{
|
||||
var interactions = __instance.GetItemContextInteractions(itemContext, null);
|
||||
if (!interactions.ExecuteInteraction(EItemInfoButton.UseAll))
|
||||
{
|
||||
interactions.ExecuteInteraction(EItemInfoButton.Use);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.UnloadAmmoKeyBind.Value.IsDown())
|
||||
if (Settings.UnloadKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.UnloadAmmo);
|
||||
if (!interactions.ExecuteInteraction(EItemInfoButton.Unload))
|
||||
{
|
||||
interactions.ExecuteInteraction(EItemInfoButton.UnloadAmmo);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.FilterByKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.FilterSearch);
|
||||
interactions.ExecuteInteraction(EItemInfoButton.FilterSearch);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Settings.LinkedSearchKeyBind.Value.IsDown())
|
||||
{
|
||||
__instance.GetItemContextInteractions(itemContext, null).ExecuteInteraction(EItemInfoButton.LinkedSearch);
|
||||
interactions.ExecuteInteraction(EItemInfoButton.LinkedSearch);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
10
Settings.cs
10
Settings.cs
@@ -47,7 +47,7 @@ namespace UIFixes
|
||||
public static ConfigEntry<KeyboardShortcut> TopUpKeyBind { get; set; }
|
||||
public static ConfigEntry<KeyboardShortcut> UseKeyBind { get; set; }
|
||||
public static ConfigEntry<KeyboardShortcut> UseAllKeyBind { get; set; }
|
||||
public static ConfigEntry<KeyboardShortcut> UnloadAmmoKeyBind { get; set; }
|
||||
public static ConfigEntry<KeyboardShortcut> UnloadKeyBind { get; set; }
|
||||
public static ConfigEntry<KeyboardShortcut> FilterByKeyBind { get; set; }
|
||||
public static ConfigEntry<KeyboardShortcut> LinkedSearchKeyBind { get; set; }
|
||||
public static ConfigEntry<bool> UseRaidMouseScrollMulti { get; set; } // Advanced
|
||||
@@ -228,12 +228,12 @@ namespace UIFixes
|
||||
null,
|
||||
new ConfigurationManagerAttributes { })));
|
||||
|
||||
configEntries.Add(UnloadAmmoKeyBind = config.Bind(
|
||||
configEntries.Add(UnloadKeyBind = config.Bind(
|
||||
InputSection,
|
||||
"Unload Ammo Shortcut",
|
||||
new KeyboardShortcut(KeyCode.None),
|
||||
"Unload Mag/Ammo Shortcut",
|
||||
new KeyboardShortcut(KeyCode.U),
|
||||
new ConfigDescription(
|
||||
"Keybind to unload the ammo in a magazine",
|
||||
"Keybind to unload the ammo in a magazine, or a magazine in a gun",
|
||||
null,
|
||||
new ConfigurationManagerAttributes { })));
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net471</TargetFramework>
|
||||
<AssemblyName>Tyfon.UIFixes</AssemblyName>
|
||||
<Description>SPT UI Fixes</Description>
|
||||
<Version>1.6.7</Version>
|
||||
<Version>1.7.0</Version>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Configurations>Debug;Release;Dist</Configurations>
|
||||
@@ -64,7 +64,7 @@
|
||||
<HintPath>$(PathToSPT)\EscapeFromTarkov_Data\Managed\UnityEngine.InputLegacyModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TextRenderingModule">
|
||||
<HintPath>..\..\..\..\SPT\3.8.3-debug\EscapeFromTarkov_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
|
||||
<HintPath>$(PathToSPT)\EscapeFromTarkov_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>$(PathToSPT)\EscapeFromTarkov_Data\Managed\UnityEngine.UI.dll</HintPath>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "uifixes",
|
||||
"version": "1.6.7",
|
||||
"version": "1.7.0",
|
||||
"main": "src/mod.js",
|
||||
"license": "MIT",
|
||||
"author": "Tyfon",
|
||||
|
Reference in New Issue
Block a user