Merge pull request #26 from Silent-Client/TEST2

Test2
This commit is contained in:
kirillsaint 2023-08-25 00:04:56 +06:00 committed by GitHub
commit 930367bb4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 436 additions and 69 deletions

View File

@ -26,6 +26,7 @@ import net.silentclient.client.mixin.accessors.MinecraftAccessor;
import net.silentclient.client.mods.ModInstances;
import net.silentclient.client.mods.SettingsManager;
import net.silentclient.client.mods.settings.FPSBoostMod;
import net.silentclient.client.mods.settings.GeneralMod;
import net.silentclient.client.mods.util.PingSource;
import net.silentclient.client.mods.util.Utils;
import net.silentclient.client.premium.PremiumCosmeticsGui;
@ -443,7 +444,7 @@ public class Client {
banerror = true;
}
}
if(keyBindManager.CLICKGUI.isPressed()) {
if(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Mod Menu Keybind").isKeyDown()) {
Minecraft.getMinecraft().displayGuiScreen(Client.getInstance().getGlobalSettings().isLite() ? new ClickGUI() : new ModMenu());
}

View File

@ -14,6 +14,7 @@ import net.silentclient.client.gui.font.SilentFontRenderer;
import net.silentclient.client.gui.lite.clickgui.utils.RenderUtils;
import net.silentclient.client.gui.theme.Theme;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.NotificationUtils;
import org.lwjgl.input.Keyboard;
@ -34,6 +35,7 @@ public class AddConfigModal extends SilentScreen {
@Override
public void initGui() {
MenuBlurUtils.loadBlur();
defaultCursor = false;
this.cloneConfig = false;
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
@ -67,6 +69,7 @@ public class AddConfigModal extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MenuBlurUtils.renderBackground(this);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
GlStateManager.pushMatrix();
int x = width / 2 - (this.modalWidth / 2);
int y = height / 2 - (this.modalHeight / 2);
@ -78,6 +81,11 @@ public class AddConfigModal extends SilentScreen {
// Content
this.silentInputs.get(0).render(mouseX, mouseY, x + 3, y + 23, this.modalWidth - 6);
Checkbox.render(mouseX, mouseY, x + 3, y + 50, "Clone Current Config", cloneConfig);
if(Checkbox.isHovered(mouseX, mouseY, x + 3, y + 50)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
super.drawScreen(mouseX, mouseY, partialTicks);

View File

@ -1,16 +1,5 @@
package net.silentclient.client.config;
import java.awt.Color;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import net.minecraft.client.Minecraft;
import net.silentclient.client.Client;
import net.silentclient.client.gui.hud.ScreenPosition;
@ -21,6 +10,12 @@ import net.silentclient.client.mods.Setting;
import net.silentclient.client.mods.player.AutoTextMod.AutoTextCommand;
import net.silentclient.client.utils.MenuBlurUtils;
import java.awt.*;
import java.io.*;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public final class ConfigManager {
public File configFile;
@ -175,6 +170,13 @@ public final class ConfigManager {
}
}
if(set.isKeybind()) {
try {
set.setKeybind(Integer.parseInt(args[3]));
} catch (Exception err) {
}
}
if (set.isCombo()) {
try {
if(set.getOptions().contains(args[3])) {
@ -259,6 +261,9 @@ public final class ConfigManager {
if(set.isInput()) {
writer.println("SET:" + set.getName() + ":" + set.getParentMod().getName() + ":" + set.getValString());
}
if(set.isKeybind()) {
writer.println("SET:" + set.getName() + ":" + set.getParentMod().getName() + ":" + set.getKeybind());
}
}
for(AutoTextCommand command : Client.getInstance().getModInstances().getAutoText().getCommands()) {

View File

@ -24,6 +24,7 @@ import net.silentclient.client.mods.settings.GeneralMod;
import net.silentclient.client.gui.theme.button.DefaultButtonTheme;
import net.silentclient.client.gui.theme.button.SelectedButtonTheme;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import net.silentclient.client.utils.types.PlayerResponse.Account.Cosmetics.CosmeticItem;
import org.lwjgl.input.Mouse;
@ -43,6 +44,7 @@ public class CosmeticsGui extends SilentScreen {
@Override
public void initGui() {
rotate = 144;
defaultCursor = false;
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
} else {
@ -234,6 +236,7 @@ public class CosmeticsGui extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
if(mc.thePlayer == null) {
GlStateManager.disableAlpha();
Client.backgroundPanorama.renderSkybox(mouseX, mouseY, partialTicks);
@ -306,7 +309,9 @@ public class CosmeticsGui extends SilentScreen {
if(items != null) {
for(CosmeticItem m : items) {
RenderUtil.drawRoundedOutline(x + 100, y + modOffsetY + scrollAnimation.getValue(), 135, 28, 10, 2, selected_item.contains(m.getId()) ? new Color(32, 252, 3).getRGB() : new Color(252, 3, 3).getRGB());
if(MouseUtils.isInside(mouseX, mouseY, x + 100, y + modOffsetY + scrollAnimation.getValue(), 135, 28)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
GL11.glDisable((int) 2929);
GL11.glEnable((int) 3042);
GL11.glDepthMask((boolean) false);
@ -357,6 +362,8 @@ public class CosmeticsGui extends SilentScreen {
if(selectedCategory == "icons" && can_show) {
RenderUtil.drawImage(Client.getInstance().getAccount().getSelectedIcon() != 0 && !Client.getInstance().getAccount().plusIcon() ? Client.getInstance().getCosmetics().getIconById(Client.getInstance().getAccount().getSelectedIcon()).getLocation() : new ResourceLocation(Client.getInstance().getAccount().plusIcon() ? "silentclient/icons/plus_icon.png" : "silentclient/icons/player_icon.png"), x + 285, y + ((height / 2) - 25), 50, 50, false);
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
final Scroll scroll = MouseUtils.scroll();

View File

@ -16,6 +16,7 @@ import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
import net.silentclient.client.gui.theme.Theme;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.types.PlayerResponse;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
@ -38,6 +39,7 @@ public class OutfitsGui extends SilentScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.scrollY = 0;
if(mc.thePlayer == null) {
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
@ -53,6 +55,7 @@ public class OutfitsGui extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
if(mc.thePlayer == null) {
GlStateManager.disableAlpha();
Client.backgroundPanorama.renderSkybox(mouseX, mouseY, partialTicks);
@ -84,6 +87,7 @@ public class OutfitsGui extends SilentScreen {
int outfitIndex = 0;
boolean isCreateHovered = MouseUtils.isInside(mouseX, mouseY, outfitX, outfitY, 80, 80);
if(isCreateHovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
RenderUtil.drawRoundedRect(outfitX, outfitY, 80, 80, 3, new Color(255, 255, 255, 30).getRGB());
}
RenderUtil.drawRoundedOutline(outfitX, outfitY, 80, 80, 3, 1, Theme.borderColor().getRGB());
@ -94,6 +98,7 @@ public class OutfitsGui extends SilentScreen {
for(Outfits.Outfit outfit : Outfits.getOutfits()) {
boolean isHovered = MouseUtils.isInside(mouseX, mouseY, outfitX, outfitY, 80, 80) && !MouseUtils.isInside(mouseX, mouseY, outfitX + 80 - 3 - 10, outfitY + 3, 10, 10);
if(isHovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
RenderUtil.drawRoundedRect(outfitX, outfitY, 80, 80, 3, new Color(255, 255, 255, 30).getRGB());
}
RenderUtil.drawRoundedOutline(outfitX, outfitY, 80, 80, 3, 1, Theme.borderColor().getRGB());
@ -166,6 +171,7 @@ public class OutfitsGui extends SilentScreen {
outfitX += 83;
}
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glPopMatrix();

View File

@ -1,19 +1,29 @@
package net.silentclient.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.silentclient.client.Client;
import net.silentclient.client.gui.elements.Button;
import net.silentclient.client.gui.elements.Input;
import net.silentclient.client.mods.settings.GeneralMod;
import net.silentclient.client.utils.MouseCursorHandler;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class SilentScreen extends GuiScreen {
protected boolean defaultCursor = true;
protected ArrayList<Input> silentInputs = new ArrayList<>();
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
super.drawScreen(mouseX, mouseY, partialTicks);
if(defaultCursor) {
Client.getInstance().getMouseCursorHandler().enableCursor(getCursor(silentInputs, buttonList));
}
}
public static MouseCursorHandler.CursorType getCursor(ArrayList<Input> silentInputs, List<GuiButton> buttonList) {
MouseCursorHandler.CursorType cursorType = MouseCursorHandler.CursorType.NORMAL;
for(Input input : silentInputs) {
@ -22,7 +32,13 @@ public class SilentScreen extends GuiScreen {
}
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
for(GuiButton button : buttonList) {
if(button instanceof Button && button.isMouseOver() && !(((Button) button).escMenu && Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Vanilla ESC Menu Layout").getValBoolean())) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
return cursorType;
}
@Override

View File

@ -19,7 +19,7 @@ public class Button extends GuiButton
{
protected int animatedOpacity = 0;
private boolean escMenu = false;
public boolean escMenu = false;
private int fontSize;
protected TimerUtils animateTimer = new TimerUtils();

View File

@ -66,6 +66,10 @@ public class Input {
}
public void render(int mouseX, int mouseY, float x, float y, int width, boolean small, IInputTheme theme) {
this.render(mouseX, mouseY, x, y, width, small, theme, false);
}
public void render(int mouseX, int mouseY, float x, float y, int width, boolean small, IInputTheme theme, boolean center) {
int borderColor = theme.getBorderColor().getRGB();
if(MouseUtils.isInside(mouseX, mouseY, x, y, width, 20)) {
borderColor = theme.getHoveredBorderColor().getRGB();
@ -95,7 +99,11 @@ public class Input {
ColorUtils.setColor(theme.getFocusedBorderColor().getRGB());
}
}
Client.getInstance().getSilentFontRenderer().drawString(EnumChatFormatting.getTextWithoutFormattingCodes(renderText), x + 2, y + (small ? 1 : 3), small ? 12 : 14, SilentFontRenderer.FontType.TITLE);
float textX = x + 2;
if(center) {
textX = x + (width / 2) - (Client.getInstance().getSilentFontRenderer().getStringWidth(renderText, small ? 12 : 14, SilentFontRenderer.FontType.TITLE) / 2);
}
Client.getInstance().getSilentFontRenderer().drawString(EnumChatFormatting.getTextWithoutFormattingCodes(renderText), textX, y + (small ? 1 : 3), small ? 12 : 14, SilentFontRenderer.FontType.TITLE);
}
public boolean isHovered() {

View File

@ -1,11 +1,11 @@
package net.silentclient.client.gui.friends;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.animation.SimpleAnimation;
import net.silentclient.client.gui.elements.Button;
import net.silentclient.client.gui.elements.IconButton;
@ -20,6 +20,7 @@ import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.mods.settings.GeneralMod;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.types.FriendsResponse;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
@ -27,7 +28,7 @@ import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.io.IOException;
public class FriendsListOverlay extends GuiScreen {
public class FriendsListOverlay extends SilentScreen {
private double scrollY;
private SimpleAnimation scrollAnimation = new SimpleAnimation(0.0F);
private boolean showRequests;
@ -36,6 +37,7 @@ public class FriendsListOverlay extends GuiScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.introAnimation = new SimpleAnimation(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Animations").getValBoolean() ? -150 : 0);
Client.getInstance().updateFriendsList();
this.scrollY = 0;
@ -51,6 +53,7 @@ public class FriendsListOverlay extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MenuBlurUtils.renderBackground(this);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
this.buttonList.get(2).displayString = "Requests (" + Client.getInstance().getFriends().getRequestCount() + ")";
SilentFontRenderer font = Client.getInstance().getSilentFontRenderer();
GlStateManager.pushMatrix();
@ -98,6 +101,9 @@ public class FriendsListOverlay extends GuiScreen {
ColorUtils.setColor(new Color(255, 255, 255, 127).getRGB());
font.drawString(friend.isOnline() ? friend.getCurrentServer().equals("") ? "Online" : "Playing on " + friend.getCurrentServer() : "Offline", 23, friendY + 8, 10, SilentFontRenderer.FontType.TITLE, 108);
RenderUtil.drawImage(new ResourceLocation("silentclient/icons/cross.png"), 135, friendY + 3, 12, 12, false);
if(MouseUtils.isInside(mouseX, mouseY, 135, friendY + 3, 12, 12)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
friendY += 25;
}
} else {
@ -116,11 +122,20 @@ public class FriendsListOverlay extends GuiScreen {
font.drawString(request.isIncoming() ? "Incoming Friend Request" : "Outgoing Friend Request", 23, friendY + 8, 10, SilentFontRenderer.FontType.TITLE);
if(request.isIncoming()) {
RenderUtil.drawImage(new ResourceLocation("silentclient/icons/accept.png"), 120, friendY + 3, 12, 12, false);
if(MouseUtils.isInside(mouseX, mouseY, 120, friendY + 3, 12, 12)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
if(MouseUtils.isInside(mouseX, mouseY, 135, friendY + 3, 12, 12)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
RenderUtil.drawImage(new ResourceLocation("silentclient/icons/cross.png"), 135, friendY + 3, 12, 12, false);
friendY += 25;
}
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glPopMatrix();
GlStateManager.popMatrix();

View File

@ -7,6 +7,7 @@ import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.elements.IconButton;
import net.silentclient.client.gui.font.SilentFontRenderer.FontType;
import net.silentclient.client.mods.CustomFontRenderer;
@ -23,6 +24,7 @@ import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import java.io.IOException;
import java.util.ArrayList;
public class HUDConfigScreen extends GuiScreen {
@ -76,7 +78,7 @@ public class HUDConfigScreen extends GuiScreen {
Client.getInstance().getSilentFontRenderer().drawString(0, 36, "selectedMod: " + (this.mod != null ? this.mod.getClass().getName() : "null"), 6, FontType.TITLE);
}
MouseCursorHandler.CursorType cursorType = MouseCursorHandler.CursorType.NORMAL;
MouseCursorHandler.CursorType cursorType = SilentScreen.getCursor(new ArrayList<>(), buttonList);
for(Mod m : Client.getInstance().getModInstances().getMods()) {
if(m.isEnabled() && m instanceof ModDraggable) {

View File

@ -12,6 +12,7 @@ import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.elements.Button;
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.SCTextureManager;
import net.silentclient.client.utils.TimerUtils;
import net.silentclient.client.utils.types.NewsResponse;
@ -59,6 +60,7 @@ public class GuiNews extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
loadPanel();
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
GlStateManager.disableAlpha();
Client.backgroundPanorama.renderSkybox(mouseX, mouseY, partialTicks);
GlStateManager.enableAlpha();
@ -71,6 +73,9 @@ public class GuiNews extends SilentScreen {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
if(imageLocation != null) {
RenderUtil.drawImage(imageLocation, (this.width / 2) - (300 / 2), (this.height / 2) - (168 / 2) - 10, 300, 168, false);
if(MouseUtils.isInside(mouseX, mouseY, (this.width / 2) - (300 / 2), (this.height / 2) - (168 / 2) - 10, 300, 168)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
super.drawScreen(mouseX, mouseY, partialTicks);
@ -85,10 +90,13 @@ public class GuiNews extends SilentScreen {
logoTimer.reset();
}
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
}
@Override
public void initGui() {
defaultCursor = false;
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
this.buttonList.add(new Button(1, (this.width / 2) - (98 / 2), this.height - 30, 98, 20, "Exit"));
super.initGui();

View File

@ -10,10 +10,7 @@ import net.silentclient.client.gui.silentmainmenu.components.AccountPicker;
import net.silentclient.client.gui.theme.button.DefaultButtonTheme;
import net.silentclient.client.gui.theme.button.IButtonTheme;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.AccountManager;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.SCTextureManager;
import net.silentclient.client.utils.TimerUtils;
import net.silentclient.client.utils.*;
import java.awt.*;
import java.awt.image.BufferedImage;
@ -30,7 +27,8 @@ public class LiteAccountPicker extends AccountPicker {
super(x, y);
}
public void draw(Minecraft mc, int mouseX, int mouseY) {
public MouseCursorHandler.CursorType draw(Minecraft mc, int mouseX, int mouseY) {
MouseCursorHandler.CursorType cursorType = null;
IButtonTheme theme = new DefaultButtonTheme();
ColorUtils.setColor(theme.getBackgroundColor().getRGB());
RenderUtil.drawRoundedRect(x, y, 100, 18, 3, theme.getBackgroundColor().getRGB());
@ -53,6 +51,7 @@ public class LiteAccountPicker extends AccountPicker {
Client.getInstance().getSilentFontRenderer().drawString(Client.getInstance().getAccount().original_username, x + 18, y + 9 - 6, 12, SilentFontRenderer.FontType.TITLE, 70);
if(MouseUtils.isInside(mouseX, mouseY, x, y, 100, 18)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
if (this.animatedOpacity < 75 && animateTimer.delay(30)) {
this.animatedOpacity += 15;
animateTimer.reset();
@ -80,6 +79,7 @@ public class LiteAccountPicker extends AccountPicker {
}
if(MouseUtils.isInside(mouseX, mouseY, x, accountY, 100, 18)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
RenderUtil.drawRoundedRect(x, accountY, 100, 18, 3, theme.getHoveredBackgroundColor(75).getRGB());
}
@ -88,6 +88,8 @@ public class LiteAccountPicker extends AccountPicker {
accountY += 18;
}
}
return cursorType;
}
public void onClick(Minecraft mc, int mouseX, int mouseY) {

View File

@ -5,6 +5,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.cosmetics.gui.CosmeticsGui;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.animation.SimpleAnimation;
import net.silentclient.client.gui.elements.Button;
import net.silentclient.client.gui.elements.IconButton;
@ -14,12 +15,13 @@ import net.silentclient.client.gui.silentmainmenu.MainMenuConcept;
import net.silentclient.client.gui.silentmainmenu.components.AccountPicker;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
public class LiteMainMenu extends GuiScreen
public class LiteMainMenu extends SilentScreen
{
private SimpleAnimation bannerAnimation;
private AccountPicker accountPicker;
@ -27,6 +29,7 @@ public class LiteMainMenu extends GuiScreen
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.accountPicker = new LiteAccountPicker(this.width - 100 - 4, 5);
this.bannerAnimation = new SimpleAnimation(0);
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
@ -54,6 +57,7 @@ public class LiteMainMenu extends GuiScreen
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
GuiNews.loadPanel();
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
GlStateManager.disableAlpha();
Client.backgroundPanorama.renderSkybox(mouseX, mouseY, partialTicks);
GlStateManager.enableAlpha();
@ -72,6 +76,7 @@ public class LiteMainMenu extends GuiScreen
if(GuiNews.imageLocation != null) {
if(MouseUtils.isInside(mouseX, mouseY, this.width - 74, this.height - 42, 71, 40)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
this.bannerAnimation.setAnimation(4, 20);
} else {
this.bannerAnimation.setAnimation(0, 30);
@ -79,7 +84,13 @@ public class LiteMainMenu extends GuiScreen
RenderUtil.drawImage(GuiNews.imageLocation, this.width - 74 + (-this.bannerAnimation.getValue()), this.height - 42 + (-this.bannerAnimation.getValue()), 71, 40, false);
}
accountPicker.draw(mc, mouseX, mouseY);
MouseCursorHandler.CursorType accountCursor = accountPicker.draw(mc, mouseX, mouseY);
if(accountCursor != null) {
cursorType = accountCursor;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
super.drawScreen(mouseX, mouseY, partialTicks);
}

View File

@ -29,6 +29,7 @@ import net.silentclient.client.mods.settings.GeneralMod;
import net.silentclient.client.premium.PremiumGui;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import org.lwjgl.Sys;
import org.lwjgl.input.Keyboard;
@ -66,6 +67,7 @@ public class ClickGUI extends SilentScreen {
@Override
public void initGui() {
close = false;
defaultCursor = false;
Client.getInstance().configManager.updateConfigs();
ClickGUI.scrollY = 0;
MenuBlurUtils.loadBlur();
@ -107,6 +109,7 @@ public class ClickGUI extends SilentScreen {
int modOffsetY = 25;
//Draw background
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
GlStateManager.pushMatrix();
GlUtils.startScale(((x) + (x) + width) / 2, ((y) + (y + height)) / 2, (float) introAnimation.getValue());
RenderUtil.drawRoundedRect(x, y, width, height, 10, Theme.backgroundColor().getRGB());
@ -140,6 +143,10 @@ public class ClickGUI extends SilentScreen {
Switch.render(mouseX, mouseY, switchX, switchY, m.switchAniamation, m.isEnabled(), m.isForceDisabled());
}
if(switchHovered || isHovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
if(m.isUpdated() || m.isNew()) {
String status = "UPDATED";
if(m.isNew()) {
@ -162,13 +169,19 @@ public class ClickGUI extends SilentScreen {
Client.getInstance().getSilentFontRenderer().drawString("New Config", x + 110 + (column == 1 ? 0 : 140), y + modOffsetY + 7 - (int) scrollAnimation.getValue(), 14, SilentFontRenderer.FontType.TITLE);
if(MouseUtils.isInside(mouseX, mouseY, x + 100 + (column == 1 ? 0 : 140), y + modOffsetY - scrollAnimation.getValue(), 135, 28)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
modOffsetY+=column == 1 ? 0 : 35;
this.scrollHeight += column == 2 ? 28 : 0;
column = column == 1 ? 2 : 1;
RenderUtil.drawRoundedOutline(x + 100 + (column == 1 ? 0 : 140), y + modOffsetY - scrollAnimation.getValue(), 135, 28, 10, 2, -1);
Client.getInstance().getSilentFontRenderer().drawString("Open Folder", x + 110 + (column == 1 ? 0 : 140), y + modOffsetY + 7 - (int) scrollAnimation.getValue(), 14, SilentFontRenderer.FontType.TITLE);
if(MouseUtils.isInside(mouseX, mouseY, x + 100 + (column == 1 ? 0 : 140), y + modOffsetY - scrollAnimation.getValue(), 135, 28)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
modOffsetY+=column == 1 ? 0 : 35;
this.scrollHeight += column == 2 ? 28 : 0;
column = column == 1 ? 2 : 1;
@ -188,7 +201,9 @@ public class ClickGUI extends SilentScreen {
RenderUtil.drawImage(new ResourceLocation("silentclient/icons/trash-icon.png"), x + 90 + (column == 1 ? 0 : 130) + (column == 1 ? 125 : 135), y + modOffsetY + 7 - scrollAnimation.getValue(), 15, 15, false);
ColorUtils.setColor(new Color(255, 255, 255).getRGB());
Client.getInstance().getSilentFontRenderer().drawString(config.replace(".txt", ""), x + 110 + (column == 1 ? 0 : 140), y + modOffsetY + 7 - (int) scrollAnimation.getValue(), 14, SilentFontRenderer.FontType.TITLE, 45);
if(MouseUtils.isInside(mouseX, mouseY, x + 100 + (column == 1 ? 0 : 140), y + modOffsetY - scrollAnimation.getValue(), 135, 28)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
modOffsetY+=column == 1 ? 0 : 35;
this.scrollHeight += column == 2 ? 28 : 0;
column = column == 1 ? 2 : 1;
@ -222,6 +237,7 @@ public class ClickGUI extends SilentScreen {
if(introAnimation.isDone() && !close) {
loaded = true;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
GlUtils.stopScale();
GlStateManager.popMatrix();

View File

@ -6,6 +6,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.animation.normal.Direction;
import net.silentclient.client.gui.lite.clickgui.utils.GlUtils;
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
@ -20,6 +21,7 @@ import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.Setting;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -28,7 +30,7 @@ import java.awt.*;
import java.io.IOException;
import java.util.ArrayList;
public class GuiColorPicker extends GuiScreen {
public class GuiColorPicker extends SilentScreen {
private final Mod mod;
private final GuiScreen parentScreen;
@ -46,6 +48,7 @@ public class GuiColorPicker extends GuiScreen {
@Override
public void initGui() {
defaultCursor = false;
this.initTime = System.currentTimeMillis();
colors.clear();
colors.add(new Color(255, 255, 255));
@ -86,6 +89,8 @@ public class GuiColorPicker extends GuiScreen {
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MenuBlurUtils.renderBackground(this);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
int addX = 190;
int addY = 110;
@ -110,7 +115,10 @@ public class GuiColorPicker extends GuiScreen {
for(Color color : colors) {
RenderUtils.drawRect(x + spacing, settingY - 1, 22, 22, new Color(0, 0, 0).getRGB());
RenderUtils.drawRect(x + spacing + 1, settingY - 1 + 1, 20, 20, new Color(color.getRed(), color.getGreen(), color.getBlue(), setting.getOpacity()).getRGB());
spacing += 25;
if(MouseUtils.isInside(mouseX, mouseY, x + spacing, settingY - 1, 22, 22)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
spacing += 25;
colorIndex += 1;
if(colorIndex == 5 || colorIndex == 10) {
spacing = 100;
@ -134,7 +142,11 @@ public class GuiColorPicker extends GuiScreen {
settingY += settingHeight;
Checkbox.render(mouseX, mouseY, x + 100, settingY - 1, "Chroma", setting.isChroma());
if(Checkbox.isHovered(mouseX, mouseY, x + 100, settingY - 1)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
GL11.glPopMatrix();

View File

@ -17,6 +17,7 @@ import net.silentclient.client.gui.elements.*;
import net.silentclient.client.gui.font.SilentFontRenderer;
import net.silentclient.client.gui.hud.HUDConfigScreen;
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.Mod;
import net.silentclient.client.mods.ModCategory;
@ -25,6 +26,7 @@ import net.silentclient.client.mods.render.CrosshairMod;
import net.silentclient.client.mods.world.TimeChangerMod;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -52,6 +54,7 @@ public class ModSettings extends SilentScreen {
this.initTime = System.currentTimeMillis();
scrollAnimation.setValue(0);
MenuBlurUtils.loadBlur();
defaultCursor = false;
int addX = 190;
int addY = 110;
int x = (width / 2) - addX;
@ -63,6 +66,10 @@ public class ModSettings extends SilentScreen {
if(setting.isInput()) {
this.silentInputs.add(new Input(setting.getName(), setting.getValString()));
}
if(setting.isKeybind()) {
this.silentInputs.add(new Input(setting.getName(), setting.getKeybind()));
}
}
}
@ -80,6 +87,10 @@ public class ModSettings extends SilentScreen {
setting.setValString(this.silentInputs.get(inputIndex).getValue().length() != 0 ? this.silentInputs.get(inputIndex).getValue() : setting.defaultsval);
inputIndex++;
}
if (setting.isKeybind()) {
setting.setKeybind(this.silentInputs.get(inputIndex).getKey() != 0 ? this.silentInputs.get(inputIndex).getKey() : setting.defaultkval);
inputIndex++;
}
}
super.onGuiClosed();
}
@ -99,6 +110,7 @@ public class ModSettings extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MenuBlurUtils.renderBackground(this);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
int addX = 190;
int addY = 110;
@ -131,7 +143,13 @@ public class ModSettings extends SilentScreen {
if(mod.getCategory() == ModCategory.MODS) {
RenderUtil.drawImage(new ResourceLocation("silentclient/icons/reset_settings.png"), x + width - (10 + 8) - 15, y + 5 + scrollAnimation.getValue(), 10, 10);
Switch.render(mouseX, mouseY, x + width - (10 + 8), y + 6 + scrollAnimation.getValue(), mod.switchAniamation, mod.isEnabled(), mod.isForceDisabled());
if(MouseUtils.isInside(mouseX, mouseY, x + width - (10 + 8) - 15, y + 5 + scrollAnimation.getValue(), 10, 10)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
Switch.render(mouseX, mouseY, x + width - (10 + 8), y + 6 + scrollAnimation.getValue(), mod.switchAniamation, mod.isEnabled(), mod.isForceDisabled());
if(Switch.isHovered(mouseX, mouseY, x + width - (10 + 8), y + 6 + scrollAnimation.getValue())) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
Client.getInstance().getSilentFontRenderer().drawString(mod.getName(), x + 100, (int) (y + 5) + scrollAnimation.getValue(), 14, SilentFontRenderer.FontType.TITLE);
@ -159,17 +177,34 @@ public class ModSettings extends SilentScreen {
settingY += 5;
inputIndex++;
}
if(setting.isKeybind()) {
Client.getInstance().getSilentFontRenderer().drawString(setting.getName() + ":", x + 100, settingY + 1, 12, SilentFontRenderer.FontType.TITLE);
this.silentInputs.get(inputIndex).render(mouseX, mouseY, x + width - 50 - 5, settingY, 50, true, new DefaultInputTheme(), true);
ColorUtils.setColor(-1);
settingY += 5;
inputIndex++;
}
if(setting.isCombo()) {
Select.render(mouseX, mouseY, x, settingY, width, setting.getName(), setting.getValString());
if(Select.nextHovered(mouseX, mouseY, x, settingY, width) || Select.prevHovered(mouseX, mouseY, x, settingY, width)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
if (setting.isColor()) {
ColorPicker.render(x, settingY - 1, width, setting.getName(), setting.getValColor().getRGB());
if(ColorPicker.isHovered(mouseX, mouseY, x, settingY - 1, width)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
if (setting.isCheck()) {
Checkbox.render(mouseX, mouseY, x + 100, settingY - 1, setting.getName(), setting.getValBoolean());
if(Checkbox.isHovered(mouseX, mouseY, x + 100, settingY - 1)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
if (setting.isSlider()) {
Slider.render(x, settingY - 1, width, setting.getName(), setting.getMax(), setting.getValDouble());
@ -189,7 +224,7 @@ public class ModSettings extends SilentScreen {
settingY += settingHeight;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
GL11.glDisable(GL11.GL_SCISSOR_TEST);
GL11.glPopMatrix();
@ -308,6 +343,12 @@ public class ModSettings extends SilentScreen {
settingY += 5;
inputIndex++;
}
if(setting.isKeybind()) {
this.silentInputs.get(inputIndex).onClick(mouseX, mouseY, x + width - 50 - 5, settingY, 50, true);
settingY += 5;
inputIndex++;
}
if(setting.isCombo()) {
int index = 0;
@ -383,6 +424,11 @@ public class ModSettings extends SilentScreen {
setting.setValString(this.silentInputs.get(inputIndex).getValue());
inputIndex++;
}
if (setting.isKeybind()) {
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
setting.setKeybind(this.silentInputs.get(inputIndex).getKey());
inputIndex++;
}
}
}

View File

@ -1,16 +1,7 @@
package net.silentclient.client.gui.minecraft;
import java.awt.Color;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.concurrent.atomic.AtomicInteger;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.gui.*;
import net.minecraft.client.multiplayer.ServerAddress;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.WorldClient;
@ -25,14 +16,20 @@ import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.event.impl.ConnectToServerEvent;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.elements.Button;
import net.silentclient.client.gui.font.SilentFontRenderer;
import net.silentclient.client.gui.util.RenderUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class GuiConnecting extends GuiScreen
import java.awt.*;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.concurrent.atomic.AtomicInteger;
public class GuiConnecting extends SilentScreen
{
private static final AtomicInteger CONNECTION_ID = new AtomicInteger(0);
private static final Logger logger = LogManager.getLogger();

View File

@ -13,6 +13,7 @@ import net.silentclient.client.cosmetics.Cosmetics;
import net.silentclient.client.cosmetics.gui.CosmeticsGui;
import net.silentclient.client.event.impl.ServerLeaveEvent;
import net.silentclient.client.gui.GuiMultiplayerInGame;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.elements.Button;
import net.silentclient.client.gui.elements.IconButton;
import net.silentclient.client.gui.friends.FriendsListOverlay;
@ -24,7 +25,7 @@ import net.silentclient.client.utils.MenuBlurUtils;
import java.io.IOException;
public class GuiIngameMenu extends GuiScreen
public class GuiIngameMenu extends SilentScreen
{
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the

View File

@ -15,6 +15,7 @@ import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.mods.Setting;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import java.awt.*;
import java.io.IOException;
@ -38,6 +39,7 @@ public class ColorPicker extends SilentScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.initTime = System.currentTimeMillis();
this.buttonList.clear();
this.silentInputs.clear();
@ -72,6 +74,7 @@ public class ColorPicker extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MenuBlurUtils.renderBackground(this);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
Setting setting = Client.getInstance().getSettingsManager().getSettingByName(mod, this.value);
ModMenu.drawOverlayListBase(height, "Choose a color");
@ -85,6 +88,9 @@ public class ColorPicker extends SilentScreen {
for(Color color : colors) {
RenderUtil.drawRoundedRect(colorX, colorY, 20, 20, 3, new Color(color.getRed(), color.getGreen(), color.getBlue(), setting.getOpacity()).getRGB());
RenderUtil.drawRoundedOutline(colorX, colorY, 20, 20, 3, 2, new Color(0, 0, 0).getRGB());
if(MouseUtils.isInside(mouseX, mouseY, colorX, colorY, 20, 20)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
colorX += 25;
colorIndex += 1;
if(colorIndex == 6) {
@ -111,6 +117,11 @@ public class ColorPicker extends SilentScreen {
colorY += settingHeight;
Checkbox.render(mouseX, mouseY, 3, colorY, "Chroma", setting.isChroma());
if(Checkbox.isHovered(mouseX, mouseY, 3, colorY)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
ModMenu.trimContentEnd();
}

View File

@ -29,6 +29,7 @@ import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.mods.settings.GeneralMod;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import org.lwjgl.Sys;
import org.lwjgl.input.Mouse;
@ -62,6 +63,7 @@ public class ModMenu extends SilentScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
if(!loaded) {
introAnimation = new SimpleAnimation(Client.getInstance().getSettingsManager().getSettingByClass(GeneralMod.class, "Menu Animations").getValBoolean() ? -150 : 0);
}
@ -137,6 +139,8 @@ public class ModMenu extends SilentScreen {
this.buttonList.get(7).visible = false;
}
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
trimContentStart(width, height);
if(modCategory != ModCategory.CONFIGS && modCategory != ModCategory.PLUS) {
float modY = 66 - scrollAnimation.getValue();
@ -145,6 +149,7 @@ public class ModMenu extends SilentScreen {
if(mouseInContent(0, (int) modY, height) || mouseInContent(0, (int) (modY + 20), height)) {
boolean isHovered = mouseInContent(mouseX, mouseY, height) && MouseUtils.isInside(mouseX, mouseY, 3, modY, 144, 20) && !(modCategory == ModCategory.MODS && Switch.isHovered(mouseX, mouseY, 129, modY + 10 - 4)) && (Client.getInstance().getSettingsManager().getSettingByMod(mod).size() != 0 || mod.getName() == "Auto Text");
if(isHovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
RenderUtil.drawRoundedRect(3, modY, 144, 20, 3, new Color(255, 255, 255, 30).getRGB());
}
RenderUtil.drawRoundedOutline(3, modY, 144, 20, 3, 1, Theme.borderColor().getRGB());
@ -158,6 +163,9 @@ public class ModMenu extends SilentScreen {
if(modCategory == ModCategory.MODS) {
Switch.render(mouseX, mouseY, 129, modY + 10 - 4, mod.switchAniamation, mod.isEnabled(), mod.isForceDisabled());
if(Switch.isHovered(mouseX, mouseY, 129, modY + 10 - 4)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
}
@ -176,6 +184,7 @@ public class ModMenu extends SilentScreen {
boolean isHovered = mouseInContent(mouseX, mouseY, height) && MouseUtils.isInside(mouseX, mouseY, 3, configY, 144, 20);
if(isHovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
RenderUtil.drawRoundedRect(3, configY, 144, 20, 3, new Color(255, 255, 255, 30).getRGB());
}
RenderUtil.drawRoundedOutline(3, configY, 144, 20, 3, 1, Theme.borderColor().getRGB());
@ -197,9 +206,15 @@ public class ModMenu extends SilentScreen {
Client.getInstance().getSilentFontRenderer().drawString(days != -1 ? days + " days left" : "Unknown Time Remaining", 3, (int) premiumY, 12, SilentFontRenderer.FontType.TITLE);
premiumY += 15;
RegularColorPicker.render(3, (int) premiumY, 144, "Chroma Bandana Color", Client.getInstance().getAccount().getBandanaColor() == 50 ? ColorUtils.getChromaColor(0, 0, 1).getRGB() : Client.getInstance().getAccount().getBandanaColor());
if(RegularColorPicker.isHovered(mouseX, mouseY, 3, (int) premiumY, 144)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
premiumY += 15;
Client.getInstance().getSilentFontRenderer().drawString("Custom Capes", 3, premiumY, 12, SilentFontRenderer.FontType.TITLE);
StaticButton.render(150 - 3 - 65, (int) premiumY, 65, 12, Client.getInstance().getAccount().isPremiumPlus() ? "OPEN MENU" : "BUY PREMIUM+");
if(StaticButton.isHovered(mouseX, mouseY, 150 - 3 - 65, premiumY, 65, 12)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
premiumY += 15;
ColorUtils.setColor(new Color(255, 255, 255, 127).getRGB());
Client.getInstance().getSilentFontRenderer().drawString("Nametag Message Settings:", 3, premiumY, 12, SilentFontRenderer.FontType.TITLE);
@ -207,18 +222,27 @@ public class ModMenu extends SilentScreen {
ColorUtils.setColor(new Color(255, 255, 255, 255).getRGB());
if(Client.getInstance().getAccount().isPremiumPlus()) {
Checkbox.render(mouseX, mouseY, 3, (int) premiumY, "Show Nametag Message", Client.getInstance().getAccount().showNametagMessage());
if(Checkbox.isHovered(mouseX, mouseY, 3, premiumY)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
premiumY += 15;
Client.getInstance().getSilentFontRenderer().drawString("Nametag Message:", 3, premiumY + 1, 12, SilentFontRenderer.FontType.TITLE);
premiumY += 15;
this.silentInputs.get(1).render(mouseX, mouseY, 3, (int) premiumY, 144, true);
premiumY += 20;
StaticButton.render(150 - 3 - 50, (int) premiumY, 50, 12, "Save");
if(StaticButton.isHovered(mouseX, mouseY, 150 - 3 - 50, premiumY, 50, 12)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
} else {
Client.getInstance().getSilentFontRenderer().drawString("You're currently not Premium+", 3, (int) premiumY, 12, SilentFontRenderer.FontType.TITLE);
}
}
this.scrollHeight = 66 + premiumY + scrollAnimation.getValue();
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
trimContentEnd();
scrollAnimation.setAnimation(scrollY, 12);

View File

@ -13,13 +13,16 @@ import net.silentclient.client.gui.elements.Input;
import net.silentclient.client.gui.elements.StaticButton;
import net.silentclient.client.gui.font.SilentFontRenderer;
import net.silentclient.client.gui.theme.button.DefaultButtonTheme;
import net.silentclient.client.gui.theme.button.RedButtonTheme;
import net.silentclient.client.gui.theme.button.SelectedButtonTheme;
import net.silentclient.client.gui.theme.input.DefaultInputTheme;
import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.mods.Setting;
import net.silentclient.client.mods.render.CrosshairMod;
import net.silentclient.client.mods.world.TimeChangerMod;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import org.lwjgl.input.Mouse;
@ -45,6 +48,7 @@ public class ModSettings extends SilentScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.buttonList.clear();
this.silentInputs.clear();
this.initTime = System.currentTimeMillis();
@ -57,13 +61,17 @@ public class ModSettings extends SilentScreen {
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"));
if(mod.getCategory() == ModCategory.MODS) {
this.buttonList.add(new Button(3, 76, this.height - 18, 70, 15, mod.isEnabled() ? "Enabled" : "Disabled", false, mod.isEnabled() ? new SelectedButtonTheme() : new DefaultButtonTheme()));
this.buttonList.add(new Button(3, 76, this.height - 18, 70, 15, mod.isEnabled() && !mod.isForceDisabled() ? "Enabled" : "Disabled", false, mod.isForceDisabled() ? new RedButtonTheme() : mod.isEnabled() ? new SelectedButtonTheme() : new DefaultButtonTheme()));
}
for (Setting setting : Client.getInstance().getSettingsManager().getSettingByMod(mod)) {
if(setting.isInput()) {
this.silentInputs.add(new Input(setting.getName(), setting.getValString()));
}
if(setting.isKeybind()) {
this.silentInputs.add(new Input(setting.getName(), setting.getKeybind()));
}
}
}
@ -74,6 +82,8 @@ public class ModSettings extends SilentScreen {
super.drawScreen(mouseX, mouseY, partialTicks);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
ModMenu.trimContentStart(width, height);
float settingY = 66 - scrollAnimation.getValue();
int inputIndex = 0;
@ -105,11 +115,23 @@ public class ModSettings extends SilentScreen {
settingY += 5;
inputIndex++;
}
if(setting.isKeybind()) {
Client.getInstance().getSilentFontRenderer().drawString(setting.getName(), 3, settingY, 12, SilentFontRenderer.FontType.TITLE);
this.silentInputs.get(inputIndex).render(mouseX, mouseY, 150 - 50 - 3, settingY, 50, true, new DefaultInputTheme(), true);
settingY += 5;
inputIndex++;
}
if (setting.isColor()) {
RegularColorPicker.render(3, settingY, 144, setting.getName(), setting.getValColor().getRGB());
if(RegularColorPicker.isHovered(mouseX, mouseY, 3, (int) settingY, 144)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
if (setting.isCheck()) {
Checkbox.render(mouseX, mouseY, 3, settingY, setting.getName(), setting.getValBoolean());
if(Checkbox.isHovered(mouseX, mouseY, 3, settingY)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
}
if(setting.isSlider()) {
@ -130,12 +152,17 @@ public class ModSettings extends SilentScreen {
if(setting.isCombo()) {
RegularSelect.render(mouseX, mouseY, 3, settingY, 144, setting.getName(), setting.getValString());
if(RegularSelect.nextHovered(mouseX, mouseY, 3, settingY, 144) || RegularSelect.prevHovered(mouseX, mouseY, 3, settingY)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
settingY += 15;
}
settingY += settingHeight;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
this.scrollHeight = 66 + settingY + scrollAnimation.getValue();
ModMenu.trimContentEnd();
@ -216,6 +243,12 @@ public class ModSettings extends SilentScreen {
settingY += 5;
inputIndex++;
}
if(setting.isKeybind()) {
Client.getInstance().getSilentFontRenderer().drawString(setting.getName(), 3, settingY, 12, SilentFontRenderer.FontType.TITLE);
this.silentInputs.get(inputIndex).onClick(mouseX, mouseY, 150 - 50 - 3, (int) settingY, 50, true);
settingY += 5;
inputIndex++;
}
if (setting.isColor() && RegularColorPicker.isHovered(mouseX, mouseY, 3, (int) settingY, 144)) {
mc.displayGuiScreen(new ColorPicker(mod, setting.getName(), this));
}
@ -285,6 +318,9 @@ public class ModSettings extends SilentScreen {
mod.reset(false);
break;
case 3:
if(mod.isForceDisabled()) {
break;
}
mod.toggle();
button.displayString = mod.isEnabled() ? "Enabled" : "Disabled";
if(button instanceof Button) {
@ -310,6 +346,12 @@ public class ModSettings extends SilentScreen {
setting.setValString(this.silentInputs.get(inputIndex).getValue());
inputIndex++;
}
if (setting.isKeybind()) {
this.silentInputs.get(inputIndex).onKeyTyped(typedChar, keyCode);
setting.setKeybind(this.silentInputs.get(inputIndex).getKey());
inputIndex++;
}
}
}
@ -326,6 +368,10 @@ public class ModSettings extends SilentScreen {
setting.setValString(this.silentInputs.get(inputIndex).getValue().length() != 0 ? this.silentInputs.get(inputIndex).getValue() : setting.defaultsval);
inputIndex++;
}
if (setting.isKeybind()) {
setting.setKeybind(this.silentInputs.get(inputIndex).getKey() != 0 ? this.silentInputs.get(inputIndex).getKey() : setting.defaultkval);
inputIndex++;
}
}
Client.getInstance().configManager.save();
MenuBlurUtils.unloadBlur();

View File

@ -9,6 +9,7 @@ import net.silentclient.client.gui.elements.Checkbox;
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import java.awt.*;
import java.io.IOException;
@ -26,6 +27,7 @@ public class PremiumColorPicker extends SilentScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.initTime = System.currentTimeMillis();
this.buttonList.clear();
this.silentInputs.clear();
@ -57,6 +59,8 @@ public class PremiumColorPicker extends SilentScreen {
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MenuBlurUtils.renderBackground(this);
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
ModMenu.drawOverlayListBase(height, "Choose a color");
super.drawScreen(mouseX, mouseY, partialTicks);
@ -68,6 +72,9 @@ public class PremiumColorPicker extends SilentScreen {
for(Color color : colors) {
RenderUtil.drawRoundedRect(colorX, colorY, 20, 20, 3, new Color(color.getRed(), color.getGreen(), color.getBlue()).getRGB());
RenderUtil.drawRoundedOutline(colorX, colorY, 20, 20, 3, 2, new Color(0, 0, 0).getRGB());
if(MouseUtils.isInside(mouseX, mouseY, colorX, colorY, 20, 20)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
colorX += 25;
colorIndex += 1;
if(colorIndex == 6) {
@ -83,6 +90,12 @@ public class PremiumColorPicker extends SilentScreen {
Checkbox.render(mouseX, mouseY, 3, colorY, "Chroma", Client.getInstance().getAccount().getBandanaColor() == 50);
if(Checkbox.isHovered(mouseX, mouseY, 3, colorY)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
ModMenu.trimContentEnd();
}

View File

@ -21,6 +21,7 @@ import net.silentclient.client.gui.silentmainmenu.components.AccountPicker;
import net.silentclient.client.gui.silentmainmenu.components.MenuOption;
import net.silentclient.client.gui.theme.button.IButtonTheme;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.SCTextureManager;
import java.awt.*;
@ -39,6 +40,7 @@ public class MainMenuConcept extends SilentScreen {
@Override
public void initGui() {
super.initGui();
defaultCursor = false;
this.buttonList.clear();
Client.backgroundPanorama.updateWidthHeight(this.width, this.height);
@ -78,6 +80,7 @@ public class MainMenuConcept extends SilentScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
GuiNews.loadPanel();
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
this.loadSkin();
GlStateManager.disableAlpha();
Client.backgroundPanorama.renderSkybox(mouseX, mouseY, partialTicks);
@ -91,6 +94,9 @@ public class MainMenuConcept extends SilentScreen {
}
if(GuiNews.imageLocation != null) {
if(MouseUtils.isInside(mouseX, mouseY, 10, 10, 109, 63)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
RenderUtils.drawRect(10, 10, 109, 63, -1);
RenderUtil.drawImage(GuiNews.imageLocation, 12, 12, 105, 59, false);
}
@ -99,7 +105,13 @@ public class MainMenuConcept extends SilentScreen {
super.drawScreen(mouseX, mouseY, partialTicks);
this.accountPicker.draw(mc, mouseX, mouseY);
MouseCursorHandler.CursorType accountCursor = this.accountPicker.draw(mc, mouseX, mouseY);
if(accountCursor != null) {
cursorType = accountCursor;
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
}
@Override

View File

@ -6,6 +6,7 @@ import net.silentclient.client.gui.font.SilentFontRenderer;
import net.silentclient.client.gui.lite.clickgui.utils.MouseUtils;
import net.silentclient.client.utils.AccountManager;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import java.awt.*;
@ -20,10 +21,14 @@ public class AccountPicker {
this.open = false;
}
public void draw(Minecraft mc, int mouseX, int mouseY) {
public MouseCursorHandler.CursorType draw(Minecraft mc, int mouseX, int mouseY) {
MouseCursorHandler.CursorType cursorType = null;
boolean hovered = MouseUtils.isInside(mouseX, mouseY, x - (Client.getInstance().getSilentFontRenderer().getStringWidth(Client.getInstance().getAccount().original_username, 14, SilentFontRenderer.FontType.TITLE) / 2), y, Client.getInstance().getSilentFontRenderer().getStringWidth(Client.getInstance().getAccount().original_username, 14, SilentFontRenderer.FontType.TITLE), 14);
ColorUtils.setColor(hovered ? new Color(255, 255, 255, 127).getRGB() : -1);
Client.getInstance().getSilentFontRenderer().drawCenteredString(Client.getInstance().getAccount().original_username, x, y, 14, SilentFontRenderer.FontType.TITLE);
if(hovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
if(this.open) {
int accountY = y + 15;
for(AccountManager.AccountType account : Client.getInstance().getAccountManager().getAccounts()) {
@ -31,11 +36,16 @@ public class AccountPicker {
continue;
}
boolean accountHovered = MouseUtils.isInside(mouseX, mouseY, x - (Client.getInstance().getSilentFontRenderer().getStringWidth(Client.getInstance().getAccount().original_username, 14, SilentFontRenderer.FontType.TITLE) / 2), accountY, Client.getInstance().getSilentFontRenderer().getStringWidth(Client.getInstance().getAccount().original_username, 14, SilentFontRenderer.FontType.TITLE), 14);
if(accountHovered) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
ColorUtils.setColor(accountHovered ? new Color(255, 255, 255, 127).getRGB() : -1);
Client.getInstance().getSilentFontRenderer().drawCenteredString(account.username, x, accountY, 14, SilentFontRenderer.FontType.TITLE);
accountY += 15;
}
}
return cursorType;
}
public void onClick(Minecraft mc, int mouseX, int mouseY) {

View File

@ -0,0 +1,25 @@
package net.silentclient.client.gui.theme.button;
import java.awt.*;
public class RedButtonTheme implements IButtonTheme {
@Override
public Color getBorderColor() {
return new Color(229, 62, 62);
}
@Override
public Color getBackgroundColor() {
return new Color(229, 62, 62);
}
@Override
public Color getTextColor() {
return new Color(255, 255, 255);
}
@Override
public Color getHoveredBackgroundColor(int opacity) {
return new Color(229, 62, 62, opacity);
}
}

View File

@ -5,14 +5,13 @@ import net.minecraft.client.settings.GameSettings;
import net.minecraft.client.settings.KeyBinding;
import net.silentclient.client.mixin.SilentClientTweaker;
import org.apache.commons.lang3.ArrayUtils;
import org.lwjgl.input.Keyboard;
import java.util.Arrays;
public class KeyBindManager {
public KeyBinding CLICKGUI = new KeyBinding("Silent Client - Mod Menu", Keyboard.KEY_RSHIFT, "Silent Client");
public KeyBinding PERSPECTIVE = new KeyBinding("Silent Client - Perspective", Keyboard.KEY_LMENU, "Silent Client");
public KeyBinding ZOOM = new KeyBinding("Silent Client - Zoom", Keyboard.KEY_C, "Silent Client");
// public KeyBinding CLICKGUI = new KeyBinding("Silent Client - Mod Menu", Keyboard.KEY_RSHIFT, "Silent Client");
// public KeyBinding PERSPECTIVE = new KeyBinding("Silent Client - Perspective", Keyboard.KEY_LMENU, "Silent Client");
// public KeyBinding ZOOM = new KeyBinding("Silent Client - Zoom", Keyboard.KEY_C, "Silent Client");
public KeyBindManager(GameSettings gameSettings) {
if(SilentClientTweaker.hasOptifine) {
@ -23,9 +22,9 @@ public class KeyBindManager {
}
}
this.registerKeyBind(gameSettings, CLICKGUI);
this.registerKeyBind(gameSettings, PERSPECTIVE);
this.registerKeyBind(gameSettings, ZOOM);
// this.registerKeyBind(gameSettings, CLICKGUI);
// this.registerKeyBind(gameSettings, PERSPECTIVE);
// this.registerKeyBind(gameSettings, ZOOM);
}
public void registerKeyBind(GameSettings gameSettings, KeyBinding key) {

View File

@ -89,6 +89,10 @@ public class Mod implements IMod {
setting.setValBoolean(setting.defaultbval);
}
if(setting.isKeybind()) {
setting.setKeybind(setting.defaultkval);
}
if(setting.isColor()) {
setting.setValColor(setting.defaultcval);
setting.setChroma(false);
@ -254,6 +258,13 @@ public class Mod implements IMod {
Client.getInstance().getSettingsManager().addSetting(setting = new Setting(name, mod, toggle));
return setting;
}
public Setting addKeybindSetting(String name, Mod mod, int keybind) {
Setting setting;
Client.getInstance().getSettingsManager().addSetting(setting = new Setting(name, mod, keybind));
return setting;
}
public Setting addModeSetting(String name, Mod mod, String defaultMode, ArrayList<String> options) {
Setting setting;

View File

@ -1,11 +1,13 @@
package net.silentclient.client.mods;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.silentclient.client.Client;
import net.silentclient.client.utils.ColorUtils;
import org.lwjgl.input.Keyboard;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class Setting implements Comparable<Setting> {
private final String name;
@ -25,6 +27,10 @@ public class Setting implements Comparable<Setting> {
private double max;
private boolean onlyint = false;
// For keybind setting
private int kval;
public int defaultkval;
// For color setting
private Color cval;
public Color defaultcval;
@ -56,6 +62,14 @@ public class Setting implements Comparable<Setting> {
this.mode = "Check";
}
public Setting(String name, Mod parent, int kval) {
this.name = name;
this.parent = parent;
this.kval = kval;
this.defaultkval = kval;
this.mode = "Keybind";
}
public Setting(String name, Mod parent, Color cval) {
this.name = name;
this.parent = parent;
@ -133,6 +147,26 @@ public class Setting implements Comparable<Setting> {
this.sval = in;
}
public int getKeybind() {
return kval;
}
public void setKeybind(int kval) {
this.kval = kval;
}
public boolean isKeybind() {
return this.mode.equalsIgnoreCase("Keybind");
}
public boolean isKeyDown() {
if(!isKeybind()) {
return false;
}
return Minecraft.getMinecraft().inGameHasFocus && Keyboard.isKeyDown(kval);
}
public List<String> getOptions() {
return this.options;
}

View File

@ -10,6 +10,7 @@ import net.silentclient.client.event.impl.EventPlayerHeadRotation;
import net.silentclient.client.mods.Mod;
import net.silentclient.client.mods.ModCategory;
import net.silentclient.client.mods.util.Server;
import org.lwjgl.input.Keyboard;
public class PerspectiveMod extends Mod {
@ -21,7 +22,13 @@ public class PerspectiveMod extends Mod {
public PerspectiveMod() {
super("Perspective", ModCategory.MODS, "silentclient/icons/mods/perspective.png");
}
@Override
public void setup() {
super.setup();
this.addKeybindSetting("Keybind", this, Keyboard.KEY_LMENU);
}
@Override
public boolean isForceDisabled() {
if(Client.getInstance().getAccount().isAdmin() || Client.getInstance().getAccount().isStaff() || Client.getInstance().getAccount().isTester()) {
@ -33,7 +40,7 @@ public class PerspectiveMod extends Mod {
@EventTarget
public void updateEvent(ClientTickEvent event) {
if(!isForceDisabled()) {
if(Client.getInstance().getKeyBindManager().PERSPECTIVE.isKeyDown()) {
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Keybind").isKeyDown()) {
start();
mc.gameSettings.thirdPersonView = 3;
}

View File

@ -25,6 +25,7 @@ public class ZoomMod extends Mod {
@Override
public void setup() {
this.addKeybindSetting("Keybind", this, Keyboard.KEY_C);
this.addBooleanSetting("Scroll", this, false);
this.addBooleanSetting("Smooth Zoom", this, true);
this.addSliderSetting("Zoom Speed", this, 14, 5, 20, true);
@ -38,7 +39,7 @@ public class ZoomMod extends Mod {
@EventTarget
public void onTick(ClientTickEvent event) {
if(Keyboard.isKeyDown(Client.getInstance().getKeyBindManager().ZOOM.getKeyCode()) && mc.inGameHasFocus) {
if(Client.getInstance().getSettingsManager().getSettingByName(this, "Keybind").isKeyDown()) {
if(!active) {
active = true;
lastSensitivity = mc.gameSettings.mouseSensitivity;

View File

@ -1,7 +1,5 @@
package net.silentclient.client.mods.settings;
import java.util.ArrayList;
import net.silentclient.client.Client;
import net.silentclient.client.gui.lite.clickgui.ClickGUI;
import net.silentclient.client.mods.Mod;
@ -10,6 +8,9 @@ import net.silentclient.client.mods.Setting;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.OSUtil;
import net.silentclient.client.utils.RawInputHandler;
import org.lwjgl.input.Keyboard;
import java.util.ArrayList;
public class GeneralMod extends Mod {
@Override
@ -28,6 +29,7 @@ public class GeneralMod extends Mod {
this.addBooleanSetting("Hide mods in F3", this, true);
this.addBooleanSetting("Vanilla ESC Menu Layout", this, false);
this.addBooleanSetting("Menu Background Blur", this, true);
this.addKeybindSetting("Mod Menu Keybind", this, Keyboard.KEY_RSHIFT);
ArrayList<String> options = new ArrayList<>();
options.add("Bottom Right Corner");
options.add("Bottom Left Corner");

View File

@ -6,6 +6,7 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.util.ResourceLocation;
import net.silentclient.client.Client;
import net.silentclient.client.gui.SilentScreen;
import net.silentclient.client.gui.animation.normal.Direction;
import net.silentclient.client.gui.lite.clickgui.ClickGUI;
import net.silentclient.client.gui.lite.clickgui.utils.GlUtils;
@ -20,6 +21,7 @@ import net.silentclient.client.gui.theme.Theme;
import net.silentclient.client.gui.util.RenderUtil;
import net.silentclient.client.utils.ColorUtils;
import net.silentclient.client.utils.MenuBlurUtils;
import net.silentclient.client.utils.MouseCursorHandler;
import net.silentclient.client.utils.Sounds;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
@ -106,7 +108,7 @@ public class PremiumGui {
}
}
public static class PremiumColorPicker extends GuiScreen {
public static class PremiumColorPicker extends SilentScreen {
private final GuiScreen parentScreen;
private ArrayList<Color> colors = new ArrayList<Color>();
@ -118,6 +120,7 @@ public class PremiumGui {
@Override
public void initGui() {
colors.clear();
defaultCursor = false;
colors.add(new Color(255, 255, 255));
colors.add(new Color(156, 157, 151));
colors.add(new Color(71,79,82));
@ -151,6 +154,7 @@ public class PremiumGui {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
MouseCursorHandler.CursorType cursorType = getCursor(silentInputs, buttonList);
MenuBlurUtils.renderBackground(this);
int addX = 190;
@ -175,7 +179,10 @@ public class PremiumGui {
for(Color color : colors) {
RenderUtils.drawRect(x + spacing, settingY - 1, 22, 22, new Color(0, 0, 0).getRGB());
RenderUtils.drawRect(x + spacing + 1, settingY - 1 + 1, 20, 20, new Color(color.getRed(), color.getGreen(), color.getBlue()).getRGB());
spacing += 25;
if(MouseUtils.isInside(mouseX, mouseY, x + spacing, settingY - 1, 22, 22)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
spacing += 25;
colorIndex += 1;
if(colorIndex == 5 || colorIndex == 10) {
spacing = 100;
@ -188,7 +195,9 @@ public class PremiumGui {
settingY += settingHeight;
Checkbox.render(mouseX, mouseY, x + 100, settingY - 1, "Chroma", Client.getInstance().getAccount().getBandanaColor() == 50);
if(Checkbox.isHovered(mouseX, mouseY, x + 100, settingY - 1)) {
cursorType = MouseCursorHandler.CursorType.POINTER;
}
GL11.glPopMatrix();
@ -203,6 +212,8 @@ public class PremiumGui {
mc.displayGuiScreen(null);
}
}
Client.getInstance().getMouseCursorHandler().enableCursor(cursorType);
GlUtils.stopScale();
GlStateManager.popMatrix();

View File

@ -38,7 +38,7 @@ public class MouseCursorHandler {
public void loadCursorType(final CursorType cursorType) {
try {
this.cursors.put(cursorType, this.loadCursor(ImageIO.read(this.getClass().getResourceAsStream("/assets/minecraft/silentclient/mouse/" + cursorType.name().toLowerCase(Locale.US) + ".png"))));
this.cursors.put(cursorType, this.loadCursor(ImageIO.read(this.getClass().getResourceAsStream(String.format("/assets/minecraft/silentclient/mouse/%s/%s.png", OSUtil.isMac() ? "mac" : "win", cursorType.name().toLowerCase(Locale.US))))));
}
catch (final Exception ex) {
LogManager.getLogger().catching((Throwable)ex);

View File

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B