Refactor flexo
This commit is contained in:
@@ -29,7 +29,8 @@ import net.runelite.client.config.ConfigGroup;
|
|||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
|
||||||
@ConfigGroup("flexo")
|
@ConfigGroup("flexo")
|
||||||
public interface FlexoConfig extends Config {
|
public interface FlexoConfig extends Config
|
||||||
|
{
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 0,
|
position = 0,
|
||||||
@@ -37,7 +38,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Overlay Enabled",
|
name = "Overlay Enabled",
|
||||||
description = "Shows clicking area and points etc."
|
description = "Shows clicking area and points etc."
|
||||||
)
|
)
|
||||||
default boolean overlayEnabled() {
|
default boolean overlayEnabled()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +49,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Min Delay",
|
name = "Min Delay",
|
||||||
description = "Minimum delay that is applied to every action at the end (ms)"
|
description = "Minimum delay that is applied to every action at the end (ms)"
|
||||||
)
|
)
|
||||||
default int minDelayAmt() {
|
default int minDelayAmt()
|
||||||
|
{
|
||||||
return 45;
|
return 45;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +61,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Reaction Time",
|
name = "Reaction Time",
|
||||||
description = "The base time between actions (ms)"
|
description = "The base time between actions (ms)"
|
||||||
)
|
)
|
||||||
default int getReactionTimeVariation() {
|
default int getReactionTimeVariation()
|
||||||
|
{
|
||||||
return 80;
|
return 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +72,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Mouse drag speed",
|
name = "Mouse drag speed",
|
||||||
description = "The speed at which steps are executed. Keep at 49? cuz jagex mouse recorder?"
|
description = "The speed at which steps are executed. Keep at 49? cuz jagex mouse recorder?"
|
||||||
)
|
)
|
||||||
default int getMouseDragSpeed() {
|
default int getMouseDragSpeed()
|
||||||
|
{
|
||||||
return 49;
|
return 49;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +84,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Overshoots",
|
name = "Overshoots",
|
||||||
description = "Higher number = more overshoots"
|
description = "Higher number = more overshoots"
|
||||||
)
|
)
|
||||||
default int getOvershoots() {
|
default int getOvershoots()
|
||||||
|
{
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,7 +95,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Variating",
|
name = "Flow - Variating",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getVariatingFlow() {
|
default boolean getVariatingFlow()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,7 +106,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Slow startup",
|
name = "Flow - Slow startup",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getSlowStartupFlow() {
|
default boolean getSlowStartupFlow()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +118,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Slow startup 2",
|
name = "Flow - Slow startup 2",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getSlowStartup2Flow() {
|
default boolean getSlowStartup2Flow()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +129,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Jagged",
|
name = "Flow - Jagged",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getJaggedFlow() {
|
default boolean getJaggedFlow()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +140,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Interrupted",
|
name = "Flow - Interrupted",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getInterruptedFlow() {
|
default boolean getInterruptedFlow()
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +152,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Interrupted 2",
|
name = "Flow - Interrupted 2",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getInterruptedFlow2() {
|
default boolean getInterruptedFlow2()
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +163,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Flow - Stopping",
|
name = "Flow - Stopping",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default boolean getStoppingFlow() {
|
default boolean getStoppingFlow()
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +174,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Deviation slope divider",
|
name = "Deviation slope divider",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default int getDeviationSlope() {
|
default int getDeviationSlope()
|
||||||
|
{
|
||||||
return 10;
|
return 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,7 +186,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Noisiness divider",
|
name = "Noisiness divider",
|
||||||
description = ""
|
description = ""
|
||||||
)
|
)
|
||||||
default String getNoisinessDivider() {
|
default String getNoisinessDivider()
|
||||||
|
{
|
||||||
return "2.0D";
|
return "2.0D";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +197,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Debug NPCs",
|
name = "Debug NPCs",
|
||||||
description = "Draws clickArea and clickPoints across all visible npcs"
|
description = "Draws clickArea and clickPoints across all visible npcs"
|
||||||
)
|
)
|
||||||
default boolean getDebugNPCs() {
|
default boolean getDebugNPCs()
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,7 +208,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Debug Players",
|
name = "Debug Players",
|
||||||
description = "Draws clickArea and clickPoints across all visible players"
|
description = "Draws clickArea and clickPoints across all visible players"
|
||||||
)
|
)
|
||||||
default boolean getDebugPlayers() {
|
default boolean getDebugPlayers()
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +219,8 @@ public interface FlexoConfig extends Config {
|
|||||||
name = "Debug Ground Items",
|
name = "Debug Ground Items",
|
||||||
description = "Draws clickArea and clickPoints across all visible ground items"
|
description = "Draws clickArea and clickPoints across all visible ground items"
|
||||||
)
|
)
|
||||||
default boolean getDebugGroundItems() {
|
default boolean getDebugGroundItems()
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,56 +27,64 @@
|
|||||||
|
|
||||||
package net.runelite.client.plugins.flexo;
|
package net.runelite.client.plugins.flexo;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Point;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.awt.geom.Line2D;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
public class FlexoOverlay extends Overlay
|
||||||
import javax.inject.Inject;
|
{
|
||||||
import java.awt.*;
|
private static Rectangle clickArea;
|
||||||
import java.awt.geom.Line2D;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class FlexoOverlay extends Overlay {
|
ArrayList<Rectangle> clickAreas = new ArrayList<>();
|
||||||
|
ArrayList<Point> clickPoints = new ArrayList<>();
|
||||||
public static Rectangle clickArea;
|
|
||||||
public ArrayList<Rectangle> clickAreas = new ArrayList<>();
|
|
||||||
public ArrayList<Point> clickPoints = new ArrayList<>();
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private Client client;
|
|
||||||
|
|
||||||
@Inject
|
|
||||||
private FlexoPlugin plugin;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private FlexoConfig config;
|
private FlexoConfig config;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public FlexoOverlay(@Nullable Client client, FlexoPlugin plugin, FlexoConfig config) {
|
public FlexoOverlay(FlexoConfig config)
|
||||||
|
{
|
||||||
setPosition(OverlayPosition.DYNAMIC);
|
setPosition(OverlayPosition.DYNAMIC);
|
||||||
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
setLayer(OverlayLayer.ABOVE_WIDGETS);
|
||||||
this.client = client;
|
|
||||||
this.plugin = plugin;
|
|
||||||
this.config = config;
|
this.config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics) {
|
public Dimension render(Graphics2D graphics)
|
||||||
if (config.getDebugNPCs() || config.getDebugGroundItems() || config.getDebugPlayers()) {
|
{
|
||||||
|
if (config.getDebugNPCs() || config.getDebugGroundItems() || config.getDebugPlayers())
|
||||||
|
{
|
||||||
if (clickArea != null)
|
if (clickArea != null)
|
||||||
|
{
|
||||||
graphics.draw(clickArea);
|
graphics.draw(clickArea);
|
||||||
if (clickAreas!=null) {
|
}
|
||||||
for (Rectangle clickArea : clickAreas) {
|
if (clickAreas != null)
|
||||||
|
{
|
||||||
|
for (Rectangle clickArea : clickAreas)
|
||||||
|
{
|
||||||
if (clickArea != null)
|
if (clickArea != null)
|
||||||
|
{
|
||||||
graphics.draw(clickArea);
|
graphics.draw(clickArea);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (clickPoints!=null) {
|
}
|
||||||
for (Point p : clickPoints) {
|
if (clickPoints != null)
|
||||||
if (p!=null) {
|
{
|
||||||
|
for (Point p : clickPoints)
|
||||||
|
{
|
||||||
|
if (p != null)
|
||||||
|
{
|
||||||
graphics.setColor(Color.MAGENTA);
|
graphics.setColor(Color.MAGENTA);
|
||||||
graphics.draw(new Line2D.Double(p.x, p.y, p.x, p.y));
|
graphics.draw(new Line2D.Double(p.x, p.y, p.x, p.y));
|
||||||
graphics.draw(new Line2D.Double(p.x - 1, p.y - 1, p.x - 1, p.y - 1));
|
graphics.draw(new Line2D.Double(p.x - 1, p.y - 1, p.x - 1, p.y - 1));
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ import com.github.joonasvali.naturalmouse.support.Flow;
|
|||||||
import com.github.joonasvali.naturalmouse.support.SinusoidalDeviationProvider;
|
import com.github.joonasvali.naturalmouse.support.SinusoidalDeviationProvider;
|
||||||
import com.github.joonasvali.naturalmouse.util.FlowTemplates;
|
import com.github.joonasvali.naturalmouse.util.FlowTemplates;
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
|
import java.awt.AWTException;
|
||||||
|
import java.awt.Rectangle;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.Perspective;
|
import net.runelite.api.Perspective;
|
||||||
@@ -42,7 +47,6 @@ import net.runelite.api.Player;
|
|||||||
import net.runelite.api.coords.LocalPoint;
|
import net.runelite.api.coords.LocalPoint;
|
||||||
import net.runelite.api.events.BeforeRender;
|
import net.runelite.api.events.BeforeRender;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.ConfigChanged;
|
||||||
import net.runelite.api.events.GameTick;
|
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.flexo.Flexo;
|
import net.runelite.client.flexo.Flexo;
|
||||||
@@ -56,25 +60,23 @@ import net.runelite.client.plugins.stretchedmode.StretchedModeConfig;
|
|||||||
import net.runelite.client.ui.ClientUI;
|
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 java.awt.*;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Flexo Config",
|
name = "Flexo Config",
|
||||||
description = "Customizes the flexo api",
|
description = "Customizes the flexo api",
|
||||||
tags = {"flexo", "null"},
|
tags = {"flexo", "null"},
|
||||||
type = PluginType.UTILITY
|
type = PluginType.UTILITY
|
||||||
)
|
)
|
||||||
public class FlexoPlugin extends Plugin {
|
public class FlexoPlugin extends Plugin
|
||||||
|
{
|
||||||
private Flexo flexo;
|
private Flexo flexo;
|
||||||
|
|
||||||
{
|
{
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
flexo = new Flexo();
|
flexo = new Flexo();
|
||||||
} catch (AWTException e) {
|
}
|
||||||
|
catch (AWTException e)
|
||||||
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,16 +97,22 @@ public class FlexoPlugin extends Plugin {
|
|||||||
private FlexoOverlay overlay;
|
private FlexoOverlay overlay;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
FlexoConfig getConfig(ConfigManager configManager) {
|
FlexoConfig getConfig(ConfigManager configManager)
|
||||||
|
{
|
||||||
return configManager.getConfig(FlexoConfig.class);
|
return configManager.getConfig(FlexoConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
private void onConfigChanged(ConfigChanged event) {
|
private void onConfigChanged(ConfigChanged event)
|
||||||
if (event.getKey().compareTo("overlayEnabled")==0) {
|
{
|
||||||
if (getConfig(configManager).overlayEnabled()) {
|
if (event.getKey().compareTo("overlayEnabled") == 0)
|
||||||
|
{
|
||||||
|
if (getConfig(configManager).overlayEnabled())
|
||||||
|
{
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
overlayManager.remove(overlay);
|
overlayManager.remove(overlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,20 +121,30 @@ public class FlexoPlugin extends Plugin {
|
|||||||
|
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
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)
|
if (Flexo.clientUI == null)
|
||||||
|
{
|
||||||
Flexo.clientUI = clientUI;
|
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())
|
||||||
|
{
|
||||||
Flexo.isStretched = client.isStretchedEnabled();
|
Flexo.isStretched = client.isStretchedEnabled();
|
||||||
Flexo.scale = configManager.getConfig(StretchedModeConfig.class).scalingFactor();
|
Flexo.scale = configManager.getConfig(StretchedModeConfig.class).scalingFactor();
|
||||||
if (flexo != null)
|
if (flexo != null)
|
||||||
for (NPC npc : client.getNpcs()) {
|
{
|
||||||
|
for (NPC npc : client.getNpcs())
|
||||||
|
{
|
||||||
if (npc != null)
|
if (npc != null)
|
||||||
if (npc.getConvexHull() != null) {
|
{
|
||||||
|
if (npc.getConvexHull() != null)
|
||||||
|
{
|
||||||
Rectangle r = FlexoMouse.getClickArea(npc.getConvexHull().getBounds());
|
Rectangle r = FlexoMouse.getClickArea(npc.getConvexHull().getBounds());
|
||||||
overlay.clickAreas.add(r);
|
overlay.clickAreas.add(r);
|
||||||
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
||||||
@@ -134,14 +152,21 @@ public class FlexoPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getDebugPlayers()) {
|
if (getConfig(configManager).getDebugPlayers())
|
||||||
|
{
|
||||||
Flexo.isStretched = client.isStretchedEnabled();
|
Flexo.isStretched = client.isStretchedEnabled();
|
||||||
Flexo.scale = configManager.getConfig(StretchedModeConfig.class).scalingFactor();
|
Flexo.scale = configManager.getConfig(StretchedModeConfig.class).scalingFactor();
|
||||||
if (flexo != null)
|
if (flexo != null)
|
||||||
for (Player player : client.getPlayers()) {
|
{
|
||||||
|
for (Player player : client.getPlayers())
|
||||||
|
{
|
||||||
if (player != null)
|
if (player != null)
|
||||||
if (player.getConvexHull() != null) {
|
{
|
||||||
|
if (player.getConvexHull() != null)
|
||||||
|
{
|
||||||
Rectangle r = FlexoMouse.getClickArea(player.getConvexHull().getBounds());
|
Rectangle r = FlexoMouse.getClickArea(player.getConvexHull().getBounds());
|
||||||
overlay.clickAreas.add(r);
|
overlay.clickAreas.add(r);
|
||||||
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
java.awt.Point p = FlexoMouse.getClickPoint(r);
|
||||||
@@ -149,17 +174,29 @@ public class FlexoPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Could still use some improvement
|
// Could still use some improvement
|
||||||
if (getConfig(configManager).getDebugGroundItems()) {
|
if (getConfig(configManager).getDebugGroundItems())
|
||||||
|
{
|
||||||
Flexo.isStretched = client.isStretchedEnabled();
|
Flexo.isStretched = client.isStretchedEnabled();
|
||||||
Flexo.scale = configManager.getConfig(StretchedModeConfig.class).scalingFactor();
|
Flexo.scale = configManager.getConfig(StretchedModeConfig.class).scalingFactor();
|
||||||
|
|
||||||
if (flexo != null)
|
if (flexo != null)
|
||||||
|
{
|
||||||
if (GroundItemsPlugin.getCollectedGroundItems() != null)
|
if (GroundItemsPlugin.getCollectedGroundItems() != null)
|
||||||
for (GroundItem gi : GroundItemsPlugin.getCollectedGroundItems().values()) {
|
{
|
||||||
|
for (GroundItem gi : GroundItemsPlugin.getCollectedGroundItems().values())
|
||||||
|
{
|
||||||
if (gi != null)
|
if (gi != null)
|
||||||
if (Perspective.getCanvasTilePoly(client, LocalPoint.fromWorld(client, gi.getLocation()))!=null) {
|
{
|
||||||
Rectangle r1 = FlexoMouse.getClickArea(Perspective.getCanvasTilePoly(client, LocalPoint.fromWorld(client, gi.getLocation())).getBounds());
|
LocalPoint lp = LocalPoint.fromWorld(client, gi.getLocation());
|
||||||
|
if (lp != null)
|
||||||
|
{
|
||||||
|
if (Perspective.getCanvasTilePoly(client, lp) != null)
|
||||||
|
{
|
||||||
|
Rectangle r1 = FlexoMouse.getClickArea(Perspective.getCanvasTilePoly(client, lp).getBounds());
|
||||||
Rectangle r2 = FlexoMouse.getClickArea(r1);
|
Rectangle r2 = FlexoMouse.getClickArea(r1);
|
||||||
Rectangle r3 = FlexoMouse.getClickArea(r2);
|
Rectangle r3 = FlexoMouse.getClickArea(r2);
|
||||||
overlay.clickAreas.add(r3);
|
overlay.clickAreas.add(r3);
|
||||||
@@ -169,13 +206,13 @@ public class FlexoPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@Subscribe
|
}
|
||||||
public void onGameTick(GameTick event) {
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateMouseMotionFactory() {
|
private void updateMouseMotionFactory()
|
||||||
|
{
|
||||||
Flexo.minDelay = getConfig(configManager).minDelayAmt();
|
Flexo.minDelay = getConfig(configManager).minDelayAmt();
|
||||||
MouseMotionFactory factory = new MouseMotionFactory();
|
MouseMotionFactory factory = new MouseMotionFactory();
|
||||||
// TODO:Add Options for various flows to allow more personalization
|
// TODO:Add Options for various flows to allow more personalization
|
||||||
@@ -185,25 +222,39 @@ public class FlexoPlugin extends Plugin {
|
|||||||
flows.add(new Flow(FlowTemplates.random()));
|
flows.add(new Flow(FlowTemplates.random()));
|
||||||
|
|
||||||
if (getConfig(configManager).getVariatingFlow())
|
if (getConfig(configManager).getVariatingFlow())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.variatingFlow()));
|
flows.add(new Flow(FlowTemplates.variatingFlow()));
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getSlowStartupFlow())
|
if (getConfig(configManager).getSlowStartupFlow())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.slowStartupFlow()));
|
flows.add(new Flow(FlowTemplates.slowStartupFlow()));
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getSlowStartup2Flow())
|
if (getConfig(configManager).getSlowStartup2Flow())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.slowStartup2Flow()));
|
flows.add(new Flow(FlowTemplates.slowStartup2Flow()));
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getJaggedFlow())
|
if (getConfig(configManager).getJaggedFlow())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.jaggedFlow()));
|
flows.add(new Flow(FlowTemplates.jaggedFlow()));
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getInterruptedFlow())
|
if (getConfig(configManager).getInterruptedFlow())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.interruptedFlow()));
|
flows.add(new Flow(FlowTemplates.interruptedFlow()));
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getInterruptedFlow2())
|
if (getConfig(configManager).getInterruptedFlow2())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.interruptedFlow2()));
|
flows.add(new Flow(FlowTemplates.interruptedFlow2()));
|
||||||
|
}
|
||||||
|
|
||||||
if (getConfig(configManager).getStoppingFlow())
|
if (getConfig(configManager).getStoppingFlow())
|
||||||
|
{
|
||||||
flows.add(new Flow(FlowTemplates.stoppingFlow()));
|
flows.add(new Flow(FlowTemplates.stoppingFlow()));
|
||||||
|
}
|
||||||
|
|
||||||
DefaultSpeedManager manager = new DefaultSpeedManager(flows);
|
DefaultSpeedManager manager = new DefaultSpeedManager(flows);
|
||||||
//TODO:Add options for custom Deviation Provider and Noise Provider
|
//TODO:Add options for custom Deviation Provider and Noise Provider
|
||||||
@@ -220,14 +271,16 @@ public class FlexoPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception {
|
protected void startUp() throws Exception
|
||||||
|
{
|
||||||
Flexo.isStretched = client.isStretchedEnabled();
|
Flexo.isStretched = client.isStretchedEnabled();
|
||||||
overlayManager.add(overlay);
|
overlayManager.add(overlay);
|
||||||
updateMouseMotionFactory();
|
updateMouseMotionFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void shutDown() throws Exception {
|
protected void shutDown() throws Exception
|
||||||
|
{
|
||||||
overlayManager.remove(overlay);
|
overlayManager.remove(overlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user