runelite-client: add tooltip font type dropdown

This commit is contained in:
Reasel
2018-05-09 11:05:05 -07:00
committed by Adam
parent cb6e1ae5fb
commit 143af4e00c
3 changed files with 15 additions and 4 deletions

View File

@@ -189,11 +189,22 @@ public interface RuneLiteConfig extends Config
return FontType.SMALL; return FontType.SMALL;
} }
@ConfigItem(
keyName = "tooltipFontType",
name = "Tooltip Font",
description = "Configures what font type is used for in-game tooltips such as food stats, NPC names, etc.",
position = 31
)
default FontType tooltipFontType()
{
return FontType.SMALL;
}
@ConfigItem( @ConfigItem(
keyName = "infoBoxVertical", keyName = "infoBoxVertical",
name = "Display infoboxes vertically", name = "Display infoboxes vertically",
description = "Toggles the infoboxes to display vertically", description = "Toggles the infoboxes to display vertically",
position = 31 position = 32
) )
default boolean infoBoxVertical() default boolean infoBoxVertical()
{ {
@@ -204,7 +215,7 @@ public interface RuneLiteConfig extends Config
keyName = "infoBoxWrap", keyName = "infoBoxWrap",
name = "Infobox wrap count", name = "Infobox wrap count",
description = "Configures the amount of infoboxes shown before wrapping", description = "Configures the amount of infoboxes shown before wrapping",
position = 32 position = 33
) )
default int infoBoxWrap() default int infoBoxWrap()
{ {

View File

@@ -517,7 +517,7 @@ public class OverlayRenderer extends MouseListener implements KeyListener
} }
else if (position == OverlayPosition.TOOLTIP) else if (position == OverlayPosition.TOOLTIP)
{ {
subGraphics.setFont(FontManager.getRunescapeSmallFont()); subGraphics.setFont(runeLiteConfig.tooltipFontType().getFont());
} }
else else
{ {

View File

@@ -53,7 +53,7 @@ public class TooltipComponent implements RenderableEntity
// Tooltip size // Tooltip size
final FontMetrics metrics = graphics.getFontMetrics(); final FontMetrics metrics = graphics.getFontMetrics();
final int textDescent = metrics.getDescent(); final int textDescent = metrics.getDescent();
final int textHeight = graphics.getFontMetrics().getHeight(); final int textHeight = metrics.getHeight();
int tooltipWidth = 0; int tooltipWidth = 0;
int tooltipHeight = 0; int tooltipHeight = 0;
String[] lines = BR.split(text); String[] lines = BR.split(text);