Merge pull request #9021 from jplsek/inv-grid-color-config
Inventory Grid Plugin: Add color configuration
This commit is contained in:
@@ -24,6 +24,8 @@
|
||||
*/
|
||||
package net.runelite.client.plugins.inventorygrid;
|
||||
|
||||
import java.awt.Color;
|
||||
import net.runelite.client.config.Alpha;
|
||||
import net.runelite.client.config.Config;
|
||||
import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
@@ -35,7 +37,8 @@ public interface InventoryGridConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "showItem",
|
||||
name = "Show item",
|
||||
description = "Show a preview of the item in the new slot"
|
||||
description = "Show a preview of the item in the new slot",
|
||||
position = 6
|
||||
)
|
||||
default boolean showItem()
|
||||
{
|
||||
@@ -45,7 +48,8 @@ public interface InventoryGridConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "showGrid",
|
||||
name = "Show grid",
|
||||
description = "Show a grid on the inventory while dragging"
|
||||
description = "Show a grid on the inventory while dragging",
|
||||
position = 3
|
||||
)
|
||||
default boolean showGrid()
|
||||
{
|
||||
@@ -55,7 +59,8 @@ public interface InventoryGridConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "showHighlight",
|
||||
name = "Highlight background",
|
||||
description = "Show a green background highlight on the new slot"
|
||||
description = "Show a background highlight on the new slot",
|
||||
position = 2
|
||||
)
|
||||
default boolean showHighlight()
|
||||
{
|
||||
@@ -65,11 +70,36 @@ public interface InventoryGridConfig extends Config
|
||||
@ConfigItem(
|
||||
keyName = "dragDelay",
|
||||
name = "Drag delay",
|
||||
description = "Time to wait after an item press before the overlay is enabled"
|
||||
description = "Time to wait after an item press before the overlay is enabled",
|
||||
position = 1
|
||||
)
|
||||
@Units(Units.MILLISECONDS)
|
||||
default int dragDelay()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "gridColor",
|
||||
name = "Grid color",
|
||||
description = "The color of the grid",
|
||||
position = 4
|
||||
)
|
||||
default Color gridColor()
|
||||
{
|
||||
return new Color(255, 255, 255, 45);
|
||||
}
|
||||
|
||||
@Alpha
|
||||
@ConfigItem(
|
||||
keyName = "highlightColor",
|
||||
name = "Highlight color",
|
||||
description = "The color of the new inventory slot highlight",
|
||||
position = 5
|
||||
)
|
||||
default Color highlightColor()
|
||||
{
|
||||
return new Color(0, 255, 0, 45);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.inventorygrid;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import java.awt.AlphaComposite;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Point;
|
||||
@@ -48,9 +47,6 @@ class InventoryGridOverlay extends Overlay
|
||||
private static final int INVENTORY_SIZE = 28;
|
||||
private static final int DISTANCE_TO_ACTIVATE_HOVER = 5;
|
||||
|
||||
private static final Color HIGHLIGHT = new Color(0, 255, 0, 45);
|
||||
private static final Color GRID = new Color(255, 255, 255, 45);
|
||||
|
||||
private final InventoryGridConfig config;
|
||||
private final Client client;
|
||||
private final ItemManager itemManager;
|
||||
@@ -126,12 +122,12 @@ class InventoryGridOverlay extends Overlay
|
||||
|
||||
if (config.showHighlight() && inBounds)
|
||||
{
|
||||
graphics.setColor(HIGHLIGHT);
|
||||
graphics.setColor(config.highlightColor());
|
||||
graphics.fill(bounds);
|
||||
}
|
||||
else if (config.showGrid())
|
||||
{
|
||||
graphics.setColor(GRID);
|
||||
graphics.setColor(config.gridColor());
|
||||
graphics.fill(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user