Change line endings to LF
This commit is contained in:
@@ -28,30 +28,30 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.api;
|
||||
|
||||
public enum GameState
|
||||
{
|
||||
UNKNOWN(-1),
|
||||
STARTING(0),
|
||||
LOGIN_SCREEN(10),
|
||||
LOGGING_IN(20),
|
||||
LOADING(25),
|
||||
LOGGED_IN(30),
|
||||
HOPPING(45);
|
||||
|
||||
private final int state;
|
||||
|
||||
GameState(int state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public static GameState of(int state)
|
||||
{
|
||||
for (GameState gs : GameState.values())
|
||||
if (gs.state == state)
|
||||
return gs;
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
package net.runelite.api;
|
||||
|
||||
public enum GameState
|
||||
{
|
||||
UNKNOWN(-1),
|
||||
STARTING(0),
|
||||
LOGIN_SCREEN(10),
|
||||
LOGGING_IN(20),
|
||||
LOADING(25),
|
||||
LOGGED_IN(30),
|
||||
HOPPING(45);
|
||||
|
||||
private final int state;
|
||||
|
||||
GameState(int state)
|
||||
{
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public static GameState of(int state)
|
||||
{
|
||||
for (GameState gs : GameState.values())
|
||||
if (gs.state == state)
|
||||
return gs;
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,43 +28,43 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.api;
|
||||
|
||||
public enum Skill
|
||||
{
|
||||
ATTACK("Attack"),
|
||||
DEFENCE("Defence"),
|
||||
STRENGTH("Strength"),
|
||||
HITPOINTS("Hitpoints"),
|
||||
RANGED("Ranged"),
|
||||
PRAYER("Prayer"),
|
||||
MAGIC("Magic"),
|
||||
COOKING("Cooking"),
|
||||
WOODCUTTING("Woodcutting"),
|
||||
FLETCHING("Fletching"),
|
||||
FISHING("Fishing"),
|
||||
FIREMAKING("Firemaking"),
|
||||
CRAFTING("Crafting"),
|
||||
SMITHING("Smithing"),
|
||||
MINING("Mining"),
|
||||
HERBLORE("Herblore"),
|
||||
AGILITY("Agility"),
|
||||
THIEVING("Thieving"),
|
||||
SLAYER("Slayer"),
|
||||
FARMING("Farming"),
|
||||
RUNECRAFT("Runecraft"),
|
||||
HUNTER("Hunter"),
|
||||
CONSTRUCTION("Construction");
|
||||
|
||||
private final String name;
|
||||
|
||||
Skill(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
package net.runelite.api;
|
||||
|
||||
public enum Skill
|
||||
{
|
||||
ATTACK("Attack"),
|
||||
DEFENCE("Defence"),
|
||||
STRENGTH("Strength"),
|
||||
HITPOINTS("Hitpoints"),
|
||||
RANGED("Ranged"),
|
||||
PRAYER("Prayer"),
|
||||
MAGIC("Magic"),
|
||||
COOKING("Cooking"),
|
||||
WOODCUTTING("Woodcutting"),
|
||||
FLETCHING("Fletching"),
|
||||
FISHING("Fishing"),
|
||||
FIREMAKING("Firemaking"),
|
||||
CRAFTING("Crafting"),
|
||||
SMITHING("Smithing"),
|
||||
MINING("Mining"),
|
||||
HERBLORE("Herblore"),
|
||||
AGILITY("Agility"),
|
||||
THIEVING("Thieving"),
|
||||
SLAYER("Slayer"),
|
||||
FARMING("Farming"),
|
||||
RUNECRAFT("Runecraft"),
|
||||
HUNTER("Hunter"),
|
||||
CONSTRUCTION("Construction");
|
||||
|
||||
private final String name;
|
||||
|
||||
Skill(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.mapping;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface ObfuscatedOverride
|
||||
{
|
||||
String value();
|
||||
}
|
||||
package net.runelite.mapping;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.METHOD)
|
||||
public @interface ObfuscatedOverride
|
||||
{
|
||||
String value();
|
||||
}
|
||||
|
||||
@@ -28,18 +28,18 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.mapping;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
public @interface ObfuscatedSignature
|
||||
{
|
||||
String signature();
|
||||
|
||||
String garbageValue() default ""; // valid garbage value for last parameter. can't be an Object because Java.
|
||||
}
|
||||
package net.runelite.mapping;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
|
||||
public @interface ObfuscatedSignature
|
||||
{
|
||||
String signature();
|
||||
|
||||
String garbageValue() default ""; // valid garbage value for last parameter. can't be an Object because Java.
|
||||
}
|
||||
|
||||
@@ -28,95 +28,95 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ConfigLoader
|
||||
{
|
||||
private static URL configURL;
|
||||
|
||||
public static final String CODEBASE = "codebase";
|
||||
public static final String INITIAL_JAR = "initial_jar";
|
||||
public static final String INITIAL_CLASS = "initial_class";
|
||||
public static final String APP_MINWIDTH = "applet_minwidth";
|
||||
public static final String APP_MINHEIGHT = "applet_minheight";
|
||||
|
||||
private final Map<String, String> properties = new HashMap<>(),
|
||||
appletProperties = new HashMap<>();
|
||||
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
configURL = new URL("http://oldschool.runescape.com/jav_config.ws"); // https redirects us to rs3
|
||||
}
|
||||
catch (MalformedURLException ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void fetch() throws IOException
|
||||
{
|
||||
URLConnection conn = configURL.openConnection();
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())))
|
||||
{
|
||||
String str;
|
||||
|
||||
while ((str = in.readLine()) != null)
|
||||
{
|
||||
int idx = str.indexOf('=');
|
||||
|
||||
if (idx == -1)
|
||||
continue;
|
||||
|
||||
String s = str.substring(0, idx);
|
||||
|
||||
if (s.equals("param"))
|
||||
{
|
||||
str = str.substring(idx + 1);
|
||||
idx = str.indexOf('=');
|
||||
s = str.substring(0, idx);
|
||||
|
||||
appletProperties.put(s, str.substring(idx + 1));
|
||||
}
|
||||
else if (s.equals("msg"))
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
else
|
||||
{
|
||||
properties.put(s, str.substring(idx + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getProperty(String name)
|
||||
{
|
||||
return properties.get(name);
|
||||
}
|
||||
|
||||
public Map<String, String> getProperties()
|
||||
{
|
||||
return properties;
|
||||
}
|
||||
|
||||
public String getAppletProperty(String name)
|
||||
{
|
||||
return appletProperties.get(name);
|
||||
}
|
||||
|
||||
public Map<String, String> getAppletProperties()
|
||||
{
|
||||
return appletProperties;
|
||||
}
|
||||
}
|
||||
package net.runelite.client;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ConfigLoader
|
||||
{
|
||||
private static URL configURL;
|
||||
|
||||
public static final String CODEBASE = "codebase";
|
||||
public static final String INITIAL_JAR = "initial_jar";
|
||||
public static final String INITIAL_CLASS = "initial_class";
|
||||
public static final String APP_MINWIDTH = "applet_minwidth";
|
||||
public static final String APP_MINHEIGHT = "applet_minheight";
|
||||
|
||||
private final Map<String, String> properties = new HashMap<>(),
|
||||
appletProperties = new HashMap<>();
|
||||
|
||||
static
|
||||
{
|
||||
try
|
||||
{
|
||||
configURL = new URL("http://oldschool.runescape.com/jav_config.ws"); // https redirects us to rs3
|
||||
}
|
||||
catch (MalformedURLException ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void fetch() throws IOException
|
||||
{
|
||||
URLConnection conn = configURL.openConnection();
|
||||
try (BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())))
|
||||
{
|
||||
String str;
|
||||
|
||||
while ((str = in.readLine()) != null)
|
||||
{
|
||||
int idx = str.indexOf('=');
|
||||
|
||||
if (idx == -1)
|
||||
continue;
|
||||
|
||||
String s = str.substring(0, idx);
|
||||
|
||||
if (s.equals("param"))
|
||||
{
|
||||
str = str.substring(idx + 1);
|
||||
idx = str.indexOf('=');
|
||||
s = str.substring(0, idx);
|
||||
|
||||
appletProperties.put(s, str.substring(idx + 1));
|
||||
}
|
||||
else if (s.equals("msg"))
|
||||
{
|
||||
// ignore
|
||||
}
|
||||
else
|
||||
{
|
||||
properties.put(s, str.substring(idx + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getProperty(String name)
|
||||
{
|
||||
return properties.get(name);
|
||||
}
|
||||
|
||||
public Map<String, String> getProperties()
|
||||
{
|
||||
return properties;
|
||||
}
|
||||
|
||||
public String getAppletProperty(String name)
|
||||
{
|
||||
return appletProperties.get(name);
|
||||
}
|
||||
|
||||
public Map<String, String> getAppletProperties()
|
||||
{
|
||||
return appletProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,70 +28,70 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client;
|
||||
|
||||
import java.applet.Applet;
|
||||
import java.applet.AppletContext;
|
||||
import java.applet.AppletStub;
|
||||
import java.awt.Dimension;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
public class RSStub implements AppletStub
|
||||
{
|
||||
private final ConfigLoader config;
|
||||
private final Applet app;
|
||||
|
||||
public RSStub(ConfigLoader config, Applet app)
|
||||
{
|
||||
this.config = config;
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getDocumentBase()
|
||||
{
|
||||
return getCodeBase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getCodeBase()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new URL(config.getProperty(ConfigLoader.CODEBASE));
|
||||
}
|
||||
catch (MalformedURLException ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String name)
|
||||
{
|
||||
return config.getAppletProperty(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppletContext getAppletContext()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appletResize(int width, int height)
|
||||
{
|
||||
Dimension d = new Dimension(width, height);
|
||||
|
||||
app.setSize(d);
|
||||
app.setPreferredSize(d);
|
||||
}
|
||||
|
||||
}
|
||||
package net.runelite.client;
|
||||
|
||||
import java.applet.Applet;
|
||||
import java.applet.AppletContext;
|
||||
import java.applet.AppletStub;
|
||||
import java.awt.Dimension;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
public class RSStub implements AppletStub
|
||||
{
|
||||
private final ConfigLoader config;
|
||||
private final Applet app;
|
||||
|
||||
public RSStub(ConfigLoader config, Applet app)
|
||||
{
|
||||
this.config = config;
|
||||
this.app = app;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getDocumentBase()
|
||||
{
|
||||
return getCodeBase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getCodeBase()
|
||||
{
|
||||
try
|
||||
{
|
||||
return new URL(config.getProperty(ConfigLoader.CODEBASE));
|
||||
}
|
||||
catch (MalformedURLException ex)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getParameter(String name)
|
||||
{
|
||||
return config.getAppletProperty(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppletContext getAppletContext()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appletResize(int width, int height)
|
||||
{
|
||||
Dimension d = new Dimension(width, height);
|
||||
|
||||
app.setSize(d);
|
||||
app.setPreferredSize(d);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,78 +28,78 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client;
|
||||
|
||||
import java.io.File;
|
||||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.plugins.PluginManager;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
import net.runelite.client.ui.overlay.OverlayRenderer;
|
||||
|
||||
|
||||
public class RuneLite
|
||||
{
|
||||
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
||||
public static final File REPO_DIR = new File(RUNELITE_DIR, "repository");
|
||||
|
||||
private static OptionSet options;
|
||||
private static Client client;
|
||||
private static RuneLite runelite;
|
||||
|
||||
private ClientUI gui;
|
||||
private PluginManager pluginManager;
|
||||
private OverlayRenderer renderer;
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
OptionParser parser = new OptionParser();
|
||||
parser.accepts("developer-mode");
|
||||
options = parser.parse(args);
|
||||
|
||||
runelite = new RuneLite();
|
||||
runelite.start();
|
||||
}
|
||||
|
||||
public void start() throws Exception
|
||||
{
|
||||
gui = new ClientUI();
|
||||
gui.setVisible(true);
|
||||
|
||||
pluginManager = new PluginManager();
|
||||
pluginManager.loadAll();
|
||||
|
||||
renderer = new OverlayRenderer();
|
||||
}
|
||||
|
||||
public static Client getClient()
|
||||
{
|
||||
return client;
|
||||
}
|
||||
|
||||
public static void setClient(Client client)
|
||||
{
|
||||
RuneLite.client = client;
|
||||
}
|
||||
|
||||
public static RuneLite getRunelite()
|
||||
{
|
||||
return runelite;
|
||||
}
|
||||
|
||||
public PluginManager getPluginManager()
|
||||
{
|
||||
return pluginManager;
|
||||
}
|
||||
|
||||
public OverlayRenderer getRenderer()
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
|
||||
public static OptionSet getOptions()
|
||||
{
|
||||
return options;
|
||||
}
|
||||
}
|
||||
package net.runelite.client;
|
||||
|
||||
import java.io.File;
|
||||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import net.runelite.api.Client;
|
||||
import net.runelite.client.plugins.PluginManager;
|
||||
import net.runelite.client.ui.ClientUI;
|
||||
import net.runelite.client.ui.overlay.OverlayRenderer;
|
||||
|
||||
|
||||
public class RuneLite
|
||||
{
|
||||
public static final File RUNELITE_DIR = new File(System.getProperty("user.home"), ".runelite");
|
||||
public static final File REPO_DIR = new File(RUNELITE_DIR, "repository");
|
||||
|
||||
private static OptionSet options;
|
||||
private static Client client;
|
||||
private static RuneLite runelite;
|
||||
|
||||
private ClientUI gui;
|
||||
private PluginManager pluginManager;
|
||||
private OverlayRenderer renderer;
|
||||
|
||||
public static void main(String[] args) throws Exception
|
||||
{
|
||||
OptionParser parser = new OptionParser();
|
||||
parser.accepts("developer-mode");
|
||||
options = parser.parse(args);
|
||||
|
||||
runelite = new RuneLite();
|
||||
runelite.start();
|
||||
}
|
||||
|
||||
public void start() throws Exception
|
||||
{
|
||||
gui = new ClientUI();
|
||||
gui.setVisible(true);
|
||||
|
||||
pluginManager = new PluginManager();
|
||||
pluginManager.loadAll();
|
||||
|
||||
renderer = new OverlayRenderer();
|
||||
}
|
||||
|
||||
public static Client getClient()
|
||||
{
|
||||
return client;
|
||||
}
|
||||
|
||||
public static void setClient(Client client)
|
||||
{
|
||||
RuneLite.client = client;
|
||||
}
|
||||
|
||||
public static RuneLite getRunelite()
|
||||
{
|
||||
return runelite;
|
||||
}
|
||||
|
||||
public PluginManager getPluginManager()
|
||||
{
|
||||
return pluginManager;
|
||||
}
|
||||
|
||||
public OverlayRenderer getRenderer()
|
||||
{
|
||||
return renderer;
|
||||
}
|
||||
|
||||
public static OptionSet getOptions()
|
||||
{
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,88 +28,88 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client.ui;
|
||||
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
|
||||
public final class ClientUI extends JFrame implements ComponentListener
|
||||
{
|
||||
private ClientPanel panel;
|
||||
|
||||
public ClientUI() throws Exception
|
||||
{
|
||||
init();
|
||||
pack();
|
||||
setTitle("RuneLite");
|
||||
setLocationRelativeTo(getOwner());
|
||||
setMinimumSize(getSize());
|
||||
setResizable(true);
|
||||
this.addComponentListener(this);
|
||||
}
|
||||
|
||||
private void init() throws Exception
|
||||
{
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
|
||||
addWindowListener(new WindowAdapter()
|
||||
{
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
checkExit();
|
||||
}
|
||||
});
|
||||
|
||||
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
|
||||
try
|
||||
{
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
}
|
||||
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ignored)
|
||||
{
|
||||
}
|
||||
|
||||
panel = new ClientPanel();
|
||||
add(panel);
|
||||
}
|
||||
|
||||
private void checkExit()
|
||||
{
|
||||
int result = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit?", "Exit", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
|
||||
|
||||
if (result == JOptionPane.OK_OPTION)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e)
|
||||
{
|
||||
SwingUtilities.invokeLater(() -> pack()); // is this right?
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e)
|
||||
{
|
||||
}
|
||||
package net.runelite.client.ui;
|
||||
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.UnsupportedLookAndFeelException;
|
||||
|
||||
public final class ClientUI extends JFrame implements ComponentListener
|
||||
{
|
||||
private ClientPanel panel;
|
||||
|
||||
public ClientUI() throws Exception
|
||||
{
|
||||
init();
|
||||
pack();
|
||||
setTitle("RuneLite");
|
||||
setLocationRelativeTo(getOwner());
|
||||
setMinimumSize(getSize());
|
||||
setResizable(true);
|
||||
this.addComponentListener(this);
|
||||
}
|
||||
|
||||
private void init() throws Exception
|
||||
{
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
|
||||
addWindowListener(new WindowAdapter()
|
||||
{
|
||||
@Override
|
||||
public void windowClosing(WindowEvent e)
|
||||
{
|
||||
checkExit();
|
||||
}
|
||||
});
|
||||
|
||||
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
|
||||
try
|
||||
{
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
}
|
||||
catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ignored)
|
||||
{
|
||||
}
|
||||
|
||||
panel = new ClientPanel();
|
||||
add(panel);
|
||||
}
|
||||
|
||||
private void checkExit()
|
||||
{
|
||||
int result = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit?", "Exit", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
|
||||
|
||||
if (result == JOptionPane.OK_OPTION)
|
||||
{
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentResized(ComponentEvent e)
|
||||
{
|
||||
SwingUtilities.invokeLater(() -> pack()); // is this right?
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentShown(ComponentEvent e)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentHidden(ComponentEvent e)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -28,9 +28,9 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client.ui.overlay;
|
||||
|
||||
public enum OverlayPosition
|
||||
{
|
||||
TOP_LEFT;
|
||||
}
|
||||
package net.runelite.client.ui.overlay;
|
||||
|
||||
public enum OverlayPosition
|
||||
{
|
||||
TOP_LEFT;
|
||||
}
|
||||
|
||||
@@ -28,30 +28,30 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.runelite.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adam
|
||||
*/
|
||||
public class ConfigLoaderTest
|
||||
{
|
||||
@Test
|
||||
public void test() throws IOException
|
||||
{
|
||||
ConfigLoader loader = new ConfigLoader();
|
||||
loader.fetch();
|
||||
|
||||
for (String key : loader.getProperties().keySet())
|
||||
System.out.println(key + ": " + loader.getProperty(key));
|
||||
|
||||
System.out.println("Applet properties:");
|
||||
|
||||
for (String key : loader.getAppletProperties().keySet())
|
||||
System.out.println(key + ": " + loader.getAppletProperty(key));
|
||||
}
|
||||
|
||||
}
|
||||
package net.runelite.client;
|
||||
|
||||
import java.io.IOException;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Adam
|
||||
*/
|
||||
public class ConfigLoaderTest
|
||||
{
|
||||
@Test
|
||||
public void test() throws IOException
|
||||
{
|
||||
ConfigLoader loader = new ConfigLoader();
|
||||
loader.fetch();
|
||||
|
||||
for (String key : loader.getProperties().keySet())
|
||||
System.out.println(key + ": " + loader.getProperty(key));
|
||||
|
||||
System.out.println("Applet properties:");
|
||||
|
||||
for (String key : loader.getAppletProperties().keySet())
|
||||
System.out.println(key + ": " + loader.getAppletProperty(key));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user