use of net.runelite.api.Client in project runelite by runelite.
the class MenuManager method removePlayerMenuItem.
private void removePlayerMenuItem(int playerOptionIndex) {
Client client = clientProvider.get();
if (client == null) {
return;
}
client.getPlayerOptions()[playerOptionIndex] = null;
playerMenuIndexMap.remove(playerOptionIndex);
}
use of net.runelite.api.Client in project runelite by runelite.
the class MenuManager method findEmptyPlayerMenuIndex.
/**
* Find the next empty player menu slot index
*
* @return
*/
private int findEmptyPlayerMenuIndex() {
int index = IDX_LOWER;
Client client = clientProvider.get();
if (client == null) {
return IDX_UPPER;
}
String[] playerOptions = client.getPlayerOptions();
while (index < IDX_UPPER && playerOptions[index] != null) {
index++;
}
return index;
}
use of net.runelite.api.Client in project runelite by runelite.
the class MenuManager method addPlayerMenuItem.
private void addPlayerMenuItem(int playerOptionIndex, String menuText) {
Client client = clientProvider.get();
if (client == null) {
return;
}
client.getPlayerOptions()[playerOptionIndex] = menuText;
client.getPlayerOptionsPriorities()[playerOptionIndex] = true;
client.getPlayerMenuTypes()[playerOptionIndex] = MenuAction.RUNELITE.getId();
playerMenuIndexMap.put(playerOptionIndex, menuText);
}
use of net.runelite.api.Client in project runelite by runelite.
the class MenuManager method removeNpcMenuOption.
public void removeNpcMenuOption(String option) {
npcMenuOptions.remove(option);
// remove this option from all npc compositions
Client client = clientProvider.get();
if (client == null) {
return;
}
for (NPC npc : client.getNpcs()) {
NPCComposition composition = npc.getComposition();
removeNpcOption(composition, option);
}
}
use of net.runelite.api.Client in project runelite by runelite.
the class MenuManager method addNpcMenuOption.
public void addNpcMenuOption(String option) {
npcMenuOptions.add(option);
// add to surrounding npcs
Client client = clientProvider.get();
if (client == null) {
return;
}
for (NPC npc : client.getNpcs()) {
NPCComposition composition = npc.getComposition();
addNpcOption(composition, option);
}
}
Aggregations