Merge remote-tracking branch 'runelite/master'

This commit is contained in:
Owain van Brakel
2021-07-28 15:14:43 +02:00
17 changed files with 1346 additions and 1250 deletions

View File

@@ -229,7 +229,8 @@ public enum ItemMapping
SLAYER_HELMET, SLAYER_HELMET_I, BLACK_SLAYER_HELMET, BLACK_SLAYER_HELMET_I, PURPLE_SLAYER_HELMET, PURPLE_SLAYER_HELMET_I, RED_SLAYER_HELMET, RED_SLAYER_HELMET_I,
GREEN_SLAYER_HELMET, GREEN_SLAYER_HELMET_I, TURQUOISE_SLAYER_HELMET, TURQUOISE_SLAYER_HELMET_I, TWISTED_SLAYER_HELMET, TWISTED_SLAYER_HELMET_I, HYDRA_SLAYER_HELMET, HYDRA_SLAYER_HELMET_I,
SLAYER_HELMET_I_25177, BLACK_SLAYER_HELMET_I_25179, GREEN_SLAYER_HELMET_I_25181, RED_SLAYER_HELMET_I_25183, PURPLE_SLAYER_HELMET_I_25185, TURQUOISE_SLAYER_HELMET_I_25187, HYDRA_SLAYER_HELMET_I_25189, TWISTED_SLAYER_HELMET_I_25191,
BLACK_MASK_I_25276, BLACK_MASK_1_I_25275, BLACK_MASK_2_I_25274, BLACK_MASK_3_I_25273, BLACK_MASK_4_I_25272, BLACK_MASK_5_I_25271, BLACK_MASK_6_I_25270, BLACK_MASK_7_I_25269, BLACK_MASK_8_I_25268, BLACK_MASK_9_I_25267, BLACK_MASK_10_I_25266),
BLACK_MASK_I_25276, BLACK_MASK_1_I_25275, BLACK_MASK_2_I_25274, BLACK_MASK_3_I_25273, BLACK_MASK_4_I_25272, BLACK_MASK_5_I_25271, BLACK_MASK_6_I_25270, BLACK_MASK_7_I_25269, BLACK_MASK_8_I_25268, BLACK_MASK_9_I_25267, BLACK_MASK_10_I_25266,
TZTOK_SLAYER_HELMET, TZTOK_SLAYER_HELMET_I, TZTOK_SLAYER_HELMET_I_25902, VAMPYRIC_SLAYER_HELMET, VAMPYRIC_SLAYER_HELMET_I, VAMPYRIC_SLAYER_HELMET_I_25908, TZKAL_SLAYER_HELMET, TZKAL_SLAYER_HELMET_I, TZKAL_SLAYER_HELMET_I_25914),
// Pharaoh's Sceptres
ITEM_PHARAOHS_SCEPTRE_1(PHARAOHS_SCEPTRE, PHARAOHS_SCEPTRE_1),

View File

