inventory grid: add delay before activating overlay
This commit is contained in:
@@ -1360,6 +1360,13 @@ public interface Client extends GameEngine
|
|||||||
*/
|
*/
|
||||||
boolean isInInstancedRegion();
|
boolean isInInstancedRegion();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of client ticks an item has been pressed
|
||||||
|
*
|
||||||
|
* @return the number of client ticks an item has been pressed
|
||||||
|
*/
|
||||||
|
int getItemPressedDuration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether the client is hiding entities.
|
* Sets whether the client is hiding entities.
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import net.runelite.client.ui.overlay.OverlayPosition;
|
|||||||
class InventoryGridOverlay extends Overlay
|
class InventoryGridOverlay extends Overlay
|
||||||
{
|
{
|
||||||
private static final int INVENTORY_SIZE = 28;
|
private static final int INVENTORY_SIZE = 28;
|
||||||
|
private static final int DRAG_DELAY = 5;
|
||||||
|
|
||||||
private static final Color HIGHLIGHT = new Color(0, 255, 0, 45);
|
private static final Color HIGHLIGHT = new Color(0, 255, 0, 45);
|
||||||
private static final Color GRID = new Color(255, 255, 255, 45);
|
private static final Color GRID = new Color(255, 255, 255, 45);
|
||||||
@@ -70,7 +71,8 @@ class InventoryGridOverlay extends Overlay
|
|||||||
final Widget if1DraggingWidget = client.getIf1DraggedWidget();
|
final Widget if1DraggingWidget = client.getIf1DraggedWidget();
|
||||||
final Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY);
|
final Widget inventoryWidget = client.getWidget(WidgetInfo.INVENTORY);
|
||||||
|
|
||||||
if (if1DraggingWidget == null || if1DraggingWidget != inventoryWidget)
|
if (if1DraggingWidget == null || if1DraggingWidget != inventoryWidget
|
||||||
|
|| client.getItemPressedDuration() < DRAG_DELAY)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -777,6 +777,7 @@ public interface RSClient extends RSGameEngine, Client
|
|||||||
boolean isInInstancedRegion();
|
boolean isInInstancedRegion();
|
||||||
|
|
||||||
@Import("itemPressedDuration")
|
@Import("itemPressedDuration")
|
||||||
|
@Override
|
||||||
int getItemPressedDuration();
|
int getItemPressedDuration();
|
||||||
|
|
||||||
@Import("itemPressedDuration")
|
@Import("itemPressedDuration")
|
||||||
|
|||||||
Reference in New Issue
Block a user