some more ui improvements
This commit is contained in:
parent
021f2ef785
commit
d6f70abc68
|
@ -20,7 +20,10 @@ public class Info extends RenderMod {
|
||||||
public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" };
|
public static final String[] directionsF = new String[] { "\u00A79S\u00A7r", "\u00A72W\u00A7r", "\u00A74N\u00A7r", "\u00A76E\u00A7r" };
|
||||||
|
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
return mc.fontRendererObj.getStringWidth("X: " + mc.thePlayer.posX + " Dir: " + directionsF[MathHelper.floor_double(this.mc.thePlayer.rotationYaw * 4 / 360 + 0.5) & 3]);
|
int px = (int) mc.thePlayer.posX;
|
||||||
|
int py = (int) mc.thePlayer.posY;
|
||||||
|
int pz = (int) mc.thePlayer.posZ;
|
||||||
|
return 5 + mc.fontRendererObj.getStringWidth(" X: Biome:" + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName + Math.max(py, pz));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
|
@ -41,7 +44,7 @@ public class Info extends RenderMod {
|
||||||
|
|
||||||
if (direction.getValue()){
|
if (direction.getValue()){
|
||||||
drawString(" Dir: ", this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
|
drawString(" Dir: ", this.x + 5 + mc.fontRendererObj.getStringWidth(" X: " + px), this.y + 14, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
|
||||||
mc.fontRendererObj.drawString(directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth("X: " + px), this.y + 14, -1, Theme.getTextShadow());
|
mc.fontRendererObj.drawString(directionsF[rot], this.x+5+mc.fontRendererObj.getStringWidth(" X: Dir: " + px), this.y + 14, -1, Theme.getTextShadow());
|
||||||
}
|
}
|
||||||
drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x + 5, this.y + 44, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
|
drawString(" Biome: " + mc.theWorld.getBiomeGenForCoords(new BlockPos(px, py, pz)).biomeName, this.x + 5, this.y + 44, Theme.getFontColor(Theme.getFontId()), Theme.getTextShadow());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package dev.resent.visual.ui;
|
package dev.resent.visual.ui;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
import dev.resent.client.ClientInfo;
|
import dev.resent.client.ClientInfo;
|
||||||
import dev.resent.client.Resent;
|
import dev.resent.client.Resent;
|
||||||
|
@ -59,6 +60,7 @@ public class ClickGUI extends GuiScreen {
|
||||||
this.openedMod = null;
|
this.openedMod = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName())));
|
||||||
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory) ) {
|
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory) ) {
|
||||||
int fh = 9;
|
int fh = 9;
|
||||||
|
|
||||||
|
@ -89,8 +91,7 @@ public class ClickGUI extends GuiScreen {
|
||||||
|
|
||||||
if (openedMod != null) {
|
if (openedMod != null) {
|
||||||
int var = 0;
|
int var = 0;
|
||||||
for (int asdf = 0; asdf < this.openedMod.settings.size(); asdf++) {
|
for (Setting s : this.openedMod.settings) {
|
||||||
Setting s = this.openedMod.settings.get(asdf);
|
|
||||||
|
|
||||||
if (s instanceof BooleanSetting) {
|
if (s instanceof BooleanSetting) {
|
||||||
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) {
|
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) {
|
||||||
|
@ -173,6 +174,8 @@ public class ClickGUI extends GuiScreen {
|
||||||
//white line
|
//white line
|
||||||
drawRect(x - 8, height + 29, width + 33, height + 30, -1);
|
drawRect(x - 8, height + 29, width + 33, height + 30, -1);
|
||||||
GlUtils.stopScale();
|
GlUtils.stopScale();
|
||||||
|
|
||||||
|
Resent.INSTANCE.modManager.modsInCategory(selectedCategory).sort(Comparator.comparingInt(m -> fr.getStringWidth(m.getName())));
|
||||||
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
|
for (Mod m : Resent.INSTANCE.modManager.modsInCategory(selectedCategory)) {
|
||||||
if (this.openedMod == null) {
|
if (this.openedMod == null) {
|
||||||
int fh = 9;
|
int fh = 9;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user