banktags: Add tag tab drag blocking

This commit is contained in:
trimbe
2020-07-20 23:43:12 -07:00
committed by Jordan Atwood
parent e8d4ff38cb
commit d8df5920ba
2 changed files with 19 additions and 0 deletions

View File

@@ -64,6 +64,17 @@ public interface BankTagsConfig extends Config
return false;
}
@ConfigItem(
keyName = "preventTagTabDrags",
name = "Prevent tag tab item dragging",
description = "Ignore dragged items to prevent unwanted bank item reordering",
position = 4
)
default boolean preventTagTabDrags()
{
return false;
}
@ConfigItem(
keyName = "position",
name = "",

View File

@@ -802,6 +802,14 @@ public class TabInterface
Widget draggedOn = client.getDraggedOnWidget();
Widget draggedWidget = client.getDraggedWidget();
// Returning early or nulling the drag release listener has no effect. Hence, we need to
// null the draggedOnWidget instead.
if (draggedWidget.getId() == WidgetInfo.BANK_ITEM_CONTAINER.getId() && isActive()
&& config.preventTagTabDrags())
{
client.setDraggedOnWidget(null);
}
if (!isDragging || draggedOn == null)
{
return;