Merge pull request #7536 from deathbeam/require-shift
Add option to require shift for overlay menus
This commit is contained in:
@@ -229,11 +229,22 @@ public interface RuneLiteConfig extends Config
|
||||
return FontType.REGULAR;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "menuEntryShift",
|
||||
name = "Require Shift for overlay menu",
|
||||
description = "Overlay right-click menu will require shift to be added",
|
||||
position = 33
|
||||
)
|
||||
default boolean menuEntryShift()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "infoBoxVertical",
|
||||
name = "Display infoboxes vertically",
|
||||
description = "Toggles the infoboxes to display vertically",
|
||||
position = 33
|
||||
position = 40
|
||||
)
|
||||
default boolean infoBoxVertical()
|
||||
{
|
||||
@@ -244,7 +255,7 @@ public interface RuneLiteConfig extends Config
|
||||
keyName = "infoBoxWrap",
|
||||
name = "Infobox wrap count",
|
||||
description = "Configures the amount of infoboxes shown before wrapping",
|
||||
position = 34
|
||||
position = 41
|
||||
)
|
||||
default int infoBoxWrap()
|
||||
{
|
||||
@@ -255,7 +266,7 @@ public interface RuneLiteConfig extends Config
|
||||
keyName = "infoBoxSize",
|
||||
name = "Infobox size (px)",
|
||||
description = "Configures the size of each infobox in pixels",
|
||||
position = 35
|
||||
position = 42
|
||||
)
|
||||
default int infoBoxSize()
|
||||
{
|
||||
|
||||
@@ -75,6 +75,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
private final Point mousePosition = new Point();
|
||||
private Overlay movedOverlay;
|
||||
private boolean inOverlayDraggingMode;
|
||||
private boolean inMenuEntryMode;
|
||||
private MenuEntry[] menuEntries;
|
||||
|
||||
// Overlay state validation
|
||||
@@ -106,6 +107,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
if (!event.isFocused())
|
||||
{
|
||||
inOverlayDraggingMode = false;
|
||||
inMenuEntryMode = false;
|
||||
menuEntries = null;
|
||||
}
|
||||
}
|
||||
@@ -118,6 +120,11 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inMenuEntryMode && runeLiteConfig.menuEntryShift())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (client.isMenuOpen())
|
||||
{
|
||||
return;
|
||||
@@ -401,6 +408,11 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
{
|
||||
inOverlayDraggingMode = true;
|
||||
}
|
||||
|
||||
if (e.isShiftDown() && runeLiteConfig.menuEntryShift())
|
||||
{
|
||||
inMenuEntryMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -410,6 +422,11 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
{
|
||||
inOverlayDraggingMode = false;
|
||||
}
|
||||
|
||||
if (!e.isShiftDown())
|
||||
{
|
||||
inMenuEntryMode = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void safeRender(Client client, Overlay overlay, OverlayLayer layer, Graphics2D graphics, Point point)
|
||||
|
||||
Reference in New Issue
Block a user