Reference Index
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using AetherBags.Configuration;
|
using AetherBags.Configuration;
|
||||||
|
using AetherBags.Nodes.Input;
|
||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||||
using KamiToolKit.Nodes;
|
using KamiToolKit.Nodes;
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||||
using KamiToolKit.Nodes;
|
using KamiToolKit.Nodes;
|
||||||
|
|
||||||
namespace AetherBags.Nodes;
|
namespace AetherBags.Nodes.Input;
|
||||||
|
|
||||||
public class LabeledDropdownNode : SimpleComponentNode {
|
public class LabeledDropdownNode : SimpleComponentNode {
|
||||||
private readonly GridNode _gridNode;
|
private readonly GridNode _gridNode;
|
||||||
|
|||||||
@@ -224,7 +224,10 @@ public class InventoryCategoryNode : SimpleComponentNode
|
|||||||
InventoryItem item = data.Item;
|
InventoryItem item = data.Item;
|
||||||
InventoryMappedLocation visualLocation = data.VisualLocation;
|
InventoryMappedLocation visualLocation = data.VisualLocation;
|
||||||
|
|
||||||
bool useVisualLocation = item.Container.IsMainInventory;
|
int startIndex = item.Container.GetInventoryStartIndex;
|
||||||
|
int absoluteIndex = startIndex + visualLocation.Slot;
|
||||||
|
|
||||||
|
bool useVisualLocation = true;
|
||||||
bool isSlotBlocked = item.Container.IsMainInventory && data.IsSlotBlocked;
|
bool isSlotBlocked = item.Container.IsMainInventory && data.IsSlotBlocked;
|
||||||
float alpha = !isSlotBlocked && data.IsEligibleForContext ? 1.0f : 0.4f;
|
float alpha = !isSlotBlocked && data.IsEligibleForContext ? 1.0f : 0.4f;
|
||||||
|
|
||||||
@@ -241,6 +244,7 @@ public class InventoryCategoryNode : SimpleComponentNode
|
|||||||
Type = DragDropType.Item,
|
Type = DragDropType.Item,
|
||||||
Int1 = useVisualLocation ? visualLocation.Container : (int)item.Container,
|
Int1 = useVisualLocation ? visualLocation.Container : (int)item.Container,
|
||||||
Int2 = useVisualLocation ? visualLocation.Slot : item.Slot,
|
Int2 = useVisualLocation ? visualLocation.Slot : item.Slot,
|
||||||
|
ReferenceIndex = (short)absoluteIndex,
|
||||||
},
|
},
|
||||||
IsClickable = true,
|
IsClickable = true,
|
||||||
OnDiscard = node => OnDiscard(node, data),
|
OnDiscard = node => OnDiscard(node, data),
|
||||||
@@ -271,7 +275,7 @@ public class InventoryCategoryNode : SimpleComponentNode
|
|||||||
private void OnPayloadAccepted(DragDropNode node, DragDropPayload payload, ItemInfo targetItemInfo)
|
private void OnPayloadAccepted(DragDropNode node, DragDropPayload payload, ItemInfo targetItemInfo)
|
||||||
{
|
{
|
||||||
InventoryItem item = targetItemInfo.Item;
|
InventoryItem item = targetItemInfo.Item;
|
||||||
if (! payload.IsValidInventoryPayload)
|
if (!payload.IsValidInventoryPayload)
|
||||||
{
|
{
|
||||||
Services.Logger.Warning($"[OnPayload] Invalid payload type: {payload.Type}");
|
Services.Logger.Warning($"[OnPayload] Invalid payload type: {payload.Type}");
|
||||||
return;
|
return;
|
||||||
@@ -282,7 +286,7 @@ public class InventoryCategoryNode : SimpleComponentNode
|
|||||||
|
|
||||||
InventoryLocation sourceLocation = payload.InventoryLocation;
|
InventoryLocation sourceLocation = payload.InventoryLocation;
|
||||||
|
|
||||||
if (! sourceLocation.IsValid)
|
if (!sourceLocation.IsValid)
|
||||||
{
|
{
|
||||||
Services.Logger. Warning($"[OnPayload] Could not resolve source from payload");
|
Services.Logger. Warning($"[OnPayload] Could not resolve source from payload");
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user