package wtf.expensive;
import viamcp.ViaMCP;
import wtf.expensive.Logger.DiscordWebhook;
import wtf.expensive.Logger.cfg;
import wtf.expensive.command.CommandManager;
import wtf.expensive.command.macro.MacroManager;
import wtf.expensive.config.ConfigManager;
import wtf.expensive.event.Event;
import wtf.expensive.event.EventListener;
import wtf.expensive.event.EventProtocol;
import wtf.expensive.event.impl.player.EventMouseTick;
import wtf.expensive.friendSystem.FriendManager;
import wtf.expensive.modules.Module;
import wtf.expensive.modules.ModuleManager;
import wtf.expensive.styles.StyleConfig;
import wtf.expensive.styles.StyleManager;
import wtf.expensive.ui.csgo.CSGui;
import wtf.expensive.ui.expclickgui.ExpGui;
import wtf.expensive.utility.drag.DragManager;
import wtf.expensive.utility.drag.Dragging;
import wtf.expensive.utility.math.ScaleMath;
import wtf.expensive.utility.util.SoundUtility;
import static wtf.expensive.utility.Utility.mc;
public class Expensive {
public static final Expensive instance = new Expensive();
public String VERSION = "1";
private final ScaleMath scaleMath = new ScaleMath(2);
public static Profile profile;
public static double balance;
DiscordWebhook webhook;
private final EventProtocol<Event> eventProtocol = new EventProtocol<>();
private ModuleManager moduleManager;
public FriendManager friendManager;
public CSGui csGui;
public ExpGui expgui;
public ModuleManager ModuleManager;
public CommandManager commandManager;
public MacroManager macroManager;
public StyleManager styleManager;
public ConfigManager config;
private DiscordWebhook webhookLogger;
public void init() {
styleManager = new StyleManager();
moduleManager = new ModuleManager();
moduleManager.arraylist.sorted = moduleManager.getModules();
csGui = new CSGui();
expgui = new ExpGui();
commandManager = new CommandManager();
try {
config = new ConfigManager();
macroManager = new MacroManager();
macroManager.init();
friendManager = new FriendManager();
friendManager.init();
StyleConfig.load();
} catch (Exception e) {
e.printStackTrace();
}
DragManager.load();
ViaMCP.init();
eventProtocol.register(this);
}
public Expensive() {
this.webhook = cfg.connection;
}
public void keyTyped(int key) {
for (Module m : moduleManager.getModules()) {
if (m.bind == key) {
m.toggle();
}
}
if (macroManager != null) {
macroManager.onKeyPressed(key);
}
}
private final EventListener<EventMouseTick> onTickMouse = event -> {
for (Module m : moduleManager.getModules()) {
if (m.mouseBind == event.getButton() && event.getButton() > 2) {
m.toggle();
}
}
};
public static Expensive getInstance() {
return instance;
}
public void onWelcomeUI() {
mc.displayGuiScreen(new WelcomeGUI());
SoundUtility.playSound("kill.wav", 4);
mc.player.sendChatMessage(".help");
}
public ModuleManager getModuleManager() {
return moduleManager;
}
public EventProtocol<Event> getEventProtocol() {
return eventProtocol;
}
public Dragging createDrag(Module module, String name, float x, float y) {
DragManager.draggables.put(name, new Dragging(module, name, x, y));
return DragManager.draggables.get(name);
}
public ScaleMath getScaleMath() {
return scaleMath;
}
}