zoom plugin: add zoom scroll speed configuration
This commit is contained in:
@@ -97,4 +97,16 @@ public interface ZoomConfig extends Config
|
||||
{
|
||||
return 512;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
keyName = "zoomIncrement",
|
||||
name = "Zoom Speed",
|
||||
description = "Speed of zoom",
|
||||
position = 6
|
||||
)
|
||||
default int zoomIncrement()
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class ZoomPlugin extends Plugin implements KeyListener
|
||||
* 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 DEFAULT_ZOOM_INCREMENT = 25;
|
||||
|
||||
private boolean controlDown;
|
||||
|
||||
@@ -109,6 +110,12 @@ public class ZoomPlugin extends Plugin implements KeyListener
|
||||
return;
|
||||
}
|
||||
|
||||
if ("scrollWheelZoomIncrement".equals(event.getEventName()) && zoomConfig.zoomIncrement() != DEFAULT_ZOOM_INCREMENT)
|
||||
{
|
||||
intStack[intStackSize - 1] = zoomConfig.zoomIncrement();
|
||||
return;
|
||||
}
|
||||
|
||||
if (zoomConfig.innerLimit())
|
||||
{
|
||||
// This lets the options panel's slider have an exponential rate
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
iconst 0
|
||||
iload 0
|
||||
iconst 25
|
||||
sconst "scrollWheelZoomIncrement"
|
||||
runelite_callback
|
||||
multiply
|
||||
sub
|
||||
istore 1
|
||||
|
||||
Reference in New Issue
Block a user