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),
|
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),
|
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_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_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),
|
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),
|
YANILLE_DUNGEON_BALANCE(40, "Balancing Ledge", null, BALANCING_LEDGE_23548),
|
||||||
|
|||||||
@@ -1,59 +1,57 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019 Hydrox6 <ikada@protonmail.ch>
|
* Copyright (c) 2019 Hydrox6 <ikada@protonmail.ch>
|
||||||
* 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
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
* list of conditions and the following disclaimer.
|
* list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* 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
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* 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
|
* (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.ammo;
|
package net.runelite.client.plugins.ammo;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.ui.overlay.infobox.Counter;
|
import net.runelite.client.ui.overlay.infobox.Counter;
|
||||||
import net.runelite.client.util.StackFormatter;
|
import net.runelite.client.util.StackFormatter;
|
||||||
|
|
||||||
public class AmmoCounter extends Counter
|
class AmmoCounter extends Counter
|
||||||
{
|
{
|
||||||
@Getter
|
@Getter
|
||||||
private int itemID;
|
private final int itemID;
|
||||||
|
private final String name;
|
||||||
@Getter
|
|
||||||
private String name;
|
AmmoCounter(Plugin plugin, int itemID, int count, String name, BufferedImage image)
|
||||||
|
{
|
||||||
public AmmoCounter(Plugin plugin, int itemID, int count, String name, BufferedImage image)
|
super(image, plugin, count);
|
||||||
{
|
this.itemID = itemID;
|
||||||
super(image, plugin, count);
|
this.name = name;
|
||||||
this.itemID = itemID;
|
}
|
||||||
this.name = name;
|
|
||||||
}
|
@Override
|
||||||
|
public String getText()
|
||||||
@Override
|
{
|
||||||
public String getText()
|
return StackFormatter.quantityToRSDecimalStack(getCount());
|
||||||
{
|
}
|
||||||
return StackFormatter.quantityToRSDecimalStack(getCount());
|
|
||||||
}
|
@Override
|
||||||
|
public String getTooltip()
|
||||||
@Override
|
{
|
||||||
public String getTooltip()
|
return name;
|
||||||
{
|
}
|
||||||
return name;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ import net.runelite.client.ui.overlay.infobox.InfoBoxManager;
|
|||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Ammo",
|
name = "Ammo",
|
||||||
description = "Shows the current ammo the player has equipped",
|
description = "Shows the current ammo the player has equipped",
|
||||||
tags = {"bolts", "darts", "chinchompa"},
|
tags = {"bolts", "darts", "chinchompa", "equipment"}
|
||||||
type = "utility"
|
|
||||||
)
|
)
|
||||||
public class AmmoPlugin extends Plugin
|
public class AmmoPlugin extends Plugin
|
||||||
{
|
{
|
||||||
@@ -63,20 +62,21 @@ public class AmmoPlugin extends Plugin
|
|||||||
private AmmoCounter counterBox;
|
private AmmoCounter counterBox;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
clientThread.invokeLater(() ->
|
clientThread.invokeLater(() ->
|
||||||
{
|
{
|
||||||
ItemContainer container = client.getItemContainer(InventoryID.EQUIPMENT);
|
final ItemContainer container = client.getItemContainer(InventoryID.EQUIPMENT);
|
||||||
|
|
||||||
if (container != null)
|
if (container != null)
|
||||||
{
|
{
|
||||||
parseInventory(container.getItems());
|
checkInventory(container.getItems());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void shutDown() throws Exception
|
protected void shutDown() throws Exception
|
||||||
{
|
{
|
||||||
infoBoxManager.removeInfoBox(counterBox);
|
infoBoxManager.removeInfoBox(counterBox);
|
||||||
counterBox = null;
|
counterBox = null;
|
||||||
@@ -90,10 +90,10 @@ public class AmmoPlugin extends Plugin
|
|||||||
return;
|
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,
|
// Check for weapon slot items. This overrides the ammo slot,
|
||||||
// as the player will use the thrown weapon (eg. chinchompas, knives, darts)
|
// as the player will use the thrown weapon (eg. chinchompas, knives, darts)
|
||||||
@@ -126,7 +126,7 @@ public class AmmoPlugin extends Plugin
|
|||||||
updateInfobox(ammo, comp);
|
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())
|
if (counterBox != null && counterBox.getItemID() == item.getId())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ enum QuestStartLocation
|
|||||||
IMP_CATCHER("Imp Catcher", new WorldPoint(3108, 3160, 0)),
|
IMP_CATCHER("Imp Catcher", new WorldPoint(3108, 3160, 0)),
|
||||||
THE_KNIGHTS_SWORD("The Knight's Sword", new WorldPoint(2976, 3342, 0)),
|
THE_KNIGHTS_SWORD("The Knight's Sword", new WorldPoint(2976, 3342, 0)),
|
||||||
MISTHALIN_MYSTERY("Misthalin Mystery", new WorldPoint(3234, 3155, 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)),
|
PRINCE_ALI_RESCUE("Prince Ali Rescue", new WorldPoint(3301, 3163, 0)),
|
||||||
THE_RESTLESS_GHOST("The Restless Ghost", new WorldPoint(3240, 3210, 0)),
|
THE_RESTLESS_GHOST("The Restless Ghost", new WorldPoint(3240, 3210, 0)),
|
||||||
RUNE_MYSTERIES("Rune Mysteries", new WorldPoint(3210, 3220, 0)),
|
RUNE_MYSTERIES("Rune Mysteries", new WorldPoint(3210, 3220, 0)),
|
||||||
|
|||||||
Reference in New Issue
Block a user