fix some multi-select context actions not working in raid
This commit is contained in:
@@ -239,11 +239,8 @@ namespace UIFixes
|
|||||||
{
|
{
|
||||||
if (!allOrNothing || InteractionCount(EItemInfoButton.Equip, itemUiContext) == Count)
|
if (!allOrNothing || InteractionCount(EItemInfoButton.Equip, itemUiContext) == Count)
|
||||||
{
|
{
|
||||||
foreach (ItemContextClass selectedItemContext in SortedItemContexts())
|
var taskSerializer = itemUiContext.GetOrAddComponent<ItemContextTaskSerializer>();
|
||||||
{
|
taskSerializer.Initialize(SortedItemContexts(), itemContext => itemUiContext.QuickEquip(itemContext.Item));
|
||||||
itemUiContext.QuickEquip(selectedItemContext.Item).HandleExceptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
itemUiContext.Tooltip?.Close();
|
itemUiContext.Tooltip?.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -252,11 +249,8 @@ namespace UIFixes
|
|||||||
{
|
{
|
||||||
if (!allOrNothing || InteractionCount(EItemInfoButton.Unequip, itemUiContext) == Count)
|
if (!allOrNothing || InteractionCount(EItemInfoButton.Unequip, itemUiContext) == Count)
|
||||||
{
|
{
|
||||||
foreach (ItemContextClass selectedItemContext in SortedItemContexts())
|
var taskSerializer = itemUiContext.GetOrAddComponent<ItemContextTaskSerializer>();
|
||||||
{
|
taskSerializer.Initialize(SortedItemContexts(), itemContext => itemUiContext.Uninstall(itemContext.GClass2813_0));
|
||||||
itemUiContext.Uninstall(selectedItemContext.GClass2813_0).HandleExceptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
itemUiContext.Tooltip?.Close();
|
itemUiContext.Tooltip?.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -265,11 +259,8 @@ namespace UIFixes
|
|||||||
{
|
{
|
||||||
if (!allOrNothing || InteractionCount(EItemInfoButton.UnloadAmmo, itemUiContext) == Count)
|
if (!allOrNothing || InteractionCount(EItemInfoButton.UnloadAmmo, itemUiContext) == Count)
|
||||||
{
|
{
|
||||||
foreach (ItemContextClass selectedItemContext in SortedItemContexts())
|
var taskSerializer = itemUiContext.GetOrAddComponent<ItemContextTaskSerializer>();
|
||||||
{
|
taskSerializer.Initialize(SortedItemContexts(), itemContext => itemUiContext.UnloadAmmo(itemContext.Item));
|
||||||
itemUiContext.UnloadAmmo(selectedItemContext.Item).HandleExceptions();
|
|
||||||
}
|
|
||||||
|
|
||||||
itemUiContext.Tooltip?.Close();
|
itemUiContext.Tooltip?.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,6 +319,9 @@ namespace UIFixes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Specific type of TaskSerializer because Unity can't understand generics
|
||||||
|
public class ItemContextTaskSerializer : TaskSerializer<ItemContextClass> { }
|
||||||
|
|
||||||
public static class MultiSelectExtensions
|
public static class MultiSelectExtensions
|
||||||
{
|
{
|
||||||
public static bool IsSelectable(this ItemView itemView)
|
public static bool IsSelectable(this ItemView itemView)
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace UIFixes
|
|||||||
____text.text += " (x" + count + ")";
|
____text.text += " (x" + count + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (caption == EItemInfoButton.UnloadAmmo.ToString())
|
else if (caption == EItemInfoButton.UnloadAmmo.ToString()))
|
||||||
{
|
{
|
||||||
int count = MultiSelect.InteractionCount(EItemInfoButton.UnloadAmmo, ItemUiContext.Instance);
|
int count = MultiSelect.InteractionCount(EItemInfoButton.UnloadAmmo, ItemUiContext.Instance);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
|
|||||||
@@ -34,9 +34,6 @@ namespace UIFixes
|
|||||||
private static bool DisableMerge = false;
|
private static bool DisableMerge = false;
|
||||||
private static bool IgnoreItemParent = false;
|
private static bool IgnoreItemParent = false;
|
||||||
|
|
||||||
// Specific type of TaskSerializer because Unity can't understand generics
|
|
||||||
public class ItemContextTaskSerializer : TaskSerializer<ItemContextClass> { }
|
|
||||||
|
|
||||||
public static void Enable()
|
public static void Enable()
|
||||||
{
|
{
|
||||||
// Initialization
|
// Initialization
|
||||||
|
|||||||
Reference in New Issue
Block a user