Smooth scroll option & mod overflow fix
This commit is contained in:
parent
caba4f87ff
commit
adb95c142b
55276
javascript/classes.js
55276
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -8,6 +8,7 @@ import dev.resent.module.base.Mod.Category;
|
|||
import dev.resent.module.impl.hud.ArmorHud;
|
||||
import dev.resent.module.impl.hud.BPS;
|
||||
import dev.resent.module.impl.hud.CPS;
|
||||
import dev.resent.module.impl.hud.ClickGui;
|
||||
import dev.resent.module.impl.hud.ComboCounter;
|
||||
import dev.resent.module.impl.hud.FPS;
|
||||
import dev.resent.module.impl.hud.Freelook;
|
||||
|
@ -72,9 +73,11 @@ public class ModManager {
|
|||
public static SelfNametag selfNametag = new SelfNametag();
|
||||
public static Cape cape = new Cape();
|
||||
public static BPS bps = new BPS();
|
||||
public static ClickGui clickGui = new ClickGui();
|
||||
|
||||
public ModManager() {
|
||||
//Hud
|
||||
register(clickGui);
|
||||
register(bps);
|
||||
register(cape);
|
||||
register(selfNametag);
|
||||
|
|
19
src/main/java/dev/resent/module/impl/hud/ClickGui.java
Normal file
19
src/main/java/dev/resent/module/impl/hud/ClickGui.java
Normal file
|
@ -0,0 +1,19 @@
|
|||
package dev.resent.module.impl.hud;
|
||||
|
||||
import dev.resent.annotation.Module;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.base.Mod.Category;
|
||||
import dev.resent.module.base.setting.BooleanSetting;
|
||||
import dev.resent.module.base.setting.ModeSetting;
|
||||
|
||||
@Module(name = "ClickGUI", category = Category.HUD, hasSetting = true)
|
||||
public class ClickGui extends Mod{
|
||||
|
||||
public BooleanSetting scroll = new BooleanSetting("Smooth scroll", "", false);
|
||||
public ModeSetting guiTheme = new ModeSetting("Gui theme", "", "New", "Classic revised");
|
||||
|
||||
public ClickGui(){
|
||||
addSetting(scroll, guiTheme);
|
||||
}
|
||||
|
||||
}
|
|
@ -3,9 +3,7 @@ package dev.resent.module.impl.misc;
|
|||
import dev.resent.annotation.Module;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.base.Mod.Category;
|
||||
import dev.resent.module.base.setting.BooleanSetting;
|
||||
import dev.resent.module.base.setting.CustomRectSettingDraw;
|
||||
import dev.resent.module.base.setting.ModeSetting;
|
||||
import dev.resent.visual.cape.CapeUi;
|
||||
|
||||
@Module(name = "Cape", category = Category.MISC, hasSetting = true)
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.io.IOException;
|
|||
|
||||
import dev.resent.client.Resent;
|
||||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.base.ModManager;
|
||||
import dev.resent.module.base.Mod.Category;
|
||||
import dev.resent.module.base.setting.BooleanSetting;
|
||||
import dev.resent.module.base.setting.CustomRectSettingDraw;
|
||||
|
@ -70,7 +71,7 @@ public class ClickGUI extends GuiScreen {
|
|||
// Close ui
|
||||
mc.displayGuiScreen(null);
|
||||
this.modWatching = null;
|
||||
}else if(isMouseInside(mouseX, mouseY, this.x+48+xo, height-2-fh*-(off)+48-offset+15, this.x+80+xo, height+30-fh*-off+30+2-offset+10)){
|
||||
}else if(isMouseInside(mouseX, mouseY, this.x+48+xo, height-2-fh*-(off)+70-1-offset, this.x+80+xo, height+30-fh*-off+30+2-offset+17)){
|
||||
m.toggle();
|
||||
}/* else if (isMouseInside(mouseX, mouseY, this.x + 10 + xo - 2 + 10, height - 2 - fh * -(off) + 50 - 2 - offset, this.x + 90 + xo + 22, height + 30 - fh * (-off) + 30 + 2 - offset) && mouseButton == 0 && modWatching == null) {
|
||||
}
|
||||
|
@ -165,7 +166,7 @@ public class ClickGUI extends GuiScreen {
|
|||
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
|
||||
if (this.modWatching == null) {
|
||||
int fh = 9;
|
||||
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 30 - fh * (-off) + 30 + 2 - offset < y + 20 && introAnimation.isDone()) {
|
||||
if (height - 2 - fh * -(off) + 50 - 2 - offset > height + 29 && height + 40 - fh * (-off) + 30 +15 - offset < y + 20 && introAnimation.isDone()) {
|
||||
// Enabled outline
|
||||
|
||||
m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 5);
|
||||
|
@ -263,18 +264,19 @@ public class ClickGUI extends GuiScreen {
|
|||
for (int i = 0; i < 20; i++) {
|
||||
offset = MathHelper.clamp_int(offset + 1, 0, getListMaxScroll());
|
||||
try {
|
||||
if(ModManager.clickGui.scroll.getValue())
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
})
|
||||
.start();
|
||||
}).start();
|
||||
} else if (wheel > 0) {
|
||||
new Thread(() -> {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
offset = MathHelper.clamp_int(offset - 1, 0, getListMaxScroll());
|
||||
try {
|
||||
if(ModManager.clickGui.scroll.getValue())
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -293,6 +295,6 @@ public class ClickGUI extends GuiScreen {
|
|||
}
|
||||
|
||||
private int getListMaxScroll() {
|
||||
return 60 + 70 - this.height;
|
||||
return 130 - this.height;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user