tag tabs: respect bank rearrange mode for reordering
This commit is contained in:
@@ -470,6 +470,7 @@ public enum Varbits
|
||||
SUPERIOR_ENABLED(5362),
|
||||
FOSSIL_ISLAND_WYVERN_DISABLE(6251),
|
||||
|
||||
BANK_REARRANGE_MODE(3959),
|
||||
CURRENT_BANK_TAB(4150),
|
||||
|
||||
WORLDHOPPER_FAVROITE_1(4597),
|
||||
|
||||
@@ -690,12 +690,7 @@ public class TabInterface
|
||||
else if (parent.getId() == draggedOn.getId() && parent.getId() == draggedWidget.getId())
|
||||
{
|
||||
// Reorder tag tabs
|
||||
if (!Strings.isNullOrEmpty(draggedOn.getName()))
|
||||
{
|
||||
tabManager.move(draggedWidget.getName(), draggedOn.getName());
|
||||
tabManager.save();
|
||||
updateTabs();
|
||||
}
|
||||
moveTagTab(draggedWidget, draggedOn);
|
||||
}
|
||||
}
|
||||
else if (draggedWidget.getItemId() > 0)
|
||||
@@ -725,6 +720,26 @@ public class TabInterface
|
||||
}
|
||||
}
|
||||
|
||||
private void moveTagTab(final Widget source, final Widget dest)
|
||||
{
|
||||
if (Strings.isNullOrEmpty(dest.getName()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (client.getVar(Varbits.BANK_REARRANGE_MODE) == 0)
|
||||
{
|
||||
tabManager.swap(source.getName(), dest.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
tabManager.insert(source.getName(), dest.getName());
|
||||
}
|
||||
|
||||
tabManager.save();
|
||||
updateTabs();
|
||||
}
|
||||
|
||||
private boolean isHidden()
|
||||
{
|
||||
Widget widget = client.getWidget(WidgetInfo.BANK_CONTAINER);
|
||||
|
||||
@@ -95,7 +95,7 @@ class TabManager
|
||||
return tagTab;
|
||||
}
|
||||
|
||||
void move(String tagToMove, String tagDestination)
|
||||
void swap(String tagToMove, String tagDestination)
|
||||
{
|
||||
tagToMove = Text.standardize(tagToMove);
|
||||
tagDestination = Text.standardize(tagDestination);
|
||||
@@ -106,6 +106,17 @@ class TabManager
|
||||
}
|
||||
}
|
||||
|
||||
void insert(String tagToMove, String tagDestination)
|
||||
{
|
||||
tagToMove = Text.standardize(tagToMove);
|
||||
tagDestination = Text.standardize(tagDestination);
|
||||
|
||||
if (contains(tagToMove) && contains(tagDestination))
|
||||
{
|
||||
tabs.add(indexOf(tagDestination), tabs.remove(indexOf(tagToMove)));
|
||||
}
|
||||
}
|
||||
|
||||
void remove(String tag)
|
||||
{
|
||||
TagTab tagTab = find(tag);
|
||||
|
||||
Reference in New Issue
Block a user