This commit is contained in:
kirillsaint 2023-11-06 14:42:21 +06:00
parent 09e8dbf8d8
commit f486c61926
27 changed files with 23 additions and 168 deletions

View File

@ -34,7 +34,6 @@ public class AddConfigModal extends SilentScreen {
@Override
public void initGui() {
MenuBlurUtils.loadBlur();
defaultCursor = false;
this.cloneConfig = false;
int x = width / 2 - (this.modalWidth / 2);
@ -103,11 +102,6 @@ public class AddConfigModal extends SilentScreen {
}
}
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) {

View File

@ -1,6 +1,5 @@
package net.silentclient.client.config;
import net.minecraft.client.Minecraft;
import net.silentclient.client.Client;
import net.silentclient.client.gui.hud.ScreenPosition;
import net.silentclient.client.gui.notification.NotificationManager;
@ -9,7 +8,6 @@ import net.silentclient.client.mods.ModDraggable;
import net.silentclient.client.mods.Setting;
import net.silentclient.client.mods.player.AutoTextMod.AutoTextCommand;
import net.silentclient.client.utils.FileUtils;
import net.silentclient.client.utils.MenuBlurUtils;
import java.awt.*;
import java.io.*;
@ -170,15 +168,6 @@ public final class ConfigManager {
if (set.isCheck()) {
try {
set.setValBoolean(Boolean.parseBoolean(args[3]));
if(set.getName() == "Menu Background Blur") {
if(Minecraft.getMinecraft().currentScreen != null) {
if(!set.getValBoolean()) {
MenuBlurUtils.unloadBlur(true);
} else {
MenuBlurUtils.loadBlur(true);
}
}
}
} catch (Exception err) {
}

View File

@ -45,8 +45,6 @@ public class CosmeticsGui extends SilentScreen {
defaultCursor = false;
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
} else {
MenuBlurUtils.loadBlur();
}
this.silentInputs.add(new Input("Search"));
CosmeticsGui.selectedCategory = "capes";

View File

@ -35,8 +35,6 @@ public class NewOutfitModal extends SilentScreen {
public void initGui() {
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
} else {
MenuBlurUtils.loadBlur();
}
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
@ -113,11 +111,6 @@ public class NewOutfitModal extends SilentScreen {
this.silentInputs.get(0).onClick(mouseX, mouseY, x + 3, y + 23, this.modalWidth - 6);
}
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) {

View File

@ -40,8 +40,6 @@ public class OutfitsGui extends SilentScreen {
defaultCursor = false;
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
} else {
MenuBlurUtils.loadBlur();
}
int width = 255;
int height = 200;
@ -246,10 +244,4 @@ public class OutfitsGui extends SilentScreen {
mc.displayGuiScreen(parentScreen);
}
}
@Override
public void onGuiClosed() {
super.onGuiClosed();
MenuBlurUtils.unloadBlur();
}
}

View File

@ -34,7 +34,6 @@ public class ModalBase extends GuiScreen {
@Override
public void initGui() {
MenuBlurUtils.loadBlur();
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
this.buttonList.add(new IconButton(0, x + this.modalWidth - 14 - 3, y + 3, 14, 14, 8, 8, new ResourceLocation("silentclient/icons/exit.png")));
@ -63,11 +62,7 @@ public class ModalBase extends GuiScreen {
public int getContentY() {
return height / 2 - (this.modalHeight / 2);
}
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {

View File

@ -33,7 +33,6 @@ public class AddFriendModal extends SilentScreen {
@Override
public void initGui() {
MenuBlurUtils.loadBlur();
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
this.buttonList.add(new IconButton(1, x + this.modalWidth - 14 - 3, y + 3, 14, 14, 8, 8, new ResourceLocation("silentclient/icons/exit.png")));
@ -92,12 +91,6 @@ public class AddFriendModal extends SilentScreen {
this.silentInputs.get(0).onClick(mouseX, mouseY, x + 3, y + 23, this.modalWidth - 6);
}
@Override
public void onGuiClosed() {
super.onGuiClosed();
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) {

View File

@ -42,7 +42,6 @@ public class FriendsListOverlay extends SilentScreen {
this.introAnimation = new SimpleAnimation(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Animations").getValBoolean() ? -150 : 0);
Client.getInstance().updateFriendsList();
this.scrollY = 0;
MenuBlurUtils.loadBlur();
this.buttonList.add(new IconButton(1, 133, 6, 14, 14, 8, 8, new ResourceLocation("silentclient/icons/exit.png")));
this.buttonList.add(new Button(2, 3, 26, 70, 15, "Friends", 12, false, !showRequests ? new SelectedButtonTheme() : new DefaultButtonTheme()));
@ -240,10 +239,4 @@ public class FriendsListOverlay extends SilentScreen {
}
}
}
@Override
public void onGuiClosed() {
super.onGuiClosed();
MenuBlurUtils.unloadBlur();
}
}

View File

@ -40,7 +40,6 @@ public class HUDConfigScreen extends GuiScreen {
@Override
public void initGui() {
MenuBlurUtils.loadBlur();
super.initGui();
this.mod = null;
@ -170,7 +169,6 @@ public class HUDConfigScreen extends GuiScreen {
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
Client.getInstance().configManager.save();
for(Mod m : Client.getInstance().getModInstances().getMods()) {
if(m instanceof ModDraggable) {

View File

@ -70,7 +70,6 @@ public class ClickGUI extends SilentScreen {
defaultCursor = false;
Client.getInstance().configManager.updateConfigs();
ClickGUI.scrollY = 0;
MenuBlurUtils.loadBlur();
this.silentInputs.add(new Input("Search"));
int categoryOffsetY = 25;
int addX = 190;
@ -476,9 +475,8 @@ public class ClickGUI extends SilentScreen {
}
@Override
public void onGuiClosed() {
public void onGuiClosed() {
super.onGuiClosed();
Client.getInstance().configManager.save();
MenuBlurUtils.unloadBlur();
}
}
}

View File

@ -66,7 +66,6 @@ public class GuiColorPicker extends SilentScreen {
colors.add(new Color(243,140,170));
colors.add(new Color(198,79,189));
colors.add(new Color(137,50,183));
MenuBlurUtils.loadBlur();
int addX = 190;
int addY = 110;
int x = (width / 2) - addX;
@ -81,7 +80,6 @@ public class GuiColorPicker extends SilentScreen {
if(mod.getName() == "Pack Tweaks" && mod.isEnabled()) {
mc.renderGlobal.loadRenderers();
}
MenuBlurUtils.unloadBlur();
super.onGuiClosed();
}

View File

@ -53,7 +53,6 @@ public class ModSettings extends SilentScreen {
public void initGui() {
this.initTime = System.currentTimeMillis();
scrollAnimation.setValue(0);
MenuBlurUtils.loadBlur();
defaultCursor = false;
int addX = 190;
int addY = 110;
@ -76,7 +75,6 @@ public class ModSettings extends SilentScreen {
@Override
public void onGuiClosed() {
Client.getInstance().configManager.save();
MenuBlurUtils.unloadBlur();
int inputIndex = 0;
for (Setting setting : Client.getInstance().getSettingsManager().getSettingByMod(mod)) {
if (setting.isInput()) {

View File

@ -33,7 +33,6 @@ public class GuiIngameMenu extends SilentScreen
*/
public void initGui()
{
// MenuBlurUtils.loadBlur();
this.buttonList.clear();
int i = -16;
this.buttonList.add(new Button(1, this.width / 2 - 100, this.height / 4 + 120 + i, "Save and Quit to Title", true));

View File

@ -44,8 +44,6 @@ public class ColorPicker extends SilentScreen {
this.buttonList.clear();
this.silentInputs.clear();
MenuBlurUtils.loadBlur();
ModMenu.initBaseButtons(this.buttonList);
this.buttonList.add(new Button(1, 3, 26, 144, 15, "Back"));
this.buttonList.add(new Button(2, 3, this.height - 18, mod.getCategory() == ModCategory.MODS ? 70 : 144, 15, "Reset"));
@ -189,6 +187,5 @@ public class ColorPicker extends SilentScreen {
if(mod.getName() == "Pack Tweaks" && mod.isEnabled()) {
mc.renderGlobal.loadRenderers();
}
MenuBlurUtils.unloadBlur();
}
}

View File

@ -68,7 +68,6 @@ public class ModMenu extends SilentScreen {
introAnimation = new SimpleAnimation(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Animations").getValBoolean() ? -150 : 0);
}
Client.getInstance().configManager.updateConfigs();
MenuBlurUtils.loadBlur();
this.buttonList.clear();
this.silentInputs.clear();
@ -506,7 +505,6 @@ public class ModMenu extends SilentScreen {
public void onGuiClosed() {
super.onGuiClosed();
Client.getInstance().configManager.save();
MenuBlurUtils.unloadBlur();
}
private ArrayList<Mod> getMods() {

View File

@ -54,7 +54,6 @@ public class ModSettings extends SilentScreen {
this.initTime = System.currentTimeMillis();
scrollY = 0;
scrollAnimation.setValue(0);
MenuBlurUtils.loadBlur();
ModMenu.initBaseButtons(this.buttonList);
@ -378,7 +377,6 @@ public class ModSettings extends SilentScreen {
}
}
Client.getInstance().configManager.save();
MenuBlurUtils.unloadBlur();
}
@Override

View File

@ -32,8 +32,6 @@ public class PremiumColorPicker extends SilentScreen {
this.buttonList.clear();
this.silentInputs.clear();
MenuBlurUtils.loadBlur();
ModMenu.initBaseButtons(this.buttonList);
this.buttonList.add(new Button(1, 3, 26, 144, 15, "Back"));
@ -140,10 +138,4 @@ public class PremiumColorPicker extends SilentScreen {
mc.displayGuiScreen(parentScreen);
}
}
@Override
public void onGuiClosed() {
super.onGuiClosed();
MenuBlurUtils.unloadBlur();
}
}

View File

@ -48,8 +48,6 @@ public class AddServerGui extends SilentScreen {
public void initGui() {
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
} else {
MenuBlurUtils.loadBlur();
}
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
@ -142,11 +140,6 @@ public class AddServerGui extends SilentScreen {
this.silentInputs.get(1).onClick(mouseX, mouseY, x + 3, y + 23 + 25, this.modalWidth - 6);
}
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) {

View File

@ -38,8 +38,6 @@ public class DirectConnectGui extends SilentScreen {
serverData = new ServerData("", "", false);
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
} else {
MenuBlurUtils.loadBlur();
}
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
@ -115,11 +113,6 @@ public class DirectConnectGui extends SilentScreen {
this.silentInputs.get(0).onClick(mouseX, mouseY, x + 3, y + 23, this.modalWidth - 6);
}
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) {

View File

@ -29,7 +29,6 @@ public class QuickplayGui extends SilentScreen {
@Override
public void initGui() {
super.initGui();
MenuBlurUtils.loadBlur();
defaultCursor = false;
this.scrollY = 0;
this.buttonList.clear();
@ -145,10 +144,4 @@ public class QuickplayGui extends SilentScreen {
break;
}
}
@Override
public void onGuiClosed() {
super.onGuiClosed();
MenuBlurUtils.unloadBlur();
}
}

View File

@ -38,7 +38,6 @@ public class QuickplayModeGui extends SilentScreen {
public void initGui() {
super.initGui();
this.scrollY = 0;
MenuBlurUtils.loadBlur();
defaultCursor = false;
this.buttonList.clear();
this.silentInputs.clear();
@ -198,6 +197,5 @@ public class QuickplayModeGui extends SilentScreen {
public void onGuiClosed() {
super.onGuiClosed();
Client.getInstance().getConfigManager().save();
MenuBlurUtils.unloadBlur();
}
}

View File

@ -7,7 +7,6 @@ import net.silentclient.client.Client;
import net.silentclient.client.event.EventManager;
import net.silentclient.client.gui.animation.SimpleAnimation;
import net.silentclient.client.gui.hud.ScreenPosition;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.RawInputHandler;
@ -78,13 +77,6 @@ public class Mod implements IMod {
if(setting.getName() == "Raw Mouse Input") {
RawInputHandler.toggleRawInput(setting.getValBoolean());
}
if(setting.getName() == "Menu Background Blur") {
if(setting.getValBoolean()) {
MenuBlurUtils.unloadBlur();
} else {
MenuBlurUtils.loadBlur();
}
}
}
if(setting.isCheck()) {
setting.setValBoolean(setting.defaultbval);

View File

@ -249,7 +249,6 @@ public class AutoTextMod extends Mod {
@Override
public void initGui() {
MenuBlurUtils.loadBlur();
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
this.buttonList.add(new IconButton(1, x + this.modalWidth - 14 - 3, y + 3, 14, 14, 8, 8, new ResourceLocation("silentclient/icons/exit.png")));
@ -311,11 +310,6 @@ public class AutoTextMod extends Mod {
this.silentInputs.get(1).onClick(mouseX, mouseY, x + 3, y + 46, this.modalWidth - 6);
}
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
}
@Override
protected void keyTyped(char typedChar, int keyCode) throws IOException {
if (keyCode == Keyboard.KEY_ESCAPE) {

View File

@ -50,13 +50,6 @@ public class GeneralMod extends Mod {
case "Raw Mouse Input":
RawInputHandler.toggleRawInput(setting.getValBoolean());
break;
case "Menu Background Blur":
if(setting.getValBoolean()) {
MenuBlurUtils.loadBlur(true);
} else {
MenuBlurUtils.unloadBlur(true);
}
break;
case "Menu Animations":
case "Menu Animations Speed":
if(ClickGUI.introAnimation != null) {

View File

@ -161,7 +161,6 @@ public class PremiumGui {
colors.add(new Color(243,140,170));
colors.add(new Color(198,79,189));
colors.add(new Color(137,50,183));
MenuBlurUtils.loadBlur();
int addX = 190;
int addY = 110;
int x = (width / 2) - addX;
@ -173,7 +172,6 @@ public class PremiumGui {
@Override
public void onGuiClosed() {
MenuBlurUtils.unloadBlur();
super.onGuiClosed();
}

View File

@ -28,32 +28,30 @@ public class HypixelUtils {
return result;
} else if(!isLoading) {
isLoading = true;
(new Thread() {
public void run() {
try {
String content = Requests.get("https://hypixel.silentclient.net/uuid/" + id.toString() + ".json");
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
(new Thread(() -> {
try {
String content = Requests.get("https://hypixel.silentclient.net/uuid/" + id.toString() + ".json");
GsonBuilder builder = new GsonBuilder();
Gson gson = builder.create();
HypixelProxyResponse response = gson.fromJson(content, HypixelProxyResponse.class);
if(response != null && !response.error) {
levelCache.put(id, Integer.toString(response.level));
} else {
levelCache.put(id, "null");
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
Client.logger.catching(e);
}
HypixelUtils.isLoading = false;
} catch (Exception e) {
Client.logger.catching(e);
HypixelProxyResponse response = gson.fromJson(content, HypixelProxyResponse.class);
if(response != null && !response.error) {
levelCache.put(id, Integer.toString(response.level));
} else {
levelCache.put(id, "null");
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
Client.logger.catching(e);
}
HypixelUtils.isLoading = false;
} catch (Exception e) {
Client.logger.catching(e);
levelCache.put(id, "null");
}
}).start();
})).start();
}
return null;

View File

@ -9,16 +9,6 @@ import net.silentclient.client.mods.settings.GeneralMod;
import java.awt.*;
public class MenuBlurUtils {
public static void loadBlur() {
loadBlur(false);
}
public static void loadBlur(boolean force) {
// if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean() || force) {
// ((EntityRendererExt) Minecraft.getMinecraft().entityRenderer).silent$loadShader(new StaticResourceLocation("shaders/post/menu_blur.json"));
// }
}
public static void renderBackground(GuiScreen instance) {
if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean()) {
BlurUtil.blur2(0, 0, 1920, 1080, 0, 0);
@ -27,14 +17,4 @@ public class MenuBlurUtils {
instance.drawDefaultBackground();
}
}
public static void unloadBlur() {
unloadBlur(false);
}
public static void unloadBlur(boolean force) {
// if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Background Blur").getValBoolean() || force) {
// Minecraft.getMinecraft().entityRenderer.loadEntityShader(null);
// }
}
}