Merge branch 'new' of https://github.com/ThisIsALegitUsername/Resent-1.8 into new
This commit is contained in:
commit
d94ffce9c9
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because it is too large
Load Diff
61655
javascript/classes.js
61655
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -130,8 +130,9 @@ public class PlatformAudio {
|
|||
|
||||
public void errorMessage(String parString1, String parString2, int parInt1) {
|
||||
if (!parString2.isEmpty()) {
|
||||
logger.error("Error in class \"{}\"!", parString1);
|
||||
logger.error(parString2);
|
||||
// stfu pls
|
||||
//logger.error("Error in class \"{}\"!", parString1);
|
||||
//logger.error(parString2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
26
src/main/java/dev/resent/util/misc/TimerUtil.java
Normal file
26
src/main/java/dev/resent/util/misc/TimerUtil.java
Normal file
|
@ -0,0 +1,26 @@
|
|||
package dev.resent.util.misc;
|
||||
|
||||
public class TimerUtil {
|
||||
private static long halfSecond = 500000000;
|
||||
private long lastTime;
|
||||
|
||||
private long getDeltaTime(){
|
||||
return (System.nanoTime()-lastTime);
|
||||
}
|
||||
|
||||
private void updateTime(){
|
||||
this.lastTime = System.nanoTime();
|
||||
}
|
||||
|
||||
public TimerUtil() {
|
||||
this.lastTime = System.nanoTime();
|
||||
}
|
||||
|
||||
public boolean hasHalfSecondPassoed() {
|
||||
if (getDeltaTime() >= halfSecond) {
|
||||
updateTime();
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
}
|
|
@ -7,7 +7,6 @@ import dev.resent.client.Resent;
|
|||
import dev.resent.module.base.Mod;
|
||||
import dev.resent.module.base.setting.BooleanSetting;
|
||||
import dev.resent.module.base.setting.Setting;
|
||||
import dev.resent.util.misc.FuncUtils;
|
||||
import dev.resent.util.misc.GlUtils;
|
||||
import dev.resent.util.render.Color;
|
||||
import dev.resent.util.render.RenderUtils;
|
||||
|
@ -25,8 +24,8 @@ import net.minecraft.client.gui.FontRenderer;
|
|||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.EntityRenderer;
|
||||
import net.minecraft.util.ChatAllowedCharacters;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
|
@ -37,7 +36,7 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
public float x, y, width, height;
|
||||
public Animation introAnimation;
|
||||
public ScaledResolution sr;
|
||||
public boolean closing;
|
||||
public boolean closing, isSearchFocused;
|
||||
public Mod selectedMod;
|
||||
public String searchString = "";
|
||||
public SimpleAnimation partAnimation = new SimpleAnimation(0);
|
||||
|
@ -63,13 +62,13 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
RenderUtils.drawRoundedRect(x + 60, y, x + width, y + height, 32, backgroundColor);
|
||||
Gui.drawRect(x + 60, y, x + 102, y + height, backgroundColor);
|
||||
|
||||
//Seperating line
|
||||
//Separating line
|
||||
Gui.drawRect(x, y + 90, x + width, y + 95, secondaryColor);
|
||||
|
||||
//Title
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x + 80, y + 36, 0);
|
||||
GlStateManager.scale(3.5f, 3.5f, 1);
|
||||
GlStateManager.scale(3.5F, 3.5F, 1);
|
||||
GlStateManager.translate(-(x + 80), -(y + 36), 0);
|
||||
fr.drawString("Resent", x + 80, y + 36, -1, false);
|
||||
GlStateManager.popMatrix();
|
||||
|
@ -79,22 +78,29 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
|
||||
//Navigation icons
|
||||
GlStateManager.color(1, 1, 1);
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("/resent/house.png"));
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/house.png"));
|
||||
Gui.drawModalRectWithCustomSizedTexture(x + 20, (int) y + 120, 0, 0, 20, 20, 20, 20);
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("/resent/gear.png"));
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png"));
|
||||
Gui.drawModalRectWithCustomSizedTexture(x + 20, (int) y + 170, 0, 0, 20, 20, 20, 20);
|
||||
|
||||
//Search
|
||||
RenderUtils.drawRoundedRect(x + width - 300, y + 25, x + width - 50, y + 65, 9, secondaryColor);
|
||||
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate(x + width - 290, y + 40, 0);
|
||||
GlStateManager.scale(1.5f, 1.5f, 1);
|
||||
GlStateManager.scale(1.5F, 1.5F, 1);
|
||||
GlStateManager.translate(-(x + width - 290), -(y + 40), 0);
|
||||
if (searchString.length() > 0) {
|
||||
fr.drawString(searchString, x + width - 290, y + 40, secondaryFontColor, false);
|
||||
} else {
|
||||
fr.drawString("Search", x+width-290, y+40, new Color(97, 97, 97).getRGB(), false);
|
||||
fr.drawString(EnumChatFormatting.ITALIC + "Search", x + width - 290, y + 40, new Color(97, 97, 97).getRGB(), false);
|
||||
}
|
||||
|
||||
if (isSearchFocused) {
|
||||
drawRect(x + width - 290 + fr.getStringWidth(searchString), y + 38, x + width - 289 + fr.getStringWidth(searchString), y + 50, secondaryFontColor);
|
||||
}
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
//Draw module button
|
||||
|
@ -108,7 +114,7 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
//Gear
|
||||
if (m.doesHaveSetting()) {
|
||||
GlStateManager.color(1, 1, 1);
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("/resent/gear.png"));
|
||||
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png"));
|
||||
Gui.drawModalRectWithCustomSizedTexture(x + width - 60, (int) y + 140 + offset + scrollOffset, 0, 0, 20, 20, 20, 20);
|
||||
}
|
||||
//RenderUtils.drawRoundedRect(x+width-60, y+140+offset, x+width-40, y+160+offset, 4, -1);
|
||||
|
@ -149,6 +155,7 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
mc.displayGuiScreen(null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -160,6 +167,12 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
partAnimation.setAnimation(0 - partOffset, 10);
|
||||
}
|
||||
|
||||
if (isMouseInside(mouseX, mouseY, x + width - 300, y + 25, x + width - 50, y + 65)) {
|
||||
isSearchFocused = true;
|
||||
} else {
|
||||
isSearchFocused = false;
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
|
||||
for (Mod m: Resent.INSTANCE.modManager.modules) {
|
||||
|
@ -189,9 +202,9 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
sr = new ScaledResolution(mc);
|
||||
x = sr.getScaledWidth() / 10;
|
||||
y = sr.getScaledHeight() / 10;
|
||||
width = sr.getScaledWidth()/1.25f;
|
||||
height = sr.getScaledHeight()/1.25f;
|
||||
introAnimation = Theme.getAnimation(500, 1, 3, 3.8f, 1.35f, false);
|
||||
width = sr.getScaledWidth() / 1.25F;
|
||||
height = sr.getScaledHeight() / 1.25F;
|
||||
introAnimation = Theme.getAnimation(500, 1, 3, 3.8F, 1.35F, false);
|
||||
fr = mc.fontRendererObj;
|
||||
}
|
||||
|
||||
|
@ -208,12 +221,12 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
}
|
||||
|
||||
// Search box stuff
|
||||
else if(key == KeyboardConstants.KEY_BACK) {
|
||||
else if (key == KeyboardConstants.KEY_BACK && isSearchFocused) {
|
||||
if (searchString.length() != 0) {
|
||||
searchString = searchString.substring(0, searchString.length() - 1);
|
||||
}
|
||||
} else {
|
||||
if(searchString.length() <= 18) {
|
||||
if (searchString.length() <= 18 && isSearchFocused) {
|
||||
String balls = ChatAllowedCharacters.filterAllowedCharacters(String.valueOf(par1));
|
||||
if (balls != null && balls != "") {
|
||||
searchString += String.valueOf(par1);
|
||||
|
@ -221,9 +234,9 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleMouseInput() throws IOException {
|
||||
int scroll = Mouse.getEventDWheel();
|
||||
|
@ -241,7 +254,6 @@ public class ClickGuiRewrite extends GuiScreen{
|
|||
}
|
||||
|
||||
public int getMaxScroll() {
|
||||
return Resent.INSTANCE.modManager.modules.size() * -68;
|
||||
return Resent.INSTANCE.modManager.modules.size() * -69;
|
||||
}
|
||||
|
||||
}
|
|
@ -53,6 +53,26 @@ public class ScaledResolution {
|
|||
this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD);
|
||||
}
|
||||
|
||||
public ScaledResolution(Minecraft parMinecraft, int uwu) {
|
||||
this.scaledWidth = parMinecraft.displayWidth;
|
||||
this.scaledHeight = parMinecraft.displayHeight;
|
||||
this.scaleFactor = 1;
|
||||
boolean flag = parMinecraft.isUnicode();
|
||||
|
||||
while (this.scaleFactor < uwu && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) {
|
||||
++this.scaleFactor;
|
||||
}
|
||||
|
||||
if (flag && this.scaleFactor % 2 != 0 && this.scaleFactor != 1) {
|
||||
--this.scaleFactor;
|
||||
}
|
||||
|
||||
this.scaledWidthD = (double) this.scaledWidth / (double) this.scaleFactor;
|
||||
this.scaledHeightD = (double) this.scaledHeight / (double) this.scaleFactor;
|
||||
this.scaledWidth = MathHelper.ceiling_double_int(this.scaledWidthD);
|
||||
this.scaledHeight = MathHelper.ceiling_double_int(this.scaledHeightD);
|
||||
}
|
||||
|
||||
public int getScaledWidth() {
|
||||
return this.scaledWidth;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user