camera: add option to preserve pitch on compass look menu entries

This commit is contained in:
Hydrox6
2021-05-11 20:35:42 -04:00
committed by Adam
parent 038ba21649
commit ab7023fac5
3 changed files with 21 additions and 2 deletions
@@ -159,11 +159,22 @@ public interface CameraConfig extends Config
return true;
}
@ConfigItem(
keyName = "compassLookPreservePitch",
name = "Preserve pitch on compass look",
description = "Preserves the current pitch value (vertical angle) when using the compass look options.",
position = 11
)
default boolean compassLookPreservePitch()
{
return false;
}
@ConfigItem(
keyName = "invertYaw",
name = "Invert Yaw",
description = "Makes moving the camera horizontally with the mouse backwards",
position = 11
position = 12
)
default boolean invertYaw()
{
@@ -174,7 +185,7 @@ public interface CameraConfig extends Config
keyName = "invertPitch",
name = "Invert Pitch",
description = "Makes moving the camera vertically with the mouse backwards",
position = 12
position = 13
)
default boolean invertPitch()
{
@@ -249,6 +249,12 @@ public class CameraPlugin extends Plugin implements KeyListener, MouseListener
return;
}
if ("lookPreservePitch".equals(event.getEventName()) && config.compassLookPreservePitch())
{
intStack[intStackSize - 1] = client.getCameraPitch();
return;
}
if (config.innerLimit())
{
// This lets the options panel's slider have an exponential rate
@@ -47,6 +47,8 @@ LOOK:
iconst 0
sound_synth
iconst 225
sconst "lookPreservePitch"
runelite_callback
iconst 5
randominc
add