Merge remote-tracking branch 'upstream/master' into master
This commit is contained in:
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@@ -14,7 +14,7 @@ Here are the guidelines we'd like you to follow:
|
|||||||
|
|
||||||
## <a name="question"></a> Got a Question or Problem?
|
## <a name="question"></a> Got a Question or Problem?
|
||||||
|
|
||||||
If you have questions about how to contribute to runelite, please join our [Discord](https://discord.gg/HN5gf3m) server.
|
If you have questions about how to contribute to runelite, please join our [Discord](https://discord.gg/r287wN6bkc) server.
|
||||||
|
|
||||||
## <a name="issue"></a> Found an Issue?
|
## <a name="issue"></a> Found an Issue?
|
||||||
|
|
||||||
@@ -130,5 +130,5 @@ from the main (upstream) repository:
|
|||||||
To ensure consistency throughout the source code, review our [code conventions](https://github.com/runelite/runelite/wiki/Code-Conventions).
|
To ensure consistency throughout the source code, review our [code conventions](https://github.com/runelite/runelite/wiki/Code-Conventions).
|
||||||
|
|
||||||
|
|
||||||
[github]: https://github.com/runelite-extended/runelite
|
[github]: https://github.com/open-osrs/runelite
|
||||||
[discord]: https://discord.gg/HN5gf3m
|
[discord]: https://discord.gg/r287wN6bkc
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ This branch uses upstreams PlayerManager/OverlayManager etc so keep that in mind
|
|||||||
Contributions are welcome, but there should be no changes made to runelite-client unless necessary/minor. Mould the api around the client.
|
Contributions are welcome, but there should be no changes made to runelite-client unless necessary/minor. Mould the api around the client.
|
||||||
## Discord
|
## Discord
|
||||||
|
|
||||||
[](https://discord.gg/openosrs)
|
[](https://discord.gg/r287wN6bkc)
|
||||||
|
|
||||||
## Project Layout
|
## Project Layout
|
||||||
|
|
||||||
|
|||||||
@@ -549,6 +549,7 @@ public class WidgetID
|
|||||||
static final int MUSIC_TAB = 40;
|
static final int MUSIC_TAB = 40;
|
||||||
static final int MUSIC_ICON = 49;
|
static final int MUSIC_ICON = 49;
|
||||||
static final int MAGIC_ICON = 66;
|
static final int MAGIC_ICON = 66;
|
||||||
|
static final int INTERFACE_CONTAINER = 68;
|
||||||
static final int INVENTORY_CONTAINER = 74;
|
static final int INVENTORY_CONTAINER = 74;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -263,6 +263,8 @@ public enum WidgetInfo
|
|||||||
RESIZABLE_VIEWPORT_OPTIONS_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.OPTIONS_ICON),
|
RESIZABLE_VIEWPORT_OPTIONS_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.OPTIONS_ICON),
|
||||||
RESIZABLE_VIEWPORT_EMOTES_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.EMOTES_ICON),
|
RESIZABLE_VIEWPORT_EMOTES_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.EMOTES_ICON),
|
||||||
RESIZABLE_VIEWPORT_MUSIC_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.MUSIC_ICON),
|
RESIZABLE_VIEWPORT_MUSIC_ICON(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.MUSIC_ICON),
|
||||||
|
RESIZABLE_VIEWPORT_INTERFACE_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.INTERFACE_CONTAINER),
|
||||||
|
RESIZABLE_VIEWPORT_INVENTORY_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.INVENTORY_CONTAINER),
|
||||||
|
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.Viewport.RESIZABLE_VIEWPORT_BOTTOM_LINE),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.Viewport.RESIZABLE_VIEWPORT_BOTTOM_LINE),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_LOGOUT_BUTTON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.LOGOUT_BUTTON_OVERLAY),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_LOGOUT_BUTTON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.LOGOUT_BUTTON_OVERLAY),
|
||||||
@@ -281,9 +283,7 @@ public enum WidgetInfo
|
|||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_EMOTES_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.EMOTE_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_EMOTES_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.EMOTE_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_MUSIC_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.MUSIC_ICON),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_MUSIC_ICON(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.MUSIC_ICON),
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.INVENTORY_CONTAINER),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_INVENTORY_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.INVENTORY_CONTAINER),
|
||||||
RESIZABLE_VIEWPORT_INTERFACE_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.INTERFACE_CONTAINER),
|
RESIZABLE_VIEWPORT_BOTTOM_LINE_INTERFACE_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewportBottomLine.INTERFACE_CONTAINER),
|
||||||
RESIZABLE_VIEWPORT_INVENTORY_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_OLD_SCHOOL_BOX_GROUP_ID, WidgetID.ResizableViewport.INVENTORY_CONTAINER),
|
|
||||||
RESIZABLE_VIEWPORT_BOTTOM_LINE_INTERFACE_CONTAINER(WidgetID.RESIZABLE_VIEWPORT_BOTTOM_LINE_GROUP_ID, WidgetID.ResizableViewport.INTERFACE_CONTAINER),
|
|
||||||
|
|
||||||
PRAYER_THICK_SKIN(WidgetID.PRAYER_GROUP_ID, WidgetID.Prayer.THICK_SKIN),
|
PRAYER_THICK_SKIN(WidgetID.PRAYER_GROUP_ID, WidgetID.Prayer.THICK_SKIN),
|
||||||
PRAYER_BURST_OF_STRENGTH(WidgetID.PRAYER_GROUP_ID, WidgetID.Prayer.BURST_OF_STRENGTH),
|
PRAYER_BURST_OF_STRENGTH(WidgetID.PRAYER_GROUP_ID, WidgetID.Prayer.BURST_OF_STRENGTH),
|
||||||
|
|||||||
@@ -163,6 +163,9 @@ public class RuneLite
|
|||||||
parser.accepts("debug", "Show extra debugging output");
|
parser.accepts("debug", "Show extra debugging output");
|
||||||
parser.accepts("safe-mode", "Disables external plugins and the GPU plugin");
|
parser.accepts("safe-mode", "Disables external plugins and the GPU plugin");
|
||||||
parser.accepts("insecure-skip-tls-verification", "Disables TLS verification");
|
parser.accepts("insecure-skip-tls-verification", "Disables TLS verification");
|
||||||
|
parser.accepts("jav_config", "jav_config url")
|
||||||
|
.withRequiredArg()
|
||||||
|
.defaultsTo(RuneLiteProperties.getJavConfig());
|
||||||
|
|
||||||
final ArgumentAcceptingOptionSpec<File> sessionfile = parser.accepts("sessionfile", "Use a specified session file")
|
final ArgumentAcceptingOptionSpec<File> sessionfile = parser.accepts("sessionfile", "Use a specified session file")
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
@@ -275,7 +278,7 @@ public class RuneLite
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final ClientLoader clientLoader = new ClientLoader(okHttpClient, options.valueOf(updateMode));
|
final ClientLoader clientLoader = new ClientLoader(okHttpClient, options.valueOf(updateMode), (String) options.valueOf("jav_config"));
|
||||||
|
|
||||||
new Thread(() ->
|
new Thread(() ->
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ import net.runelite.client.util.ExecutorServiceExceptionLogger;
|
|||||||
import net.runelite.http.api.RuneLiteAPI;
|
import net.runelite.http.api.RuneLiteAPI;
|
||||||
import net.runelite.http.api.chat.ChatClient;
|
import net.runelite.http.api.chat.ChatClient;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class RuneLiteModule extends AbstractModule
|
public class RuneLiteModule extends AbstractModule
|
||||||
@@ -106,10 +104,6 @@ public class RuneLiteModule extends AbstractModule
|
|||||||
bind(EventBus.class)
|
bind(EventBus.class)
|
||||||
.annotatedWith(Names.named("Deferred EventBus"))
|
.annotatedWith(Names.named("Deferred EventBus"))
|
||||||
.to(DeferredEventBus.class);
|
.to(DeferredEventBus.class);
|
||||||
|
|
||||||
bind(Logger.class)
|
|
||||||
.annotatedWith(Names.named("Core Logger"))
|
|
||||||
.toInstance(LoggerFactory.getLogger(RuneLite.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ public class ChatMessageManager
|
|||||||
case OBJECT_EXAMINE:
|
case OBJECT_EXAMINE:
|
||||||
case NPC_EXAMINE:
|
case NPC_EXAMINE:
|
||||||
case CONSOLE:
|
case CONSOLE:
|
||||||
|
case FRIENDSCHATNOTIFICATION:
|
||||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -251,6 +252,7 @@ public class ChatMessageManager
|
|||||||
case OBJECT_EXAMINE:
|
case OBJECT_EXAMINE:
|
||||||
case NPC_EXAMINE:
|
case NPC_EXAMINE:
|
||||||
case CONSOLE:
|
case CONSOLE:
|
||||||
|
case FRIENDSCHATNOTIFICATION:
|
||||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
package net.runelite.client.config;
|
package net.runelite.client.config;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import net.runelite.client.ui.JagexColors;
|
|
||||||
|
|
||||||
@ConfigGroup("textrecolor")
|
@ConfigGroup("textrecolor")
|
||||||
public interface ChatColorConfig extends Config
|
public interface ChatColorConfig extends Config
|
||||||
@@ -111,15 +110,12 @@ public interface ChatColorConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 7,
|
position = 7,
|
||||||
keyName = "opaqueClanChatInfo",
|
keyName = "opaqueFriendsChatInfo",
|
||||||
name = "Friends chat info",
|
name = "Friends chat info",
|
||||||
description = "Friends Chat Information (eg. when joining a channel)",
|
description = "Friends Chat Information (eg. when joining a channel)",
|
||||||
section = opaqueSection
|
section = opaqueSection
|
||||||
)
|
)
|
||||||
default Color opaqueFriendsChatInfo()
|
Color opaqueFriendsChatInfo();
|
||||||
{
|
|
||||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 8,
|
position = 8,
|
||||||
@@ -387,15 +383,12 @@ public interface ChatColorConfig extends Config
|
|||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 57,
|
position = 57,
|
||||||
keyName = "transparentClanChatInfo",
|
keyName = "transparentFriendsChatInfo",
|
||||||
name = "Friends chat info (transparent)",
|
name = "Friends chat info (transparent)",
|
||||||
description = "Friends chat information (eg. when joining a channel) (transparent)",
|
description = "Friends chat information (eg. when joining a channel) (transparent)",
|
||||||
section = transparentSection
|
section = transparentSection
|
||||||
)
|
)
|
||||||
default Color transparentFriendsChatInfo()
|
Color transparentFriendsChatInfo();
|
||||||
{
|
|
||||||
return JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
position = 58,
|
position = 58,
|
||||||
|
|||||||
@@ -90,9 +90,9 @@ public class MenuManager
|
|||||||
managedMenuOptions.remove(customMenuOption.getWidgetId(), customMenuOption);
|
managedMenuOptions.remove(customMenuOption.getWidgetId(), customMenuOption);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean menuContainsCustomMenu(WidgetMenuOption customMenuOption)
|
private static boolean menuContainsCustomMenu(MenuEntry[] menuEntries, WidgetMenuOption customMenuOption)
|
||||||
{
|
{
|
||||||
for (MenuEntry menuEntry : client.getMenuEntries())
|
for (MenuEntry menuEntry : menuEntries)
|
||||||
{
|
{
|
||||||
String option = menuEntry.getOption();
|
String option = menuEntry.getOption();
|
||||||
String target = menuEntry.getTarget();
|
String target = menuEntry.getTarget();
|
||||||
@@ -115,23 +115,36 @@ public class MenuManager
|
|||||||
|
|
||||||
int widgetId = event.getActionParam1();
|
int widgetId = event.getActionParam1();
|
||||||
Collection<WidgetMenuOption> options = managedMenuOptions.get(widgetId);
|
Collection<WidgetMenuOption> options = managedMenuOptions.get(widgetId);
|
||||||
|
if (options.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MenuEntry[] menuEntries = client.getMenuEntries();
|
||||||
|
|
||||||
|
MenuEntry[] newMenuEntries = Arrays.copyOf(menuEntries, menuEntries.length + options.size());
|
||||||
|
// Menu entries are sorted with higher-index entries appearing toward the top of the minimenu, so insert older
|
||||||
|
// managed menu entries at higher indices and work backward for newer entries so newly-added entries appear at
|
||||||
|
// the bottom
|
||||||
|
int insertIdx = newMenuEntries.length - 1;
|
||||||
for (WidgetMenuOption currentMenu : options)
|
for (WidgetMenuOption currentMenu : options)
|
||||||
{
|
{
|
||||||
if (!menuContainsCustomMenu(currentMenu))//Don't add if we have already added it to this widget
|
// Exit if we've inserted the managed menu entries already
|
||||||
|
if (menuContainsCustomMenu(menuEntries, currentMenu))
|
||||||
{
|
{
|
||||||
MenuEntry[] menuEntries = client.getMenuEntries();
|
return;
|
||||||
menuEntries = Arrays.copyOf(menuEntries, menuEntries.length + 1);
|
}
|
||||||
|
|
||||||
MenuEntry menuEntry = menuEntries[menuEntries.length - 1] = new MenuEntry();
|
MenuEntry menuEntry = new MenuEntry();
|
||||||
menuEntry.setOption(currentMenu.getMenuOption());
|
menuEntry.setOption(currentMenu.getMenuOption());
|
||||||
menuEntry.setParam1(widgetId);
|
menuEntry.setParam1(widgetId);
|
||||||
menuEntry.setTarget(currentMenu.getMenuTarget());
|
menuEntry.setTarget(currentMenu.getMenuTarget());
|
||||||
menuEntry.setType(MenuAction.RUNELITE.getId());
|
menuEntry.setType(MenuAction.RUNELITE.getId());
|
||||||
|
|
||||||
client.setMenuEntries(menuEntries);
|
newMenuEntries[insertIdx--] = menuEntry;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.setMenuEntries(newMenuEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addPlayerMenuItem(String menuText)
|
public void addPlayerMenuItem(String menuText)
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public interface AgilityConfig extends Config
|
|||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "showClickboxes",
|
keyName = "showClickboxes",
|
||||||
name = "Show Clickboxes",
|
name = "Show Clickboxes",
|
||||||
description = "Show agility course obstacle clickboxes",
|
description = "Show agility course and other obstacle clickboxes",
|
||||||
position = 0
|
position = 0
|
||||||
)
|
)
|
||||||
default boolean showClickboxes()
|
default boolean showClickboxes()
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class AgilityOverlay extends Overlay
|
|||||||
{
|
{
|
||||||
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !config.highlightShortcuts() ||
|
if (Obstacles.SHORTCUT_OBSTACLE_IDS.containsKey(object.getId()) && !config.highlightShortcuts() ||
|
||||||
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !config.showTrapOverlay() ||
|
Obstacles.TRAP_OBSTACLE_IDS.contains(object.getId()) && !config.showTrapOverlay() ||
|
||||||
Obstacles.COURSE_OBSTACLE_IDS.contains(object.getId()) && !config.showClickboxes() ||
|
Obstacles.OBSTACLE_IDS.contains(object.getId()) && !config.showClickboxes() ||
|
||||||
Obstacles.SEPULCHRE_OBSTACLE_IDS.contains(object.getId()) && !config.highlightSepulchreObstacles() ||
|
Obstacles.SEPULCHRE_OBSTACLE_IDS.contains(object.getId()) && !config.highlightSepulchreObstacles() ||
|
||||||
Obstacles.SEPULCHRE_SKILL_OBSTACLE_IDS.contains(object.getId()) && !config.highlightSepulchreSkilling())
|
Obstacles.SEPULCHRE_SKILL_OBSTACLE_IDS.contains(object.getId()) && !config.highlightSepulchreSkilling())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ public class AgilityPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Obstacles.COURSE_OBSTACLE_IDS.contains(newObject.getId()) ||
|
if (Obstacles.OBSTACLE_IDS.contains(newObject.getId()) ||
|
||||||
Obstacles.PORTAL_OBSTACLE_IDS.contains(newObject.getId()) ||
|
Obstacles.PORTAL_OBSTACLE_IDS.contains(newObject.getId()) ||
|
||||||
(Obstacles.TRAP_OBSTACLE_IDS.contains(newObject.getId())
|
(Obstacles.TRAP_OBSTACLE_IDS.contains(newObject.getId())
|
||||||
&& Obstacles.TRAP_OBSTACLE_REGIONS.contains(newObject.getWorldLocation().getRegionID())) ||
|
&& Obstacles.TRAP_OBSTACLE_REGIONS.contains(newObject.getWorldLocation().getRegionID())) ||
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import net.runelite.client.game.AgilityShortcut;
|
|||||||
|
|
||||||
class Obstacles
|
class Obstacles
|
||||||
{
|
{
|
||||||
static final Set<Integer> COURSE_OBSTACLE_IDS = ImmutableSet.of(
|
static final Set<Integer> OBSTACLE_IDS = ImmutableSet.of(
|
||||||
// Gnome
|
// Gnome
|
||||||
OBSTACLE_NET_23134, TREE_BRANCH_23559, TREE_BRANCH_23560, OBSTACLE_NET_23135, OBSTACLE_PIPE_23138,
|
OBSTACLE_NET_23134, TREE_BRANCH_23559, TREE_BRANCH_23560, OBSTACLE_NET_23135, OBSTACLE_PIPE_23138,
|
||||||
OBSTACLE_PIPE_23139, LOG_BALANCE_23145, BALANCING_ROPE_23557,
|
OBSTACLE_PIPE_23139, LOG_BALANCE_23145, BALANCING_ROPE_23557,
|
||||||
@@ -95,7 +95,10 @@ class Obstacles
|
|||||||
ZIP_LINE_11645, ZIP_LINE_11646,
|
ZIP_LINE_11645, ZIP_LINE_11646,
|
||||||
// Prifddinas
|
// Prifddinas
|
||||||
LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, LADDER_36232,
|
LADDER_36221, TIGHTROPE_36225, CHIMNEY_36227, ROOF_EDGE, DARK_HOLE_36229, LADDER_36231, LADDER_36232,
|
||||||
ROPE_BRIDGE_36233, TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238
|
ROPE_BRIDGE_36233, TIGHTROPE_36234, ROPE_BRIDGE_36235, TIGHTROPE_36236, TIGHTROPE_36237, DARK_HOLE_36238,
|
||||||
|
// Rellekka Lighthouse
|
||||||
|
BASALT_ROCK, BASALT_ROCK_4553, BASALT_ROCK_4554, BASALT_ROCK_4556, BASALT_ROCK_4558, ROCKY_SHORE,
|
||||||
|
BASALT_ROCK_4557, BASALT_ROCK_4555, BASALT_ROCK_4552, BEACH
|
||||||
);
|
);
|
||||||
|
|
||||||
static final Set<Integer> PORTAL_OBSTACLE_IDS = ImmutableSet.of(
|
static final Set<Integer> PORTAL_OBSTACLE_IDS = ImmutableSet.of(
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ public class ChatCommandsPlugin extends Plugin
|
|||||||
private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>[0-9:.]+</col> Personal best: </col><col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col>");
|
private static final Pattern RAIDS_DURATION_PATTERN = Pattern.compile("<col=ef20ff>Congratulations - your raid is complete!</col><br>Team size: <col=ff0000>" + COX_TEAM_SIZES + "</col> Duration:</col> <col=ff0000>[0-9:.]+</col> Personal best: </col><col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col>");
|
||||||
private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(Personal best!\\)");
|
private static final Pattern TOB_WAVE_PB_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>(?<pb>[0-9:]+(?:\\.[0-9]+)?)</col> \\(Personal best!\\)");
|
||||||
private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>[0-9:.]+</col><br></col>Personal best: (?<pb>[0-9:]+(?:\\.[0-9]+)?)");
|
private static final Pattern TOB_WAVE_DURATION_PATTERN = Pattern.compile("^.*Theatre of Blood wave completion time: <col=ff0000>[0-9:.]+</col><br></col>Personal best: (?<pb>[0-9:]+(?:\\.[0-9]+)?)");
|
||||||
private static final Pattern KILL_DURATION_PATTERN = Pattern.compile("(?i)^(?:Fight |Lap |Challenge |Corrupted challenge )?duration: <col=ff0000>[0-9:.]+</col>\\. Personal best: (?:<col=ff0000>)?(?<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: <col=ff0000>(?<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_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 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 (.+)");
|
private static final Pattern ADVENTURE_LOG_TITLE_PATTERN = Pattern.compile("The Exploits of (.+)");
|
||||||
|
|||||||
@@ -217,6 +217,10 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
|
|
||||||
private final TextComponent textComponent = new TextComponent();
|
private final TextComponent textComponent = new TextComponent();
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
private EmoteClue activeSTASHClue;
|
||||||
|
private EmoteClue clickedSTASHClue;
|
||||||
|
|
||||||
@Provides
|
@Provides
|
||||||
ClueScrollConfig getConfig(ConfigManager configManager)
|
ClueScrollConfig getConfig(ConfigManager configManager)
|
||||||
{
|
{
|
||||||
@@ -264,9 +268,11 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String message = event.getMessage();
|
||||||
|
|
||||||
if (clue instanceof HotColdClue)
|
if (clue instanceof HotColdClue)
|
||||||
{
|
{
|
||||||
if (((HotColdClue) clue).update(event.getMessage(), this))
|
if (((HotColdClue) clue).update(message, this))
|
||||||
{
|
{
|
||||||
worldMapPointsSet = false;
|
worldMapPointsSet = false;
|
||||||
}
|
}
|
||||||
@@ -274,7 +280,7 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
|
|
||||||
if (clue instanceof SkillChallengeClue)
|
if (clue instanceof SkillChallengeClue)
|
||||||
{
|
{
|
||||||
String text = Text.removeTags(event.getMessage());
|
String text = Text.removeTags(message);
|
||||||
if (text.equals("Skill challenge completed.") ||
|
if (text.equals("Skill challenge completed.") ||
|
||||||
text.equals("You have completed your master level challenge!") ||
|
text.equals("You have completed your master level challenge!") ||
|
||||||
text.startsWith("You have completed Charlie's task,") ||
|
text.startsWith("You have completed Charlie's task,") ||
|
||||||
@@ -283,6 +289,19 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
((SkillChallengeClue) clue).setChallengeCompleted(true);
|
((SkillChallengeClue) clue).setChallengeCompleted(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.endsWith(" the STASH unit."))
|
||||||
|
{
|
||||||
|
if (clue instanceof EmoteClue && clickedSTASHClue != null && message.equals("You withdraw your items from the STASH unit."))
|
||||||
|
{
|
||||||
|
activeSTASHClue = clickedSTASHClue;
|
||||||
|
}
|
||||||
|
else if (message.equals("You deposit your items into the STASH unit."))
|
||||||
|
{
|
||||||
|
activeSTASHClue = null;
|
||||||
|
}
|
||||||
|
clickedSTASHClue = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
@@ -300,7 +319,11 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onMenuOptionClicked(final MenuOptionClicked event)
|
public void onMenuOptionClicked(final MenuOptionClicked event)
|
||||||
{
|
{
|
||||||
if (event.getMenuOption() != null && event.getMenuOption().equals("Read"))
|
if (event.getMenuOption() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.getMenuOption().equals("Read"))
|
||||||
{
|
{
|
||||||
final ItemComposition itemComposition = itemManager.getItemComposition(event.getId());
|
final ItemComposition itemComposition = itemManager.getItemComposition(event.getId());
|
||||||
|
|
||||||
@@ -310,6 +333,14 @@ public class ClueScrollPlugin extends Plugin
|
|||||||
updateClue(MapClue.forItemId(clueItemId));
|
updateClue(MapClue.forItemId(clueItemId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (event.getMenuOption().equals("Search") && clue instanceof EmoteClue)
|
||||||
|
{
|
||||||
|
EmoteClue emoteClue = (EmoteClue) clue;
|
||||||
|
if (emoteClue.getStashUnit() != null && emoteClue.getStashUnit().getObjectId() == event.getId())
|
||||||
|
{
|
||||||
|
clickedSTASHClue = emoteClue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.awt.Dimension;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
|
import net.runelite.client.plugins.cluescrolls.clues.ClueScroll;
|
||||||
|
import net.runelite.client.plugins.cluescrolls.clues.EmoteClue;
|
||||||
import net.runelite.client.ui.overlay.Overlay;
|
import net.runelite.client.ui.overlay.Overlay;
|
||||||
import net.runelite.client.ui.overlay.OverlayLayer;
|
import net.runelite.client.ui.overlay.OverlayLayer;
|
||||||
import net.runelite.client.ui.overlay.OverlayPosition;
|
import net.runelite.client.ui.overlay.OverlayPosition;
|
||||||
@@ -61,6 +62,12 @@ public class ClueScrollWorldOverlay extends Overlay
|
|||||||
clue.makeWorldOverlayHint(graphics, plugin);
|
clue.makeWorldOverlayHint(graphics, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmoteClue activeSTASHClue = plugin.getActiveSTASHClue();
|
||||||
|
if (activeSTASHClue != null && activeSTASHClue != clue)
|
||||||
|
{
|
||||||
|
activeSTASHClue.makeSTASHOverlay(graphics, plugin);
|
||||||
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class CrypticClue extends ClueScroll implements TextClueScroll, NpcClueSc
|
|||||||
new CrypticClue("Stop crying! Talk to the head.", "Head mourner", new WorldPoint(2042, 4630, 0), "Talk to the Head mourner in the mourner headquarters in West Ardougne."),
|
new CrypticClue("Stop crying! Talk to the head.", "Head mourner", new WorldPoint(2042, 4630, 0), "Talk to the Head mourner in the mourner headquarters in West Ardougne."),
|
||||||
new CrypticClue("Search the crate near a cart in Port Khazard.", CRATE_366, new WorldPoint(2660, 3149, 0), "Search by the southern Khazard General Store in Port Khazard."),
|
new CrypticClue("Search the crate near a cart in Port Khazard.", CRATE_366, new WorldPoint(2660, 3149, 0), "Search by the southern Khazard General Store in Port Khazard."),
|
||||||
new CrypticClue("Speak to the bartender of the Blue Moon Inn in Varrock.", "Bartender", new WorldPoint(3226, 3399, 0), "Talk to the bartender in Blue Moon Inn in Varrock."),
|
new CrypticClue("Speak to the bartender of the Blue Moon Inn in Varrock.", "Bartender", new WorldPoint(3226, 3399, 0), "Talk to the bartender in Blue Moon Inn in Varrock."),
|
||||||
new CrypticClue("This aviator is at the peak of his profession.", "Captain Bleemadge", new WorldPoint(2846, 1749, 0), "Captain Bleemadge, the gnome glider pilot, is found at the top of White Wolf Mountain."),
|
new CrypticClue("This aviator is at the peak of his profession.", "Captain Bleemadge", new WorldPoint(2847, 3499, 0), "Captain Bleemadge, the gnome glider pilot, is found at the top of White Wolf Mountain."),
|
||||||
new CrypticClue("Search the crates in the shed just north of East Ardougne.", CRATE_355, new WorldPoint(2617, 3347, 0), "The crates in the shed north of the northern Ardougne bank."),
|
new CrypticClue("Search the crates in the shed just north of East Ardougne.", CRATE_355, new WorldPoint(2617, 3347, 0), "The crates in the shed north of the northern Ardougne bank."),
|
||||||
new CrypticClue("I wouldn't wear this jean on my legs.", "Father Jean", new WorldPoint(1734, 3576, 0), "Talk to father Jean in the Hosidius church."),
|
new CrypticClue("I wouldn't wear this jean on my legs.", "Father Jean", new WorldPoint(1734, 3576, 0), "Talk to father Jean in the Hosidius church."),
|
||||||
new CrypticClue("Search the crate in the Toad and Chicken pub.", CRATE_354, new WorldPoint(2913, 3536, 0), "The Toad and Chicken pub is located in Burthorpe."),
|
new CrypticClue("Search the crate in the Toad and Chicken pub.", CRATE_354, new WorldPoint(2913, 3536, 0), "The Toad and Chicken pub is located in Burthorpe."),
|
||||||
|
|||||||
@@ -311,6 +311,11 @@ public class EmoteClue extends ClueScroll implements TextClueScroll, LocationClu
|
|||||||
OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localPoint, plugin.getEmoteImage(), Color.ORANGE);
|
OverlayUtil.renderTileOverlay(plugin.getClient(), graphics, localPoint, plugin.getEmoteImage(), Color.ORANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
makeSTASHOverlay(graphics, plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void makeSTASHOverlay(Graphics2D graphics, ClueScrollPlugin plugin)
|
||||||
|
{
|
||||||
if (stashUnit != null)
|
if (stashUnit != null)
|
||||||
{
|
{
|
||||||
final WorldPoint[] worldPoints = stashUnit.getWorldPoints();
|
final WorldPoint[] worldPoints = stashUnit.getWorldPoints();
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
|
|||||||
item(ItemID.INFERNAL_PICKAXE_UNCHARGED_25369),
|
item(ItemID.INFERNAL_PICKAXE_UNCHARGED_25369),
|
||||||
item(ItemID.GILDED_PICKAXE),
|
item(ItemID.GILDED_PICKAXE),
|
||||||
item(ItemID._3RD_AGE_PICKAXE),
|
item(ItemID._3RD_AGE_PICKAXE),
|
||||||
item(ItemID.CRYSTAL_PICKAXE)
|
item(ItemID.CRYSTAL_PICKAXE),
|
||||||
|
item(ItemID.CRYSTAL_PICKAXE_INACTIVE)
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final AnyRequirementCollection ANY_AXE = any("Any Axe",
|
private static final AnyRequirementCollection ANY_AXE = any("Any Axe",
|
||||||
@@ -106,7 +107,8 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
|
|||||||
item(ItemID.INFERNAL_AXE_UNCHARGED_25371),
|
item(ItemID.INFERNAL_AXE_UNCHARGED_25371),
|
||||||
item(ItemID.GILDED_AXE),
|
item(ItemID.GILDED_AXE),
|
||||||
item(ItemID._3RD_AGE_AXE),
|
item(ItemID._3RD_AGE_AXE),
|
||||||
item(ItemID.CRYSTAL_AXE)
|
item(ItemID.CRYSTAL_AXE),
|
||||||
|
item(ItemID.CRYSTAL_AXE_INACTIVE)
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final AnyRequirementCollection ANY_HARPOON = any("Harpoon",
|
private static final AnyRequirementCollection ANY_HARPOON = any("Harpoon",
|
||||||
@@ -118,7 +120,8 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
|
|||||||
item(ItemID.INFERNAL_HARPOON_OR),
|
item(ItemID.INFERNAL_HARPOON_OR),
|
||||||
item(ItemID.INFERNAL_HARPOON_UNCHARGED),
|
item(ItemID.INFERNAL_HARPOON_UNCHARGED),
|
||||||
item(ItemID.INFERNAL_HARPOON_UNCHARGED_25367),
|
item(ItemID.INFERNAL_HARPOON_UNCHARGED_25367),
|
||||||
item(ItemID.CRYSTAL_HARPOON)
|
item(ItemID.CRYSTAL_HARPOON),
|
||||||
|
item(ItemID.CRYSTAL_HARPOON_INACTIVE)
|
||||||
);
|
);
|
||||||
|
|
||||||
private static final Set<SkillChallengeClue> CLUES = ImmutableSet.of(
|
private static final Set<SkillChallengeClue> CLUES = ImmutableSet.of(
|
||||||
@@ -202,7 +205,10 @@ public class SkillChallengeClue extends ClueScroll implements NpcClueScroll, Nam
|
|||||||
new SkillChallengeClue("Chop a redwood log.", "chop a redwood log whilst sporting the finest lumberjack gear.", true, ANY_AXE, all("Lumberjack outfit", item(ItemID.LUMBERJACK_HAT), item(ItemID.LUMBERJACK_TOP), item(ItemID.LUMBERJACK_LEGS), item(ItemID.LUMBERJACK_BOOTS))),
|
new SkillChallengeClue("Chop a redwood log.", "chop a redwood log whilst sporting the finest lumberjack gear.", true, ANY_AXE, all("Lumberjack outfit", item(ItemID.LUMBERJACK_HAT), item(ItemID.LUMBERJACK_TOP), item(ItemID.LUMBERJACK_LEGS), item(ItemID.LUMBERJACK_BOOTS))),
|
||||||
new SkillChallengeClue("Craft a light orb in the Dorgesh-Kaan bank.", item(ItemID.CAVE_GOBLIN_WIRE), item(ItemID.EMPTY_LIGHT_ORB)),
|
new SkillChallengeClue("Craft a light orb in the Dorgesh-Kaan bank.", item(ItemID.CAVE_GOBLIN_WIRE), item(ItemID.EMPTY_LIGHT_ORB)),
|
||||||
new SkillChallengeClue("Kill a reanimated Abyssal Demon.", "kill a reanimated abyssal.", xOfItem(ItemID.SOUL_RUNE, 4), xOfItem(ItemID.BLOOD_RUNE, 2), any("Nature Rune x4", xOfItem(ItemID.NATURE_RUNE, 4), item(ItemID.BRYOPHYTAS_STAFF)), range("Ensouled abyssal head", ItemID.ENSOULED_ABYSSAL_HEAD, ItemID.ENSOULED_ABYSSAL_HEAD_13508)),
|
new SkillChallengeClue("Kill a reanimated Abyssal Demon.", "kill a reanimated abyssal.", xOfItem(ItemID.SOUL_RUNE, 4), xOfItem(ItemID.BLOOD_RUNE, 2), any("Nature Rune x4", xOfItem(ItemID.NATURE_RUNE, 4), item(ItemID.BRYOPHYTAS_STAFF)), range("Ensouled abyssal head", ItemID.ENSOULED_ABYSSAL_HEAD, ItemID.ENSOULED_ABYSSAL_HEAD_13508)),
|
||||||
new SkillChallengeClue("Kill a Fiyr shade inside Mort'tons shade catacombs.", any("Any Silver Shade Key", item(ItemID.SILVER_KEY_RED), item(ItemID.SILVER_KEY_BROWN), item(ItemID.SILVER_KEY_CRIMSON), item(ItemID.SILVER_KEY_BLACK), item(ItemID.SILVER_KEY_PURPLE)))
|
new SkillChallengeClue("Kill a Fiyr shade inside Mort'tons shade catacombs.",
|
||||||
|
any("Any Gold or Silver Shade Key",
|
||||||
|
item(ItemID.GOLD_KEY_RED), item(ItemID.GOLD_KEY_BROWN), item(ItemID.GOLD_KEY_CRIMSON), item(ItemID.GOLD_KEY_BLACK), item(ItemID.GOLD_KEY_PURPLE),
|
||||||
|
item(ItemID.SILVER_KEY_RED), item(ItemID.SILVER_KEY_BROWN), item(ItemID.SILVER_KEY_CRIMSON), item(ItemID.SILVER_KEY_BLACK), item(ItemID.SILVER_KEY_PURPLE)))
|
||||||
);
|
);
|
||||||
|
|
||||||
private final ChallengeType type;
|
private final ChallengeType type;
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public enum HotColdLocation
|
|||||||
KANDARIN_SINCLAR_MANSION(new WorldPoint(2730, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut.", BRASSICAN_MAGE),
|
KANDARIN_SINCLAR_MANSION(new WorldPoint(2730, 3588, 0), KANDARIN, "North-west of the Sinclair Mansion, near the log balance shortcut.", BRASSICAN_MAGE),
|
||||||
KANDARIN_CATHERBY(new WorldPoint(2774, 3436, 0), KANDARIN, "Catherby, between the bank and the beehives, near small rock formation.", BRASSICAN_MAGE),
|
KANDARIN_CATHERBY(new WorldPoint(2774, 3436, 0), KANDARIN, "Catherby, between the bank and the beehives, near small rock formation.", BRASSICAN_MAGE),
|
||||||
KANDARIN_GRAND_TREE(new WorldPoint(2448, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure.", BRASSICAN_MAGE),
|
KANDARIN_GRAND_TREE(new WorldPoint(2448, 3503, 0), KANDARIN, "Grand Tree, just east of the terrorchick gnome enclosure.", BRASSICAN_MAGE),
|
||||||
KANDARIN_SEERS(new WorldPoint(2735, 3486, 0), KANDARIN, "Between the Seers' Village bank and Camelot.", BRASSICAN_MAGE),
|
KANDARIN_SEERS(new WorldPoint(2732, 3485, 0), KANDARIN, "Outside Seers' Village bank.", BRASSICAN_MAGE),
|
||||||
KANDARIN_MCGRUBORS_WOOD(new WorldPoint(2653, 3485, 0), KANDARIN, "McGrubor's Wood", BRASSICAN_MAGE),
|
KANDARIN_MCGRUBORS_WOOD(new WorldPoint(2653, 3485, 0), KANDARIN, "McGrubor's Wood", BRASSICAN_MAGE),
|
||||||
KANDARIN_FISHING_BUILD(new WorldPoint(2590, 3369, 0), KANDARIN, "South of Fishing Guild", BRASSICAN_MAGE),
|
KANDARIN_FISHING_BUILD(new WorldPoint(2590, 3369, 0), KANDARIN, "South of Fishing Guild", BRASSICAN_MAGE),
|
||||||
KANDARIN_WITCHHAVEN(new WorldPoint(2707, 3306, 0), KANDARIN, "Outside Witchaven, west of Jeb, Holgart, and Caroline.", BRASSICAN_MAGE),
|
KANDARIN_WITCHHAVEN(new WorldPoint(2707, 3306, 0), KANDARIN, "Outside Witchaven, west of Jeb, Holgart, and Caroline.", BRASSICAN_MAGE),
|
||||||
|
|||||||
@@ -68,8 +68,8 @@ import okhttp3.OkHttpClient;
|
|||||||
*/
|
*/
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
name = "Examine",
|
name = "Examine",
|
||||||
description = "Send examine information to the API",
|
description = "Shows additional examine information (eg. GE Average, HA Value)",
|
||||||
tags = {"npcs", "items", "inventory", "objects"}
|
tags = {"npcs", "items", "inventory", "objects", "prices", "high alchemy"}
|
||||||
)
|
)
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExaminePlugin extends Plugin
|
public class ExaminePlugin extends Plugin
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.friendschat;
|
package net.runelite.client.plugins.friendschat;
|
||||||
|
|
||||||
|
import com.google.common.base.MoreObjects;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.util.concurrent.Runnables;
|
import com.google.common.util.concurrent.Runnables;
|
||||||
@@ -71,6 +72,7 @@ import net.runelite.api.widgets.WidgetInfo;
|
|||||||
import net.runelite.api.widgets.WidgetType;
|
import net.runelite.api.widgets.WidgetType;
|
||||||
import net.runelite.client.callback.ClientThread;
|
import net.runelite.client.callback.ClientThread;
|
||||||
import net.runelite.client.chat.ChatMessageBuilder;
|
import net.runelite.client.chat.ChatMessageBuilder;
|
||||||
|
import net.runelite.client.config.ChatColorConfig;
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.eventbus.Subscribe;
|
import net.runelite.client.eventbus.Subscribe;
|
||||||
import net.runelite.client.events.ConfigChanged;
|
import net.runelite.client.events.ConfigChanged;
|
||||||
@@ -119,6 +121,9 @@ public class FriendsChatPlugin extends Plugin
|
|||||||
@Inject
|
@Inject
|
||||||
private ChatboxPanelManager chatboxPanelManager;
|
private ChatboxPanelManager chatboxPanelManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ChatColorConfig chatColorConfig;
|
||||||
|
|
||||||
private List<String> chats = new ArrayList<>();
|
private List<String> chats = new ArrayList<>();
|
||||||
private final List<Player> members = new ArrayList<>();
|
private final List<Player> members = new ArrayList<>();
|
||||||
private MembersIndicator membersIndicator;
|
private MembersIndicator membersIndicator;
|
||||||
@@ -388,14 +393,19 @@ public class FriendsChatPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
final String activityMessage = activityType == ActivityType.JOINED ? " has joined." : " has left.";
|
final String activityMessage = activityType == ActivityType.JOINED ? " has joined." : " has left.";
|
||||||
final FriendsChatRank rank = member.getRank();
|
final FriendsChatRank rank = member.getRank();
|
||||||
Color textColor = CHAT_FC_TEXT_OPAQUE_BACKGROUND;
|
final Color textColor, channelColor;
|
||||||
Color channelColor = CHAT_FC_NAME_OPAQUE_BACKGROUND;
|
|
||||||
int rankIcon = -1;
|
int rankIcon = -1;
|
||||||
|
|
||||||
|
// Use configured friends chat info colors if set, otherwise default to the jagex text and fc name colors
|
||||||
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
|
if (client.isResized() && client.getVar(Varbits.TRANSPARENT_CHATBOX) == 1)
|
||||||
{
|
{
|
||||||
textColor = CHAT_FC_TEXT_TRANSPARENT_BACKGROUND;
|
textColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatInfo(), CHAT_FC_TEXT_TRANSPARENT_BACKGROUND);
|
||||||
channelColor = CHAT_FC_NAME_TRANSPARENT_BACKGROUND;
|
channelColor = MoreObjects.firstNonNull(chatColorConfig.transparentFriendsChatChannelName(), CHAT_FC_NAME_TRANSPARENT_BACKGROUND);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
textColor = MoreObjects.firstNonNull(chatColorConfig.opaqueFriendsChatInfo(), CHAT_FC_TEXT_OPAQUE_BACKGROUND);
|
||||||
|
channelColor = MoreObjects.firstNonNull(chatColorConfig.opaqueFriendsChatChannelName(), CHAT_FC_NAME_OPAQUE_BACKGROUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.chatIcons() && rank != null && rank != FriendsChatRank.UNRANKED)
|
if (config.chatIcons() && rank != null && rank != FriendsChatRank.UNRANKED)
|
||||||
|
|||||||
@@ -1078,8 +1078,14 @@ public class GpuPlugin extends Plugin implements DrawCallbacks
|
|||||||
{
|
{
|
||||||
shutdownAAFbo();
|
shutdownAAFbo();
|
||||||
|
|
||||||
|
// Bind default FBO to check whether anti-aliasing is forced
|
||||||
|
gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0);
|
||||||
|
final int forcedAASamples = glGetInteger(gl, gl.GL_SAMPLES);
|
||||||
final int maxSamples = glGetInteger(gl, gl.GL_MAX_SAMPLES);
|
final int maxSamples = glGetInteger(gl, gl.GL_MAX_SAMPLES);
|
||||||
final int samples = Math.min(antiAliasingMode.getSamples(), maxSamples);
|
final int samples = forcedAASamples != 0 ? forcedAASamples :
|
||||||
|
Math.min(antiAliasingMode.getSamples(), maxSamples);
|
||||||
|
|
||||||
|
log.debug("AA samples: {}, max samples: {}, forced samples: {}", samples, maxSamples, forcedAASamples);
|
||||||
|
|
||||||
initAAFbo(stretchedCanvasWidth, stretchedCanvasHeight, samples);
|
initAAFbo(stretchedCanvasWidth, stretchedCanvasHeight, samples);
|
||||||
|
|
||||||
|
|||||||
@@ -186,10 +186,10 @@ public class InfoPanel extends PluginPanel
|
|||||||
actionsContainer.setBorder(new EmptyBorder(10, 0, 0, 0));
|
actionsContainer.setBorder(new EmptyBorder(10, 0, 0, 0));
|
||||||
actionsContainer.setLayout(new GridLayout(0, 1, 0, 10));
|
actionsContainer.setLayout(new GridLayout(0, 1, 0, 10));
|
||||||
|
|
||||||
syncPanel = buildLinkPanel(IMPORT_ICON, "Import local settings", "to remote RuneLite account", () ->
|
syncPanel = buildLinkPanel(IMPORT_ICON, "Import signed-out", "settings", () ->
|
||||||
{
|
{
|
||||||
final int result = JOptionPane.showOptionDialog(syncPanel,
|
final int result = JOptionPane.showOptionDialog(syncPanel,
|
||||||
"This will replace your current RuneLite account settings with settings from your local profile.",
|
"<html>This will overwrite your settings with settings from your local profile, which<br/>is the profile used when not logged into RuneLite with a RuneLite account.</html>",
|
||||||
"Are you sure?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,
|
"Are you sure?", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE,
|
||||||
null, new String[]{"Yes", "No"}, "No");
|
null, new String[]{"Yes", "No"}, "No");
|
||||||
|
|
||||||
|
|||||||
@@ -661,4 +661,15 @@ public interface MenuEntrySwapperConfig extends Config
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ConfigItem(
|
||||||
|
keyName = "swapTemporossLeave",
|
||||||
|
name = "Tempoross Leave",
|
||||||
|
description = "Swap Talk-to with Leave after subduing Tempoross",
|
||||||
|
section = npcSection
|
||||||
|
)
|
||||||
|
default boolean swapTemporossLeave()
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,6 +132,13 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
"brimstail"
|
"brimstail"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
private static final Set<String> TEMPOROSS_NPCS = ImmutableSet.of(
|
||||||
|
"captain dudi",
|
||||||
|
"captain pudi",
|
||||||
|
"first mate deri",
|
||||||
|
"first mate peri"
|
||||||
|
);
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private Client client;
|
private Client client;
|
||||||
|
|
||||||
@@ -223,6 +230,7 @@ public class MenuEntrySwapperPlugin extends Plugin
|
|||||||
swap("talk-to", ESSENCE_MINE_NPCS::contains, "teleport", config::swapEssenceMineTeleport);
|
swap("talk-to", ESSENCE_MINE_NPCS::contains, "teleport", config::swapEssenceMineTeleport);
|
||||||
swap("talk-to", "collect", config::swapCollectMiscellania);
|
swap("talk-to", "collect", config::swapCollectMiscellania);
|
||||||
swap("talk-to", "deposit-items", config::swapDepositItems);
|
swap("talk-to", "deposit-items", config::swapDepositItems);
|
||||||
|
swap("talk-to", TEMPOROSS_NPCS::contains, "leave", config::swapTemporossLeave);
|
||||||
|
|
||||||
swap("leave tomb", "quick-leave", config::swapQuickLeave);
|
swap("leave tomb", "quick-leave", config::swapQuickLeave);
|
||||||
swap("tomb door", "quick-leave", config::swapQuickLeave);
|
swap("tomb door", "quick-leave", config::swapQuickLeave);
|
||||||
|
|||||||
@@ -82,15 +82,17 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
private final ClientConfigLoader clientConfigLoader;
|
private final ClientConfigLoader clientConfigLoader;
|
||||||
private ClientUpdateCheckMode updateCheckMode;
|
private ClientUpdateCheckMode updateCheckMode;
|
||||||
private final WorldSupplier worldSupplier;
|
private final WorldSupplier worldSupplier;
|
||||||
|
private final String javConfigUrl;
|
||||||
|
|
||||||
private Object client;
|
private Object client;
|
||||||
|
|
||||||
public ClientLoader(OkHttpClient okHttpClient, ClientUpdateCheckMode updateCheckMode)
|
public ClientLoader(OkHttpClient okHttpClient, ClientUpdateCheckMode updateCheckMode, String javConfigUrl)
|
||||||
{
|
{
|
||||||
this.okHttpClient = okHttpClient;
|
this.okHttpClient = okHttpClient;
|
||||||
this.clientConfigLoader = new ClientConfigLoader(okHttpClient);
|
this.clientConfigLoader = new ClientConfigLoader(okHttpClient);
|
||||||
this.updateCheckMode = updateCheckMode;
|
this.updateCheckMode = updateCheckMode;
|
||||||
this.worldSupplier = new WorldSupplier(okHttpClient);
|
this.worldSupplier = new WorldSupplier(okHttpClient);
|
||||||
|
this.javConfigUrl = javConfigUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -162,7 +164,7 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
|
|
||||||
private RSConfig downloadConfig() throws IOException
|
private RSConfig downloadConfig() throws IOException
|
||||||
{
|
{
|
||||||
HttpUrl url = HttpUrl.parse(RuneLiteProperties.getJavConfig());
|
HttpUrl url = HttpUrl.parse(javConfigUrl);
|
||||||
IOException err = null;
|
IOException err = null;
|
||||||
for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++)
|
for (int attempt = 0; attempt < NUM_ATTEMPTS; attempt++)
|
||||||
{
|
{
|
||||||
@@ -180,6 +182,12 @@ public class ClientLoader implements Supplier<Applet>
|
|||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
log.info("Failed to get jav_config from host \"{}\" ({})", url.host(), e.getMessage());
|
log.info("Failed to get jav_config from host \"{}\" ({})", url.host(), e.getMessage());
|
||||||
|
|
||||||
|
if (!javConfigUrl.equals(RuneLiteProperties.getJavConfig()))
|
||||||
|
{
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
String host = worldSupplier.get().getAddress();
|
String host = worldSupplier.get().getAddress();
|
||||||
url = url.newBuilder().host(host).build();
|
url = url.newBuilder().host(host).build();
|
||||||
err = e;
|
err = e;
|
||||||
|
|||||||
@@ -210,6 +210,12 @@
|
|||||||
"name": "Willow Longbow",
|
"name": "Willow Longbow",
|
||||||
"xp": 41.5
|
"xp": 41.5
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"level": 40,
|
||||||
|
"icon": 1391,
|
||||||
|
"name": "Battlestaff",
|
||||||
|
"xp": 80
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"level": 41,
|
"level": 41,
|
||||||
"icon": 880,
|
"icon": 880,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ runelite.title=OpenOSRS
|
|||||||
runelite.version=@project.version@
|
runelite.version=@project.version@
|
||||||
runescape.version=@rs.version@
|
runescape.version=@rs.version@
|
||||||
runelite.discord.appid=627741263881568257
|
runelite.discord.appid=627741263881568257
|
||||||
runelite.discord.invite=https://discord.gg/openosrs
|
runelite.discord.invite=https://discord.gg/r287wN6bkc
|
||||||
runelite.github.link=https://github.com/open-osrs
|
runelite.github.link=https://github.com/open-osrs
|
||||||
runelite.wiki.link=https://github.com/open-osrs/runelite/wiki
|
runelite.wiki.link=https://github.com/open-osrs/runelite/wiki
|
||||||
runelite.patreon.link=https://www.patreon.com/openosrs
|
runelite.patreon.link=https://www.patreon.com/openosrs
|
||||||
|
|||||||
@@ -145,4 +145,41 @@ public class ChatMessageManagerTest
|
|||||||
|
|
||||||
verify(messageNode).setName("<col=b20000>" + friendName + "</col>");
|
verify(messageNode).setName("<col=b20000>" + friendName + "</col>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDefaultFriendsChatInfoColors()
|
||||||
|
{
|
||||||
|
// no color is configured for opaqueFriendsChatInfo
|
||||||
|
when(chatColorConfig.opaqueFriendsChatInfoHighlight()).thenReturn(Color.RED);
|
||||||
|
|
||||||
|
// rebuild color cache
|
||||||
|
ConfigChanged configChanged = new ConfigChanged();
|
||||||
|
configChanged.setGroup("textrecolor");
|
||||||
|
chatMessageManager.onConfigChanged(configChanged);
|
||||||
|
|
||||||
|
String chatMessage = new ChatMessageBuilder()
|
||||||
|
.append(ChatColorType.NORMAL)
|
||||||
|
.append("Total points: ")
|
||||||
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
|
.append("42")
|
||||||
|
.append(ChatColorType.NORMAL)
|
||||||
|
.append(", Personal points: ")
|
||||||
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
|
.append("43")
|
||||||
|
.append(ChatColorType.NORMAL)
|
||||||
|
.append(" (")
|
||||||
|
.append(ChatColorType.HIGHLIGHT)
|
||||||
|
.append("44")
|
||||||
|
.append(ChatColorType.NORMAL)
|
||||||
|
.append("%)")
|
||||||
|
.build();
|
||||||
|
|
||||||
|
MessageNode messageNode = mock(MessageNode.class);
|
||||||
|
when(messageNode.getType()).thenReturn(ChatMessageType.FRIENDSCHATNOTIFICATION);
|
||||||
|
when(messageNode.getRuneLiteFormatMessage()).thenReturn(chatMessage);
|
||||||
|
|
||||||
|
chatMessageManager.update(messageNode);
|
||||||
|
|
||||||
|
verify(messageNode).setValue("<col=000000>Total points: <col=ff0000>42<col=000000>, Personal points: <col=ff0000>43<col=000000> (<col=ff0000>44<col=000000>%)");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2021, Jordan Atwood <nightfirecat@protonmail.com>
|
||||||
|
* 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.menus;
|
||||||
|
|
||||||
|
import com.google.inject.Guice;
|
||||||
|
import com.google.inject.testing.fieldbinder.Bind;
|
||||||
|
import com.google.inject.testing.fieldbinder.BoundFieldModule;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import net.runelite.api.Client;
|
||||||
|
import net.runelite.api.MenuAction;
|
||||||
|
import static net.runelite.api.MenuAction.CC_OP;
|
||||||
|
import static net.runelite.api.MenuAction.RUNELITE;
|
||||||
|
import net.runelite.api.MenuEntry;
|
||||||
|
import net.runelite.api.events.MenuEntryAdded;
|
||||||
|
import static net.runelite.api.widgets.WidgetInfo.WORLD_MAP_OPTION;
|
||||||
|
import net.runelite.client.util.Text;
|
||||||
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.BeforeClass;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.mockito.ArgumentCaptor;
|
||||||
|
import org.mockito.ArgumentMatchers;
|
||||||
|
import org.mockito.Mock;
|
||||||
|
import static org.mockito.Mockito.atLeastOnce;
|
||||||
|
import static org.mockito.Mockito.doAnswer;
|
||||||
|
import static org.mockito.Mockito.verify;
|
||||||
|
import static org.mockito.Mockito.when;
|
||||||
|
import org.mockito.junit.MockitoJUnitRunner;
|
||||||
|
import org.mockito.stubbing.Answer;
|
||||||
|
|
||||||
|
@RunWith(MockitoJUnitRunner.class)
|
||||||
|
public class MenuManagerTest
|
||||||
|
{
|
||||||
|
private static final MenuEntry CANCEL = new MenuEntry();
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private MenuManager menuManager;
|
||||||
|
|
||||||
|
@Mock
|
||||||
|
@Bind
|
||||||
|
private Client client;
|
||||||
|
|
||||||
|
private MenuEntry[] clientMenuEntries = {CANCEL};
|
||||||
|
|
||||||
|
@BeforeClass
|
||||||
|
public static void beforeClass()
|
||||||
|
{
|
||||||
|
CANCEL.setOption("Cancel");
|
||||||
|
CANCEL.setType(MenuAction.CANCEL.getId());
|
||||||
|
CANCEL.setParam1(WORLD_MAP_OPTION.getPackedId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void before()
|
||||||
|
{
|
||||||
|
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
|
||||||
|
|
||||||
|
doAnswer((Answer<Void>) invocationOnMock ->
|
||||||
|
{
|
||||||
|
clientMenuEntries = invocationOnMock.getArgument(0, MenuEntry[].class);
|
||||||
|
return null;
|
||||||
|
}).when(client).setMenuEntries(ArgumentMatchers.any(MenuEntry[].class));
|
||||||
|
when(client.getMenuEntries()).thenAnswer((Answer<MenuEntry[]>) invocationMock -> clientMenuEntries);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testManagedMenuOrder()
|
||||||
|
{
|
||||||
|
final MenuEntry first = new MenuEntry();
|
||||||
|
final MenuEntry second = new MenuEntry();
|
||||||
|
final MenuEntry third = new MenuEntry();
|
||||||
|
first.setOption("Test");
|
||||||
|
first.setTarget("First Entry");
|
||||||
|
first.setParam1(WORLD_MAP_OPTION.getPackedId());
|
||||||
|
first.setType(RUNELITE.getId());
|
||||||
|
second.setOption("Test");
|
||||||
|
second.setTarget("Second Entry");
|
||||||
|
second.setParam1(WORLD_MAP_OPTION.getPackedId());
|
||||||
|
second.setType(RUNELITE.getId());
|
||||||
|
third.setOption("Test");
|
||||||
|
third.setTarget("Third Entry");
|
||||||
|
third.setParam1(WORLD_MAP_OPTION.getPackedId());
|
||||||
|
third.setType(RUNELITE.getId());
|
||||||
|
menuManager.addManagedCustomMenu(new WidgetMenuOption(first.getOption(), first.getTarget(), WORLD_MAP_OPTION));
|
||||||
|
menuManager.addManagedCustomMenu(new WidgetMenuOption(second.getOption(), second.getTarget(), WORLD_MAP_OPTION));
|
||||||
|
menuManager.addManagedCustomMenu(new WidgetMenuOption(third.getOption(), third.getTarget(), WORLD_MAP_OPTION));
|
||||||
|
|
||||||
|
menuManager.onMenuEntryAdded(new MenuEntryAdded(
|
||||||
|
CANCEL.getOption(),
|
||||||
|
CANCEL.getTarget(),
|
||||||
|
CC_OP.getId(),
|
||||||
|
CANCEL.getIdentifier(),
|
||||||
|
CANCEL.getParam0(),
|
||||||
|
CANCEL.getParam1()));
|
||||||
|
|
||||||
|
ArgumentCaptor<MenuEntry[]> captor = ArgumentCaptor.forClass(MenuEntry[].class);
|
||||||
|
verify(client, atLeastOnce()).setMenuEntries(captor.capture());
|
||||||
|
|
||||||
|
final MenuEntry[] resultMenuEntries = captor.getValue();
|
||||||
|
// Strip color tags from menu options before array comparison
|
||||||
|
for (MenuEntry resultEntry : resultMenuEntries)
|
||||||
|
{
|
||||||
|
final String resultTarget = resultEntry.getTarget();
|
||||||
|
if (resultTarget != null)
|
||||||
|
{
|
||||||
|
resultEntry.setTarget(Text.removeTags(resultEntry.getTarget()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
assertArrayEquals(new MenuEntry[]{CANCEL, third, second, first}, resultMenuEntries);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -906,6 +906,50 @@ public class ChatCommandsPluginTest
|
|||||||
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 59.2);
|
verify(configManager).setRSProfileConfiguration("personalbest", "TzHaar-Ket-Rak's First Challenge".toLowerCase(), 59.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTemporossNewPb()
|
||||||
|
{
|
||||||
|
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Subdued in <col=ef1020>6:35</col> (new personal best).", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Tempoross kill count is: <col=ff0000>60</col>.", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
verify(configManager).setRSProfileConfiguration("killcount", "tempoross", 60);
|
||||||
|
verify(configManager).setRSProfileConfiguration("personalbest", "tempoross", 6 * 60 + 35.0);
|
||||||
|
|
||||||
|
// Precise times
|
||||||
|
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Subdued in <col=ef1020>5:20.60</col> (new personal best).", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Tempoross kill count is: <col=ff0000>60</col>.", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
verify(configManager).setRSProfileConfiguration("personalbest", "tempoross", 5 * 60 + 20.6);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTemporossNoPb()
|
||||||
|
{
|
||||||
|
ChatMessage chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Subdued in <col=ef1020>7:40</col>. Personal best: 5:38.", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Tempoross kill count is: <col=ff0000>55</col>.", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
verify(configManager).setRSProfileConfiguration("killcount", "tempoross", 55);
|
||||||
|
verify(configManager).setRSProfileConfiguration("personalbest", "tempoross", 5 * 60 + 38.0);
|
||||||
|
|
||||||
|
// Precise times
|
||||||
|
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Subdued in <col=ef1020>6:19.80</col>. Personal best: 5:42.60.", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
chatMessage = new ChatMessage(null, GAMEMESSAGE, "", "Your Tempoross kill count is: <col=ff0000>55</col>.", null, 0);
|
||||||
|
chatCommandsPlugin.onChatMessage(chatMessage);
|
||||||
|
|
||||||
|
verify(configManager).setRSProfileConfiguration("personalbest", "tempoross", 5 * 60 + 42.6);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testTimeStringToSeconds()
|
public void testTimeStringToSeconds()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,10 +33,12 @@ import com.google.inject.testing.fieldbinder.BoundFieldModule;
|
|||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
|
import net.runelite.api.NullObjectID;
|
||||||
import net.runelite.api.Player;
|
import net.runelite.api.Player;
|
||||||
import net.runelite.api.coords.WorldPoint;
|
import net.runelite.api.coords.WorldPoint;
|
||||||
import net.runelite.api.events.ChatMessage;
|
import net.runelite.api.events.ChatMessage;
|
||||||
import net.runelite.api.events.GameTick;
|
import net.runelite.api.events.GameTick;
|
||||||
|
import net.runelite.api.events.MenuOptionClicked;
|
||||||
import net.runelite.api.widgets.Widget;
|
import net.runelite.api.widgets.Widget;
|
||||||
import net.runelite.api.widgets.WidgetInfo;
|
import net.runelite.api.widgets.WidgetInfo;
|
||||||
import net.runelite.client.game.ItemManager;
|
import net.runelite.client.game.ItemManager;
|
||||||
@@ -45,6 +47,8 @@ import net.runelite.client.plugins.cluescrolls.clues.hotcold.HotColdLocation;
|
|||||||
import net.runelite.client.ui.overlay.OverlayManager;
|
import net.runelite.client.ui.overlay.OverlayManager;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertNotEquals;
|
import static org.junit.Assert.assertNotEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
import static org.junit.Assert.assertNull;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
@@ -168,4 +172,47 @@ public class ClueScrollPluginTest
|
|||||||
verify(client, times(++clueSetupHintArrowClears)).clearHintArrow();
|
verify(client, times(++clueSetupHintArrowClears)).clearHintArrow();
|
||||||
verify(client, times(1)).setHintArrow(any(WorldPoint.class));
|
verify(client, times(1)).setHintArrow(any(WorldPoint.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSTASHMarkerPersistence()
|
||||||
|
{
|
||||||
|
when(client.getCachedNPCs()).thenReturn(new NPC[] {});
|
||||||
|
|
||||||
|
// Set up emote clue
|
||||||
|
final Widget clueWidget = mock(Widget.class);
|
||||||
|
when(clueWidget.getText()).thenReturn("Spin in the Varrock Castle courtyard. Equip a black axe, a coif and a ruby ring.");
|
||||||
|
when(client.getWidget(WidgetInfo.CLUE_SCROLL_TEXT)).thenReturn(clueWidget);
|
||||||
|
plugin.onGameTick(new GameTick());
|
||||||
|
|
||||||
|
// Simulate clicking on the STASH
|
||||||
|
MenuOptionClicked menuOptionClicked = new MenuOptionClicked();
|
||||||
|
menuOptionClicked.setMenuOption("Search");
|
||||||
|
menuOptionClicked.setMenuTarget("<col=ffff>STASH unit (easy)");
|
||||||
|
menuOptionClicked.setId(NullObjectID.NULL_28983);
|
||||||
|
plugin.onMenuOptionClicked(menuOptionClicked);
|
||||||
|
|
||||||
|
// Check that the STASH is stored after withdrawing
|
||||||
|
ChatMessage withdrawMessage = new ChatMessage();
|
||||||
|
withdrawMessage.setType(ChatMessageType.GAMEMESSAGE);
|
||||||
|
withdrawMessage.setMessage("You withdraw your items from the STASH unit.");
|
||||||
|
plugin.onChatMessage(withdrawMessage);
|
||||||
|
assertNotNull(plugin.getActiveSTASHClue());
|
||||||
|
|
||||||
|
// Complete the step and get a new step, check that the clue is stored for rendering
|
||||||
|
when(clueWidget.getText()).thenReturn("Talk to the bartender of the Rusty Anchor in Port Sarim.");
|
||||||
|
plugin.onGameTick(new GameTick());
|
||||||
|
assertNotNull(plugin.getActiveSTASHClue());
|
||||||
|
|
||||||
|
// Simulate depositing the emote items, make sure it's cleared the stored clue
|
||||||
|
ChatMessage depositMessage = new ChatMessage();
|
||||||
|
depositMessage.setType(ChatMessageType.GAMEMESSAGE);
|
||||||
|
depositMessage.setMessage("You deposit your items into the STASH unit.");
|
||||||
|
plugin.onChatMessage(depositMessage);
|
||||||
|
assertNull(plugin.getActiveSTASHClue());
|
||||||
|
|
||||||
|
// Make sure that the STASH won't get re-marked if it's not part of the active clue.
|
||||||
|
plugin.onMenuOptionClicked(menuOptionClicked);
|
||||||
|
plugin.onChatMessage(withdrawMessage);
|
||||||
|
assertNull(plugin.getActiveSTASHClue());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.inject.Named;
|
|
||||||
import net.runelite.api.ChatMessageType;
|
import net.runelite.api.ChatMessageType;
|
||||||
import net.runelite.api.EnumComposition;
|
import net.runelite.api.EnumComposition;
|
||||||
import net.runelite.api.Friend;
|
import net.runelite.api.Friend;
|
||||||
@@ -144,6 +143,7 @@ import net.runelite.rs.api.RSUsername;
|
|||||||
import net.runelite.rs.api.RSWidget;
|
import net.runelite.rs.api.RSWidget;
|
||||||
import net.runelite.rs.api.RSWorld;
|
import net.runelite.rs.api.RSWorld;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@Mixin(RSClient.class)
|
@Mixin(RSClient.class)
|
||||||
public abstract class RSClientMixin implements RSClient
|
public abstract class RSClientMixin implements RSClient
|
||||||
@@ -151,6 +151,9 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Shadow("client")
|
@Shadow("client")
|
||||||
private static RSClient client;
|
private static RSClient client;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
public static Logger rl$logger = LoggerFactory.getLogger("injected-client");
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@javax.inject.Inject
|
@javax.inject.Inject
|
||||||
private Callbacks callbacks;
|
private Callbacks callbacks;
|
||||||
@@ -158,11 +161,6 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Inject
|
@Inject
|
||||||
private DrawCallbacks drawCallbacks;
|
private DrawCallbacks drawCallbacks;
|
||||||
|
|
||||||
@Inject
|
|
||||||
@javax.inject.Inject
|
|
||||||
@Named("Core Logger")
|
|
||||||
private Logger logger;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private static int tickCount;
|
private static int tickCount;
|
||||||
|
|
||||||
@@ -351,7 +349,7 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Override
|
@Override
|
||||||
public Logger getLogger()
|
public Logger getLogger()
|
||||||
{
|
{
|
||||||
return logger;
|
return rl$logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -587,7 +585,7 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Override
|
@Override
|
||||||
public void setGameState(GameState gameState)
|
public void setGameState(GameState gameState)
|
||||||
{
|
{
|
||||||
assert this.isClientThread();
|
assert this.isClientThread() : "setGameState must be called on client thread";
|
||||||
setGameState(gameState.getState());
|
setGameState(gameState.getState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,7 +712,7 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
|
|
||||||
if (skill == Skill.OVERALL)
|
if (skill == Skill.OVERALL)
|
||||||
{
|
{
|
||||||
logger.debug("getSkillExperience called for {}!", skill);
|
rl$logger.debug("getSkillExperience called for {}!", skill);
|
||||||
return (int) getOverallExperience();
|
return (int) getOverallExperience();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -977,7 +975,8 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Override
|
@Override
|
||||||
public SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale)
|
public SpritePixels createItemSprite(int itemId, int quantity, int border, int shadowColor, int stackable, boolean noted, int scale)
|
||||||
{
|
{
|
||||||
assert isClientThread();
|
assert isClientThread() : "createItemSprite must be called on client thread";
|
||||||
|
|
||||||
int zoom = get3dZoom();
|
int zoom = get3dZoom();
|
||||||
set3dZoom(scale);
|
set3dZoom(scale);
|
||||||
try
|
try
|
||||||
@@ -1096,12 +1095,19 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Inject
|
@Inject
|
||||||
public static void gameStateChanged(int idx)
|
public static void gameStateChanged(int idx)
|
||||||
{
|
{
|
||||||
GameStateChanged gameStateChange = new GameStateChanged();
|
|
||||||
GameState gameState = client.getGameState();
|
GameState gameState = client.getGameState();
|
||||||
|
client.getLogger().debug("Game state changed: {}", gameState);
|
||||||
|
GameStateChanged gameStateChange = new GameStateChanged();
|
||||||
gameStateChange.setGameState(gameState);
|
gameStateChange.setGameState(gameState);
|
||||||
client.getCallbacks().post(gameStateChange);
|
client.getCallbacks().post(gameStateChange);
|
||||||
|
|
||||||
if (gameState == GameState.LOGGED_IN)
|
if (gameState == GameState.LOGGED_IN)
|
||||||
{
|
{
|
||||||
|
if (client.getLocalPlayer() == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int plane = client.getPlane();
|
int plane = client.getPlane();
|
||||||
RSScene scene = client.getScene();
|
RSScene scene = client.getScene();
|
||||||
RSTile[][][] tiles = scene.getTiles();
|
RSTile[][][] tiles = scene.getTiles();
|
||||||
@@ -1453,7 +1459,7 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
@Inject
|
@Inject
|
||||||
public void invokeMenuAction(String option, String target, int identifier, int opcode, int param0, int param1)
|
public void invokeMenuAction(String option, String target, int identifier, int opcode, int param0, int param1)
|
||||||
{
|
{
|
||||||
assert isClientThread();
|
assert isClientThread() : "invokeMenuAction must be called on client thread";
|
||||||
|
|
||||||
client.sendMenuAction(param0, param1, opcode, identifier, option, target, 658, 384);
|
client.sendMenuAction(param0, param1, opcode, identifier, option, target, 658, 384);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
|||||||
@Override
|
@Override
|
||||||
public int getParentId()
|
public int getParentId()
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "getParentId must be called on client thread";
|
||||||
|
|
||||||
int rsParentId = getRSParentId();
|
int rsParentId = getRSParentId();
|
||||||
if (rsParentId != -1)
|
if (rsParentId != -1)
|
||||||
@@ -249,7 +249,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
|||||||
@Override
|
@Override
|
||||||
public boolean isHidden()
|
public boolean isHidden()
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "isHidden must be called on client thread";
|
||||||
|
|
||||||
if (isSelfHidden())
|
if (isSelfHidden())
|
||||||
{
|
{
|
||||||
@@ -415,7 +415,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
|||||||
@Override
|
@Override
|
||||||
public Widget[] getNestedChildren()
|
public Widget[] getNestedChildren()
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "getNestedChildren must be called on client thread";
|
||||||
|
|
||||||
if (getRSParentId() == getId())
|
if (getRSParentId() == getId())
|
||||||
{
|
{
|
||||||
@@ -480,7 +480,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
|||||||
@Override
|
@Override
|
||||||
public Widget createChild(int index, int type)
|
public Widget createChild(int index, int type)
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "createChild must be called on client thread";
|
||||||
|
|
||||||
RSWidget w = client.createWidget();
|
RSWidget w = client.createWidget();
|
||||||
w.setType(type);
|
w.setType(type);
|
||||||
@@ -533,7 +533,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
|||||||
@Override
|
@Override
|
||||||
public void revalidate()
|
public void revalidate()
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "revalidate must be called on client thread";
|
||||||
|
|
||||||
client.revalidateWidget(this);
|
client.revalidateWidget(this);
|
||||||
}
|
}
|
||||||
@@ -542,7 +542,7 @@ public abstract class RSWidgetMixin implements RSWidget
|
|||||||
@Override
|
@Override
|
||||||
public void revalidateScroll()
|
public void revalidateScroll()
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "revalidateScroll must be called on client thread";
|
||||||
|
|
||||||
client.revalidateWidget(this);
|
client.revalidateWidget(this);
|
||||||
client.revalidateWidgetScroll(client.getWidgets()[TO_GROUP(this.getId())], this, false);
|
client.revalidateWidgetScroll(client.getWidgets()[TO_GROUP(this.getId())], this, false);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public abstract class VarbitMixin implements RSClient
|
|||||||
@Override
|
@Override
|
||||||
public int getVarbitValue(int[] varps, int varbitId)
|
public int getVarbitValue(int[] varps, int varbitId)
|
||||||
{
|
{
|
||||||
assert client.isClientThread();
|
assert client.isClientThread() : "getVarbitValue must be called on client thread";
|
||||||
|
|
||||||
RSVarbitComposition v = getVarbitComposition(varbitId);
|
RSVarbitComposition v = getVarbitComposition(varbitId);
|
||||||
if (v == null)
|
if (v == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user