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") @ConfigGroup("zoom")
public interface ZoomConfig extends Config 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( @ConfigItem(
keyName = "inner", keyName = "inner",
name = "Expand inner zoom limit", name = "Expand inner zoom limit",
description = "Configures whether or not the inner zoom limit is reduced", description = "Configures whether or not the inner zoom limit is reduced",
position = 2 position = 1
) )
default boolean innerLimit() default boolean innerLimit()
{ {
@@ -57,7 +46,7 @@ public interface ZoomConfig extends Config
keyName = "relaxCameraPitch", keyName = "relaxCameraPitch",
name = "Vertical camera", name = "Vertical camera",
description = "Relax the camera's upper pitch limit", description = "Relax the camera's upper pitch limit",
position = 3 position = 2
) )
default boolean relaxCameraPitch() default boolean relaxCameraPitch()
{ {
@@ -68,7 +57,7 @@ public interface ZoomConfig extends Config
keyName = "requireControlDown", keyName = "requireControlDown",
name = "Require control down", name = "Require control down",
description = "Configures if holding control is required for zooming", description = "Configures if holding control is required for zooming",
position = 4 position = 3
) )
default boolean requireControlDown() default boolean requireControlDown()
{ {

View File

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

View File

@@ -276,28 +276,24 @@ LABEL253:
6202 6202
get_varc 73 get_varc 73
load_int 128 load_int 128
load_string "fixedOuterZoomLimit"
runelite_callback
if_icmpge LABEL262 if_icmpge LABEL262
jump LABEL278 jump LABEL278
LABEL262: LABEL262:
get_varc 73 get_varc 73
load_int 896 load_int 896
load_string "fixedInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
if_icmple LABEL266 if_icmple LABEL266
jump LABEL278 jump LABEL278
LABEL266: LABEL266:
get_varc 74 get_varc 74
load_int 128 load_int 128
load_string "resizableOuterZoomLimit"
runelite_callback
if_icmpge LABEL270 if_icmpge LABEL270
jump LABEL278 jump LABEL278
LABEL270: LABEL270:
get_varc 74 get_varc 74
load_int 896 load_int 896
load_string "resizableInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
if_icmple LABEL274 if_icmple LABEL274
jump LABEL278 jump LABEL278

View File

@@ -35,19 +35,15 @@ LABEL5:
invoke 1046 invoke 1046
istore 2 istore 2
load_int 896 load_int 896
load_string "resizableInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
load_int 128 load_int 128
load_string "resizableOuterZoomLimit"
runelite_callback
isub isub
istore 6 ; resizable delta istore 6 ; resizable delta
load_int 896 load_int 896
load_string "fixedInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
load_int 128 load_int 128
load_string "fixedOuterZoomLimit"
runelite_callback
isub isub
istore 7 ; fixed delta istore 7 ; fixed delta
iload 2 iload 2
@@ -57,11 +53,9 @@ LABEL5:
idiv idiv
iload 6 iload 6
load_string "zoomLinToExp" load_string "zoomLinToExp"
runelite_callback runelite_callback
pop_int pop_int
load_int 128 load_int 128
load_string "resizableOuterZoomLimit"
runelite_callback
iadd iadd
istore 3 istore 3
iload 2 iload 2
@@ -71,11 +65,9 @@ LABEL5:
idiv idiv
iload 7 iload 7
load_string "zoomLinToExp" load_string "zoomLinToExp"
runelite_callback runelite_callback
pop_int pop_int
load_int 128 load_int 128
load_string "fixedOuterZoomLimit"
runelite_callback
iadd iadd
istore 4 istore 4
iload 4 iload 4

View File

@@ -8,19 +8,15 @@
; 1 fixedZoomRange ; 1 fixedZoomRange
; 2 bar size ; 2 bar size
load_int 896 load_int 896
load_string "resizableInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
load_int 128 load_int 128
load_string "resizableOuterZoomLimit"
runelite_callback
isub isub
istore 0 istore 0
load_int 896 load_int 896
load_string "fixedInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
load_int 128 load_int 128
load_string "fixedOuterZoomLimit"
runelite_callback
isub isub
istore 1 istore 1
load_int 17104905 load_int 17104905
@@ -45,33 +41,29 @@
LABEL27: LABEL27:
get_varc 74 get_varc 74
load_int 128 load_int 128
load_string "resizableOuterZoomLimit" isub
runelite_callback iload 0
isub
iload 2
load_string "zoomExpToLin" load_string "zoomExpToLin"
runelite_callback runelite_callback
pop_int pop_int
iload 2 iload 2
imul imul
iload 0 iload 0
idiv idiv
istore 5 istore 5
jump LABEL44 jump LABEL44
LABEL36: LABEL36:
get_varc 73 get_varc 73
load_int 128 load_int 128
load_string "fixedOuterZoomLimit" isub
runelite_callback iload 0
isub
iload 2
load_string "zoomExpToLin" load_string "zoomExpToLin"
runelite_callback runelite_callback
pop_int pop_int
iload 2 iload 2
imul imul
iload 1 iload 1
idiv idiv
istore 5 istore 5
LABEL44: LABEL44:
iload 5 iload 5

View File

@@ -3,7 +3,7 @@
.string_stack_count 0 .string_stack_count 0
.int_var_count 4 .int_var_count 4
.string_var_count 0 .string_var_count 0
load_int 0 load_int 1
load_int 0 load_int 0
load_string "scrollWheelZoom" load_string "scrollWheelZoom"
runelite_callback runelite_callback

View File

@@ -11,26 +11,22 @@ LABEL4:
return return
LABEL5: LABEL5:
load_int 896 load_int 896
load_string "fixedInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
iload 0 iload 0
invoke 1046 invoke 1046
istore 0 istore 0
load_int 128 load_int 128
load_string "fixedOuterZoomLimit"
runelite_callback
iload 0 iload 0
invoke 1045 invoke 1045
istore 0 istore 0
load_int 896 load_int 896
load_string "resizableInnerZoomLimit" load_string "innerZoomLimit"
runelite_callback runelite_callback
iload 1 iload 1
invoke 1046 invoke 1046
istore 1 istore 1
load_int 128 load_int 128
load_string "resizableOuterZoomLimit"
runelite_callback
iload 1 iload 1
invoke 1045 invoke 1045
istore 1 istore 1