Merge branch 'master' of runelite
This commit is contained in:
@@ -108,6 +108,10 @@ public enum AgilityShortcut
|
||||
AL_KHARID_MINING_PITCLIFF_SCRAMBLE(38, "Rocks", new WorldPoint(3305, 3315, 0), ROCKS_16549, ROCKS_16550),
|
||||
YANILLE_WALL_GRAPPLE(39, "Grapple Wall", new WorldPoint(2552, 3072, 0), WALL_17047),
|
||||
NEITIZNOT_BRIDGE_REPAIR(40, "Bridge Repair - Quest", new WorldPoint(2315, 3828, 0), ROPE_BRIDGE_21306, ROPE_BRIDGE_21307),
|
||||
NEITIZNOT_BRIDGE_SOUTHEAST(40, "Rope Bridge", null, ROPE_BRIDGE_21308, ROPE_BRIDGE_21309),
|
||||
NEITIZNOT_BRIDGE_NORTHWEST(40, "Rope Bridge", null, ROPE_BRIDGE_21310, ROPE_BRIDGE_21311),
|
||||
NEITIZNOT_BRIDGE_NORTH(40, "Rope Bridge", null, ROPE_BRIDGE_21312, ROPE_BRIDGE_21313),
|
||||
NEITIZNOT_BRIDGE_NORTHEAST(40, "Broken Rope bridge", null, ROPE_BRIDGE_21314, ROPE_BRIDGE_21315),
|
||||
KOUREND_LAKE_JUMP_EAST(40, "Stepping Stones", new WorldPoint(1612, 3570, 0), STEPPING_STONE_29729, STEPPING_STONE_29730),
|
||||
KOUREND_LAKE_JUMP_WEST(40, "Stepping Stones", new WorldPoint(1604, 3572, 0), STEPPING_STONE_29729, STEPPING_STONE_29730),
|
||||
YANILLE_DUNGEON_BALANCE(40, "Balancing Ledge", null, BALANCING_LEDGE_23548),
|
||||
|
||||
@@ -1,59 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2019 Hydrox6 <ikada@protonmail.ch>
|
||||
* 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.ammo;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import lombok.Getter;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||
import net.runelite.client.util.StackFormatter;
|
||||
|
||||
public class AmmoCounter extends Counter
|
||||
{
|
||||
@Getter
|
||||
private int itemID;
|
||||
|
||||
@Getter
|
||||
private String name;
|
||||
|
||||
public AmmoCounter(Plugin plugin, int itemID, int count, String name, BufferedImage image)
|
||||
{
|
||||
super(image, plugin, count);
|
||||
this.itemID = itemID;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return StackFormatter.quantityToRSDecimalStack(getCount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Copyright (c) 2019 Hydrox6 <ikada@protonmail.ch>
|
||||
* 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.ammo;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import lombok.Getter;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||
import net.runelite.client.util.StackFormatter;
|
||||
|
||||
class AmmoCounter extends Counter
|
||||
{
|
||||
@Getter
|
||||
private final int itemID;
|
||||
private final String name;
|
||||
|
||||
AmmoCounter(Plugin plugin, int itemID, int count, String name, BufferedImage image)
|
||||
{
|
||||
super(image, plugin, count);
|
||||
this.itemID = itemID;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText()
|
||||
{
|
||||
return StackFormatter.quantityToRSDecimalStack(getCount());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
||||
@PluginDescriptor(
|
||||
name = "Ammo",
|
||||
description = "Shows the current ammo the player has equipped",
|
||||
tags = {"bolts", "darts", "chinchompa"},
|
||||
type = "utility"
|
||||
tags = {"bolts", "darts", "chinchompa", "equipment"}
|
||||
)
|
||||
public class AmmoPlugin extends Plugin
|
||||
{
|
||||
@@ -63,20 +62,21 @@ public class AmmoPlugin extends Plugin
|
||||
private AmmoCounter counterBox;
|
||||
|
||||
@Override
|
||||
public void startUp() throws Exception
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
clientThread.invokeLater(() ->
|
||||
{
|
||||
ItemContainer container = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||
final ItemContainer container = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||
|
||||
if (container != null)
|
||||
{
|
||||
parseInventory(container.getItems());
|
||||
checkInventory(container.getItems());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutDown() throws Exception
|
||||
protected void shutDown() throws Exception
|
||||
{
|
||||
infoBoxManager.removeInfoBox(counterBox);
|
||||
counterBox = null;
|
||||
@@ -90,10 +90,10 @@ public class AmmoPlugin extends Plugin
|
||||
return;
|
||||
}
|
||||
|
||||
parseInventory(event.getItemContainer().getItems());
|
||||
checkInventory(event.getItemContainer().getItems());
|
||||
}
|
||||
|
||||
private void parseInventory(Item[] items)
|
||||
private void checkInventory(final Item[] items)
|
||||
{
|
||||
// Check for weapon slot items. This overrides the ammo slot,
|
||||
// as the player will use the thrown weapon (eg. chinchompas, knives, darts)
|
||||
@@ -126,7 +126,7 @@ public class AmmoPlugin extends Plugin
|
||||
updateInfobox(ammo, comp);
|
||||
}
|
||||
|
||||
private void updateInfobox(Item item, ItemComposition comp)
|
||||
private void updateInfobox(final Item item, final ItemComposition comp)
|
||||
{
|
||||
if (counterBox != null && counterBox.getItemID() == item.getId())
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ enum QuestStartLocation
|
||||
IMP_CATCHER("Imp Catcher", new WorldPoint(3108, 3160, 0)),
|
||||
THE_KNIGHTS_SWORD("The Knight's Sword", new WorldPoint(2976, 3342, 0)),
|
||||
MISTHALIN_MYSTERY("Misthalin Mystery", new WorldPoint(3234, 3155, 0)),
|
||||
PIRATES_TREASURE("Pirate's Treasure", new WorldPoint(3050, 3248, 0)),
|
||||
PIRATES_TREASURE("Pirate's Treasure", new WorldPoint(3051, 3252, 0)),
|
||||
PRINCE_ALI_RESCUE("Prince Ali Rescue", new WorldPoint(3301, 3163, 0)),
|
||||
THE_RESTLESS_GHOST("The Restless Ghost", new WorldPoint(3240, 3210, 0)),
|
||||
RUNE_MYSTERIES("Rune Mysteries", new WorldPoint(3210, 3220, 0)),
|
||||
|
||||
Reference in New Issue
Block a user