@@ -56,18 +56,19 @@ import net.runelite.api.IndexedSprite;
import net.runelite.api.ItemComposition;
import net.runelite.api.MessageNode;
import net.runelite.api.Player;
import net.runelite.api.ScriptID;
import net.runelite.api.VarPlayer;
import net.runelite.api.Varbits;
import net.runelite.api.WorldType;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameStateChanged;
import net.runelite.api.events.GameTick;
import net.runelite.api.events.ScriptPostFired;
import net.runelite.api.events.VarbitChanged;
import net.runelite.api.events.WidgetLoaded;
import net.runelite.api.vars.AccountType;
import net.runelite.api.widgets.Widget;
import static net.runelite.api.widgets.WidgetID.ADVENTURE_LOG_ID;
import static net.runelite.api.widgets.WidgetID.COLLECTION_LOG_ID;
import static net.runelite.api.widgets.WidgetID.GENERIC_SCROLL_GROUP_ID;
import static net.runelite.api.widgets.WidgetID.KILL_LOGS_GROUP_ID;
import net.runelite.api.widgets.WidgetInfo;
@@ -114,7 +115,7 @@ public class ChatCommandsPlugin extends Plugin
private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)");
private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("Theatre of Blood wave completion time: <col=ff0000>[0-9:.]+</col>\\. Personal best: (?<pb>[0-9:]+(?:\\.[0-9]+)?)");
private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>[0-9:.]+</col>\\. Personal best: (?:<col=ff0000>)?(?<pb>[0-9:]+(?:\\.[0-9]+)?)");
private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)^(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)");
private static final Pattern NEW_PB_PATTERN = Pattern.compile("(?i)(?:(?:Fight |Lap |Challenge |Corrupted challenge )?duration:|Subdued in) <col=[0-9a-f]{6}>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(new personal best\\)");
private static final Pattern DUEL_ARENA_WINS_PATTERN = Pattern.compile("You (were defeated|won)! You have(?: now)? won (\\d+) duels?");
private static final Pattern DUEL_ARENA_LOSSES_PATTERN = Pattern.compile("You have(?: now)? lost (\\d+) duels?");
private static final Pattern ADVENTURE_LOG_TITLE_PATTERN = Pattern.compile("The Exploits of (.+)");
@@ -155,7 +156,6 @@ public class ChatCommandsPlugin extends Plugin
private boolean bossLogLoaded;
private boolean advLogLoaded;
private boolean scrollInterfaceLoaded;
private boolean collectionLogLoaded;
private String pohOwner;
private HiscoreEndpoint hiscoreEndpoint; // hiscore endpoint for current player
private String lastBossKill;
@@ -599,39 +599,6 @@ public class ChatCommandsPlugin extends Plugin
}
}
if (collectionLogLoaded && (pohOwner == null || pohOwner.equals(client.getLocalPlayer().getName())))
{
collectionLogLoaded = false;
Widget collectionLogEntryHeader = client.getWidget(WidgetInfo.COLLECTION_LOG_ENTRY_HEADER);
if (collectionLogEntryHeader != null && collectionLogEntryHeader.getChildren() != null)
{
Widget entryTitle = collectionLogEntryHeader.getChild(COL_LOG_ENTRY_HEADER_TITLE_INDEX);
// Make sure that the player is looking in the All Pets tab of the collection log
if (entryTitle.getText().equals("All Pets"))
{
Widget collectionLogEntryItems = client.getWidget(WidgetInfo.COLLECTION_LOG_ENTRY_ITEMS);
if (collectionLogEntryItems != null && collectionLogEntryItems.getChildren() != null)
{
List<Pet> petList = new ArrayList<>();
for (Widget child : collectionLogEntryItems.getChildren())
{
if (child.getOpacity() == 0)
{
Pet pet = Pet.findPet(Text.removeTags(child.getName()));
if (pet != null)
{
petList.add(pet);
}
}
}
setPetList(petList);
}
}
}
}
if (bossLogLoaded && (pohOwner == null || pohOwner.equals(client.getLocalPlayer().getName())))
{
bossLogLoaded = false;
@@ -700,6 +667,47 @@ public class ChatCommandsPlugin extends Plugin
}
}
@Subscribe
public void onScriptPostFired(ScriptPostFired scriptPostFired)
{
if (scriptPostFired.getScriptId() != ScriptID.COLLECTION_DRAW_LIST)
{
return;
}
if (pohOwner == null || pohOwner.equals(client.getLocalPlayer().getName()))
{
Widget collectionLogEntryHeader = client.getWidget(WidgetInfo.COLLECTION_LOG_ENTRY_HEADER);
if (collectionLogEntryHeader != null && collectionLogEntryHeader.getChildren() != null)
{
Widget entryTitle = collectionLogEntryHeader.getChild(COL_LOG_ENTRY_HEADER_TITLE_INDEX);
// Make sure that the player is looking in the All Pets tab of the collection log
if (entryTitle.getText().equals("All Pets"))
{
Widget collectionLogEntryItems = client.getWidget(WidgetInfo.COLLECTION_LOG_ENTRY_ITEMS);
if (collectionLogEntryItems != null && collectionLogEntryItems.getChildren() != null)
{
List<Pet> petList = new ArrayList<>();
for (Widget child : collectionLogEntryItems.getChildren())
{
if (child.getOpacity() == 0)
{
Pet pet = Pet.findPet(Text.removeTags(child.getName()));
if (pet != null)
{
petList.add(pet);
}
}
}
setPetList(petList);
log.debug("Loaded {} pets", petList.size());
}
}
}
}
}
@Subscribe
public void onWidgetLoaded(WidgetLoaded widget)
{
@@ -708,9 +716,6 @@ public class ChatCommandsPlugin extends Plugin
case ADVENTURE_LOG_ID:
advLogLoaded = true;
break;
case COLLECTION_LOG_ID:
collectionLogLoaded = true;
break;
case KILL_LOGS_GROUP_ID:
bossLogLoaded = true;
break;
@@ -1194,7 +1199,9 @@ public class ChatCommandsPlugin extends Plugin
return;
}
ChatMessageBuilder responseBuilder = new ChatMessageBuilder().append("Pets: ")
ChatMessageBuilder responseBuilder = new ChatMessageBuilder()
.append(ChatColorType.NORMAL)
.append("Pets: ")
.append("(" + playerPetList.size() + ")");
// Append pets that the player owns
@@ -1211,7 +1218,8 @@ public class ChatCommandsPlugin extends Plugin
log.debug("Setting response {}", response);
final MessageNode messageNode = chatMessage.getMessageNode();
messageNode.setValue(response);
messageNode.setRuneLiteFormatMessage(response);
chatMessageManager.update(messageNode);
client.refreshChat();
}

