Skip to content

Commit

Permalink
Merge branch 'upstream-master' into runelite
Browse files Browse the repository at this point in the history
  • Loading branch information
Therealnull committed Feb 4, 2021
2 parents 4be1b25 + 4f6f518 commit fd6b8fc
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void save(Store store) throws IOException
br.printf("revision=%d\n", idx.getRevision());
br.printf("compression=%d\n", idx.getCompression());
br.printf("crc=%d\n", idx.getCrc());
br.printf("named=%b\n", idx.getCompression());
br.printf("named=%b\n", idx.isNamed());

idx.getArchives().sort(Comparator.comparing(Archive::getArchiveId));
for (Archive archive : idx.getArchives())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ public MenuOptionClicked(String option, String target, int identifier, int opcod
this.mouseButton = mouseButton;
}

/**
* The selected item index at the time of the option click.
*/
private int selectedItemIndex;
/**
* Whether or not the event has been consumed by a subscriber.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ private void saveToFile(final File propertiesFile) throws IOException

parent.mkdirs();

File tempFile = new File(parent, RuneLite.DEFAULT_CONFIG_FILE.getName() + ".tmp");
File tempFile = File.createTempFile("runelite", null, parent);

try (FileOutputStream out = new FileOutputStream(tempFile))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ public class LootTrackerPlugin extends Plugin
// Chest loot handling
private static final String CHEST_LOOTED_MESSAGE = "You find some treasure in the chest!";
private static final Pattern LARRAN_LOOTED_PATTERN = Pattern.compile("You have opened Larran's (big|small) chest .*");
private static final String STONE_CHEST_LOOTED_MESSAGE = "You steal some loot from the chest.";
// Used by Stone Chest, Isle of Souls chest, Dark Chest
private static final String OTHER_CHEST_LOOTED_MESSAGE = "You steal some loot from the chest.";
private static final String DORGESH_KAAN_CHEST_LOOTED_MESSAGE = "You find treasure inside!";
private static final String GRUBBY_CHEST_LOOTED_MESSAGE = "You have opened the Grubby Chest";
private static final Pattern HAM_CHEST_LOOTED_PATTERN = Pattern.compile("Your (?<key>[a-z]+) key breaks in the lock.*");
Expand All @@ -161,6 +162,8 @@ public class LootTrackerPlugin extends Plugin
put(10835, "Dorgesh-Kaan Chest").
put(10834, "Dorgesh-Kaan Chest").
put(7323, "Grubby Chest").
put(8593, "Isle of Souls Chest").
put(7827, "Dark Chest").
build();

// Shade chest loot handling
Expand All @@ -186,6 +189,11 @@ public class LootTrackerPlugin extends Plugin
put(ObjectID.SILVER_CHEST_4128, "Silver key crimson").
put(ObjectID.SILVER_CHEST_4129, "Silver key black").
put(ObjectID.SILVER_CHEST_4130, "Silver key purple").
put(ObjectID.GOLD_CHEST, "Gold key red").
put(ObjectID.GOLD_CHEST_41213, "Gold key brown").
put(ObjectID.GOLD_CHEST_41214, "Gold key crimson").
put(ObjectID.GOLD_CHEST_41215, "Gold key black").
put(ObjectID.GOLD_CHEST_41216, "Gold key purple").
build();

// Hallow Sepulchre Coffin handling
Expand Down Expand Up @@ -625,7 +633,7 @@ public void onChatMessage(ChatMessage event)

final String message = event.getMessage();

if (message.equals(CHEST_LOOTED_MESSAGE) || message.equals(STONE_CHEST_LOOTED_MESSAGE)
if (message.equals(CHEST_LOOTED_MESSAGE) || message.equals(OTHER_CHEST_LOOTED_MESSAGE)
|| message.equals(DORGESH_KAAN_CHEST_LOOTED_MESSAGE) || message.startsWith(GRUBBY_CHEST_LOOTED_MESSAGE)
|| LARRAN_LOOTED_PATTERN.matcher(message).matches())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ private class Slider

public void update()
{
handle.setNoClickThrough(false);
handle.setOnDragListener((JavaScriptCallback) this::drag);
handle.setOnDragCompleteListener((JavaScriptCallback) this::drag);
handle.setHasListener(true);
Expand Down Expand Up @@ -511,6 +512,9 @@ protected void moveHandle(int x)
int level = (x * channel.max) / getWidth();
level = Ints.constrainToRange(level, 0, channel.max);
channel.setLevel(level);

int percent = (int) Math.round((level * 100.0 / channel.getMax()));
sliderTooltip = new Tooltip(channel.getName() + ": " + percent + "%");
}

protected int getWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ enum MinigameLocation
PYRAMID_PLUNDER("Pyramid Plunder", new WorldPoint(3288, 2787, 0)),
RANGING_GUILD("Ranging Guild", new WorldPoint(2671, 3419, 0)),
ROGUES_DEN("Rogues' Den", new WorldPoint(2905, 3537, 0)),
SHADES_OF_MORTTON("Shades of Mort'ton", new WorldPoint(3505, 3315, 0)),
SORCERESSS_GARDEN("Sorceress's Garden", new WorldPoint(3285, 3180, 0)),
TROUBLE_BREWING("Trouble Brewing", new WorldPoint(3811, 3021, 0)),
VOLCANIC_MINE("Volcanic Mine", new WorldPoint(3812, 3810, 0)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void onStatChanged(StatChanged statChanged)
{
case AGILITY:
{
int newAgilityLevel = statChanged.getLevel();
int newAgilityLevel = statChanged.getBoostedLevel();
if (newAgilityLevel != agilityLevel)
{
agilityLevel = newAgilityLevel;
Expand All @@ -196,7 +196,7 @@ public void onStatChanged(StatChanged statChanged)
}
case WOODCUTTING:
{
int newWoodcutLevel = statChanged.getLevel();
int newWoodcutLevel = statChanged.getBoostedLevel();
if (newWoodcutLevel != woodcuttingLevel)
{
woodcuttingLevel = newWoodcutLevel;
Expand Down

0 comments on commit fd6b8fc

Please sign in to comment.