Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Player/Interface right-click predict option #177

Merged
merged 2 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Identifies bots by sending nearby players' information to a third-party machine
| Panel Settings | Show Feedback Textbox | Adds a textbox to the prediction feedback panel, so you can explain your choice in up to 250 characters. Make sure you type your feedback *before* you make your choice! |
| Panel Settings | Panel Default Stats Tab | Sets panel default stats tab when the Plugin turns on. |
| Panel Settings | Panel Font Size | Sets the font size of most of the Plugin's Panel elements. |
| 'Predict' Settings | Right-click 'Predict' Players | Allows you to right-click predict players, instead of having to type their name in the Plugin's panel manually. |
| 'Predict' Settings | Right-click 'Predict' Players | Allows you to right-click predict players in the game world, instead of having to type their name in the Plugin's panel manually. |
| 'Predict' Settings | Right-click 'Predict' Menus | Allows you to right-click predict players in interfaces. |
| 'Predict' Settings | 'Predict' on Right-click 'Report' | If you right-click Report someone via Jagex's official in-game report system, the player will be automatically predicted in the Plugin's Panel. |
| 'Predict' Settings | 'Predict' Copy Name to Clipboard | Copies the predicted player's name to your clipboard when right-click predicting. |
| 'Predict' Settings | 'Predict' Default Color | If set, highlights unflagged/unfeedbacked players' 'Predict' option in the given color so that you can easily spot it on the in-game menu. |
Expand Down
29 changes: 21 additions & 8 deletions src/main/java/com/botdetector/BotDetectorConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public interface BotDetectorConfig extends Config
String CONFIG_GROUP = "botdetector";
String ONLY_SEND_AT_LOGOUT_KEY = "sendAtLogout";
String AUTO_SEND_MINUTES_KEY = "autoSendMinutes";
String ADD_PREDICT_OPTION_KEY = "addDetectOption"; // I know it says detect, don't change it.
String ADD_PREDICT_PLAYER_OPTION_KEY = "addDetectOption"; // I know it says detect, don't change it.
String ADD_PREDICT_MENU_OPTION_KEY = "addPlayerMenuOption";
String ANONYMOUS_UPLOADING_KEY = "enableAnonymousReporting";
String PANEL_FONT_TYPE_KEY = "panelFontType";
String AUTH_FULL_TOKEN_KEY = "authToken";
Expand Down Expand Up @@ -197,18 +198,30 @@ default PanelFontType panelFontType()

@ConfigItem(
position = 1,
keyName = ADD_PREDICT_OPTION_KEY,
keyName = ADD_PREDICT_PLAYER_OPTION_KEY,
name = "Right-click 'Predict' Players",
description = "Adds an entry to player menus to quickly check them in the prediction panel.",
description = "Adds an entry to game world player menus to quickly check them in the prediction panel.",
section = predictSection
)
default boolean addPredictOption()
default boolean addPredictPlayerOption()
{
return false;
}

@ConfigItem(
position = 2,
keyName = ADD_PREDICT_MENU_OPTION_KEY,
name = "Right-click 'Predict' Menus",
description = "Adds an entry to interface player menus to quickly check them in the prediction panel.",
section = predictSection
)
default boolean addPredictMenuOption()
{
return false;
}

@ConfigItem(
position = 3,
keyName = "predictOnReport",
name = "'Predict' on Right-click 'Report'",
description = "Makes the in-game right-click 'Report' option also open the prediction panel.",
Expand All @@ -220,7 +233,7 @@ default boolean predictOnReport()
}

@ConfigItem(
position = 3,
position = 4,
keyName = "predictOptionCopyName",
name = "'Predict' Copy Name to Clipboard",
description = "Copies the player's name to the clipboard when right-click predicting a player.",
Expand All @@ -232,7 +245,7 @@ default boolean predictOptionCopyName()
}

@ConfigItem(
position = 4,
position = 5,
keyName = "predictOptionDefaultColor",
name = "'Predict' Default Color",
description = "When right-clicking on a player, the predict option will be this color by default.",
Expand All @@ -241,7 +254,7 @@ default boolean predictOptionCopyName()
Color predictOptionDefaultColor();

@ConfigItem(
position = 5,
position = 6,
keyName = "predictOptionFlaggedColor",
name = "'Predict' Voted/Flagged Color",
description = "When right-clicking on a player that has been flagged or given feedback, the predict option will be this color instead.",
Expand All @@ -250,7 +263,7 @@ default boolean predictOptionCopyName()
Color predictOptionFlaggedColor();

@ConfigItem(
position = 6,
position = 7,
keyName = "applyPredictColorsOnReportOption",
name = "Apply Colors to 'Report'",
description = "Applies the above 'Predict' color options to the in-game 'Report' option as well.",
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/botdetector/BotDetectorPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ protected void startUp()

clientToolbar.addNavigation(navButton);

if (config.addPredictOption() && client != null)
if (config.addPredictPlayerOption() && client != null)
{
menuManager.addPlayerMenuItem(PREDICT_OPTION);
}
Expand Down Expand Up @@ -598,12 +598,12 @@ private void onConfigChanged(ConfigChanged event)

switch (event.getKey())
{
case BotDetectorConfig.ADD_PREDICT_OPTION_KEY:
case BotDetectorConfig.ADD_PREDICT_PLAYER_OPTION_KEY:
if (client != null)
{
menuManager.removePlayerMenuItem(PREDICT_OPTION);

if (config.addPredictOption())
if (config.addPredictPlayerOption())
{
menuManager.addPlayerMenuItem(PREDICT_OPTION);
}
Expand Down Expand Up @@ -955,7 +955,7 @@ private void statsChatCommand(ChatMessage chatMessage, String message)
@Subscribe
private void onMenuEntryAdded(MenuEntryAdded event)
{
if (!config.addPredictOption())
if (!config.addPredictMenuOption())
{
return;
}
Expand Down