1
0
Fork 0

improve container gui

This commit is contained in:
Sen 2025-09-07 14:03:54 +02:00
parent d44352c40e
commit 5421552dde
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
23 changed files with 133 additions and 190 deletions

View file

@ -608,12 +608,6 @@ public class Client implements IThreadListener {
@Variable(name = "gui_scale", category = CVarCategory.GUI, min = 1, max = 5, display = "Skalierung", unit = "x", callback = RedrawFunction.class)
private int scaleVar = 1;
@Variable(name = "gui_scale_items", category = CVarCategory.GUI, display = "Gegenstände vergrößern", callback = ItemRedrawFunction.class)
public boolean scaleItems = true;
@Variable(name = "gui_scale_items_always", category = CVarCategory.GUI, display = "Immer vergrößern", callback = ItemRedrawFunction.class)
public boolean scaleItemsAlways = false;
@Variable(name = "gui_scale_hotbar", category = CVarCategory.GUI, display = "Leiste vergrößern")
public boolean scaleHotbar = true;
@Variable(name = "hud_margin", category = CVarCategory.GUI, min = 0, max = 120, unit = "px", display = "Seitenabstand der HUD")
private int hudMargin = 4;
@Variable(name = "phy_sensitivity", category = CVarCategory.INPUT, min = 0.01f, max = 10.0f, display = "Mausempfindlichkeit", precision = 2, unit = "%")
@ -1182,7 +1176,7 @@ public class Client implements IThreadListener {
public void renderHud() {
final int selected = this.world != null && this.player != null && this.viewEntity == this.player ? this.player.getSelectedIndex() : -1;
final int scale = this.scaleHotbar ? 2 : 1;
final int scale = 2;
final int size = this.world != null && this.player != null && this.viewEntity == this.player ? this.player.getHotbarSize() : 1;
int total = 1;
if(this.world != null && this.player != null && this.viewEntity == this.player) {
@ -1224,7 +1218,7 @@ public class Client implements IThreadListener {
continue;
if(selected == n)
Drawing.drawRect(x - scale * 2, by - scale * 2, 20 * scale, 20 * scale, 0xffffffff);
InventoryButton.drawButton(this, x - scale, by - scale, 18 * scale, 18 * scale, this.scaleHotbar);
InventoryButton.drawButton(this, x - scale, by - scale, 18 * scale, 18 * scale);
x += (width >= 20 || selected == n || selected == n + 1 ? 20 : width) * scale;
}
@ -1283,7 +1277,7 @@ public class Client implements IThreadListener {
stats += 1;
}
x = this.fbX - this.hudMargin - 250;
y = this.fbY - this.hudMargin - 14 - (this.scaleHotbar ? 24 : 0) - stats * 40;
y = this.fbY - this.hudMargin - 14 - 24 - stats * 40;
int hp = entity.getHealth();
int max = entity.getMaxHealth();
y = this.drawStat(x, y, Color.RED + "Schaden", hp, max, 0xff0000);
@ -1316,7 +1310,7 @@ public class Client implements IThreadListener {
}
x = this.hudMargin;
y = this.fbY - this.hudMargin - 14 - (this.scaleHotbar ? 24 : 0) - (this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f ? 2 : 1) * 40;
y = this.fbY - this.hudMargin - 14 - 24 - (this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f ? 2 : 1) * 40;
if(this.player.isRidingHorse() && this.player.getHorseJumpPower() != 0.0f) // {
y = this.drawBar(x, y, String.format(Color.NEON + "Sprungkraft: " + Color.CYAN + "%d %%", (int)(this.player.getHorseJumpPower() * 100.0f)),
this.player.getHorseJumpPower(), 0x4040ff);
@ -1379,8 +1373,7 @@ public class Client implements IThreadListener {
ItemRenderer.enableGUIStandardItemLighting();
GL15.glPushMatrix();
GL15.glTranslatef(0.0f, (float)by, 0.0f);
if(this.scaleHotbar)
GL15.glScalef(2.0f, 2.0f, 2.0f);
GL15.glScalef(2.0f, 2.0f, 2.0f);
int xPos = xoff;
int cnt = 0;
@ -1433,7 +1426,7 @@ public class Client implements IThreadListener {
if(itemstack != null && itemstack.getItem().getCategory() == this.itemSelection) {
if(width >= 17 || index == selected) {
GuiContainer.renderItemOverlay(itemstack,
xPos, by, null, index == this.player.getSelectedIndex() ? this.controller.getUseCooldown() : 0, this.controller.getUseCooldownMax(), scale);
xPos, by, null, index == this.player.getSelectedIndex() ? this.controller.getUseCooldown() : 0, this.controller.getUseCooldownMax());
}
xPos += (width >= 20 || selected == index || selected == index + 1 ? 20 : width) * scale;
}