banktags: Add tag tab drag blocking
This commit is contained in:
@@ -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 = "",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user