player-indicators: don't decorate non-player custom menu options

Splits the RUNELITE menu action into two actions:

RUNELITE -  general menu items.

RUNELITE_PLAYER - menu items which target a player and have its identifier set to a player index.

Then the player indicators plugin is changed to only decorate RUNELITE_PLAYER menu items.
This commit is contained in:
Lotto
2020-05-28 00:11:07 +02:00
committed by Adam
parent 654966c5b3
commit 6518a6a51d
4 changed files with 12 additions and 6 deletions

View File

@@ -253,9 +253,10 @@ public class MenuManager
@Subscribe
public void onMenuOptionClicked(MenuOptionClicked event)
{
if (event.getMenuAction() != MenuAction.RUNELITE)
if (event.getMenuAction() != MenuAction.RUNELITE
&& event.getMenuAction() != MenuAction.RUNELITE_PLAYER)
{
return; // not a player menu
return; // not a managed widget option or custom player option
}
int widgetId = event.getWidgetId();
@@ -294,7 +295,7 @@ public class MenuManager
{
client.getPlayerOptions()[playerOptionIndex] = menuText;
client.getPlayerOptionsPriorities()[playerOptionIndex] = true;
client.getPlayerMenuTypes()[playerOptionIndex] = MenuAction.RUNELITE.getId();
client.getPlayerMenuTypes()[playerOptionIndex] = MenuAction.RUNELITE_PLAYER.getId();
playerMenuIndexMap.put(playerOptionIndex, menuText);
}

View File

@@ -124,7 +124,7 @@ public class PlayerIndicatorsPlugin extends Plugin
|| type == PLAYER_SIXTH_OPTION.getId()
|| type == PLAYER_SEVENTH_OPTION.getId()
|| type == PLAYER_EIGTH_OPTION.getId()
|| type == RUNELITE.getId())
|| type == RUNELITE_PLAYER.getId())
{
Player[] players = client.getCachedPlayers();
Player player = null;