overlayrenderer: Fix font styles not applying
This commit is contained in:
@@ -28,7 +28,6 @@ import com.google.common.base.MoreObjects;
|
||||
import java.awt.Color;
|
||||
import java.awt.Composite;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Paint;
|
||||
import java.awt.Point;
|
||||
@@ -51,7 +50,6 @@ import net.runelite.api.MenuOpcode;
|
||||
import net.runelite.api.MenuEntry;
|
||||
import net.runelite.api.events.BeforeRender;
|
||||
import net.runelite.api.events.ClientTick;
|
||||
import net.runelite.api.events.ConfigChanged;
|
||||
import net.runelite.api.events.FocusChanged;
|
||||
import net.runelite.api.widgets.Widget;
|
||||
import net.runelite.api.widgets.WidgetInfo;
|
||||
@@ -97,10 +95,6 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
private boolean isResizeable;
|
||||
private OverlayBounds snapCorners;
|
||||
|
||||
private Font standardFont;
|
||||
private Font tooltipFont;
|
||||
private Font interfaceFont;
|
||||
|
||||
@Inject
|
||||
private OverlayRenderer(
|
||||
final Client client,
|
||||
@@ -113,32 +107,14 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
this.client = client;
|
||||
this.overlayManager = overlayManager;
|
||||
this.runeLiteConfig = runeLiteConfig;
|
||||
this.updateConfig();
|
||||
keyManager.registerKeyListener(this);
|
||||
mouseManager.registerMouseListener(this);
|
||||
|
||||
eventbus.subscribe(ConfigChanged.class, this, this::onConfigChanged);
|
||||
eventbus.subscribe(FocusChanged.class, this, this::onFocusChanged);
|
||||
eventbus.subscribe(ClientTick.class, this, this::onClientTick);
|
||||
eventbus.subscribe(BeforeRender.class, this, this::onBeforeRender);
|
||||
}
|
||||
|
||||
private void updateConfig()
|
||||
{
|
||||
// Overlay Fonts
|
||||
this.standardFont = runeLiteConfig.fontType().getFont();
|
||||
this.tooltipFont = runeLiteConfig.tooltipFontType().getFont();
|
||||
this.interfaceFont = runeLiteConfig.interfaceFontType().getFont();
|
||||
}
|
||||
|
||||
private void onConfigChanged(ConfigChanged event)
|
||||
{
|
||||
if (event.getGroup().equals("runelite"))
|
||||
{
|
||||
updateConfig();
|
||||
}
|
||||
}
|
||||
|
||||
private void onFocusChanged(FocusChanged event)
|
||||
{
|
||||
if (!event.isFocused())
|
||||
@@ -514,16 +490,15 @@ public class OverlayRenderer extends MouseAdapter implements KeyListener
|
||||
// Set font based on configuration
|
||||
if (position == OverlayPosition.DYNAMIC || position == OverlayPosition.DETACHED)
|
||||
{
|
||||
graphics.setFont(this.standardFont); // TODO MAKE USE CONFIG SYSTEM
|
||||
|
||||
graphics.setFont(runeLiteConfig.fontType().getFont());
|
||||
}
|
||||
else if (position == OverlayPosition.TOOLTIP)
|
||||
{
|
||||
graphics.setFont(this.tooltipFont);
|
||||
graphics.setFont(runeLiteConfig.tooltipFontType().getFont());
|
||||
}
|
||||
else
|
||||
{
|
||||
graphics.setFont(this.interfaceFont);
|
||||
graphics.setFont(runeLiteConfig.interfaceFontType().getFont());
|
||||
}
|
||||
|
||||
graphics.translate(point.x, point.y);
|
||||
|
||||
Reference in New Issue
Block a user