fix kone-chan's code

This commit is contained in:
ThisIsALegitUsername 2023-04-13 00:26:54 +00:00
parent ca532da0c6
commit 16cfb43fc5
3 changed files with 11369 additions and 11361 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.KeyboardConstants;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord; import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.audio.SoundHandler;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiScreen;
@ -344,11 +343,10 @@ public class ClickGuiRewrite extends GuiScreen {
if (isMouseInside(mouseX, mouseY, (x+width)-70, y+90, (x+width)-40, y+120) && mouseButton == 0) { if (isMouseInside(mouseX, mouseY, (x+width)-70, y+90, (x+width)-40, y+120) && mouseButton == 0) {
playPressSound(); playPressSound();
switch(currentView){ if(currentView == "normalView"){
case "normalView": currentView = "gridView";
currentView = "gridView"; }else if(currentView == "gridView"){
case "gridView": currentView = "normalView";
currentView = "normalView";
} }
} }
@ -358,49 +356,57 @@ public class ClickGuiRewrite extends GuiScreen {
int numElementsX = 0; int numElementsX = 0;
for (Mod m : Resent.INSTANCE.modManager.modules) { for (Mod m : Resent.INSTANCE.modManager.modules) {
if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) { if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) {
if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") { if (currentView == "normalView") {
if (currentView == "normalView") { if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") {
if (isMouseInside(mouseX, mouseY, x+width-70, y+140+offset+scrollOffset, x+width-50, y+140+offset+scrollOffset+20) && mouseButton == 0 && m.doesHaveSetting()) { if (isMouseInside(mouseX, mouseY, x+width-70, y+140+offset+scrollOffset, x+width-50, y+140+offset+scrollOffset+20) && mouseButton == 0 && m.doesHaveSetting()) {
selectedMod = m; selectedMod = m;
playPressSound(); playPressSound();
drawSetting(); drawSetting();
} }
if (isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) { if (isMouseInside(mouseX, mouseY, x+80, y+125+offset+scrollOffset, x+width-20, y+175+offset+scrollOffset)) {
if (mouseButton == 1 && m.doesHaveSetting()) { if (mouseButton == 1 && m.doesHaveSetting()) {
selectedMod = m; selectedMod = m;
playPressSound(); playPressSound();
drawSetting(); drawSetting();
} }
if (mouseButton == 0 && selectedMod == null) { if (mouseButton == 0 && selectedMod == null) {
m.toggle(); m.toggle();
playPressSound(); playPressSound();
} }
} }
offset += 60; }
}else if(currentView == "gridView"){ offset += 60;
} else if(currentView == "gridView"){
if (y+125+offset+scrollOffset > y+95 && y+240+offset+scrollOffset < y+height) {
if (isMouseInside(mouseX, mouseY, x+140+offsetX, (int) y+220+offset+scrollOffset, x+160+offsetX, (int) y+240+offset+scrollOffset) && mouseButton == 0 && m.doesHaveSetting()) { if (isMouseInside(mouseX, mouseY, x+140+offsetX, (int) y+220+offset+scrollOffset, x+160+offsetX, (int) y+240+offset+scrollOffset) && mouseButton == 0 && m.doesHaveSetting()) {
selectedMod = m; selectedMod = m;
playPressSound(); playPressSound();
drawSetting(); drawSetting();
} }
if (isMouseInside(mouseX, mouseY, x+92+offsetX, y+222+offset+scrollOffset, x+127+offsetX, y+237+offset+scrollOffset)) { if (isMouseInside(mouseX, mouseY, x+85+offsetX, y+125+offset+scrollOffset, x+175+offsetX, y+250+offset+scrollOffset)) {
if (mouseButton == 0 && selectedMod == null) { if (mouseButton == 1 && m.doesHaveSetting()) {
m.toggle(); selectedMod = m;
playPressSound(); playPressSound();
} drawSetting();
} }
numElementsX++;
offsetX += 100;
if (numElementsX % numElements == 0) {
offset += 130;
offsetX = 0;
}
}
}
if (mouseButton == 0 && selectedMod == null) {
m.toggle();
playPressSound();
}
}
}
numElementsX++;
offsetX += 100;
if (numElementsX % numElements == 0) {
offset += 130;
offsetX = 0;
}
}
} }
} }