This commit is contained in:
ThisIsALegitUsername 2023-02-22 01:16:16 +00:00
parent 57a39085dc
commit 34e8196a24
7 changed files with 43 additions and 32240 deletions

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ import net.minecraft.client.renderer.texture.DynamicTexture;
public class CapeUi extends GuiScreen { public class CapeUi extends GuiScreen {
public void initGui() { public void initGui() {
buttonList.add(new GuiButton(200, width / 2 - 100, height / 6 + 128, "Back")); buttonList.add(new GuiButton(200, width / 2 - 100, height / 6 + 128, "Close"));
buttonList.add(new GuiButton(1, width / 2 - 100, height / 6 + 150, "Choose cape")); buttonList.add(new GuiButton(1, width / 2 - 100, height / 6 + 150, "Choose cape"));
} }

View File

@ -4,8 +4,19 @@ import dev.resent.annotation.Module;
import dev.resent.cape.CapeUi; import dev.resent.cape.CapeUi;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.base.Mod.Category; import dev.resent.module.base.Mod.Category;
import dev.resent.module.setting.CustomRectSettingDraw;
@Module(name = "Cape", category = Category.MISC) @Module(name = "Cape", category = Category.MISC)
public class Cape extends Mod{ public class Cape extends Mod{
public CustomRectSettingDraw open = new CustomRectSettingDraw("Choose cape", "Select which cape you want to use"){
@Override
public void onChange(){
mc.displayGuiScreen(new CapeUi());
}
};
public Cape(){
addSetting(open);
}
} }

View File

@ -0,0 +1,9 @@
package dev.resent.module.setting;
public class CustomRectSettingDraw extends Setting{
public CustomRectSettingDraw(String name, String description){
super(name, description);
}
public void onChange(){ }
}

View File

@ -18,7 +18,7 @@ public class NumberSetting extends Setting {
this.min = min; this.min = min;
this.max = max; this.max = max;
} }
public void incr() { public void incr() {
if (value + increment >= max) { if (value + increment >= max) {
value = max; value = max;

View File

@ -16,4 +16,6 @@ public class Setting {
this.description = description; this.description = description;
this.gameSetting = gameSetting; this.gameSetting = gameSetting;
} }
public void draw(int x, int y){ }
} }

View File

@ -5,6 +5,7 @@ import java.io.IOException;
import dev.resent.client.Resent; import dev.resent.client.Resent;
import dev.resent.module.base.Mod; import dev.resent.module.base.Mod;
import dev.resent.module.setting.BooleanSetting; import dev.resent.module.setting.BooleanSetting;
import dev.resent.module.setting.CustomRectSettingDraw;
import dev.resent.module.setting.ModeSetting; import dev.resent.module.setting.ModeSetting;
import dev.resent.module.setting.Setting; import dev.resent.module.setting.Setting;
import dev.resent.ui.animation.Animation; import dev.resent.ui.animation.Animation;
@ -85,14 +86,21 @@ public class ClickGUI extends GuiScreen {
if (s instanceof BooleanSetting) { if (s instanceof BooleanSetting) {
b = (BooleanSetting) s; b = (BooleanSetting) s;
if (isMouseInside(mouseX, mouseY, this.x + 6 + 1 + 6, height - 9 + 50 - offset + var + 1, this.x + 15 - 1 + 6, height - 9 + 50 + 9 - offset + var - 1) && mouseButton == 0) { if (isMouseInside(mouseX, mouseY, this.x + 13, height - 9 + 50 - offset + var + 1, this.x + 20, height - 9 + 50 + 9 - offset + var - 1) && mouseButton == 0) {
b.toggle(); b.toggle();
} }
} }
if (s instanceof ModeSetting) { if (s instanceof ModeSetting) {
m = (ModeSetting) s; m = (ModeSetting) s;
if (isMouseInside(mouseX, mouseY, this.x + 24, height - 9 + 50 + var, this.x + 24 + fr.getStringWidth(s.name + ": " + m.getValue()), height - 9 + 50 + var + 9) && mouseButton == 0) m.next(); if (isMouseInside(mouseX, mouseY, this.x + 24, height - 9 + 50 + var, this.x + 24 + fr.getStringWidth(s.name + ": " + m.getValue()), height - 9 + 50 + var + 9) && mouseButton == 0)
m.next();
}
if(s instanceof CustomRectSettingDraw){
if(isMouseInside(mouseX, mouseY, x+20, height+41+var, x+24+fr.getStringWidth(s.name), height+var+50)){
((CustomRectSettingDraw)s).onChange();
}
} }
var += 9 + 2; var += 9 + 2;
@ -157,13 +165,14 @@ public class ClickGUI extends GuiScreen {
); );
if (m.isHasSetting()) { if (m.isHasSetting()) {
GlStateManager.enableBlend();
GlStateManager.color(1, 1, 1);
this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 99 + xo, height - 2 - fh * -(off) + 51 + 1 - offset, 0, 0, 8, 8, 8, 8);
if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, this.x + 90 + xo - 1 + 10 + fr.getStringWidth("o"), height - 2 - fh * -(off) + 51 + 1 - offset + 9)) GlStateManager.color(1, 1, 1, 0.6f); else { if (isMouseInside(mouseX, mouseY, this.x + 90 + xo - 1 + 10, height - 2 - fh * -(off) + 51 + 1 - offset, this.x + 90 + xo - 1 + 10 + fr.getStringWidth("o"), height - 2 - fh * -(off) + 51 + 1 - offset + 9)) GlStateManager.color(1, 1, 1, 0.6f); else {
GlStateManager.enableBlend(); GlStateManager.color(1, 1, 1, 0.75f);
this.mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear.png"));
Gui.drawModalRectWithCustomSizedTexture(this.x + 99 + xo, height - 2 - fh * -(off) + 51 + 1 - offset, 0, 0, 8, 8, 8, 8);
GlStateManager.color(1, 1, 1);
GlStateManager.disableBlend();
} }
GlStateManager.disableBlend();
} }
fr.drawStringWithShadow(m.getName(), this.x + 15 + 7 + xo, height - fh * -(off) + 50 - offset, -1); fr.drawStringWithShadow(m.getName(), this.x + 15 + 7 + xo, height - fh * -(off) + 50 - offset, -1);
@ -191,8 +200,9 @@ public class ClickGUI extends GuiScreen {
if (s instanceof ModeSetting) { if (s instanceof ModeSetting) {
mo = (ModeSetting) s; mo = (ModeSetting) s;
fr.drawStringWithShadow(s.name + ": " + mo.getValue(), this.x + 18 + 6, height - 9 + 50 + var, -1); fr.drawStringWithShadow(s.name + ": " + mo.getValue(), this.x + 18 + 6, height - 9 + 50 + var, -1);
} else { } else if(s instanceof CustomRectSettingDraw){
fr.drawStringWithShadow(s.name, this.x + 18 + 6, height - 9 + 50 + var, -1); Gui.drawRect(x+20, height+41+var, x+24+fr.getStringWidth(s.name), height+var+50, new Color(255, 255, 255, 70).getRGB());
fr.drawStringWithShadow(s.name, this.x + 24, height +41 + var, -1);
} }
var += 9 + 2; var += 9 + 2;