use of dev.hypnotic.ui.clickgui.ModuleButton in project Hypnotic-Client by Hypnotic-Development.
the class SaveLoad method load.
public void load() {
ArrayList<String> lines = new ArrayList<String>();
try {
BufferedReader reader = new BufferedReader(new FileReader(this.dataFile));
String line = reader.readLine();
while (line != null) {
lines.add(line);
line = reader.readLine();
}
reader.close();
} catch (Exception e) {
e.printStackTrace();
}
for (String s : lines) {
String[] args = s.split(":");
if (s.toLowerCase().startsWith("mod:")) {
Mod m = ModuleManager.INSTANCE.getModuleByName(args[1]);
if (m != null) {
m.setKey(Integer.parseInt(args[3]));
}
} else if (s.toLowerCase().startsWith("friend:")) {
FriendManager.INSTANCE.add(new Friend(args[1]));
} else if (s.toLowerCase().startsWith("frame:")) {
for (Frame frame : ClickGUI.INSTANCE.frames) {
if (frame.name.equalsIgnoreCase(args[1])) {
frame.setX(Integer.parseInt(args[2]));
frame.setY(Integer.parseInt(args[3]));
frame.setExtended(Boolean.parseBoolean(args[4]));
}
}
HudEditorScreen.INSTANCE.frame.setX(Integer.parseInt(args[2]));
HudEditorScreen.INSTANCE.frame.setY(Integer.parseInt(args[3]));
HudEditorScreen.INSTANCE.frame.setExtended(Boolean.parseBoolean(args[4]));
} else if (s.toLowerCase().startsWith("waypoint:")) {
for (Waypoint waypoint : WaypointManager.INSTANCE.waypoints) {
if (waypoint.getName().equalsIgnoreCase(args[1])) {
int x = Integer.parseInt(args[2]);
int y = Integer.parseInt(args[3]);
int z = Integer.parseInt(args[4]);
waypoint.setX(x);
waypoint.setY(y);
waypoint.setZ(z);
waypoint.setPos(new BlockPos(x, y, z));
}
}
} else if (s.toLowerCase().startsWith("clickgui:")) {
dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.x = Integer.parseInt(args[2]);
dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.y = Integer.parseInt(args[4]);
} else if (s.toLowerCase().startsWith("settingpos:")) {
for (ModuleButton mb : dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.buttons) {
if (mb.mod.name.equalsIgnoreCase(args[1])) {
mb.settingsWindow.x = Integer.parseInt(args[3]);
mb.settingsWindow.y = Integer.parseInt(args[5]);
}
}
}
/*else if (s.toLowerCase().startsWith("message:")) {
ModuleManager.INSTANCE.chatSpammer.custom.add(args[1]);
}*/
}
}
Aggregations