config: Add infobox component outline option

Co-authored-by: Jordan Atwood <jordan.atwood423@gmail.com>
This commit is contained in:
Adam
2020-09-14 01:08:16 -07:00
committed by Adam
parent cd8a40807d
commit bf4173c45f
3 changed files with 16 additions and 1 deletions

View File

@@ -355,11 +355,23 @@ public interface RuneLiteConfig extends Config
return 35;
}
@ConfigItem(
keyName = "infoBoxTextOutline",
name = "Outline infobox text",
description = "Draw a full outline instead of a simple shadow for infobox text",
position = 43,
section = overlaySettings
)
default boolean infoBoxTextOutline()
{
return false;
}
@ConfigItem(
keyName = "overlayBackgroundColor",
name = "Overlay Color",
description = "Configures the background color of infoboxes and overlays",
position = 43,
position = 44,
section = overlaySettings
)
@Alpha

View File

@@ -53,6 +53,7 @@ public class InfoBoxComponent implements LayoutableRenderableEntity
private Dimension preferredSize = new Dimension(DEFAULT_SIZE, DEFAULT_SIZE);
private String text;
private Color color = Color.WHITE;
private boolean outline;
private Color backgroundColor = ComponentConstants.STANDARD_BACKGROUND_COLOR;
private BufferedImage image;
@Getter
@@ -94,6 +95,7 @@ public class InfoBoxComponent implements LayoutableRenderableEntity
{
final TextComponent textComponent = new TextComponent();
textComponent.setColor(color);
textComponent.setOutline(outline);
textComponent.setText(text);
textComponent.setPosition(new Point(baseX + ((size - metrics.stringWidth(text)) / 2), baseY + size - SEPARATOR));
textComponent.render(graphics);

View File

@@ -138,6 +138,7 @@ public class InfoBoxOverlay extends OverlayPanel
{
infoBoxComponent.setColor(color);
}
infoBoxComponent.setOutline(config.infoBoxTextOutline());
infoBoxComponent.setImage(box.getScaledImage());
infoBoxComponent.setTooltip(box.getTooltip());
infoBoxComponent.setPreferredSize(new Dimension(config.infoBoxSize(), config.infoBoxSize()));