Update Scouter to include background options, and fix record raid bug.

This commit is contained in:
Ganom
2019-06-21 19:19:06 -04:00
parent a27cf7d415
commit d16ef229eb
2 changed files with 41 additions and 9 deletions

View File

@@ -59,6 +59,18 @@ public interface RaidsConfig extends Config
return true; return true;
} }
@ConfigItem(
position = 2,
parent = "scouterConfig",
keyName = "hideBackground",
name = "Hide Scouter Background",
description = "Removes the scouter background, and makes it transparent."
)
default boolean hideBackground()
{
return true;
}
@ConfigItem( @ConfigItem(
position = 2, position = 2,
parent = "scouterConfig", parent = "scouterConfig",

View File

@@ -52,6 +52,7 @@ import static net.runelite.client.ui.overlay.OverlayManager.OPTION_CONFIGURE;
import net.runelite.client.ui.overlay.OverlayMenuEntry; import net.runelite.client.ui.overlay.OverlayMenuEntry;
import net.runelite.client.ui.overlay.OverlayPosition; import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority; import net.runelite.client.ui.overlay.OverlayPriority;
import net.runelite.client.ui.overlay.components.ComponentConstants;
import net.runelite.client.ui.overlay.components.ComponentOrientation; import net.runelite.client.ui.overlay.components.ComponentOrientation;
import net.runelite.client.ui.overlay.components.ImageComponent; import net.runelite.client.ui.overlay.components.ImageComponent;
import net.runelite.client.ui.overlay.components.PanelComponent; import net.runelite.client.ui.overlay.components.PanelComponent;
@@ -154,6 +155,15 @@ public class RaidsOverlay extends Overlay
scouterActive = false; scouterActive = false;
panelComponent.getChildren().clear(); panelComponent.getChildren().clear();
if (config.hideBackground())
{
panelComponent.setBackgroundColor(null);
}
else
{
panelComponent.setBackgroundColor(ComponentConstants.STANDARD_BACKGROUND_COLOR);
}
if (plugin.getRaid() == null || plugin.getRaid().getLayout() == null) if (plugin.getRaid() == null || plugin.getRaid().getLayout() == null)
{ {
panelComponent.getChildren().add(TitleComponent.builder() panelComponent.getChildren().add(TitleComponent.builder()
@@ -279,14 +289,13 @@ public class RaidsOverlay extends Overlay
scavsBeforeIceRooms.add(prev); scavsBeforeIceRooms.add(prev);
} }
int lastScavs = scavRooms.get(scavRooms.size() - 1); int lastScavs = scavRooms.get(scavRooms.size() - 1);
if (!recordRaid())
{ panelComponent.getChildren().add(TitleComponent.builder()
panelComponent.getChildren().add(TitleComponent.builder() .text(displayLayout)
.text(displayLayout) .color(color)
.color(color) .build());
.build());
} if (recordRaid())
else
{ {
panelComponent.getChildren().add(TitleComponent.builder() panelComponent.getChildren().add(TitleComponent.builder()
.text("Record Raid") .text("Record Raid")
@@ -294,6 +303,17 @@ public class RaidsOverlay extends Overlay
.build()); .build());
panelComponent.setBackgroundColor(new Color(0, 255, 0, 10)); panelComponent.setBackgroundColor(new Color(0, 255, 0, 10));
} }
else
{
if (config.hideBackground())
{
panelComponent.setBackgroundColor(null);
}
else
{
panelComponent.setBackgroundColor(ComponentConstants.STANDARD_BACKGROUND_COLOR);
}
}
TableComponent tableComponent = new TableComponent(); TableComponent tableComponent = new TableComponent();
tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT); tableComponent.setColumnAlignments(TableAlignment.LEFT, TableAlignment.RIGHT);
@@ -304,7 +324,7 @@ public class RaidsOverlay extends Overlay
String clanOwner = Text.removeTags(client.getWidget(WidgetInfo.CLAN_CHAT_OWNER).getText()); String clanOwner = Text.removeTags(client.getWidget(WidgetInfo.CLAN_CHAT_OWNER).getText());
if (clanOwner.equals("None")) if (clanOwner.equals("None"))
{ {
clanOwner = "Open CC tab..."; clanOwner = "Open CC Tab";
color = Color.RED; color = Color.RED;
} }