mirror of
https://github.com/2006-Scape/2006RebottedClient.git
synced 2026-07-03 00:31:48 +00:00
Big fat update
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -99,9 +99,9 @@ public class Client extends GameApplet {
|
|||||||
public static int anInt1290;
|
public static int anInt1290;
|
||||||
public static String server = "";
|
public static String server = "";
|
||||||
public static int[] fullScreenTextureArray;
|
public static int[] fullScreenTextureArray;
|
||||||
static int openInterfaceId;
|
public static int openInterfaceId;
|
||||||
static int anInt1211;
|
static int anInt1211;
|
||||||
static int tabId;
|
public static int tabId;
|
||||||
private static int anInt849;
|
private static int anInt849;
|
||||||
private static int anInt854;
|
private static int anInt854;
|
||||||
private static int anInt924;
|
private static int anInt924;
|
||||||
@@ -273,14 +273,14 @@ public class Client extends GameApplet {
|
|||||||
private long loadingStartTime;
|
private long loadingStartTime;
|
||||||
private int[][] anIntArrayArray825;
|
private int[][] anIntArrayArray825;
|
||||||
private int[] friendsNodeIDs;
|
private int[] friendsNodeIDs;
|
||||||
private Deque[][][] groundItems;
|
public Deque[][][] groundItems;
|
||||||
private int[] anIntArray828;
|
private int[] anIntArray828;
|
||||||
private int[] anIntArray829;
|
private int[] anIntArray829;
|
||||||
private volatile boolean aBoolean831;
|
private volatile boolean aBoolean831;
|
||||||
private Socket jaggrab;
|
private Socket jaggrab;
|
||||||
private int loginScreenState;
|
private int loginScreenState;
|
||||||
private Buffer chatBuffer;
|
private Buffer chatBuffer;
|
||||||
private Npc[] npcs;
|
public Npc[] npcs;
|
||||||
private int npcCount;
|
private int npcCount;
|
||||||
private int[] npcIndices;
|
private int[] npcIndices;
|
||||||
private int removedMobCount;
|
private int removedMobCount;
|
||||||
@@ -297,11 +297,11 @@ public class Client extends GameApplet {
|
|||||||
private int[] anIntArray852;
|
private int[] anIntArray852;
|
||||||
private int[] anIntArray853;
|
private int[] anIntArray853;
|
||||||
private int hintIconDrawType;
|
private int hintIconDrawType;
|
||||||
private int xCameraPos;
|
public int xCameraPos;
|
||||||
private int zCameraPos;
|
public int zCameraPos;
|
||||||
private int yCameraPos;
|
public int yCameraPos;
|
||||||
private int yCameraCurve;
|
public int yCameraCurve;
|
||||||
private int xCameraCurve;
|
public int xCameraCurve;
|
||||||
private int myPrivilege;
|
private int myPrivilege;
|
||||||
private Sprite mapFlag;
|
private Sprite mapFlag;
|
||||||
private Sprite mapMarker;
|
private Sprite mapMarker;
|
||||||
@@ -309,10 +309,10 @@ public class Client extends GameApplet {
|
|||||||
private MouseDetection mouseDetection;
|
private MouseDetection mouseDetection;
|
||||||
private volatile boolean drawFlames;
|
private volatile boolean drawFlames;
|
||||||
private String reportAbuseInput;
|
private String reportAbuseInput;
|
||||||
private boolean menuOpen;
|
public boolean menuOpen;
|
||||||
private int anInt886;
|
private int anInt886;
|
||||||
private String inputString;
|
private String inputString;
|
||||||
private Player[] players;
|
public Player[] players;
|
||||||
private int playerCount;
|
private int playerCount;
|
||||||
private int[] playerList;
|
private int[] playerList;
|
||||||
private int mobsAwaitingUpdateCount;
|
private int mobsAwaitingUpdateCount;
|
||||||
@@ -328,7 +328,7 @@ public class Client extends GameApplet {
|
|||||||
private int crossY;
|
private int crossY;
|
||||||
private int crossIndex;
|
private int crossIndex;
|
||||||
private int crossType;
|
private int crossType;
|
||||||
private int plane;
|
public int plane;
|
||||||
private boolean loadingError;
|
private boolean loadingError;
|
||||||
private int[][] anIntArrayArray929;
|
private int[][] anIntArrayArray929;
|
||||||
private Sprite aClass30_Sub2_Sub1_Sub1_931;
|
private Sprite aClass30_Sub2_Sub1_Sub1_931;
|
||||||
@@ -345,8 +345,8 @@ public class Client extends GameApplet {
|
|||||||
private int menuScreenArea;
|
private int menuScreenArea;
|
||||||
private int menuOffsetX;
|
private int menuOffsetX;
|
||||||
private int menuOffsetY;
|
private int menuOffsetY;
|
||||||
private int menuWidth;
|
public int menuWidth;
|
||||||
private int menuHeight;
|
public int menuHeight;
|
||||||
private long aLong953;
|
private long aLong953;
|
||||||
private boolean aBoolean954;
|
private boolean aBoolean954;
|
||||||
private long[] friendsListAsLongs;
|
private long[] friendsListAsLongs;
|
||||||
@@ -390,15 +390,15 @@ public class Client extends GameApplet {
|
|||||||
private int anInt1026;
|
private int anInt1026;
|
||||||
private boolean aBoolean1031;
|
private boolean aBoolean1031;
|
||||||
private Sprite[] mapFunctions;
|
private Sprite[] mapFunctions;
|
||||||
private int regionBaseX;
|
public int regionBaseX;
|
||||||
private int regionBaseY;
|
public int regionBaseY;
|
||||||
private int previousAbsoluteX;
|
private int previousAbsoluteX;
|
||||||
private int previousAbsoluteY;
|
private int previousAbsoluteY;
|
||||||
private int loginFailures;
|
private int loginFailures;
|
||||||
private int anInt1039;
|
private int anInt1039;
|
||||||
private int anInt1040;
|
private int anInt1040;
|
||||||
private int anInt1041;
|
private int anInt1041;
|
||||||
private int dialogueId;
|
public int dialogueId;
|
||||||
private int member;
|
private int member;
|
||||||
private boolean maleCharacter;
|
private boolean maleCharacter;
|
||||||
private int anInt1048;
|
private int anInt1048;
|
||||||
@@ -430,10 +430,10 @@ public class Client extends GameApplet {
|
|||||||
private int activeInterfaceType;
|
private int activeInterfaceType;
|
||||||
private int anInt1087;
|
private int anInt1087;
|
||||||
private int anInt1088;
|
private int anInt1088;
|
||||||
private int[] firstMenuAction;
|
public int[] firstMenuAction;
|
||||||
private int[] secondMenuAction;
|
public int[] secondMenuAction;
|
||||||
private int[] menuActionTypes;
|
public int[] menuActionTypes;
|
||||||
private int[] selectedMenuActions;
|
public int[] selectedMenuActions;
|
||||||
private Sprite[] headIcons;
|
private Sprite[] headIcons;
|
||||||
private Sprite[] skullIcons;
|
private Sprite[] skullIcons;
|
||||||
private Sprite[] headIconsHint;
|
private Sprite[] headIconsHint;
|
||||||
@@ -456,15 +456,15 @@ public class Client extends GameApplet {
|
|||||||
private String aString1121;
|
private String aString1121;
|
||||||
private Sprite compass;
|
private Sprite compass;
|
||||||
private ProducingGraphicsBuffer chatSettingImageProducer;
|
private ProducingGraphicsBuffer chatSettingImageProducer;
|
||||||
private int cameraY;
|
public int cameraY;
|
||||||
private int menuActionRow;
|
public int menuActionRow;
|
||||||
private int spellSelected;
|
public int spellSelected;
|
||||||
private int anInt1137;
|
private int anInt1137;
|
||||||
private int spellUsableOn;
|
public int spellUsableOn;
|
||||||
private String spellTooltip;
|
private String spellTooltip;
|
||||||
private Sprite[] minimapHint;
|
private Sprite[] minimapHint;
|
||||||
private boolean inPlayerOwnedHouse;
|
private boolean inPlayerOwnedHouse;
|
||||||
private int runEnergy = 100;
|
public int runEnergy = 100;
|
||||||
private boolean continuedDialogue;
|
private boolean continuedDialogue;
|
||||||
private Sprite[] crosses;
|
private Sprite[] crosses;
|
||||||
private IndexedImage[] titleIndexedImages;
|
private IndexedImage[] titleIndexedImages;
|
||||||
@@ -487,7 +487,7 @@ public class Client extends GameApplet {
|
|||||||
private int cameraHorizontal;
|
private int cameraHorizontal;
|
||||||
private int anInt1186;
|
private int anInt1186;
|
||||||
private int anInt1187;
|
private int anInt1187;
|
||||||
private int overlayInterfaceId;
|
public int overlayInterfaceId;
|
||||||
private int[] anIntArray1190;
|
private int[] anIntArray1190;
|
||||||
private int[] anIntArray1191;
|
private int[] anIntArray1191;
|
||||||
private Buffer outgoing;
|
private Buffer outgoing;
|
||||||
@@ -498,9 +498,9 @@ public class Client extends GameApplet {
|
|||||||
private Sprite flameLeftSprite;
|
private Sprite flameLeftSprite;
|
||||||
private Sprite flameRightSprite;
|
private Sprite flameRightSprite;
|
||||||
private int minimapRotation;
|
private int minimapRotation;
|
||||||
private String promptInput;
|
public String promptInput;
|
||||||
private int anInt1213;
|
private int anInt1213;
|
||||||
private int[][][] tileHeights;
|
public int[][][] tileHeights;
|
||||||
private long serverSeed;
|
private long serverSeed;
|
||||||
private int loginScreenCursorPos;
|
private int loginScreenCursorPos;
|
||||||
private long aLong1220;
|
private long aLong1220;
|
||||||
@@ -526,17 +526,17 @@ public class Client extends GameApplet {
|
|||||||
private int anInt1253;
|
private int anInt1253;
|
||||||
private boolean welcomeScreenRaised;
|
private boolean welcomeScreenRaised;
|
||||||
private boolean messagePromptRaised;
|
private boolean messagePromptRaised;
|
||||||
private byte[][][] tileFlags;
|
public byte[][][] tileFlags;
|
||||||
private int prevSong;
|
private int prevSong;
|
||||||
private int destinationX;
|
public int destinationX;
|
||||||
private int destY;
|
public int destY;
|
||||||
private Sprite minimapImage;
|
private Sprite minimapImage;
|
||||||
private int anInt1264;
|
private int anInt1264;
|
||||||
private int anInt1265;
|
private int anInt1265;
|
||||||
private String firstLoginMessage;
|
private String firstLoginMessage;
|
||||||
private String secondLoginMessage;
|
private String secondLoginMessage;
|
||||||
private int localX;
|
public int localX;
|
||||||
private int localY;
|
public int localY;
|
||||||
private GameFont smallText;
|
private GameFont smallText;
|
||||||
private GameFont regularText;
|
private GameFont regularText;
|
||||||
private GameFont boldText;
|
private GameFont boldText;
|
||||||
@@ -552,7 +552,6 @@ public class Client extends GameApplet {
|
|||||||
private int anInt1285;
|
private int anInt1285;
|
||||||
private String selectedItemName;
|
private String selectedItemName;
|
||||||
private int publicChatMode;
|
private int publicChatMode;
|
||||||
private ClassArchive classArchive;
|
|
||||||
private RebottedAPI api;
|
private RebottedAPI api;
|
||||||
private APIData apiData;
|
private APIData apiData;
|
||||||
public Client() {
|
public Client() {
|
||||||
@@ -2630,7 +2629,7 @@ public class Client extends GameApplet {
|
|||||||
NpcDefinition entityDef = ((Npc) obj).desc;
|
NpcDefinition entityDef = ((Npc) obj).desc;
|
||||||
if (Configuration.namesAboveHeads) {
|
if (Configuration.namesAboveHeads) {
|
||||||
npcScreenPos(((Mob) (obj)), ((Mob) (obj)).height + 15);
|
npcScreenPos(((Mob) (obj)), ((Mob) (obj)).height + 15);
|
||||||
smallText.drawText(0x0099FF, entityDef.name, spriteDrawY - 5, spriteDrawX); // -15
|
smallText.drawText(0x0099FF, entityDef.name + " - ID: ["+entityDef.id+"]", spriteDrawY - 5, spriteDrawX); // -15
|
||||||
// from
|
// from
|
||||||
// original
|
// original
|
||||||
}
|
}
|
||||||
@@ -4736,21 +4735,34 @@ public class Client extends GameApplet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO menu actions
|
// TODO menu actions
|
||||||
private void processMenuActions(int id) {
|
private void processMenuActions(int index) {
|
||||||
if (id < 0) {
|
processMenuActions(index, null);
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
public void processMenuActions(int index, MenuAction menuAction) {
|
||||||
|
|
||||||
if (inputDialogState != 0) {
|
if (inputDialogState != 0) {
|
||||||
inputDialogState = 0;
|
inputDialogState = 0;
|
||||||
updateChatbox = true;
|
updateChatbox = true;
|
||||||
}
|
}
|
||||||
|
int first = -1;
|
||||||
|
int button = -1;
|
||||||
|
int action = -1;
|
||||||
|
int clicked = -1;
|
||||||
|
//First: 0 button: 0 action: 412 clicked: 777 actionText: Attack @yel@Man@gr1@ (level-2)
|
||||||
|
if(menuAction != null) {
|
||||||
|
first = menuAction.getMouseX();
|
||||||
|
button = menuAction.getMouseX();
|
||||||
|
action = menuAction.getActionId();
|
||||||
|
clicked = menuAction.getHash();
|
||||||
|
} else {
|
||||||
|
first = firstMenuAction[index];
|
||||||
|
button = secondMenuAction[index];
|
||||||
|
action = menuActionTypes[index];
|
||||||
|
clicked = selectedMenuActions[index];
|
||||||
|
}
|
||||||
|
|
||||||
int first = firstMenuAction[id];
|
//System.out.println("First: "+first + " button: "+button + " action: "+action + " clicked: "+clicked+ " actionText: "+menuActionText[index]);
|
||||||
int button = secondMenuAction[id];
|
|
||||||
int action = menuActionTypes[id];
|
|
||||||
int clicked = selectedMenuActions[id];
|
|
||||||
|
|
||||||
if (action >= 2000) {
|
if (action >= 2000) {
|
||||||
action -= 2000;
|
action -= 2000;
|
||||||
}
|
}
|
||||||
@@ -5079,7 +5091,7 @@ public class Client extends GameApplet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action == 337 || action == 42 || action == 792 || action == 322) {
|
if (action == 337 || action == 42 || action == 792 || action == 322) {
|
||||||
String string = menuActionText[id];
|
String string = menuActionText[index];
|
||||||
int indexOf = string.indexOf("@whi@");
|
int indexOf = string.indexOf("@whi@");
|
||||||
if (indexOf != -1) {
|
if (indexOf != -1) {
|
||||||
long usernameHash = StringUtils.encodeBase37(string.substring(indexOf + 5).trim());
|
long usernameHash = StringUtils.encodeBase37(string.substring(indexOf + 5).trim());
|
||||||
@@ -5133,7 +5145,7 @@ public class Client extends GameApplet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (action == 484 || action == 6) {
|
if (action == 484 || action == 6) {
|
||||||
String string = menuActionText[id];
|
String string = menuActionText[index];
|
||||||
int indexOf = string.indexOf("@whi@");
|
int indexOf = string.indexOf("@whi@");
|
||||||
if (indexOf != -1) {
|
if (indexOf != -1) {
|
||||||
string = string.substring(indexOf + 5).trim();
|
string = string.substring(indexOf + 5).trim();
|
||||||
@@ -5756,17 +5768,17 @@ public class Client extends GameApplet {
|
|||||||
|
|
||||||
// Clicking report abuse button
|
// Clicking report abuse button
|
||||||
if (action == 606) {
|
if (action == 606) {
|
||||||
String s2 = menuActionText[id];
|
String s2 = menuActionText[index];
|
||||||
int j2 = s2.indexOf("@whi@");
|
int j2 = s2.indexOf("@whi@");
|
||||||
if (j2 != -1)
|
if (j2 != -1)
|
||||||
if (openInterfaceId == -1) {
|
if (openInterfaceId == -1) {
|
||||||
clearTopInterfaces();
|
clearTopInterfaces();
|
||||||
reportAbuseInput = s2.substring(j2 + 5).trim();
|
reportAbuseInput = s2.substring(j2 + 5).trim();
|
||||||
canMute = false;
|
canMute = false;
|
||||||
for (int index = 0; index < Widget.interfaceCache.length; index++) {
|
for (int z = 0; z < Widget.interfaceCache.length; z++) {
|
||||||
if (Widget.interfaceCache[index] == null || Widget.interfaceCache[index].contentType != 600)
|
if (Widget.interfaceCache[z] == null || Widget.interfaceCache[z].contentType != 600)
|
||||||
continue;
|
continue;
|
||||||
reportAbuseInterfaceID = openInterfaceId = Widget.interfaceCache[index].parent;
|
reportAbuseInterfaceID = openInterfaceId = Widget.interfaceCache[z].parent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5797,7 +5809,7 @@ public class Client extends GameApplet {
|
|||||||
|
|
||||||
// reply to private message
|
// reply to private message
|
||||||
if (action == 639) {
|
if (action == 639) {
|
||||||
String text = menuActionText[id];
|
String text = menuActionText[index];
|
||||||
|
|
||||||
int indexOf = text.indexOf("@whi@");
|
int indexOf = text.indexOf("@whi@");
|
||||||
|
|
||||||
@@ -5997,7 +6009,6 @@ public class Client extends GameApplet {
|
|||||||
}
|
}
|
||||||
itemSelected = 0;
|
itemSelected = 0;
|
||||||
spellSelected = 0;
|
spellSelected = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
@@ -8233,8 +8244,7 @@ public class Client extends GameApplet {
|
|||||||
secondLoginMessage = "Error connecting to server.";
|
secondLoginMessage = "Error connecting to server.";
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean doWalkTo(int type, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag,
|
public boolean doWalkTo(int type, int j, int k, int i1, int j1, int k1, int l1, int i2, int j2, boolean flag, int k2) {
|
||||||
int k2) {
|
|
||||||
byte byte0 = 104;
|
byte byte0 = 104;
|
||||||
byte byte1 = 104;
|
byte byte1 = 104;
|
||||||
for (int l2 = 0; l2 < byte0; l2++) {
|
for (int l2 = 0; l2 < byte0; l2++) {
|
||||||
@@ -11174,14 +11184,16 @@ public class Client extends GameApplet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadAllOrbs(int xOffset) {
|
private void loadAllOrbs(int xOffset) {
|
||||||
loadHpOrb(xOffset);
|
if(Configuration.enableOrbs) {
|
||||||
loadPrayerOrb(xOffset);
|
loadHpOrb(xOffset);
|
||||||
loadRunOrb(xOffset);
|
loadPrayerOrb(xOffset);
|
||||||
loadSpecialOrb(xOffset);
|
loadRunOrb(xOffset);
|
||||||
if (frameMode == ScreenMode.FIXED) {
|
loadSpecialOrb(xOffset);
|
||||||
SpriteCache.lookup(worldHover ? 54 : 53).drawSprite(202, 20);
|
if (frameMode == ScreenMode.FIXED) {
|
||||||
} else {
|
SpriteCache.lookup(worldHover ? 54 : 53).drawSprite(202, 20);
|
||||||
SpriteCache.lookup(worldHover ? 52 : 51).drawSprite(frameWidth - 118, 154);
|
} else {
|
||||||
|
SpriteCache.lookup(worldHover ? 52 : 51).drawSprite(frameWidth - 118, 154);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public class GameApplet extends Applet implements Runnable, MouseListener,
|
|||||||
boolean resizable, boolean full) {
|
boolean resizable, boolean full) {
|
||||||
SwingUtilities.invokeLater(() -> {
|
SwingUtilities.invokeLater(() -> {
|
||||||
if(!resizable) {
|
if(!resizable) {
|
||||||
Client.botFrame.setSize(new Dimension(774, 559));
|
Client.botFrame.setSize(new Dimension(774, 567));
|
||||||
}
|
}
|
||||||
Client.botFrame.setResizable(resizable);
|
Client.botFrame.setResizable(resizable);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package org.rebotted;
|
||||||
|
|
||||||
|
public class MenuAction {
|
||||||
|
private int hash = 0;
|
||||||
|
private String action;
|
||||||
|
private String target;
|
||||||
|
private int mouseX = 0;
|
||||||
|
private int mouseY = 0;
|
||||||
|
private int actionId;
|
||||||
|
|
||||||
|
public MenuAction(int hash, String action, String target, int mouseX, int mouseY, int actionId) {
|
||||||
|
this.hash = hash;
|
||||||
|
this.action = action;
|
||||||
|
this.target = target;
|
||||||
|
this.mouseX = mouseX;
|
||||||
|
this.mouseY = mouseY;
|
||||||
|
this.actionId = actionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MenuAction(int hash, String action, String target, int actionId) {
|
||||||
|
this.hash = hash;
|
||||||
|
this.action = action;
|
||||||
|
this.target = target;
|
||||||
|
this.actionId = actionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHash() {
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAction() {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTarget() {
|
||||||
|
return target;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMouseX() {
|
||||||
|
return mouseX;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMouseY() {
|
||||||
|
return mouseY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getActionId() {
|
||||||
|
return actionId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -257,6 +257,7 @@ public final class ObjectDefinition {
|
|||||||
|
|
||||||
public static ObjectDefinition lookup(int id) {
|
public static ObjectDefinition lookup(int id) {
|
||||||
if (id > streamIndices.length) {
|
if (id > streamIndices.length) {
|
||||||
|
System.out.println("ID: "+id + " instance is larger than objects we have.");
|
||||||
id = streamIndices.length - 1;
|
id = streamIndices.length - 1;
|
||||||
}
|
}
|
||||||
switch (id) {
|
switch (id) {
|
||||||
|
|||||||
@@ -4,20 +4,22 @@ import org.rebotted.Client;
|
|||||||
import org.rebotted.Configuration;
|
import org.rebotted.Configuration;
|
||||||
import org.rebotted.GameApplet;
|
import org.rebotted.GameApplet;
|
||||||
import org.rebotted.script.ScriptHandler;
|
import org.rebotted.script.ScriptHandler;
|
||||||
import org.rebotted.script.types.Script;
|
import org.rebotted.ui.menu.BotMenuBar;
|
||||||
|
import org.rebotted.ui.script.ScriptUI;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
|
|
||||||
public final class BotFrame extends JFrame implements ActionListener {
|
public final class BotFrame extends JFrame implements ActionListener {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static BotMenuBar botMenuBar;
|
private static BotMenuBar botMenuBar;
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final ScriptUI scriptUI;
|
private final ScriptUI scriptUI;
|
||||||
|
|
||||||
public BotFrame(Client client, boolean resizable) {
|
public BotFrame(Client client, boolean resizable) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
final GameApplet applet = client;
|
final GameApplet applet = client;
|
||||||
@@ -28,6 +30,7 @@ public final class BotFrame extends JFrame implements ActionListener {
|
|||||||
add(applet, BorderLayout.CENTER);
|
add(applet, BorderLayout.CENTER);
|
||||||
setMinimumSize(new Dimension(774, 567));
|
setMinimumSize(new Dimension(774, 567));
|
||||||
setSize(new Dimension(774, 567));
|
setSize(new Dimension(774, 567));
|
||||||
|
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||||
pack();
|
pack();
|
||||||
setLocationRelativeTo(getParent());
|
setLocationRelativeTo(getParent());
|
||||||
setLocationRelativeTo(getOwner());
|
setLocationRelativeTo(getOwner());
|
||||||
@@ -61,9 +64,9 @@ public final class BotFrame extends JFrame implements ActionListener {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
switch (e.getActionCommand().toLowerCase()) {
|
switch (e.getActionCommand().toLowerCase()) {
|
||||||
case "run":
|
case "run":
|
||||||
if(ScriptHandler.getInstance().getScriptState() == ScriptHandler.State.STOPPED) {
|
if (ScriptHandler.getInstance().getScriptState() == ScriptHandler.State.STOPPED) {
|
||||||
scriptUI.show();
|
scriptUI.show();
|
||||||
} else if(ScriptHandler.getInstance().getScriptState() == ScriptHandler.State.PAUSE) {
|
} else if (ScriptHandler.getInstance().getScriptState() == ScriptHandler.State.PAUSE) {
|
||||||
ScriptHandler.getInstance().setScriptState(ScriptHandler.State.RUNNING);
|
ScriptHandler.getInstance().setScriptState(ScriptHandler.State.RUNNING);
|
||||||
setRunning();
|
setRunning();
|
||||||
}
|
}
|
||||||
@@ -76,6 +79,10 @@ public final class BotFrame extends JFrame implements ActionListener {
|
|||||||
setStopped();
|
setStopped();
|
||||||
ScriptHandler.getInstance().stop();
|
ScriptHandler.getInstance().stop();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "entities":
|
||||||
|
Configuration.namesAboveHeads = !Configuration.namesAboveHeads;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+14
-2
@@ -1,4 +1,6 @@
|
|||||||
package org.rebotted.ui;
|
package org.rebotted.ui.menu;
|
||||||
|
|
||||||
|
import org.rebotted.ui.BotFrame;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
@@ -9,9 +11,11 @@ import javax.swing.*;
|
|||||||
public class BotMenuBar extends JMenuBar {
|
public class BotMenuBar extends JMenuBar {
|
||||||
private BotFrame botUI;
|
private BotFrame botUI;
|
||||||
private static JButton startButton, pauseButton, stopButton;
|
private static JButton startButton, pauseButton, stopButton;
|
||||||
private JMenu file, scripts;
|
private JMenu file, scripts, debugs;
|
||||||
private JMenuItem run, pause, stop;
|
private JMenuItem run, pause, stop;
|
||||||
|
|
||||||
|
private JMenuItem debugEntities;
|
||||||
|
|
||||||
public BotMenuBar(BotFrame botUI) {
|
public BotMenuBar(BotFrame botUI) {
|
||||||
this.botUI = botUI;
|
this.botUI = botUI;
|
||||||
configure();
|
configure();
|
||||||
@@ -26,6 +30,7 @@ public class BotMenuBar extends JMenuBar {
|
|||||||
|
|
||||||
file = new JMenu("File");
|
file = new JMenu("File");
|
||||||
scripts = new JMenu("Script");
|
scripts = new JMenu("Script");
|
||||||
|
debugs = new JMenu("Debugs");
|
||||||
|
|
||||||
final JMenuItem exit = new JMenuItem("Exit");
|
final JMenuItem exit = new JMenuItem("Exit");
|
||||||
|
|
||||||
@@ -36,12 +41,18 @@ public class BotMenuBar extends JMenuBar {
|
|||||||
|
|
||||||
stop = createNewJMenuItem("Stop", false);
|
stop = createNewJMenuItem("Stop", false);
|
||||||
|
|
||||||
|
stop = createNewJMenuItem("Stop", false);
|
||||||
|
|
||||||
|
debugEntities = createNewJMenuItem("Entities", true);
|
||||||
|
|
||||||
exit.addActionListener(botUI);
|
exit.addActionListener(botUI);
|
||||||
|
|
||||||
scripts.add(run);
|
scripts.add(run);
|
||||||
scripts.add(pause);
|
scripts.add(pause);
|
||||||
scripts.add(stop);
|
scripts.add(stop);
|
||||||
|
|
||||||
|
debugs.add(debugEntities);
|
||||||
|
|
||||||
file.add(exit);
|
file.add(exit);
|
||||||
|
|
||||||
|
|
||||||
@@ -76,6 +87,7 @@ public class BotMenuBar extends JMenuBar {
|
|||||||
removeAll();
|
removeAll();
|
||||||
add(file);
|
add(file);
|
||||||
add(scripts);
|
add(scripts);
|
||||||
|
add(debugs);
|
||||||
add(Box.createHorizontalGlue());
|
add(Box.createHorizontalGlue());
|
||||||
add(startButton);
|
add(startButton);
|
||||||
add(pauseButton);
|
add(pauseButton);
|
||||||
+2
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.rebotted.ui;
|
package org.rebotted.ui.script;
|
||||||
|
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
@@ -10,6 +10,7 @@ import org.rebotted.script.ScriptHandler;
|
|||||||
import org.rebotted.script.scriptdata.ScriptData;
|
import org.rebotted.script.scriptdata.ScriptData;
|
||||||
import org.rebotted.script.scriptdata.SkillCategory;
|
import org.rebotted.script.scriptdata.SkillCategory;
|
||||||
import org.rebotted.script.types.Script;
|
import org.rebotted.script.types.Script;
|
||||||
|
import org.rebotted.ui.BotFrame;
|
||||||
|
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.rebotted.ui;
|
package org.rebotted.ui.script;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package org.rebotted.util;
|
||||||
|
|
||||||
|
public interface Filter<F> {
|
||||||
|
boolean accept(F f);
|
||||||
|
}
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
|
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
|
||||||
minWidth="-Infinity" prefHeight="353.0" prefWidth="605.0" xmlns="http://javafx.com/javafx/11.0.1"
|
minWidth="-Infinity" prefHeight="353.0" prefWidth="605.0" xmlns="http://javafx.com/javafx/11.0.1"
|
||||||
fx:controller="org.rebotted.ui.ScriptController">
|
fx:controller="org.rebotted.ui.script.ScriptController">
|
||||||
<children>
|
<children>
|
||||||
<TableView fx:id="scriptTable" prefHeight="325.0" prefWidth="605.0">
|
<TableView fx:id="scriptTable" prefHeight="325.0" prefWidth="605.0">
|
||||||
<columns>
|
<columns>
|
||||||
|
|||||||
Reference in New Issue
Block a user