Skip to content

Commit

Permalink
Separate Player/Interface right-click predict option (#177)
Browse files Browse the repository at this point in the history
* Separate Player/Interface right-click predict option

* Reword descriptions for new player menu options
  • Loading branch information
Cyborger1 authored Jan 28, 2024
1 parent ac461ec commit 78f41b6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
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 @@ -357,7 +357,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 @@ -602,12 +602,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 @@ -959,7 +959,7 @@ private void statsChatCommand(ChatMessage chatMessage, String message)
@Subscribe
private void onMenuEntryAdded(MenuEntryAdded event)
{
if (!config.addPredictOption())
if (!config.addPredictMenuOption())
{
return;
}
Expand Down

0 comments on commit 78f41b6

Please sign in to comment.