View File

@@ -126,7 +126,7 @@ public class AnagramClue extends ClueScroll implements TextClueScroll, NpcClueSc
new AnagramClue("O BIRDZ A ZANY EN PC", "Cap'n Izzy No-Beard", new WorldPoint(2807, 3191, 0), "Brimhaven Agility Arena", "How many Banana Trees are there in the plantation?", "33"),
new AnagramClue("OK CO", "Cook", new WorldPoint(3207, 3214, 0), "Ground floor of Lumbridge Castle", "How many cannons does Lumbridge Castle have?", "9"),
new AnagramClue("OR ZINC FUMES WARD", "Wizard Frumscone", new WorldPoint(2594, 3086, 0), "Downstairs in the Wizards' Guild"),
new AnagramClue("OUR OWN NEEDS", "Nurse Wooned", new WorldPoint(1511, 3619, 0), "Shayzien Infirmary", "How many wounded soldiers are in the camp?", "16"),
new AnagramClue("OUR OWN NEEDS", "Nurse Wooned", new WorldPoint(1511, 3619, 0), "Shayzien Infirmary", "How many wounded soldiers are there in the camp?", "16"),
new AnagramClue("PACINNG A TAIE", "Captain Ginea", new WorldPoint(1504, 3632, 0), "Tent east of Shayzien Encampment war tent", "1 soldier can deal with 6 lizardmen. How many soldiers do we need for an army of 678 lizardmen?", "113"),
new AnagramClue("PEAK REFLEX", "Flax keeper", new WorldPoint(2744, 3444, 0), "Flax field south of Seers Village", "If I have 1014 flax, and I spin a third of them into bowstring, how many flax do I have left?", "676"),
new AnagramClue("PEATY PERT", "Party Pete", new WorldPoint(3047, 3376, 0), "Falador Party Room"),

View File

@@ -392,6 +392,13 @@ public class GroundItemsPlugin extends Plugin
}
}
}
// Since the loot can potentially be over multiple tiles, make sure to process lootbeams on all those tiles
items.stream()
.map(ItemStack::getLocation)
.map(l -> WorldPoint.fromLocal(client, l))
.distinct()
.forEach(this::handleLootbeam);
}
private GroundItem buildGroundItem(final Tile tile, final TileItem item)

View File

@@ -70,6 +70,7 @@ import net.runelite.client.menus.WidgetMenuOption;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.plugins.PluginDescriptor;
import static net.runelite.client.plugins.menuentryswapper.MenuEntrySwapperConfig.ArdougneCloakMode;
import static net.runelite.client.plugins.menuentryswapper.MenuEntrySwapperConfig.DesertAmuletMode;
import static net.runelite.client.plugins.menuentryswapper.MenuEntrySwapperConfig.KaramjaGlovesMode;
import static net.runelite.client.plugins.menuentryswapper.MenuEntrySwapperConfig.MorytaniaLegsMode;
import static net.runelite.client.plugins.menuentryswapper.MenuEntrySwapperConfig.RadasBlessingMode;
@@ -374,6 +375,9 @@ public class MenuEntrySwapperPlugin extends Plugin
swap("wear", "ecto teleport", () -> config.swapMorytaniaLegsMode() == MorytaniaLegsMode.ECTOFUNTUS);
swap("wear", "burgh teleport", () -> config.swapMorytaniaLegsMode() == MorytaniaLegsMode.BURGH_DE_ROTT);
swap("wear", "nardah", () -> config.swapDesertAmuletMode() == DesertAmuletMode.NARDAH);
swap("wear", "kalphite cave", () -> config.swapDesertAmuletMode() == DesertAmuletMode.KALPHITE_CAVE);
swap("bury", "use", config::swapBones);
swap("wield", "battlestaff", "use", config::swapBattlestaves);

View File

