Fix zoom after update

This commit is contained in:
Magic fTail
2018-10-11 19:21:43 +02:00
parent 78cbf47b83
commit dea5efffc2
7 changed files with 31 additions and 84 deletions

View File

@@ -31,22 +31,11 @@ import net.runelite.client.config.ConfigItem;
@ConfigGroup("zoom")
public interface ZoomConfig extends Config
{
@ConfigItem(
keyName = "enabled",
name = "Expand outer zoom limit",
description = "Configures whether or not the outer zoom limit is reduced",
position = 1
)
default boolean outerLimit()
{
return true;
}
@ConfigItem(
keyName = "inner",
name = "Expand inner zoom limit",
description = "Configures whether or not the inner zoom limit is reduced",
position = 2
position = 1
)
default boolean innerLimit()
{
@@ -57,7 +46,7 @@ public interface ZoomConfig extends Config
keyName = "relaxCameraPitch",
name = "Vertical camera",
description = "Relax the camera's upper pitch limit",
position = 3
position = 2
)
default boolean relaxCameraPitch()
{
@@ -68,7 +57,7 @@ public interface ZoomConfig extends Config
keyName = "requireControlDown",
name = "Require control down",
description = "Configures if holding control is required for zooming",
position = 4
position = 3
)
default boolean requireControlDown()
{

View File

@@ -82,34 +82,16 @@ public class ZoomPlugin extends Plugin implements KeyListener
intStack[intStackSize - 1] = 1;
}
if (zoomConfig.outerLimit())
if ("innerZoomLimit".equals(event.getEventName()) && zoomConfig.innerLimit())
{
switch (event.getEventName())
{
case "fixedOuterZoomLimit":
intStack[intStackSize - 1] = 95;
break;
case "resizableOuterZoomLimit":
intStack[intStackSize - 1] = 70;
break;
}
intStack[intStackSize - 1] = 1200;
return;
}
if (zoomConfig.innerLimit())
{
switch (event.getEventName())
{
case "fixedInnerZoomLimit":
intStack[intStackSize - 1] = 2100;
break;
case "resizableInnerZoomLimit":
intStack[intStackSize - 1] = 2200;
break;
}
}
if (zoomConfig.outerLimit() || zoomConfig.innerLimit())
{
// This lets the options panel's slider have an exponential rate
final double exponent = 3.d;
final double exponent = 2.d;
switch (event.getEventName())
{
case "zoomLinToExp":