Komplettes G-Earth Paket inkl. JRE, Extensions und Tools. Extensions: - G-BuildTools, G-Click Ultimate, G-Loader, G-Manipulate - G-Presets, G-Translator, G-Trigger, G-itemViewer - Market Utils, Packet Info Explorer, Plants - RandomRoomVisitor, RoomLogger, Sanbovir Photo Inspector - SpyFriends, WallAligner, XabboScripter, xabbo
151 lines
4.6 KiB
Java
151 lines
4.6 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javafx.collections.ObservableList
|
|
* javafx.scene.control.Tab
|
|
* javafx.scene.control.TabPane
|
|
* javafx.scene.paint.Color
|
|
* javafx.stage.Stage
|
|
*/
|
|
package gearth.ui;
|
|
|
|
import gearth.protocol.HConnection;
|
|
import gearth.protocol.connection.proxy.ProxyProviderFactory;
|
|
import gearth.protocol.connection.proxy.SocksConfiguration;
|
|
import gearth.ui.SubForm;
|
|
import gearth.ui.subforms.connection.ConnectionController;
|
|
import gearth.ui.subforms.extensions.ExtensionsController;
|
|
import gearth.ui.subforms.extra.ExtraController;
|
|
import gearth.ui.subforms.info.InfoController;
|
|
import gearth.ui.subforms.injection.InjectionController;
|
|
import gearth.ui.subforms.logger.LoggerController;
|
|
import gearth.ui.subforms.logger.loggerdisplays.PacketLoggerFactory;
|
|
import gearth.ui.subforms.scheduler.SchedulerController;
|
|
import gearth.ui.subforms.tools.ToolsController;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import javafx.collections.ObservableList;
|
|
import javafx.scene.control.Tab;
|
|
import javafx.scene.control.TabPane;
|
|
import javafx.scene.paint.Color;
|
|
import javafx.stage.Stage;
|
|
|
|
public class GEarthController {
|
|
public Tab tab_Logger;
|
|
public TabPane tabBar;
|
|
private Stage stage = null;
|
|
private volatile HConnection hConnection;
|
|
private volatile int initcount = 0;
|
|
public ConnectionController connectionController;
|
|
public InjectionController injectionController;
|
|
public LoggerController loggerController;
|
|
public ToolsController toolsController;
|
|
public SchedulerController schedulerController;
|
|
public ExtraController extraController;
|
|
public InfoController infoController;
|
|
public ExtensionsController extensionsController;
|
|
private List<SubForm> tabs = null;
|
|
|
|
public GEarthController() {
|
|
SocksConfiguration temporary_socks = new SocksConfiguration(){
|
|
|
|
@Override
|
|
public boolean useSocks() {
|
|
return false;
|
|
}
|
|
|
|
@Override
|
|
public int getSocksPort() {
|
|
return 0;
|
|
}
|
|
|
|
@Override
|
|
public String getSocksHost() {
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public boolean onlyUseIfNeeded() {
|
|
return true;
|
|
}
|
|
};
|
|
ProxyProviderFactory.setSocksConfig(temporary_socks);
|
|
this.hConnection = new HConnection();
|
|
}
|
|
|
|
/*
|
|
* WARNING - Removed try catching itself - possible behaviour change.
|
|
*/
|
|
public void initialize() {
|
|
this.tabs = new ArrayList<SubForm>();
|
|
this.tabs.add(this.connectionController);
|
|
this.tabs.add(this.injectionController);
|
|
this.tabs.add(this.loggerController);
|
|
this.tabs.add(this.toolsController);
|
|
this.tabs.add(this.schedulerController);
|
|
this.tabs.add(this.extensionsController);
|
|
this.tabs.add(this.extraController);
|
|
this.tabs.add(this.infoController);
|
|
GEarthController gEarthController = this;
|
|
synchronized (gEarthController) {
|
|
this.trySetController();
|
|
}
|
|
ObservableList uiTabs = this.tabBar.getTabs();
|
|
int i = 0;
|
|
while (i < uiTabs.size()) {
|
|
Tab tab = (Tab)uiTabs.get(i);
|
|
int[] ii = new int[]{i++};
|
|
tab.setOnSelectionChanged(event -> {
|
|
if (tab.isSelected()) {
|
|
this.tabs.get(ii[0]).onTabOpened();
|
|
}
|
|
});
|
|
}
|
|
if (PacketLoggerFactory.usesUIlogger()) {
|
|
this.tabBar.getTabs().remove((Object)this.tab_Logger);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* WARNING - Removed try catching itself - possible behaviour change.
|
|
*/
|
|
public void setStage(Stage stage) {
|
|
this.stage = stage;
|
|
GEarthController gEarthController = this;
|
|
synchronized (gEarthController) {
|
|
this.trySetController();
|
|
}
|
|
}
|
|
|
|
private void trySetController() {
|
|
if (++this.initcount == 2) {
|
|
GEarthController self = this;
|
|
this.extensionsController.setParentController(self);
|
|
this.tabs.forEach(subForm -> {
|
|
if (subForm != this.extensionsController) {
|
|
subForm.setParentController(self);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
public Stage getStage() {
|
|
return this.stage;
|
|
}
|
|
|
|
HConnection getHConnection() {
|
|
return this.hConnection;
|
|
}
|
|
|
|
void writeToLog(Color color, String text) {
|
|
this.loggerController.miniLogText(color, text);
|
|
}
|
|
|
|
public void exit() {
|
|
this.tabs.forEach(SubForm::exit);
|
|
this.hConnection.abort();
|
|
}
|
|
}
|
|
|