inventory grid: add color config
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;
|
||||
@@ -34,7 +36,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 = 1
|
||||
)
|
||||
default boolean showItem()
|
||||
{
|
||||
@@ -44,7 +47,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 = 2
|
||||
)
|
||||
default boolean showGrid()
|
||||
{
|
||||
@@ -54,10 +58,35 @@ 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 = 3
|
||||
)
|
||||
default boolean showHighlight()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@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;
|
||||
@@ -47,9 +46,6 @@ class InventoryGridOverlay extends Overlay
|
||||
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 GRID = new Color(255, 255, 255, 45);
|
||||
|
||||
private final InventoryGridConfig config;
|
||||
private final Client client;
|
||||
private final ItemManager itemManager;
|
||||
@@ -101,12 +97,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