Merge pull request #853 from Kamielvf/raids-move-points-box
Raids plugin: Reposition the points box to prevent it from overlapping overlays
This commit is contained in:
@@ -170,6 +170,13 @@ public enum Varbits
|
||||
*/
|
||||
SACK_NUMBER(5558),
|
||||
|
||||
/**
|
||||
* Experience tracker
|
||||
*/
|
||||
EXPERIENCE_TRACKER_POSITION(4692),
|
||||
EXPERIENCE_TRACKER_COUNTER(4697),
|
||||
EXPERIENCE_TRACKER_PROGRESS_BAR(4698),
|
||||
|
||||
/**
|
||||
* Experience drop color
|
||||
*/
|
||||
|
||||
@@ -74,6 +74,7 @@ public class WidgetID
|
||||
public static final int WORLD_MAP = 595;
|
||||
public static final int PYRAMID_PLUNDER_GROUP_ID = 428;
|
||||
public static final int RAIDS_REWARD_GROUP_ID = 539;
|
||||
public static final int EXPERIENCE_TRACKER_GROUP_ID = 122;
|
||||
|
||||
static class WorldMap
|
||||
{
|
||||
@@ -318,4 +319,10 @@ public class WidgetID
|
||||
static final int SPRITE = 0;
|
||||
static final int TEXT = 1;
|
||||
}
|
||||
|
||||
static class ExperienceTracker
|
||||
{
|
||||
static final int WIDGET = 1;
|
||||
static final int BOTTOM_BAR = 14;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,10 @@ public enum WidgetInfo
|
||||
|
||||
BLAST_FURNACE_COFFER(WidgetID.BLAST_FURNACE_GROUP_ID, 0),
|
||||
|
||||
PYRAMID_PLUNDER_DATA(WidgetID.PYRAMID_PLUNDER_GROUP_ID, 0);
|
||||
PYRAMID_PLUNDER_DATA(WidgetID.PYRAMID_PLUNDER_GROUP_ID, 0),
|
||||
|
||||
EXPERIENCE_TRACKER(WidgetID.EXPERIENCE_TRACKER_GROUP_ID, WidgetID.ExperienceTracker.WIDGET),
|
||||
EXPERIENCE_TRACKER_BOTTOM_BAR(WidgetID.EXPERIENCE_TRACKER_GROUP_ID, WidgetID.ExperienceTracker.BOTTOM_BAR);
|
||||
|
||||
private final int groupId;
|
||||
private final int childId;
|
||||
|
||||
@@ -57,6 +57,11 @@ public class RaidsOverlay extends Overlay
|
||||
@Override
|
||||
public Dimension render(Graphics2D graphics, Point parent)
|
||||
{
|
||||
if (plugin.isInRaidChambers())
|
||||
{
|
||||
plugin.repositionPointsBox();
|
||||
}
|
||||
|
||||
if (!config.scoutOverlay() || !scoutOverlayShown)
|
||||
{
|
||||
return null;
|
||||
|
||||
@@ -53,6 +53,8 @@ import static net.runelite.api.Perspective.SCENE_SIZE;
|
||||
import net.runelite.api.events.ChatMessage;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.VarbitChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
import net.runelite.client.chat.ChatColor;
|
||||
import net.runelite.client.chat.ChatColorType;
|
||||
import net.runelite.client.chat.ChatMessageBuilder;
|
||||
@@ -84,6 +86,8 @@ public class RaidsPlugin extends Plugin
|
||||
|
||||
private BufferedImage raidsIcon;
|
||||
private RaidsTimer timer;
|
||||
|
||||
@Getter
|
||||
private boolean inRaidChambers;
|
||||
|
||||
@Inject
|
||||
@@ -302,6 +306,27 @@ public class RaidsPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
public void repositionPointsBox()
|
||||
{
|
||||
Widget widget = client.getWidget(WidgetInfo.RAIDS_POINTS_INFOBOX);
|
||||
int x = widget.getParent().getWidth() - widget.getWidth() - 2;
|
||||
int y = widget.getOriginalY();
|
||||
|
||||
if (client.getSetting(Varbits.EXPERIENCE_TRACKER_POSITION) == 0)
|
||||
{
|
||||
Widget area = client.getWidget(WidgetInfo.EXPERIENCE_TRACKER_BOTTOM_BAR);
|
||||
|
||||
if (area != null)
|
||||
{
|
||||
y = area.getOriginalY() + 2;
|
||||
area.setRelativeY(y + widget.getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
widget.setRelativeX(x);
|
||||
widget.setRelativeY(y);
|
||||
}
|
||||
|
||||
private void updateInfoBoxState()
|
||||
{
|
||||
if (timer != null)
|
||||
|
||||
Reference in New Issue
Block a user