zoom plugin: add zoom scroll speed configuration

This commit is contained in:
Ryan
2019-07-12 23:34:01 -04:00
committed by Adam
parent ebed283f1d
commit aeab3e8a7b
3 changed files with 21 additions and 0 deletions

View File

@@ -97,4 +97,16 @@ public interface ZoomConfig extends Config
{ {
return 512; return 512;
} }
@ConfigItem(
keyName = "zoomIncrement",
name = "Zoom Speed",
description = "Speed of zoom",
position = 6
)
default int zoomIncrement()
{
return 25;
}
} }

View File

@@ -56,6 +56,7 @@ public class ZoomPlugin extends Plugin implements KeyListener
* Larger values trigger an overflow in the engine's fov to scale code. * Larger values trigger an overflow in the engine's fov to scale code.
*/ */
private static final int INNER_ZOOM_LIMIT = 1004; private static final int INNER_ZOOM_LIMIT = 1004;
private static final int DEFAULT_ZOOM_INCREMENT = 25;
private boolean controlDown; private boolean controlDown;
@@ -109,6 +110,12 @@ public class ZoomPlugin extends Plugin implements KeyListener
return; return;
} }
if ("scrollWheelZoomIncrement".equals(event.getEventName()) && zoomConfig.zoomIncrement() != DEFAULT_ZOOM_INCREMENT)
{
intStack[intStackSize - 1] = zoomConfig.zoomIncrement();
return;
}
if (zoomConfig.innerLimit()) if (zoomConfig.innerLimit())
{ {
// This lets the options panel's slider have an exponential rate // This lets the options panel's slider have an exponential rate

View File

@@ -11,6 +11,8 @@
iconst 0 iconst 0
iload 0 iload 0
iconst 25 iconst 25
sconst "scrollWheelZoomIncrement"
runelite_callback
multiply multiply
sub sub
istore 1 istore 1