-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from chsami/development
1.4.4
- Loading branch information
Showing
129 changed files
with
7,907 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
runelite-client/src/main/java/net/runelite/client/plugins/devtools/MicrobotClickOverlay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package net.runelite.client.plugins.devtools; | ||
|
||
import net.runelite.api.Client; | ||
import net.runelite.client.plugins.microbot.Microbot; | ||
import net.runelite.client.ui.overlay.Overlay; | ||
import net.runelite.client.ui.overlay.OverlayLayer; | ||
import net.runelite.client.ui.overlay.OverlayPosition; | ||
import net.runelite.client.ui.overlay.OverlayUtil; | ||
|
||
import javax.inject.Inject; | ||
import java.awt.*; | ||
|
||
public class MicrobotClickOverlay extends Overlay { | ||
private final Client client; | ||
private final DevToolsPlugin plugin; | ||
|
||
@Inject | ||
MicrobotClickOverlay(Client client, DevToolsPlugin plugin) { | ||
this.client = client; | ||
this.plugin = plugin; | ||
setPosition(OverlayPosition.DYNAMIC); | ||
setLayer(OverlayLayer.ABOVE_WIDGETS); | ||
setPriority(Overlay.PRIORITY_LOW); | ||
} | ||
|
||
@Override | ||
public Dimension render(Graphics2D g) { | ||
if (plugin.getMouseClick().isActive()) { | ||
|
||
g.setFont(new Font("Tahoma", Font.BOLD, 18)); | ||
|
||
// Get the FontMetrics for the current font | ||
FontMetrics metrics = g.getFontMetrics(g.getFont()); | ||
|
||
// Get the width and height of the character | ||
int charWidth = metrics.stringWidth("X"); | ||
int charHeight = metrics.getAscent(); // ascent gives the height of the character above the baseline | ||
|
||
int x = Microbot.getMouse().getLastClick().getX() - (charWidth / 2); | ||
int y = Microbot.getMouse().getLastClick().getY() + (charHeight / 2); | ||
|
||
OverlayUtil.renderTextLocation(g, new net.runelite.api.Point(x, y), "X", Color.WHITE); | ||
|
||
x = Microbot.getMouse().getLastClick2().getX() - (charWidth / 2); | ||
y = Microbot.getMouse().getLastClick2().getY() + (charHeight / 2); | ||
|
||
OverlayUtil.renderTextLocation(g, new net.runelite.api.Point(x, y), "X", Color.GREEN); | ||
|
||
|
||
|
||
} | ||
|
||
return null; | ||
} | ||
} | ||
|
74 changes: 74 additions & 0 deletions
74
runelite-client/src/main/java/net/runelite/client/plugins/devtools/MicrobotMouseOverlay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package net.runelite.client.plugins.devtools; | ||
|
||
import net.runelite.api.Client; | ||
import net.runelite.client.plugins.microbot.Microbot; | ||
import net.runelite.client.ui.overlay.Overlay; | ||
import net.runelite.client.ui.overlay.OverlayLayer; | ||
import net.runelite.client.ui.overlay.OverlayPosition; | ||
import net.runelite.client.ui.overlay.OverlayUtil; | ||
|
||
import javax.inject.Inject; | ||
import java.awt.*; | ||
import java.awt.geom.Path2D; | ||
|
||
public class MicrobotMouseOverlay extends Overlay { | ||
private final Client client; | ||
private final DevToolsPlugin plugin; | ||
|
||
@Inject | ||
MicrobotMouseOverlay(Client client, DevToolsPlugin plugin) { | ||
this.client = client; | ||
this.plugin = plugin; | ||
setPosition(OverlayPosition.DYNAMIC); | ||
setLayer(OverlayLayer.ABOVE_WIDGETS); | ||
setPriority(Overlay.PRIORITY_LOW); | ||
} | ||
|
||
@Override | ||
public Dimension render(Graphics2D g) { | ||
if (plugin.getMouseMovement().isActive()) { | ||
if (!Microbot.getMouse().getTimer().isRunning()) { | ||
Microbot.getMouse().getTimer().start(); | ||
} | ||
//g.setFont(new Font("Tahoma", Font.BOLD, 18)); | ||
g.setFont(g.getFont().deriveFont(40.0f)); | ||
// Get the FontMetrics for the current font | ||
FontMetrics metrics = g.getFontMetrics(g.getFont()); | ||
|
||
// Get the width and height of the character | ||
int charWidth = metrics.stringWidth("⊹"); | ||
int charHeight = metrics.getAscent(); // ascent gives the height of the character above the baseline | ||
|
||
// Calculate the new position | ||
int x = Microbot.getMouse().getLastMove().getX() - (charWidth / 2); | ||
int y = Microbot.getMouse().getLastMove().getY() + (charHeight / 2); | ||
|
||
OverlayUtil.renderTextLocation(g, new net.runelite.api.Point(x, y), "⊹", Microbot.getMouse().getRainbowColor()); | ||
|
||
g.setStroke(new BasicStroke(3)); | ||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); | ||
var points = Microbot.getMouse().getPoints(); | ||
if (points.size() > 1) { | ||
Path2D path = new Path2D.Double(); | ||
net.runelite.api.Point firstPoint = points.getFirst(); | ||
path.moveTo(firstPoint.getX(), firstPoint.getY()); | ||
|
||
for (int i = 1; i < points.size(); i++) { | ||
net.runelite.api.Point p = points.get(i); | ||
path.lineTo(p.getX(), p.getY()); | ||
g.setColor(Microbot.getMouse().getRainbowColor()); | ||
} | ||
|
||
g.draw(path); | ||
} | ||
// draw trail of mouse movements | ||
|
||
} else { | ||
Microbot.getMouse().getPoints().clear(); | ||
Microbot.getMouse().getTimer().stop(); | ||
} | ||
|
||
return null; | ||
} | ||
} | ||
|
2 changes: 1 addition & 1 deletion
2
...ot/construction2/Construction2Config.java → ...ns/construction2/Construction2Config.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...t/construction2/Construction2Overlay.java → ...s/construction2/Construction2Overlay.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ot/construction2/Construction2Script.java → ...ns/construction2/Construction2Script.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nstruction2/enums/Construction2State.java → ...nstruction2/enums/Construction2State.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.