Merge pull request #176 from runelite-extended/zulrah
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://github.com/runeliteplusplus
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client.plugins.zulrah;
|
||||
|
||||
import net.runelite.client.config.Config;
|
||||
@@ -29,20 +31,38 @@ import net.runelite.client.config.ConfigGroup;
|
||||
import net.runelite.client.config.ConfigItem;
|
||||
|
||||
@ConfigGroup("zulrah")
|
||||
public interface ZulrahConfig extends Config {
|
||||
public interface ZulrahConfig extends Config
|
||||
{
|
||||
@ConfigItem(
|
||||
position = 0,
|
||||
keyName = "zulrahenable",
|
||||
name = "Enable Zulrah Helper",
|
||||
description = "Configures whether or not to enable Zulrah Helper."
|
||||
)
|
||||
default boolean EnableZulrah() { return true; }
|
||||
default boolean EnableZulrah()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ConfigItem(
|
||||
position = 1,
|
||||
keyName = "zulrahprayenable",
|
||||
name = "Show Prayer Helper",
|
||||
description = "Configures whether or not to show when to pray at Zulrah."
|
||||
position = 1,
|
||||
keyName = "zulrahprayenable",
|
||||
name = "Show Prayer Helper",
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
* Copyright (c) 2018, https://runelitepl.us
|
||||
* Copyright (c) 2018, https://github.com/runeliteplusplus
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||
* list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client.plugins.zulrah;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import javax.inject.Inject;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Prayer;
|
||||
import net.runelite.api.SpriteID;
|
||||
import net.runelite.client.game.SpriteManager;
|
||||
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.OverlayPriority;
|
||||
import net.runelite.client.ui.overlay.components.ComponentConstants;
|
||||
import net.runelite.client.ui.overlay.components.ImageComponent;
|
||||
import net.runelite.client.ui.overlay.components.PanelComponent;
|
||||
|
||||
public class ZulrahJadOverlay extends Overlay
|
||||
{
|
||||
private static final Color NOT_ACTIVATED_BACKGROUND_COLOR = new Color(150, 0, 0, 150);
|
||||
private final ZulrahConfig config;
|
||||
private final ZulrahPlugin plugin;
|
||||
private final SpriteManager spriteManager;
|
||||
private final PanelComponent imagePanelComponent = new PanelComponent();
|
||||
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private ZulrahJadOverlay(ZulrahConfig config, ZulrahPlugin plugin, SpriteManager spriteManager)
|
||||
{
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
this.spriteManager = spriteManager;
|
||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||
setPosition(OverlayPosition.BOTTOM_RIGHT);
|
||||
setPriority(OverlayPriority.MED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.ZulrahJadHelper())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
NPC Zulrah = plugin.Zulrah;
|
||||
if (Zulrah != null)
|
||||
{
|
||||
if (plugin.jadphase > 0)
|
||||
{
|
||||
if (plugin.jadphase == 1)
|
||||
{
|
||||
if (plugin.jadflip)
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
}
|
||||
}
|
||||
else if (plugin.jadphase == 2)
|
||||
{
|
||||
if (plugin.jadflip)
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MAGIC, 0);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MAGIC)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
}
|
||||
else
|
||||
{
|
||||
final BufferedImage prayerImage = spriteManager.getSprite(SpriteID.PRAYER_PROTECT_FROM_MISSILES, 0);
|
||||
imagePanelComponent.getChildren().clear();
|
||||
imagePanelComponent.getChildren().add(new ImageComponent(prayerImage));
|
||||
imagePanelComponent.setBackgroundColor(client.isPrayerActive(Prayer.PROTECT_FROM_MISSILES)
|
||||
? ComponentConstants.STANDARD_BACKGROUND_COLOR
|
||||
: NOT_ACTIVATED_BACKGROUND_COLOR);
|
||||
}
|
||||
}
|
||||
return imagePanelComponent.render(graphics);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, https://runelitepl.us
|
||||
* Copyright (c) 2018, https://github.com/runeliteplusplus
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
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 net.runelite.api.*;
|
||||
import net.runelite.api.Client;
|
||||
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.OverlayLayer;
|
||||
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.TitleComponent;
|
||||
|
||||
public class ZulrahOverlay extends Overlay {
|
||||
public class ZulrahOverlay extends Overlay
|
||||
{
|
||||
private final ZulrahConfig config;
|
||||
private final ZulrahPlugin plugin;
|
||||
private final PanelComponent panelComponent = new PanelComponent();
|
||||
@@ -45,7 +52,8 @@ public class ZulrahOverlay extends Overlay {
|
||||
private Client client;
|
||||
|
||||
@Inject
|
||||
private ZulrahOverlay(ZulrahConfig config, ZulrahPlugin plugin) {
|
||||
private ZulrahOverlay(ZulrahConfig config, ZulrahPlugin plugin)
|
||||
{
|
||||
this.config = config;
|
||||
this.plugin = plugin;
|
||||
setLayer(OverlayLayer.ABOVE_SCENE);
|
||||
@@ -55,16 +63,21 @@ public class ZulrahOverlay extends Overlay {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics) {
|
||||
if (!config.EnableZulrahPrayerHelper()) {
|
||||
public Dimension render(Graphics2D graphics)
|
||||
{
|
||||
if (!config.EnableZulrahPrayerHelper())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
NPC Zulrah = plugin.Zulrah;
|
||||
if (Zulrah != null) {
|
||||
if (plugin.prayerconserve && plugin.nextprayerendticks == 0) {
|
||||
if (Zulrah != null)
|
||||
{
|
||||
if (plugin.prayerconserve && plugin.nextprayerendticks == 0)
|
||||
{
|
||||
Player player = client.getLocalPlayer();
|
||||
HeadIcon icon = player.getOverheadIcon();
|
||||
if (icon != null) {
|
||||
if (icon != null)
|
||||
{
|
||||
final String text = "Disable Overhead Prayer";
|
||||
final int textWidth = graphics.getFontMetrics().stringWidth(text);
|
||||
final int textHeight = graphics.getFontMetrics().getAscent() - graphics.getFontMetrics().getDescent();
|
||||
@@ -75,10 +88,13 @@ public class ZulrahOverlay extends Overlay {
|
||||
panelComponent.setPreferredLocation(jpoint);
|
||||
panelComponent.render(graphics);
|
||||
}
|
||||
} else if (plugin.nextprayerendticks != 0) {
|
||||
}
|
||||
else if (plugin.nextprayerendticks != 0)
|
||||
{
|
||||
Player player = client.getLocalPlayer();
|
||||
HeadIcon icon = player.getOverheadIcon();
|
||||
if (icon == null) {
|
||||
if (icon == null)
|
||||
{
|
||||
final String text = "Protect from MAGIC: " + (plugin.nextprayerendticks - plugin.ticks);
|
||||
final int textWidth = graphics.getFontMetrics().stringWidth(text);
|
||||
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://github.com/runeliteplusplus
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
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 javax.inject.Inject;
|
||||
|
||||
import net.runelite.api.*;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.NPC;
|
||||
import net.runelite.api.Perspective;
|
||||
import net.runelite.api.Player;
|
||||
import net.runelite.api.Point;
|
||||
import net.runelite.client.ui.FontManager;
|
||||
import net.runelite.client.ui.overlay.Overlay;
|
||||
@@ -60,29 +67,39 @@ public class ZulrahTileOverlay extends Overlay
|
||||
{
|
||||
|
||||
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);
|
||||
Player player = client.getLocalPlayer();
|
||||
if (plugin.currenttile != null) {
|
||||
if (plugin.currenttile.equals(plugin.nexttile)) {
|
||||
if (plugin.currenttile != null)
|
||||
{
|
||||
if (plugin.currenttile.equals(plugin.nexttile))
|
||||
{
|
||||
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);
|
||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Current & Next", 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);
|
||||
if (poly != null) {
|
||||
if (poly != null)
|
||||
{
|
||||
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.currenttile, "Current", 50);
|
||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Current", Color.WHITE);
|
||||
OverlayUtil.renderPolygon(graphics, poly, Color.GREEN);
|
||||
}
|
||||
}
|
||||
if (plugin.nexttile != null) {
|
||||
if (plugin.nexttile != null)
|
||||
{
|
||||
final Polygon poly2 = Perspective.getCanvasTilePoly(client, plugin.nexttile);
|
||||
if (poly2 != null) {
|
||||
if (poly2 != null)
|
||||
{
|
||||
Point textLocationtile = Perspective.getCanvasTextLocation(client, graphics, plugin.nexttile, "Next", 50);
|
||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "Next", Color.WHITE);
|
||||
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 = "";
|
||||
if (plugin.nztcolor.equals(Color.RED)) {
|
||||
if (plugin.nztcolor.equals(Color.RED))
|
||||
{
|
||||
style = "MELEE";
|
||||
} else if (plugin.nztcolor.equals(Color.BLUE)) {
|
||||
}
|
||||
else if (plugin.nztcolor.equals(Color.BLUE))
|
||||
{
|
||||
style = "MAGE";
|
||||
} else if (plugin.nztcolor.equals(Color.GREEN)) {
|
||||
}
|
||||
else if (plugin.nztcolor.equals(Color.GREEN))
|
||||
{
|
||||
style = "RANGE";
|
||||
} else if (plugin.nztcolor.equals(Color.YELLOW)) {
|
||||
}
|
||||
else if (plugin.nztcolor.equals(Color.YELLOW))
|
||||
{
|
||||
style = "JAD";
|
||||
}
|
||||
|
||||
@@ -107,19 +132,28 @@ public class ZulrahTileOverlay extends Overlay
|
||||
if (poly != null)
|
||||
{
|
||||
BufferedImage clanchatImage = null;
|
||||
if (style.equals("JAD")) {
|
||||
if (plugin.phase4 && plugin.phases.size() == 10) {
|
||||
if (style.equals("JAD"))
|
||||
{
|
||||
if (plugin.phase4 && plugin.phases.size() == 10)
|
||||
{
|
||||
clanchatImage = plugin.ProtectionIcons[2];
|
||||
} else if (plugin.phase3 && plugin.phases.size() == 9) {
|
||||
}
|
||||
else if (plugin.phase3 && plugin.phases.size() == 9)
|
||||
{
|
||||
clanchatImage = plugin.ProtectionIcons[2];
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
clanchatImage = plugin.ProtectionIcons[0];
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
clanchatImage = plugin.getProtectionIcon();
|
||||
}
|
||||
|
||||
if (clanchatImage != null) {
|
||||
if (clanchatImage != null)
|
||||
{
|
||||
Point imageLocation = new Point(textLocation.getX(), textLocation.getY() + 15);
|
||||
OverlayUtil.renderImageLocation(graphics, imageLocation, clanchatImage);
|
||||
}
|
||||
@@ -129,9 +163,11 @@ public class ZulrahTileOverlay extends Overlay
|
||||
OverlayUtil.renderPolygon(graphics, poly, plugin.nztcolor);
|
||||
}
|
||||
}
|
||||
if (plugin.MeleeTile != null) {
|
||||
if (plugin.MeleeTile != null)
|
||||
{
|
||||
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);
|
||||
graphics.setFont(FontManager.getRunescapeBoldFont());
|
||||
OverlayUtil.renderTextLocation(graphics, textLocationtile, "MOVE HERE NOW!", Color.WHITE);
|
||||
|
||||
Reference in New Issue
Block a user