Skip to content

Commit

Permalink
Fixed for checkstyles
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Jani authored Jun 19, 2020
1 parent 21b7a05 commit 6e4901b
Showing 1 changed file with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,20 @@
import net.runelite.client.plugins.PluginDescriptor;
import net.runelite.client.plugins.PluginType;
import org.pf4j.Extension;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import java.awt.Canvas;
import java.awt.image.BufferedImage;


/**
* Mirror Plugin - Creates a new window that draws only the game canvas, and ignores the AFTER_MIRROR Overlay layer
*/
@Extension
@PluginDescriptor(
name = "Mirror",
description = "Create a new window with the game image minus the top overlay layer",
type = PluginType.UTILITY,
enabledByDefault = false
name = "Mirror",
description = "Create a new window with the game image minus the top overlay layer",
type = PluginType.UTILITY,
enabledByDefault = false
)
public class MirrorPlugin extends Plugin
{
Expand All @@ -69,9 +67,6 @@ public class MirrorPlugin extends Plugin
@Inject
private ClientThread clientThread;

public MirrorPlugin() {
}

@Provides
MirrorConfig getConfig(ConfigManager configManager)
{
Expand All @@ -87,30 +82,38 @@ public void updateTitle()
{
clientThread.invokeLater(() ->
{
if (client.getGameState() == GameState.LOGGED_IN) {
if (client.getGameState() == GameState.LOGGED_IN)
{
final Player player = client.getLocalPlayer();

if (player == null) {
if (player == null)
{
return false;
}

final String name = player.getName();

if (Strings.isNullOrEmpty(name)) {
if (Strings.isNullOrEmpty(name))
{
return false;
}

if (jframe != null) {
if (config.mirrorName()) {
if (jframe != null)
{
if (config.mirrorName())
{
jframe.setTitle("OpenOSRS Mirror" + " - " + name);
} else {
}
else
{
jframe.setTitle("OpenOSRS Mirror");
}

}
} else
}
else
{
if(jframe != null)
if (jframe != null)
{
jframe.setTitle("OpenOSRS Mirror");
return true;
Expand Down Expand Up @@ -167,6 +170,11 @@ private void onDrawFinished(DrawFinished event)
@Subscribe
private void onGameStateChanged(final GameStateChanged event)
{
if (event.getGameState() != GameState.LOGGED_IN)
{
return;
}

updateTitle();
}

Expand All @@ -180,7 +188,7 @@ private void onConfigChanged(ConfigChanged event)

SwingUtilities.invokeLater(() ->
{
if(jframe != null)
if (jframe != null)
{
updateTitle();
}
Expand Down

0 comments on commit 6e4901b

Please sign in to comment.