Refactor drag and drop to use a shared interface (#2012)
* WIP in progress hours * Cleanup * Fix bugle * Fix nullable error * Merge fixes * Merge fixes * Merge fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Content.Client.GameObjects.Components.Disposal;
|
||||
using Content.Client.Interfaces.GameObjects.Components.Interaction;
|
||||
using Content.Shared.GameObjects;
|
||||
using Content.Shared.GameObjects.Components.Items;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Interfaces.ResourceManagement;
|
||||
using Robust.Client.ResourceManagement;
|
||||
@@ -19,7 +19,7 @@ namespace Content.Client.GameObjects.Components.Items
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IItemComponent))]
|
||||
public class ItemComponent : Component, IItemComponent, IClientDraggable
|
||||
public class ItemComponent : Component, IItemComponent, IDraggable
|
||||
{
|
||||
public override string Name => "Item";
|
||||
public override uint? NetID => ContentNetIDs.ITEM;
|
||||
@@ -85,14 +85,15 @@ namespace Content.Client.GameObjects.Components.Items
|
||||
EquippedPrefix = itemComponentState.EquippedPrefix;
|
||||
}
|
||||
|
||||
bool IClientDraggable.ClientCanDropOn(CanDropEventArgs eventArgs)
|
||||
bool IDraggable.CanDrop(CanDropEventArgs args)
|
||||
{
|
||||
return eventArgs.Target.HasComponent<DisposalUnitComponent>();
|
||||
return args.Target.HasComponent<DisposalUnitComponent>();
|
||||
}
|
||||
|
||||
bool IClientDraggable.ClientCanDrag(CanDragEventArgs eventArgs)
|
||||
public bool Drop(DragDropEventArgs args)
|
||||
{
|
||||
return true;
|
||||
// TODO: Shared item class
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user