added grid view (recompile EPK)
Tested with all gui scales and resizing window Large and Auto do not work for grid view because the rect is too big for it to render in large and auto
This commit is contained in:
parent
fcae6d4f25
commit
94b14a7a73
BIN
desktopRuntime/resources/assets/eagler/gui/button_gridView.png
Normal file
BIN
desktopRuntime/resources/assets/eagler/gui/button_gridView.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
BIN
desktopRuntime/resources/assets/eagler/gui/button_normalView.png
Normal file
BIN
desktopRuntime/resources/assets/eagler/gui/button_normalView.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
30300
javascript/classes.js
30300
javascript/classes.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -60,6 +60,7 @@ public class ClickGuiRewrite extends GuiScreen {
|
||||||
private Color catagoryHUDColor = new Color(40, 40, 40);
|
private Color catagoryHUDColor = new Color(40, 40, 40);
|
||||||
private Color catagoryMiscColor = new Color(40, 40, 40);
|
private Color catagoryMiscColor = new Color(40, 40, 40);
|
||||||
public Category selectedCategory = null;
|
public Category selectedCategory = null;
|
||||||
|
public boolean isGridView = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float var3) {
|
public void drawScreen(int mouseX, int mouseY, float var3) {
|
||||||
|
@ -163,8 +164,6 @@ public class ClickGuiRewrite extends GuiScreen {
|
||||||
|
|
||||||
|
|
||||||
// Mod Categories
|
// Mod Categories
|
||||||
|
|
||||||
|
|
||||||
RenderUtils.drawRoundedRect(x + 80, y+90, (x + width) - 30, y+120, 8, new Color(30, 30, 30).getRGB());
|
RenderUtils.drawRoundedRect(x + 80, y+90, (x + width) - 30, y+120, 8, new Color(30, 30, 30).getRGB());
|
||||||
RenderUtils.drawRoundedRect(x + 85, y+95, x + 130, y+115, 8, catagoryAllColor.getRGB());
|
RenderUtils.drawRoundedRect(x + 85, y+95, x + 130, y+115, 8, catagoryAllColor.getRGB());
|
||||||
RenderUtils.drawRoundedRect(x + 135, y+95, x + 180, y+115, 8, catagoryHUDColor.getRGB());
|
RenderUtils.drawRoundedRect(x + 135, y+95, x + 180, y+115, 8, catagoryHUDColor.getRGB());
|
||||||
|
@ -172,12 +171,29 @@ public class ClickGuiRewrite extends GuiScreen {
|
||||||
fr.drawString("All", (int) x+102, (int) y+102, -1);
|
fr.drawString("All", (int) x+102, (int) y+102, -1);
|
||||||
fr.drawString("HUD", (int) x+149, (int) y+102, -1);
|
fr.drawString("HUD", (int) x+149, (int) y+102, -1);
|
||||||
fr.drawString("Misc", (int) x+198, (int) y+102, -1);
|
fr.drawString("Misc", (int) x+198, (int) y+102, -1);
|
||||||
|
// Switch ClickGui Mod View
|
||||||
|
drawRect((x+width) - 75, y+95, (x + width) - 74, y+ 115, new Color(90, 90, 90).getRGB());
|
||||||
|
String buttonToUse = "gridView";
|
||||||
|
if (isGridView) {
|
||||||
|
buttonToUse = "normalView";
|
||||||
|
}
|
||||||
|
if (isMouseInside(mouseX, mouseY, (x+width)-70, y+90, (x+width)-40, y+120)) {
|
||||||
|
RenderUtils.drawRoundedRect((x+width)-72, y+92, (x+width)-37, y+117, 2, secondaryFontColor.getRGB());
|
||||||
|
}
|
||||||
|
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/button_"+buttonToUse+".png"));
|
||||||
|
GlStateManager.color(1, 1, 1);
|
||||||
|
Gui.drawModalRectWithCustomSizedTexture((x+width)-70, (int) y+90, 0, 0, 30, 30, 30, 30);
|
||||||
|
|
||||||
/* !------------- HOME/MODULE (SOON) --------------------! */
|
/* !------------- HOME/MODULE (SOON) --------------------! */
|
||||||
//Draw module button
|
//Draw module button
|
||||||
|
int offsetX = 0;
|
||||||
|
int widthOfBody = 90;
|
||||||
|
int numElements = (int) Math.floor(width/widthOfBody) - 2;
|
||||||
|
int numElementsX = 0;
|
||||||
if(part == "Home") {
|
if(part == "Home") {
|
||||||
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
|
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
|
||||||
if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) {
|
if (!m.isAdmin() && m.getName().toLowerCase().startsWith(searchString.toLowerCase()) && selectedMod == null) {
|
||||||
|
if (!isGridView) {
|
||||||
if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height) {
|
if (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height) {
|
||||||
//Body
|
//Body
|
||||||
RenderUtils.drawRoundedRect(x+80, y+125+offset+scrollOffset, x+width-30, y+175+offset+scrollOffset, 16, secondaryColor);
|
RenderUtils.drawRoundedRect(x+80, y+125+offset+scrollOffset, x+width-30, y+175+offset+scrollOffset, 16, secondaryColor);
|
||||||
|
@ -210,6 +226,55 @@ public class ClickGuiRewrite extends GuiScreen {
|
||||||
}
|
}
|
||||||
offset += 60;
|
offset += 60;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
if (y+125+offset+scrollOffset > y+95 && y+240+offset+scrollOffset < y+height) {
|
||||||
|
//Body
|
||||||
|
RenderUtils.drawRoundedRect(x+85+offsetX, y+125+offset+scrollOffset, x+175+offsetX, y+250+offset+scrollOffset, 16, secondaryColor);
|
||||||
|
|
||||||
|
|
||||||
|
//Gear
|
||||||
|
if (m.doesHaveSetting()) {
|
||||||
|
if (isMouseInside(mouseX, mouseY, x+140+offsetX, (int) y+220+offset+scrollOffset, x+160+offsetX, (int) y+240+offset+scrollOffset)) {
|
||||||
|
RenderUtils.drawRoundedRect(x+135+offsetX, (int) y+215+offset+scrollOffset, x+165+offsetX, (int) y+245+offset+scrollOffset, 8, secondaryFontColor.getRGB());
|
||||||
|
}
|
||||||
|
GlStateManager.color(1, 1, 1);
|
||||||
|
mc.getTextureManager().bindTexture(new ResourceLocation("eagler:gui/gear2.png"));
|
||||||
|
Gui.drawModalRectWithCustomSizedTexture(x+140+offsetX, (int) y+220+offset+scrollOffset, 0, 0, 20, 20, 20, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Toggle
|
||||||
|
m.toggleAnimation.setAnimation(m.isEnabled() ? 20 : 0, 12);
|
||||||
|
RenderUtils.drawRoundedRect(x+92+offsetX, y+222+offset+scrollOffset, x+127+offsetX, y+237+offset+scrollOffset, 8, new Color(66, 66, 66).getRGB(), true);
|
||||||
|
RenderUtils.drawRoundedRect(x+92+offsetX, y+222+offset+scrollOffset, x+107+offsetX+m.toggleAnimation.getValue(), y+237+offset+scrollOffset, 8, secondaryFontColor.getRGB(), true);
|
||||||
|
RenderUtils.drawRoundedRect(x+93+offsetX+m.toggleAnimation.getValue(), y+222+offset+scrollOffset, x+108+offsetX+m.toggleAnimation.getValue(), y+237+offset+scrollOffset, 8, new Color(180, 180, 180).getRGB(), true);
|
||||||
|
RenderUtils.drawRoundedRect(x+92+offsetX+m.toggleAnimation.getValue(), y+222+offset+scrollOffset, x+107+offsetX+m.toggleAnimation.getValue(), y+237+offset+scrollOffset, 8, -1, true);
|
||||||
|
|
||||||
|
GlUtils.startScale(x+92+offsetX, y+180+offset+scrollOffset, 1);
|
||||||
|
int i = fr.drawString(m.getName(), x+92+offsetX, y+180+offset+scrollOffset, -1, false);
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
GlUtils.startScale(x+92+offsetX, y+190+offset+scrollOffset, 0.7f);
|
||||||
|
if (!m.getDescription().startsWith("No des")) {
|
||||||
|
// did this to cut up the description so it fits
|
||||||
|
String description0 = (m.getDescription() + " ").substring(0, 21);
|
||||||
|
String description1 = (m.getDescription() + " ").substring(21, 41);
|
||||||
|
String description2 = (m.getDescription() + " ").substring(41, 61);
|
||||||
|
fr.drawString(description0, x+92+offsetX, y+200+offset+scrollOffset, -1, false);
|
||||||
|
fr.drawString(description1, x+92+offsetX, y+210+offset+scrollOffset, -1, false);
|
||||||
|
fr.drawString(description2, x+92+offsetX, y+220+offset+scrollOffset, -1, false);
|
||||||
|
}
|
||||||
|
GlStateManager.popMatrix();
|
||||||
|
}
|
||||||
|
numElementsX++;
|
||||||
|
offsetX += 100;
|
||||||
|
if (numElementsX % numElements == 0) {
|
||||||
|
offset += 130;
|
||||||
|
offsetX = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else if(part == "Setting") {
|
}else if(part == "Setting") {
|
||||||
fr.drawString("Not sure what to put here yet. DM me with suggestions! My discord is hooman#1196.", x+100, y+120, -1, false);
|
fr.drawString("Not sure what to put here yet. DM me with suggestions! My discord is hooman#1196.", x+100, y+120, -1, false);
|
||||||
|
@ -286,10 +351,22 @@ public class ClickGuiRewrite extends GuiScreen {
|
||||||
selectedCategory = Category.MISC;
|
selectedCategory = Category.MISC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isMouseInside(mouseX, mouseY, (x+width)-70, y+90, (x+width)-40, y+120) && mouseButton == 0) {
|
||||||
|
playPressSound();
|
||||||
|
isGridView = !isGridView;
|
||||||
|
}
|
||||||
|
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
|
int offsetX = 0;
|
||||||
|
int widthOfBody = 90;
|
||||||
|
int numElements = (int) Math.floor(width/widthOfBody) - 2;
|
||||||
|
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 (y+125+offset+scrollOffset > y+95 && y+175+offset+scrollOffset < y+height && part == "Home") {
|
||||||
|
if (!isGridView) {
|
||||||
|
|
||||||
|
|
||||||
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();
|
||||||
|
@ -308,9 +385,31 @@ public class ClickGuiRewrite extends GuiScreen {
|
||||||
playPressSound();
|
playPressSound();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
offset += 60;
|
offset += 60;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
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;
|
||||||
|
playPressSound();
|
||||||
|
drawSetting();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMouseInside(mouseX, mouseY, x+92+offsetX, y+222+offset+scrollOffset, x+127+offsetX, y+237+offset+scrollOffset)) {
|
||||||
|
if (mouseButton == 0 && selectedMod == null) {
|
||||||
|
m.toggle();
|
||||||
|
playPressSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
numElementsX++;
|
||||||
|
offsetX += 100;
|
||||||
|
if (numElementsX % numElements == 0) {
|
||||||
|
offset += 130;
|
||||||
|
offsetX = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedMod != null) {
|
if (selectedMod != null) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user