@@ -29,7 +29,6 @@ package net.runelite.client.plugins.xptracker;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.math.RoundingMode;
import java.text.DecimalFormat;
import java.util.ArrayList;
@@ -54,6 +53,7 @@ import net.runelite.api.Skill;
import net.runelite.api.WorldType;
import net.runelite.client.game.SkillIconManager;
import net.runelite.client.ui.ColorScheme;
import net.runelite.client.ui.DynamicGridLayout;
import net.runelite.client.ui.FontManager;
import net.runelite.client.ui.SkillColor;
import net.runelite.client.ui.components.MouseDragEventForwarder;
@@ -190,7 +190,7 @@ class XpInfoBox extends JPanel
headerPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
headerPanel.setLayout(new BorderLayout());
statsPanel.setLayout(new GridLayout(2, 2));
statsPanel.setLayout(new DynamicGridLayout(2, 2));
statsPanel.setBackground(ColorScheme.DARKER_GRAY_COLOR);
statsPanel.setBorder(new EmptyBorder(9, 2, 9, 2));

View File

@@ -143,6 +143,14 @@
"ry2": 48,
"z1": 2,
"z2": 2
},
{
"rx1": 53,
"ry1": 44,
"rx2": 53,
"ry2": 47,
"z1": 0,
"z2": 0
}
],
"13151":[ // Prif NE
@@ -275,6 +283,38 @@
"ry2": 52,
"z1": 2,
"z2": 2
},
{
"rx1": 46,
"ry1": 52,
"rx2": 46,
"ry2": 52,
"z1": 0,
"z2": 0
},
{
"rx1": 40,
"ry1": 47,
"rx2": 40,
"ry2": 47,
"z1": 0,
"z2": 0
},
{
"rx1": 40,
"ry1": 26,
"rx2": 40,
"ry2": 26,
"z1": 0,
"z2": 0
},
{
"rx1": 53,
"ry1": 22,
"rx2": 53,
"ry2": 25,
"z1": 0,
"z2": 0
}
],
"13150": [ // Prif SE
@@ -419,6 +459,14 @@
"ry2": 11,
"z1": 0,
"z2": 0
},
{
"rx1": 20,
"ry1": 23,
"rx2": 26,
"ry2": 34,
"z1": 1,
"z2": 1
}
],
"12852": [ // South Varrock
@@ -1919,7 +1967,25 @@
"z1": 1,
"z2": 2
},
{ // Lighthouse clockwork
{
"rx1": 12,
"ry1": 51,
"rx2": 13,
"ry2": 52,
"z1": 0,
"z2": 1
}
],
"9799": [ // Lighthouse (During Horror from the Deep)
{
"rx1": 9,
"ry1": 53,
"rx2": 16,
"ry2": 60,
"z1": 1,
"z2": 2
},
{
"rx1": 12,
"ry1": 51,
"rx2": 13,
@@ -2413,5 +2479,97 @@
"z1": 0,
"z2": 1
}
],
"8008": [ // Temple of Light Dungeon
{
"rx1": 34,
"ry1": 45,
"rx2": 54,
"ry2": 60,
"z1": 0,
"z2": 0
}
],
"12349": [ // Mage Arena
{
"rx1": 31,
"ry1": 48,
"rx2": 36,
"ry2": 53,
"z1": 0,
"z2": 0
},
{
"rx1": 23,
"ry1": 8,
"rx2": 44,
"ry2": 50,
"z1": 0,
"z2": 0
},
{
"rx1": 10,
"ry1": 18,
"rx2": 56,
"ry2": 37,
"z1": 0,
"z2": 0
},
{
"rx1": 12,
"ry1": 16,
"rx2": 54,
"ry2": 40,
"z1": 0,
"z2": 0
},
{
"rx1": 14,
"ry1": 14,
"rx2": 52,
"ry2": 42,
"z1": 0,
"z2": 0
},
{
"rx1": 16,
"ry1": 12,
"rx2": 50,
"ry2": 44,
"z1": 0,
"z2": 0
},
{
"rx1": 18,
"ry1": 10,
"rx2": 48,
"ry2": 46,
"z1": 0,
"z2": 0
},
{
"rx1": 20,
"ry1": 8,
"rx2": 46,
"ry2": 48,
"z1": 0,
"z2": 0
},
{
"rx1": 55,
"ry1": 38,
"rx2": 55,
"ry2": 38,
"z1": 0,
"z2": 0
},
{
"rx1": 24,
"ry1": 51,
"rx2": 24,
"ry2": 51,
"z1": 0,
"z2": 0
}
]
}