(fix) quickplay mod

This commit is contained in:
kirillsaint 2024-05-01 13:31:45 +06:00
parent 21d1d57f34
commit 84fdf9d5c8
5 changed files with 23 additions and 4 deletions

View File

@ -61,7 +61,6 @@ public class EmotesMod extends Mod {
EmotesMod.sending = true;
(new Thread("EMOTES BIND:" + bind.emoteId) {
public void run() {
Client.logger.info("bind found");
EmoteSocket.get().startEmote(bind.emoteId);
try {
Thread.sleep(2000L);
@ -71,8 +70,6 @@ public class EmotesMod extends Mod {
EmotesMod.sending = false;
}
}).start();
} else {
Client.logger.info("bind not found");
}
}
}

View File

@ -452,11 +452,13 @@ public class ModSettings extends SilentScreen {
}
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
setting.setValString(this.silentInputs.get(inputIndex).getValue());
mod.onChangeSettingValue(setting);
inputIndex++;
}
if (setting.isKeybind() && !setting.getName().startsWith("Quickplay Mode")) {
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
setting.setKeybind(this.silentInputs.get(inputIndex).getKey());
mod.onChangeSettingValue(setting);
inputIndex++;
}
}

View File

@ -370,12 +370,14 @@ public class ModSettings extends SilentScreen {
}
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
setting.setValString(this.silentInputs.get(inputIndex).getValue());
mod.onChangeSettingValue(setting);
inputIndex++;
}
if (setting.isKeybind() && !setting.getName().startsWith("Quickplay Mode")) {
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
setting.setKeybind(this.silentInputs.get(inputIndex).getKey());
mod.onChangeSettingValue(setting);
inputIndex++;
}
}

View File

@ -14,6 +14,7 @@ import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
import net.silentclient.client.gui.theme.Theme;
import net.silentclient.client.gui.theme.input.DefaultInputTheme;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.mods.Setting;
import net.silentclient.client.mods.hypixel.QuickPlayMod;
import net.silentclient.client.mods.util.Server;
import net.silentclient.client.utils.MenuBlurUtils;
@ -180,7 +181,9 @@ public class QuickplayModeGui extends SilentScreen {
for(QuickPlayMod.QuickplayCommandType quickplayMode : quickplayMode.modes) {
if(silentInputs.get(inputIndex).isFocused()) {
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
Client.getInstance().getSettingsManager().getSettingByClass(QuickPlayMod.class, String.format("Quickplay Mode&%s&%s", Server.isRuHypixel() ? "RuHypixel" : "Hypixel", quickplayMode.command)).setKeybind(this.silentInputs.get(inputIndex).getKey());
Setting setting = Client.getInstance().getSettingsManager().getSettingByClass(QuickPlayMod.class, String.format("Quickplay Mode&%s&%s", Server.isRuHypixel() ? "RuHypixel" : "Hypixel", quickplayMode.command));
setting.setKeybind(this.silentInputs.get(inputIndex).getKey());
Client.getInstance().getModInstances().getModByClass(QuickPlayMod.class).onChangeSettingValue(setting);
if(keyCode == Keyboard.KEY_ESCAPE) {
neededKeyCheck = false;
break;

View File

@ -35,6 +35,7 @@ public class QuickPlayMod extends Mod {
this.addKeybindSetting("Open Menu", this, Keyboard.KEY_MINUS);
initHypixelModes();
initRuHypixelModes();
updateHashMap();
}
private void initHypixelModes() {
@ -148,6 +149,20 @@ public class QuickPlayMod extends Mod {
}
}
@Override
public void onEnable() {
super.onEnable();
updateHashMap();
}
@Override
public void onDisable() {
super.onDisable();
updateHashMap();
}
public class QuickplayModeType {
public String name;
public String icon;