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;
|
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(
|
@ConfigItem(
|
||||||
keyName = "infoBoxVertical",
|
keyName = "infoBoxVertical",
|
||||||
name = "Display infoboxes vertically",
|
name = "Display infoboxes vertically",
|
||||||
description = "Toggles the infoboxes to display vertically",
|
description = "Toggles the infoboxes to display vertically",
|
||||||
position = 33
|
position = 40
|
||||||
)
|
)
|
||||||
default boolean infoBoxVertical()
|
default boolean infoBoxVertical()
|
||||||
{
|
{
|
||||||
@@ -244,7 +255,7 @@ public interface RuneLiteConfig extends Config
|
|||||||
keyName = "infoBoxWrap",
|
keyName = "infoBoxWrap",
|
||||||
name = "Infobox wrap count",
|
name = "Infobox wrap count",
|
||||||
description = "Configures the amount of infoboxes shown before wrapping",
|
description = "Configures the amount of infoboxes shown before wrapping",
|
||||||
position = 34
|
position = 41
|
||||||
)
|
)
|
||||||
default int infoBoxWrap()
|
default int infoBoxWrap()
|
||||||
{
|
{
|
||||||
@@ -255,7 +266,7 @@ public interface RuneLiteConfig extends Config
|
|||||||
keyName = "infoBoxSize",
|
keyName = "infoBoxSize",
|
||||||
name = "Infobox size (px)",
|
name = "Infobox size (px)",
|
||||||
description = "Configures the size of each infobox in pixels",
|
description = "Configures the size of each infobox in pixels",
|
||||||
position = 35
|
position = 42
|
||||||
)
|
)
|
||||||
default int infoBoxSize()
|
default int infoBoxSize()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
private final Point mousePosition = new Point();
|
private final Point mousePosition = new Point();
|
||||||
private Overlay movedOverlay;
|
private Overlay movedOverlay;
|
||||||
private boolean inOverlayDraggingMode;
|
private boolean inOverlayDraggingMode;
|
||||||
|
private boolean inMenuEntryMode;
|
||||||
private MenuEntry[] menuEntries;
|
private MenuEntry[] menuEntries;
|
||||||
|
|
||||||
// Overlay state validation
|
// Overlay state validation
|
||||||
@@ -106,6 +107,7 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
if (!event.isFocused())
|
if (!event.isFocused())
|
||||||
{
|
{
|
||||||
inOverlayDraggingMode = false;
|
inOverlayDraggingMode = false;
|
||||||
|
inMenuEntryMode = false;
|
||||||
menuEntries = null;
|
menuEntries = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,6 +120,11 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!inMenuEntryMode && runeLiteConfig.menuEntryShift())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (client.isMenuOpen())
|
if (client.isMenuOpen())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -401,6 +408,11 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
{
|
{
|
||||||
inOverlayDraggingMode = true;
|
inOverlayDraggingMode = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.isShiftDown() && runeLiteConfig.menuEntryShift())
|
||||||
|
{
|
||||||
|
inMenuEntryMode = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -410,6 +422,11 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
|||||||
{
|
{
|
||||||
inOverlayDraggingMode = false;
|
inOverlayDraggingMode = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!e.isShiftDown())
|
||||||
|
{
|
||||||
|
inMenuEntryMode = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void safeRender(Client client, Overlay overlay, OverlayLayer layer, Graphics2D graphics, Point point)
|
private void safeRender(Client client, Overlay overlay, OverlayLayer layer, Graphics2D graphics, Point point)
|
||||||
|
|||||||
Reference in New Issue
Block a user