Merge pull request #3186 from open-osrs/upstream-3004

This commit is contained in:
Owain van Brakel
2022-04-30 23:13:41 +02:00
committed by GitHub
3 changed files with 45 additions and 6 deletions

View File

@@ -1016,12 +1016,13 @@ public class LootTrackerPlugin extends Plugin
}
else if (event.getMenuOption().equals("Loot") && IMPLING_JARS.contains(event.getItemId()))
{
final int itemId = event.getItemId();
onInvChange(((invItems, groundItems, removedItems) ->
{
int cnt = removedItems.count(event.getItemId());
int cnt = removedItems.count(itemId);
if (cnt > 0)
{
String name = itemManager.getItemComposition(event.getItemId()).getName();
String name = itemManager.getItemComposition(itemId).getName();
addLoot(name, -1, LootRecordType.EVENT, null, invItems, cnt);
}
}));

View File

@@ -24,6 +24,7 @@
*/
package net.runelite.client.plugins.menuentryswapper;
import lombok.RequiredArgsConstructor;
import net.runelite.client.config.Config;
import net.runelite.client.config.ConfigGroup;
import net.runelite.client.config.ConfigItem;
@@ -612,10 +613,38 @@ public interface MenuEntrySwapperConfig extends Config
return true;
}
@RequiredArgsConstructor
enum HouseTeleportMode
{
CAST("Cast"),
OUTSIDE("Outside"),
GROUP_CHOOSE("Group: Choose"),
GROUP_PREVIOUS("Group: Previous");
private final String name;
@Override
public String toString()
{
return name;
}
}
@ConfigItem(
keyName = "swapHouseTeleportSpell",
name = "House teleport",
description = "Swap house teleport spell to a different destination on shift",
section = uiSection
)
default HouseTeleportMode swapHouseTeleportSpell()
{
return HouseTeleportMode.OUTSIDE;
}
@ConfigItem(
keyName = "swapTeleportSpell",
name = "Shift-click teleport spells",
description = "Swap teleport spells that have a second destination on shift",
description = "Swap teleport spells that have a second destination, except for teleport to house, on shift",
section = uiSection
)
default boolean swapTeleportSpell()
@@ -659,8 +688,7 @@ public interface MenuEntrySwapperConfig extends Config
@ConfigItem(
keyName = "swapGEAbort",
name = "GE Abort",
description = "Swap abort offer on Grand Exchange offers when shift-clicking"
,
description = "Swap abort offer on Grand Exchange offers when shift-clicking",
section = uiSection
)
default boolean swapGEAbort()

View File

@@ -424,7 +424,11 @@ public class MenuEntrySwapperPlugin extends Plugin
swapTeleport("varrock teleport", "grand exchange");
swapTeleport("camelot teleport", "seers'");
swapTeleport("watchtower teleport", "yanille");
swapTeleport("teleport to house", "outside");
swapHouseTeleport("cast", () -> shiftModifier() && config.swapHouseTeleportSpell() == MenuEntrySwapperConfig.HouseTeleportMode.CAST);
swapHouseTeleport("outside", () -> shiftModifier() && config.swapHouseTeleportSpell() == MenuEntrySwapperConfig.HouseTeleportMode.OUTSIDE);
swapHouseTeleport("group: choose", () -> shiftModifier() && config.swapHouseTeleportSpell() == MenuEntrySwapperConfig.HouseTeleportMode.GROUP_CHOOSE);
swapHouseTeleport("group: previous", () -> shiftModifier() && config.swapHouseTeleportSpell() == MenuEntrySwapperConfig.HouseTeleportMode.GROUP_PREVIOUS);
swap("eat", "guzzle", config::swapRockCake);
@@ -469,6 +473,12 @@ public class MenuEntrySwapperPlugin extends Plugin
swap(swappedOption, option, "cast", () -> shiftModifier() && config.swapTeleportSpell());
}
private void swapHouseTeleport(String swappedOption, Supplier<Boolean> enabled)
{
swap("cast", "teleport to house", swappedOption, enabled);
swap("outside", "teleport to house", swappedOption, enabled);
}
@Subscribe
public void onConfigChanged(ConfigChanged event)
{