fix flexo window border offsets (#209)
This commit is contained in:
@@ -52,6 +52,7 @@ public class Flexo extends Robot {
|
|||||||
public static boolean isActive;
|
public static boolean isActive;
|
||||||
public static double scale;
|
public static double scale;
|
||||||
public static Client client;
|
public static Client client;
|
||||||
|
public static ClientUI clientUI;
|
||||||
public static int fixedWidth = 765;
|
public static int fixedWidth = 765;
|
||||||
public static int fixedHeight = 503;
|
public static int fixedHeight = 503;
|
||||||
public static boolean isStretched;
|
public static boolean isStretched;
|
||||||
@@ -108,7 +109,7 @@ public class Flexo extends Robot {
|
|||||||
public synchronized void mouseMove(int x, int y) {
|
public synchronized void mouseMove(int x, int y) {
|
||||||
try {
|
try {
|
||||||
//TODO: Must be better way to determine titlebar width
|
//TODO: Must be better way to determine titlebar width
|
||||||
currentMouseMotionFactory.build(ClientUI.frame.getX()+x, ClientUI.frame.getY()+y+20).move();
|
currentMouseMotionFactory.build(ClientUI.frame.getX()+x+determineHorizontalOffset(), ClientUI.frame.getY()+y+determineVerticalOffset()).move();
|
||||||
this.delay(getMinDelay());
|
this.delay(getMinDelay());
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -269,5 +270,13 @@ public class Flexo extends Robot {
|
|||||||
public void delay(int ms) {
|
public void delay(int ms) {
|
||||||
pauseMS(ms);
|
pauseMS(ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int determineHorizontalOffset() {
|
||||||
|
return clientUI.getCanvasOffset().getX();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int determineVerticalOffset() {
|
||||||
|
return clientUI.getCanvasOffset().getY();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ import net.runelite.client.plugins.PluginType;
|
|||||||
import net.runelite.client.plugins.grounditems.GroundItem;
|
import net.runelite.client.plugins.grounditems.GroundItem;
|
||||||
import net.runelite.client.plugins.grounditems.GroundItemsPlugin;
|
import net.runelite.client.plugins.grounditems.GroundItemsPlugin;
|
||||||
import net.runelite.client.plugins.stretchedmode.StretchedModeConfig;
|
import net.runelite.client.plugins.stretchedmode.StretchedModeConfig;
|
||||||
|
import net.runelite.client.ui.ClientUI;
|
||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
@@ -80,6 +81,9 @@ public class FlexoPlugin extends Plugin {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ClientUI clientUI;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ConfigManager configManager;
|
private ConfigManager configManager;
|
||||||
@@ -112,6 +116,8 @@ public class FlexoPlugin extends Plugin {
|
|||||||
public void onBeforeRender(BeforeRender event) {
|
public void onBeforeRender(BeforeRender event) {
|
||||||
if (Flexo.client==null)
|
if (Flexo.client==null)
|
||||||
Flexo.client = client;
|
Flexo.client = client;
|
||||||
|
if (Flexo.clientUI==null)
|
||||||
|
Flexo.clientUI = clientUI;
|
||||||
overlay.clickAreas = new ArrayList<>();
|
overlay.clickAreas = new ArrayList<>();
|
||||||
overlay.clickPoints = new ArrayList<>();
|
overlay.clickPoints = new ArrayList<>();
|
||||||
if (getConfig(configManager).getDebugNPCs()) {
|
if (getConfig(configManager).getDebugNPCs()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user