tob board highlight,moveable tob health orbs and boss hp bar
This commit is contained in:
@@ -430,7 +430,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
eventType = "Chambers of Xeric";
|
||||
container = client.getItemContainer(InventoryID.CHAMBERS_OF_XERIC_CHEST);
|
||||
break;
|
||||
case (WidgetID.THEATRE_OF_BLOOD_GROUP_ID):
|
||||
case (WidgetID.THEATRE_OF_BLOOD_REWARD_GROUP_ID):
|
||||
int region = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID();
|
||||
if (region != THEATRE_OF_BLOOD_REGION)
|
||||
{
|
||||
|
||||
@@ -293,7 +293,7 @@ public class StonedLootTrackerPlugin extends Plugin
|
||||
eventType = "Chambers of Xeric";
|
||||
container = client.getItemContainer(InventoryID.CHAMBERS_OF_XERIC_CHEST);
|
||||
break;
|
||||
case (WidgetID.THEATRE_OF_BLOOD_GROUP_ID):
|
||||
case (WidgetID.THEATRE_OF_BLOOD_REWARD_GROUP_ID):
|
||||
int region = WorldPoint.fromLocalInstance(client, client.getLocalPlayer().getLocalLocation()).getRegionID();
|
||||
if (region != THEATRE_OF_BLOOD_REGION)
|
||||
{
|
||||
|
||||
@@ -13,10 +13,16 @@ import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.api.Ignore;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import net.runelite.api.events.*;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.eventbus.Subscribe;
|
||||
import net.runelite.client.plugins.Plugin;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetID;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.plugins.PluginDescriptor;
|
||||
import net.runelite.client.plugins.PluginType;
|
||||
import net.runelite.client.plugins.theatre.rooms.BloatHandler;
|
||||
@@ -28,6 +34,7 @@ import net.runelite.client.plugins.theatre.rooms.nylocas.NyloHandler;
|
||||
import net.runelite.client.ui.overlay.OverlayManager;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.awt.*;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Theatre of Blood",
|
||||
@@ -65,6 +72,8 @@ public class TheatrePlugin extends Plugin
|
||||
@Inject
|
||||
private Client client;
|
||||
|
||||
private Widget widget = null;
|
||||
|
||||
@Getter(AccessLevel.PUBLIC)
|
||||
@Inject
|
||||
private OverlayManager overlayManager;
|
||||
@@ -173,6 +182,25 @@ public class TheatrePlugin extends Plugin
|
||||
verzikHandler.onAnimationChanged(event);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onWidgetLoaded(WidgetLoaded event)
|
||||
{
|
||||
if (event.getGroupId() != WidgetID.PERFORMERS_FOR_THE_THEATRE_GROUPS_GROUP_ID && event.getGroupId() != WidgetID.PERFORMERS_FOR_THE_THEATRE_PLAYERS_GROUP_ID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.getGroupId() == WidgetID.PERFORMERS_FOR_THE_THEATRE_GROUPS_GROUP_ID)
|
||||
{
|
||||
widget = client.getWidget(WidgetID.PERFORMERS_FOR_THE_THEATRE_GROUPS_GROUP_ID, 0);
|
||||
}
|
||||
|
||||
if (event.getGroupId() == WidgetID.PERFORMERS_FOR_THE_THEATRE_PLAYERS_GROUP_ID)
|
||||
{
|
||||
widget = client.getWidget(WidgetID.PERFORMERS_FOR_THE_THEATRE_PLAYERS_GROUP_ID, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void onGameTick(GameTick event)
|
||||
{
|
||||
@@ -193,6 +221,95 @@ public class TheatrePlugin extends Plugin
|
||||
|
||||
if (verzikHandler != null)
|
||||
verzikHandler.onGameTick();
|
||||
|
||||
if (widget == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// recheck if the widget is still active
|
||||
int p_id = WidgetInfo.TO_GROUP(widget.getId());
|
||||
|
||||
List<Widget> widgetList = new LinkedList<>();
|
||||
|
||||
if (p_id == WidgetID.PERFORMERS_FOR_THE_THEATRE_GROUPS_GROUP_ID)
|
||||
{
|
||||
Widget w = client.getWidget(p_id, 16);
|
||||
if (w == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Widget[] ws = w.getStaticChildren();
|
||||
for (Widget widget : ws)
|
||||
{
|
||||
Widget[] widgets = widget.getDynamicChildren();
|
||||
if (widgets.length > 3)
|
||||
{
|
||||
widgetList.add(widgets[3]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (p_id == WidgetID.PERFORMERS_FOR_THE_THEATRE_PLAYERS_GROUP_ID)
|
||||
{
|
||||
Widget w1 = client.getWidget(p_id, 26);
|
||||
|
||||
if (w1 != null)
|
||||
{
|
||||
Widget[] dChildsAccepted = w1.getDynamicChildren();
|
||||
|
||||
if (dChildsAccepted.length > 2)
|
||||
{
|
||||
for (int i = 1; i < dChildsAccepted.length; i += 11)
|
||||
{
|
||||
if (!dChildsAccepted[i].getText().equals("-"))
|
||||
{
|
||||
widgetList.add(dChildsAccepted[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Widget w2 = client.getWidget(p_id, 41);
|
||||
|
||||
if (w2 != null)
|
||||
{
|
||||
Widget[] dChildsApplied = w2.getDynamicChildren();
|
||||
|
||||
if (dChildsApplied.length > 2)
|
||||
{
|
||||
for (int i = 1; i < dChildsApplied.length; i+=11)
|
||||
{
|
||||
if (!dChildsApplied[i].getText().equals("-"))
|
||||
{
|
||||
widgetList.add(dChildsApplied[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Widget w : widgetList)
|
||||
{
|
||||
String wtext = w.getText();
|
||||
if (client.isFriended(wtext, false))
|
||||
{
|
||||
w.setTextColor(Color.green.getRGB());
|
||||
continue;
|
||||
}
|
||||
for (int i = 0; i < client.getIgnoreCount(); i++)
|
||||
{
|
||||
String name = client.getIgnores()[i].getName();
|
||||
if (name.replace('\u00A0',' ').equals(wtext))
|
||||
{
|
||||
w.setTextColor(Color.red.getRGB());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
widget = null;
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -57,6 +57,7 @@ public class WidgetOverlay extends Overlay
|
||||
.put(WidgetInfo.MULTICOMBAT_FIXED, OverlayPosition.BOTTOM_RIGHT)
|
||||
.put(WidgetInfo.MULTICOMBAT_RESIZEABLE, OverlayPosition.CANVAS_TOP_RIGHT)
|
||||
.put(WidgetInfo.PYRAMID_PLUNDER_DATA, OverlayPosition.TOP_CENTER)
|
||||
.put(WidgetInfo.THEATRE_OF_BLOOD_HEALTH_ORBS, OverlayPosition.TOP_LEFT)
|
||||
.build();
|
||||
|
||||
public static Collection<WidgetOverlay> createOverlays(final Client client)
|
||||
|
||||
Reference in New Issue
Block a user