Bringing Zulrah back up to date.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, https://runelitepl.us
|
* Copyright (c) 2018, https://runelitepl.us
|
||||||
|
* Copyright (c) 2018, https://github.com/runeliteplusplus
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -22,6 +23,7 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.runelite.client.plugins.zulrah;
|
package net.runelite.client.plugins.zulrah;
|
||||||
|
|
||||||
import net.runelite.client.config.Config;
|
import net.runelite.client.config.Config;
|
||||||
@@ -29,20 +31,38 @@ import net.runelite.client.config.ConfigGroup;
|
|||||||
import net.runelite.client.config.ConfigItem;
|
import net.runelite.client.config.ConfigItem;
|
||||||
|
|
||||||
@ConfigGroup("zulrah")
|
@ConfigGroup("zulrah")
|
||||||
public interface ZulrahConfig extends Config {
|
public interface ZulrahConfig extends Config
|
||||||
|
{
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 0,
|
position = 0,
|
||||||
keyName = "zulrahenable",
|
keyName = "zulrahenable",
|
||||||
name = "Enable Zulrah Helper",
|
name = "Enable Zulrah Helper",
|
||||||
description = "Configures whether or not to enable Zulrah Helper."
|
description = "Configures whether or not to enable Zulrah Helper."
|
||||||
)
|
)
|
||||||
default boolean EnableZulrah() { return true; }
|
default boolean EnableZulrah()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 1,
|
position = 1,
|
||||||
keyName = "zulrahprayenable",
|
keyName = "zulrahprayenable",
|
||||||
name = "Show Prayer Helper",
|
name = "Show Prayer Helper",
|
||||||
description = "Configures whether or not to show when to pray at Zulrah."
|
description = "Configures whether or not to show when to pray at Zulrah."
|
||||||
)
|
)
|
||||||
default boolean EnableZulrahPrayerHelper() { return true; }
|
default boolean EnableZulrahPrayerHelper()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
position = 2,
|
||||||
|
keyName = "jadphasehelper",
|
||||||
|
name = "Jad Phase Helper",
|
||||||
|
description = "Tells you what to pray against Zulrah jad phase"
|
||||||
|
)
|
||||||
|
default boolean ZulrahJadHelper()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, https://runelitepl.us
|
* Copyright (c) 2018, https://runelitepl.us
|
||||||
|
* Copyright (c) 2018, https://github.com/runeliteplusplus
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -22,12 +23,17 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.runelite.client.plugins.zulrah;
|
package net.runelite.client.plugins.zulrah;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.*;
|
import net.runelite.api.HeadIcon;
|
||||||
|
import net.runelite.api.NPC;
|
||||||
|
import net.runelite.api.Player;
|
||||||
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;
|
||||||
@@ -35,7 +41,8 @@ import net.runelite.client.ui.overlay.OverlayPriority;
|
|||||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||||
import net.runelite.client.ui.overlay.components.TitleComponent;
|
import net.runelite.client.ui.overlay.components.TitleComponent;
|
||||||
|
|
||||||
public class ZulrahOverlay extends Overlay {
|
public class ZulrahOverlay extends Overlay
|
||||||
|
{
|
||||||
private final ZulrahConfig config;
|
private final ZulrahConfig config;
|
||||||
private final ZulrahPlugin plugin;
|
private final ZulrahPlugin plugin;
|
||||||
private final PanelComponent panelComponent = new PanelComponent();
|
private final PanelComponent panelComponent = new PanelComponent();
|
||||||
@@ -45,7 +52,8 @@ public class ZulrahOverlay extends Overlay {
|
|||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ZulrahOverlay(ZulrahConfig config, ZulrahPlugin plugin) {
|
private ZulrahOverlay(ZulrahConfig config, ZulrahPlugin plugin)
|
||||||
|
{
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||||
@@ -55,16 +63,21 @@ public class ZulrahOverlay extends Overlay {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics) {
|
public Dimension render(Graphics2D graphics)
|
||||||
if (!config.EnableZulrahPrayerHelper()) {
|
{
|
||||||
|
if (!config.EnableZulrahPrayerHelper())
|
||||||
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
NPC Zulrah = plugin.Zulrah;
|
NPC Zulrah = plugin.Zulrah;
|
||||||
if (Zulrah != null) {
|
if (Zulrah != null)
|
||||||
if (plugin.prayerconserve && plugin.nextprayerendticks == 0) {
|
{
|
||||||
|
if (plugin.prayerconserve && plugin.nextprayerendticks == 0)
|
||||||
|
{
|
||||||
Player player = client.getLocalPlayer();
|
Player player = client.getLocalPlayer();
|
||||||
HeadIcon icon = player.getOverheadIcon();
|
HeadIcon icon = player.getOverheadIcon();
|
||||||
if (icon != null) {
|
if (icon != null)
|
||||||
|
{
|
||||||
final String text = "Disable Overhead Prayer";
|
final String text = "Disable Overhead Prayer";
|
||||||
final int textWidth = graphics.getFontMetrics().stringWidth(text);
|
final int textWidth = graphics.getFontMetrics().stringWidth(text);
|
||||||
final int textHeight = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
|
final int textHeight = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
|
||||||
@@ -75,10 +88,13 @@ public class ZulrahOverlay extends Overlay {
|
|||||||
panelComponent.setPreferredLocation(jpoint);
|
panelComponent.setPreferredLocation(jpoint);
|
||||||
panelComponent.render(graphics);
|
panelComponent.render(graphics);
|
||||||
}
|
}
|
||||||
} else if (plugin.nextprayerendticks != 0) {
|
}
|
||||||
|
else if (plugin.nextprayerendticks != 0)
|
||||||
|
{
|
||||||
Player player = client.getLocalPlayer();
|
Player player = client.getLocalPlayer();
|
||||||
HeadIcon icon = player.getOverheadIcon();
|
HeadIcon icon = player.getOverheadIcon();
|
||||||
if (icon == null) {
|
if (icon == null)
|
||||||
|
{
|
||||||
final String text = "Protect from MAGIC: " + (plugin.nextprayerendticks - plugin.ticks);
|
final String text = "Protect from MAGIC: " + (plugin.nextprayerendticks - plugin.ticks);
|
||||||
final int textWidth = graphics.getFontMetrics().stringWidth(text);
|
final int textWidth = graphics.getFontMetrics().stringWidth(text);
|
||||||
final int textHeight = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
|
final int textHeight = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2018, https://runelitepl.us
|
* Copyright (c) 2018, https://runelitepl.us
|
||||||
|
* Copyright (c) 2018, https://github.com/runeliteplusplus
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -22,13 +23,19 @@
|
|||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.runelite.client.plugins.zulrah;
|
package net.runelite.client.plugins.zulrah;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.Color;
|
||||||
|
import java.awt.Dimension;
|
||||||
|
import java.awt.Graphics2D;
|
||||||
|
import java.awt.Polygon;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.*;
|
import net.runelite.api.NPC;
|
||||||
|
import net.runelite.api.Perspective;
|
||||||
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
import net.runelite.client.ui.FontManager;
|
import net.runelite.client.ui.FontManager;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
@@ -60,29 +67,39 @@ public class ZulrahTileOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
|
|
||||||
NPC Zulrah = plugin.Zulrah;
|
NPC Zulrah = plugin.Zulrah;
|
||||||
if (Zulrah != null) {
|
if (Zulrah != null)
|
||||||
|
{
|
||||||
OverlayUtil.renderTextLocation(graphics, Zulrah.getCanvasTextLocation(graphics, Integer.toString(plugin.phaseticks - plugin.ticks), Zulrah.getLogicalHeight() + 40), Integer.toString(plugin.phaseticks - plugin.ticks), Color.WHITE);
|
OverlayUtil.renderTextLocation(graphics, Zulrah.getCanvasTextLocation(graphics, Integer.toString(plugin.phaseticks - plugin.ticks), Zulrah.getLogicalHeight() + 40), Integer.toString(plugin.phaseticks - plugin.ticks), Color.WHITE);
|
||||||
Player player = client.getLocalPlayer();
|
Player player = client.getLocalPlayer();
|
||||||
if (plugin.currenttile != null) {
|
if (plugin.currenttile != null)
|
||||||
if (plugin.currenttile.equals(plugin.nexttile)) {
|
{
|
||||||
|
if (plugin.currenttile.equals(plugin.nexttile))
|
||||||
|
{
|
||||||
final Polygon poly = Perspective.getCanvasTilePoly(client, plugin.currenttile);
|
final Polygon poly = Perspective.getCanvasTilePoly(client, plugin.currenttile);
|
||||||
if (poly != null) {
|
if (poly != null)
|
||||||
|
{
|
||||||
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.currenttile, "Current & Next", 50);
|
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.currenttile, "Current & Next", 50);
|
||||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Current & Next", Color.WHITE);
|
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Current & Next", Color.WHITE);
|
||||||
OverlayUtil.renderPolygon(graphics, poly, Color.WHITE);
|
OverlayUtil.renderPolygon(graphics, poly, Color.WHITE);
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
if (!player.getLocalLocation().equals(plugin.currenttile)) {
|
else
|
||||||
|
{
|
||||||
|
if (!player.getLocalLocation().equals(plugin.currenttile))
|
||||||
|
{
|
||||||
final Polygon poly = Perspective.getCanvasTilePoly(client, plugin.currenttile);
|
final Polygon poly = Perspective.getCanvasTilePoly(client, plugin.currenttile);
|
||||||
if (poly != null) {
|
if (poly != null)
|
||||||
|
{
|
||||||
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.currenttile, "Current", 50);
|
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.currenttile, "Current", 50);
|
||||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Current", Color.WHITE);
|
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Current", Color.WHITE);
|
||||||
OverlayUtil.renderPolygon(graphics, poly, Color.GREEN);
|
OverlayUtil.renderPolygon(graphics, poly, Color.GREEN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (plugin.nexttile != null) {
|
if (plugin.nexttile != null)
|
||||||
|
{
|
||||||
final Polygon poly2 = Perspective.getCanvasTilePoly(client, plugin.nexttile);
|
final Polygon poly2 = Perspective.getCanvasTilePoly(client, plugin.nexttile);
|
||||||
if (poly2 != null) {
|
if (poly2 != null)
|
||||||
|
{
|
||||||
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.nexttile, "Next", 50);
|
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.nexttile, "Next", 50);
|
||||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Next", Color.WHITE);
|
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Next", Color.WHITE);
|
||||||
OverlayUtil.renderPolygon(graphics, poly2, Color.RED);
|
OverlayUtil.renderPolygon(graphics, poly2, Color.RED);
|
||||||
@@ -90,15 +107,23 @@ public class ZulrahTileOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (plugin.nextzulrahtile != null) {
|
if (plugin.nextzulrahtile != null)
|
||||||
|
{
|
||||||
String style = "";
|
String style = "";
|
||||||
if (plugin.nztcolor.equals(Color.RED)) {
|
if (plugin.nztcolor.equals(Color.RED))
|
||||||
|
{
|
||||||
style = "MELEE";
|
style = "MELEE";
|
||||||
} else if (plugin.nztcolor.equals(Color.BLUE)) {
|
}
|
||||||
|
else if (plugin.nztcolor.equals(Color.BLUE))
|
||||||
|
{
|
||||||
style = "MAGE";
|
style = "MAGE";
|
||||||
} else if (plugin.nztcolor.equals(Color.GREEN)) {
|
}
|
||||||
|
else if (plugin.nztcolor.equals(Color.GREEN))
|
||||||
|
{
|
||||||
style = "RANGE";
|
style = "RANGE";
|
||||||
} else if (plugin.nztcolor.equals(Color.YELLOW)) {
|
}
|
||||||
|
else if (plugin.nztcolor.equals(Color.YELLOW))
|
||||||
|
{
|
||||||
style = "JAD";
|
style = "JAD";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,19 +132,28 @@ public class ZulrahTileOverlay extends Overlay
|
|||||||
if (poly != null)
|
if (poly != null)
|
||||||
{
|
{
|
||||||
BufferedImage clanchatImage = null;
|
BufferedImage clanchatImage = null;
|
||||||
if (style.equals("JAD")) {
|
if (style.equals("JAD"))
|
||||||
if (plugin.phase4 && plugin.phases.size() == 10) {
|
{
|
||||||
|
if (plugin.phase4 && plugin.phases.size() == 10)
|
||||||
|
{
|
||||||
clanchatImage = plugin.ProtectionIcons[2];
|
clanchatImage = plugin.ProtectionIcons[2];
|
||||||
} else if (plugin.phase3 && plugin.phases.size() == 9) {
|
}
|
||||||
|
else if (plugin.phase3 && plugin.phases.size() == 9)
|
||||||
|
{
|
||||||
clanchatImage = plugin.ProtectionIcons[2];
|
clanchatImage = plugin.ProtectionIcons[2];
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
clanchatImage = plugin.ProtectionIcons[0];
|
clanchatImage = plugin.ProtectionIcons[0];
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
clanchatImage = plugin.getProtectionIcon();
|
clanchatImage = plugin.getProtectionIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clanchatImage != null) {
|
if (clanchatImage != null)
|
||||||
|
{
|
||||||
Point imageLocation = new Point(textLocation.getX(), textLocation.getY() + 15);
|
Point imageLocation = new Point(textLocation.getX(), textLocation.getY() + 15);
|
||||||
OverlayUtil.renderImageLocation(graphics, imageLocation, clanchatImage);
|
OverlayUtil.renderImageLocation(graphics, imageLocation, clanchatImage);
|
||||||
}
|
}
|
||||||
@@ -129,9 +163,11 @@ public class ZulrahTileOverlay extends Overlay
|
|||||||
OverlayUtil.renderPolygon(graphics, poly, plugin.nztcolor);
|
OverlayUtil.renderPolygon(graphics, poly, plugin.nztcolor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (plugin.MeleeTile != null) {
|
if (plugin.MeleeTile != null)
|
||||||
|
{
|
||||||
final Polygon poly = Perspective.getCanvasTilePoly(client, plugin.MeleeTile);
|
final Polygon poly = Perspective.getCanvasTilePoly(client, plugin.MeleeTile);
|
||||||
if (poly != null) {
|
if (poly != null)
|
||||||
|
{
|
||||||
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.MeleeTile, "MOVE HERE NOW!", 50);
|
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.MeleeTile, "MOVE HERE NOW!", 50);
|
||||||
graphics.setFont(FontManager.getRunescapeBoldFont());
|
graphics.setFont(FontManager.getRunescapeBoldFont());
|
||||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "MOVE HERE NOW!", Color.WHITE);
|
OverlayUtil.renderTextLocation(graphics, textLocationtile, "MOVE HERE NOW!", Color.WHITE);
|
||||||
|
|||||||
Reference in New Issue
Block a user