Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commit the Big GUI Update: V2 #87

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
74ef372
pain
Aug 22, 2021
d167d51
pain: v2
Aug 22, 2021
731121b
:sadge:
Aug 22, 2021
01fde9b
pain: v3
Aug 22, 2021
4941842
i hope i fixed it (TM)
Aug 22, 2021
722f5b8
aaaa
Aug 22, 2021
70e06a2
a
Aug 22, 2021
415988b
aaaaaaaaaaaaaaaaaaaaa
Aug 22, 2021
0e9b6d0
enough nonsensical commits: do the thing.
Aug 23, 2021
0cc5723
update guibind
Aug 23, 2021
e7b9736
communism
Aug 24, 2021
13b5924
Josephworks got mad fixed it
Aug 24, 2021
cf46496
also do this LOL
Aug 24, 2021
fcc3752
Add utils for color gradients when @OxideWaveLength puts in full supp…
Aug 24, 2021
4f9e7ce
munky
Aug 25, 2021
ec5a4a2
pain
Aug 25, 2021
2aebf19
Joseph why
Aug 25, 2021
9b6780c
PRAcceptable(TM)
Aug 25, 2021
e3d185a
Absolute pain and suffering
Aug 29, 2021
8c44107
Insane hackery
Aug 30, 2021
0eeb6cf
Pov: you copied the wrong directory from tests
Aug 30, 2021
b6c96e0
pain
Aug 30, 2021
2154911
Fix Codacy retardidity
Aug 30, 2021
f4a9a30
Unless I get bored and rewrite the GUI again, this is the last commit
Aug 30, 2021
0828765
Got bored. PR not merged. Do some insane java math stuff
Aug 30, 2021
e95229e
I am dumb
Aug 30, 2021
2cd3166
Relying on java math to feed my family for 3 weeks
Aug 31, 2021
0624309
Yes!! It is happening!
Dec 31, 2069
7ae220b
Accidentally broke the space-time continuum, fixed that
Sep 1, 2021
8852497
yeah v2: electric boogaloo
Sep 2, 2021
a4d934f
Fixed ClickGUI colors
Sep 7, 2021
f6f34d0
Multiple GUI changes
Sep 7, 2021
5ac7f91
Merge branch 'master' of https://github.com/AcaiBerii/Minecraft-Hack-…
Sep 7, 2021
8dcbbc0
Codacy
Sep 7, 2021
7471e15
Hoping someone merges this sometime soon...
Sep 7, 2021
9c61b49
bug patch + hotbar toggle
sigmaclientwastaken Sep 10, 2021
160d008
Added VClip
sigmaclientwastaken Sep 10, 2021
f727189
Edited default settings
sigmaclientwastaken Sep 10, 2021
3e4d63a
Merge pull request #1 from sigmaclientwastaken/master
Sep 14, 2021
cb96b33
Update Readme.md
Sep 14, 2021
45f3c94
Update Readme.md
Sep 14, 2021
6169ec4
Update Readme.md
Sep 14, 2021
c947815
Update Readme.md
Sep 14, 2021
d5e259b
Update Readme.md
Sep 14, 2021
7a81622
Update Readme.md
Sep 14, 2021
70a571f
Updated readme
sigmaclientwastaken Sep 15, 2021
234e2de
Merge pull request #2 from sigmaclientwastaken/patch-1
Sep 19, 2021
a68db5c
Update Readme.md
Sep 19, 2021
2c422e3
Make everything insane
Sep 21, 2021
dd0504e
Pain
Sep 21, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,18 @@

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*.bat
*.sh
runtime/
eclipse/
src/
jars/
conf/
docs/
LICENSE.txt
CHANGELOG
reobf/
lib/
bin/
temp/
28 changes: 25 additions & 3 deletions minecraft/me/wavelength/baseclient/BaseClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.wavelength.baseclient;

import java.awt.Color;
import java.io.File;

