This commit is contained in:
ThisIsALegitUsername 2023-03-07 22:22:39 +00:00
parent d21f86fca3
commit 458f28ebc4
8 changed files with 89 additions and 12 deletions

View File

@ -1,11 +1,16 @@
package dev.resent.client;
import dev.resent.util.render.Color;
public class ClientInfo {
public static final String name = "Resent";
public static final String version = "3.6";
public static final String author = "Nitwit";
public static final String release = Release.BETA.name;
public static final String release = Release.STABLE.name;
public static final int primaryColor = new Color(66, 66, 66).getRGB();
public static final int secondaryColor = new Color(117, 117, 117).getRGB();
public enum Release {
BETA("Beta"),

View File

@ -1,4 +1,4 @@
package dev.resent.visual.ui;
package dev.resent.visual.ui.clickgui;
import java.io.IOException;
import java.util.Comparator;
@ -16,6 +16,7 @@ import dev.resent.module.base.setting.Setting;
import dev.resent.util.misc.GlUtils;
import dev.resent.util.render.Color;
import dev.resent.util.render.RenderUtils;
import dev.resent.visual.ui.Theme;
import dev.resent.visual.ui.animation.Animation;
import dev.resent.visual.ui.animation.Direction;
import net.lax1dude.eaglercraft.v1_8.Keyboard;
@ -238,7 +239,7 @@ public class ClickGUI extends GuiScreen {
NumberSetting ss = ((NumberSetting)s);
fr.drawStringWithShadow(s.name + ": sof " + sliderOffset + ", val: " + ((NumberSetting)s).getValue(), this.x+24, height+41+var, -1);
drawRect(width-150, height+43+var, width-45, height+47+var, -1);
RenderUtils.drawRoundedRect(width-150+sliderOffset, height+41+var, width-141+sliderOffset, height+50+var, 4, Color.RED.getRGB());
RenderUtils.drawRoundedRect(width-150+sliderOffset, height+40+var, width-140+sliderOffset, height+50+var, 4, Color.RED.getRGB());
if(dragging) {
sliderOffset = mouseX-(width-150);
@ -251,11 +252,6 @@ public class ClickGUI extends GuiScreen {
dragging = false;
sliderOffset = 0;
}
if(sliderOffset > 101) {
dragging = false;
sliderOffset = 100;
}
}
if (s instanceof BooleanSetting) {

View File

@ -1,4 +1,4 @@
package dev.resent.visual.ui;
package dev.resent.visual.ui.clickgui;
import dev.resent.client.Resent;
import dev.resent.module.base.RenderMod;

View File

@ -1,4 +1,4 @@
package dev.resent.visual.ui;
package dev.resent.visual.ui.clickgui;
import dev.resent.module.base.ModManager;
import dev.resent.util.render.Color;

View File

@ -0,0 +1,65 @@
package dev.resent.visual.ui.clickgui.rewrite;
import dev.resent.util.misc.GlUtils;
import dev.resent.visual.ui.Theme;
import dev.resent.visual.ui.animation.Animation;
import dev.resent.visual.ui.animation.Direction;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
public class ClickGuiRewrite extends GuiScreen{
public Animation introAnimation;
public int x, y, width, height;
public ScaledResolution sr;
public boolean closing;
@Override
public void drawScreen(int mouseX, int mouseY, float var3) {
GlUtils.startScale((this.x + this.width) / 2, (this.y + this.height) / 2, introAnimation != null ? (float) introAnimation.getValue() : 1);
GlUtils.stopScale();
if (closing) {
if(introAnimation == null) {
mc.displayGuiScreen(null);
return;
}
introAnimation.setDirection(Direction.BACKWARDS);
if (introAnimation.isDone(Direction.BACKWARDS)) {
mc.displayGuiScreen(null);
}
}
}
@Override
protected void mouseClicked(int parInt1, int parInt2, int parInt3) {
}
@Override
public void initGui() {
sr = new ScaledResolution(mc);
x = sr.getScaledWidth()/4;
y = sr.getScaledHeight()/4;
width = x + sr.getScaledWidth()/2;
height = y + sr.getScaledHeight()/2;
introAnimation = Theme.getAnimation(Theme.getAnimationId(), 500, 1, 3, 3.8f, 1.35f, false);
}
@Override
protected void keyTyped(char par1, int par2) {
if (par2 == 0x01 || par2 == Minecraft.getMinecraft().gameSettings.keyBindClickGui.keyCode) {
closing = true;
}
}
public boolean isMouseInside(double mouseX, double mouseY, double x, double y, double width, double height) {
return (mouseX >= x && mouseX <= width) && (mouseY >= y && mouseY <= height);
}
}

View File

@ -0,0 +1,9 @@
package dev.resent.visual.ui.clickgui.rewrite.comp;
public abstract class Comp {
public abstract void draw();
public void mouseClicked() { }
public int x, y;
}

View File

@ -26,7 +26,7 @@ import com.google.common.collect.Lists;
import dev.resent.client.Resent;
import dev.resent.module.base.ModManager;
import dev.resent.util.misc.W;
import dev.resent.visual.ui.PreGUI;
import dev.resent.visual.ui.clickgui.PreGUI;
import net.lax1dude.eaglercraft.v1_8.Display;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.HString;

View File

@ -19,6 +19,8 @@ import org.teavm.jso.dom.html.HTMLDocument;
import org.teavm.jso.dom.html.HTMLElement;
import org.teavm.jso.webgl.WebGLRenderingContext;
import dev.resent.client.ClientInfo;
/**
* Copyright (c) 2022-2023 LAX1DUDE. All Rights Reserved.
*
@ -218,7 +220,7 @@ public class MainClass {
HTMLElement el = doc.getElementById(configRootElement);
StringBuilder str = new StringBuilder();
str.append("Game Crashed! I have fallen and I can't get up!\n\n");
str.append(ClientInfo.name + " " + ClientInfo.version + "has crashed! DM this crash message to me on discord, my tag is hooman#1196, along with steps to recreate the crash. \n\n");
str.append(t);
str.append('\n').append('\n');
str.append("eaglercraft.version = \"").append(EaglercraftVersion.projectForkVersion).append("\"\n");