import org.lwjgl.opengl.Display;
Expand All @@ -13,6 +14,7 @@
import me.wavelength.baseclient.friends.FriendsManager;
import me.wavelength.baseclient.gui.altmanager.GuiAltManager;
import me.wavelength.baseclient.gui.clickgui.ClickGui;
import me.wavelength.baseclient.hooks.HookManager;
import me.wavelength.baseclient.irc.IRCClient;
import me.wavelength.baseclient.module.ModuleManager;
import me.wavelength.baseclient.overlay.HotbarOverlay;
Expand All @@ -34,12 +36,13 @@ public class BaseClient {
* Fonts: Slick's font manager edited by Russian412 and color system by me
* Alt Manager: Russian412's Alt Manager with some small bug-fixes by me
* The Altening Implementation: Russian412
* ZeroDay b21 colored ClickGUI, epic arraylist and client module group: AcaiBerii
*
* Everything else is made by me
* @formatter:on
**/

private final String clientName = "BaseClient";
private String clientName = "BaseClient";
private final String clientVersion = "0.1";
private final String author = "WaveLength";

Expand Down Expand Up @@ -77,6 +80,9 @@ public BaseClient() {
}

public void initialize() {
printStartup();
setupShutdownHook();

Display.setTitle(String.format("%1$s - %2$s | Loading...", clientName, clientVersion));

this.englishLocale = new Locale();
Expand Down Expand Up @@ -113,7 +119,7 @@ public void initialize() {
switchToMojang();

this.genericConfig = new Config(new File(clientFolder + Strings.getSplitter() + "config.cfg"));
genericConfig.addDefault("tabguicolor", "5556190");
genericConfig.addDefault("tabguicolor", String.valueOf(new Color(100, 100, 100).getRGB()));

/** Setting a custom icon */

Expand All @@ -128,7 +134,7 @@ public void initialize() {
public void afterMinecraft() {
Display.setTitle(String.format("%1$s - %2$s", clientName, clientVersion));

this.font = new Font(packageBase + ".font.fonts", "BwModelicaSS01-RegularCondensed", 50, 25, 30, 33);
this.font = new Font(packageBase + ".font.fonts", "BwModelicaSS01-RegularCondensed", 25, 30, 33, 50);

registerHuds();
}
Expand Down Expand Up @@ -211,6 +217,10 @@ public ClickGui getClickGui() {
public Locale getEnglishLocale() {
return englishLocale;
}

public void setClientName(String clientName) {
this.clientName = clientName;
}

public void switchToMojang() {
try {
Expand All @@ -231,5 +241,17 @@ public void switchToTheAltening() {
System.out.println("Couldn't switch to altening altservice -2");
}
}

public void setupShutdownHook() {
boolean shutdownHookInit = HookManager.installShutdownHook(new Thread(() -> {
System.out.println(String.format("%s %s shutting down.", this.clientName, this.clientVersion));
}));

System.out.println(String.format("Shutdown hook %s initialized.", shutdownHookInit ? "successfully" : "unsuccessfully"));
}

public void printStartup() {
System.out.println(String.format("%s %s starting up.", this.clientName, this.clientVersion));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import me.wavelength.baseclient.BaseClient;
import me.wavelength.baseclient.command.commands.BindCommand;
import me.wavelength.baseclient.command.commands.ClientNameCommand;
import me.wavelength.baseclient.command.commands.ColorCommand;
import me.wavelength.baseclient.command.commands.FontCommand;
import me.wavelength.baseclient.command.commands.FriendsCommand;
Expand Down Expand Up @@ -64,6 +65,7 @@ public void registerCommands() {
registerCommand(new XRayCommand());
registerCommand(new FontCommand());
registerCommand(new ToggleCommand());
registerCommand(new ClientNameCommand());
}

public List<Command> getCommands() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package me.wavelength.baseclient.command.commands;

import java.awt.Color;

import me.wavelength.baseclient.BaseClient;
import me.wavelength.baseclient.command.Command;
import me.wavelength.baseclient.utils.Config;
import me.wavelength.baseclient.utils.Integers;
import me.wavelength.baseclient.utils.Lists;
import me.wavelength.baseclient.utils.Random;
import me.wavelength.baseclient.utils.Strings;

public class ClientNameCommand extends Command {
public ClientNameCommand() {
super("clientname", "clientname <name>", "Changes the client name");
}

@Override
public String executeCommand(String line, String[] args) {
if (args.length < 1)
return getSyntax("&c");

BaseClient.instance.setClientName(args[0]);

return String.format("&aThe client's name has been succesfully changed to &e%1$s&a.", args[0]);
}
}
8 changes: 4 additions & 4 deletions minecraft/me/wavelength/baseclient/font/Font.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class Font {
private String packageName;
private String fontName;

private int fontSizeSmall;
private int fontSizeNormal;
private int fontSizeLarge;
private int fontSizeLargest;
public int fontSizeSmall;
public int fontSizeNormal;
public int fontSizeLarge;
public int fontSizeLargest;

public static Map<String, List<UnicodeFontRenderer>> getRegisteredRenderers() {
return REGISTERED_RENDERERS;
Expand Down
84 changes: 55 additions & 29 deletions minecraft/me/wavelength/baseclient/gui/clickgui/ClickGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,41 @@
import java.util.ArrayList;
import java.util.List;

import org.lwjgl.input.Mouse;

import me.wavelength.baseclient.BaseClient;
import me.wavelength.baseclient.gui.clickgui.components.Dropdown;
import me.wavelength.baseclient.gui.clickgui.components.ModuleButton;
import me.wavelength.baseclient.event.events.MouseScrollEvent;
import me.wavelength.baseclient.module.Category;
import me.wavelength.baseclient.utils.Colors;
import me.wavelength.baseclient.utils.RenderUtils;
import me.wavelength.baseclient.utils.Strings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.settings.GameSettings.Options;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

public class ClickGui extends GuiScreen {

private List<Dropdown> dropdowns;


public me.wavelength.baseclient.module.Module clickGuiMod;

private boolean fastRender;
private boolean showDebugInfo;

private int scroll = 5;

public ClickGui() {
}

/** Credits for the Blur: MrTheShy */
@Override
public void initGui() {
this.clickGuiMod = BaseClient.instance.getModuleManager()
.getModule(me.wavelength.baseclient.module.modules.client.ClickGui.class);
int clickGuiSpacing = clickGuiMod.getModuleSettings().getInt("spacing");

if (fastRender = mc.gameSettings.ofFastRender)
mc.gameSettings.setOptionValue(Options.FAST_RENDER, 1);

Expand All @@ -44,32 +53,27 @@ public void initGui() {
if (category.equals(Category.SEMI_HIDDEN) || category.equals(Category.HIDDEN))
continue;

int x = 5 + (previousDropdown == null ? 0 : 10 + previousDropdown.getX() + previousDropdown.getWidth());
int y = (previousDropdown == null ? 5 : previousDropdown.getY());
Dropdown dropdown = new Dropdown(this, category, x, y, false);
if (x + dropdown.getWidth() > RenderUtils.getScaledResolution().getScaledWidth() && previousDropdown != null) {
Dropdown dropdown = new Dropdown(this, category, 0, 0, true);

int x = (previousDropdown == null ? 5
: clickGuiSpacing + (previousDropdown.getX() + previousDropdown.getWidth()));
int y = scroll;

dropdown.setX(x);
dropdown.setY(y);

if (x + dropdown.getWidth() > RenderUtils.getScaledResolution().getScaledWidth()
&& previousDropdown != null) {
dropdown.setX(5);
dropdown.setY(previousDropdown.getY() + previousDropdown.getHeight() + 30);
}
dropdowns.add(dropdown);
previousDropdown = dropdown;
}

if (!(mc.gameSettings.ofFastRender) && OpenGlHelper.shadersSupported && this.mc.getRenderViewEntity() instanceof EntityPlayer) {
if (this.mc.entityRenderer.theShaderGroup != null)
this.mc.entityRenderer.theShaderGroup.deleteShaderGroup();

this.mc.entityRenderer.loadShader(new ResourceLocation("shaders/post/blur.json"));
}
}

@Override
public void onGuiClosed() {
if (!(mc.gameSettings.ofFastRender) && this.mc.entityRenderer.theShaderGroup != null) {
this.mc.entityRenderer.theShaderGroup.deleteShaderGroup();
this.mc.entityRenderer.theShaderGroup = null;
}

if (fastRender)
mc.gameSettings.setOptionValue(Options.FAST_RENDER, 1);

Expand All @@ -78,12 +82,25 @@ public void onGuiClosed() {

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
int contentColor = new Color(0, 0, 0, 200).getRGB();
int headerColor = new Color(30, 150, 10, 200).getRGB();
int textColor = Color.WHITE.getRGB();
handleScrolling();
boolean isRainbow = clickGuiMod.getModuleSettings().getBoolean("rainbow");
int rainbowOffset = clickGuiMod.getModuleSettings().getInt("offset");
int rainbowSpeed = clickGuiMod.getModuleSettings().getInt("speed");

int screenHeight = mc.displayHeight;
int screenWidth = mc.displayWidth;

int textColor = new Color(255, 255, 255).getRGB();

for (int i = 0; i < dropdowns.size(); i++) {
Dropdown dropdown = dropdowns.get(i);

dropdown.setY(this.scroll);

int contentColor = isRainbow
? Colors.getRGBWave(rainbowSpeed, 1, 0.5f,
(i * ((dropdown.getWidth() + dropdown.getX()) / 2) * rainbowOffset))
: me.wavelength.baseclient.module.Color.getColor(dropdown.getCategory()).getRGB();

Category category = dropdown.getCategory();
int x = dropdown.getX();
Expand All @@ -92,14 +109,14 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
int height = dropdown.getHeight();
List<ModuleButton> moduleButtons = dropdown.getModuleButtons();

if (dropdown.isExtended())
if (dropdown.isExtended()) {
RenderUtils.drawModalRectFromTopLeft(x, y + dropdown.getHeaderHeight(), width, height, contentColor);

if (dropdown.isExtended())
moduleButtons.forEach(button -> button.drawButton(Minecraft.getMinecraft(), mouseX, mouseY));
}

RenderUtils.drawModalRectFromTopLeft(x, y, width, dropdown.getHeaderHeight(), headerColor);
RenderUtils.drawString(Strings.capitalizeOnlyFirstLetter(category.name()), x + 3, y + 1, textColor);
RenderUtils.drawModalRectFromTopLeft(x, y, width, dropdown.getHeaderHeight(), contentColor);
RenderUtils.drawString(Strings.capitalizeOnlyFirstLetter(category.name()), x + 3, y + 1, textColor,
BaseClient.instance.getFontRenderer().fontSizeNormal, true);
}
}

Expand Down Expand Up @@ -156,5 +173,14 @@ public List<GuiButton> getButtonList() {
public void setButtonList(List<GuiButton> buttonList) {
this.buttonList = buttonList;
}

public void handleScrolling() {
if (Mouse.hasWheel()) {
this.scroll += -(Mouse.getDWheel() / clickGuiMod.getModuleSettings().getInt("scroll speed"));

if (this.scroll < 5)
this.scroll = 5;
}
}

}
21 changes: 5 additions & 16 deletions minecraft/me/wavelength/baseclient/gui/clickgui/GuiBind.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.awt.Color;
import java.io.IOException;
import java.util.Comparator;

import org.lwjgl.input.Keyboard;

Expand Down Expand Up @@ -35,34 +36,22 @@ public GuiBind(Module module, ClickGui clickGui) {
public void initGui() {
if (fastRender = mc.gameSettings.ofFastRender)
mc.gameSettings.setOptionValue(Options.FAST_RENDER, 1);

if (!(mc.gameSettings.ofFastRender) && OpenGlHelper.shadersSupported && this.mc.getRenderViewEntity() instanceof EntityPlayer) {
if (this.mc.entityRenderer.theShaderGroup != null)
this.mc.entityRenderer.theShaderGroup.deleteShaderGroup();

this.mc.entityRenderer.loadShader(new ResourceLocation("shaders/post/blur.json"));
}

if (fastRender)
mc.gameSettings.setOptionValue(Options.FAST_RENDER, 1);
}

@Override
public void onGuiClosed() {
if (!(mc.gameSettings.ofFastRender) && this.mc.entityRenderer.theShaderGroup != null) {
this.mc.entityRenderer.theShaderGroup.deleteShaderGroup();
this.mc.entityRenderer.theShaderGroup = null;
}
if (fastRender)
mc.gameSettings.setOptionValue(Options.FAST_RENDER, 1);
}

@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
ScaledResolution scaledResolution = RenderUtils.getScaledResolution();
RenderUtils.drawModalRect(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), new Color(0, 0, 0, 110).getRGB());


String bindText = String.format("Bind the module %s", Strings.capitalizeFirstLetter(module.getName()));
String currentBoundText = (module.getKey() == 0 ? "Currently not bound" : String.format("Currently bound to %s", KeyUtils.getKeyName(module.getKey())));
String escapeText = "Press Escape to cancel and Back or Delete to unbind";
String escapeText = "Escape to cancel - Back or Delete to unbind";

int currentBoundTextFontSize = BaseClient.instance.getFontRenderer().getFontSize() - 3;
int escapeTextFontSize = BaseClient.instance.getFontRenderer().getFontSize() - 8;
Expand Down
Loading