From 78189ed862b1090a447120d987a9b01c514f5541 Mon Sep 17 00:00:00 2001 From: Electroblob77 <35599699+Electroblob77@users.noreply.github.com> Date: Sat, 5 Jan 2019 22:30:06 +0000 Subject: [PATCH] Fix a few things in the HUD skin chooser screen --- .../wizardry/client/gui/GuiSelectHUDSkin.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/electroblob/wizardry/client/gui/GuiSelectHUDSkin.java b/src/main/java/electroblob/wizardry/client/gui/GuiSelectHUDSkin.java index 1da12067..92a1fbe8 100644 --- a/src/main/java/electroblob/wizardry/client/gui/GuiSelectHUDSkin.java +++ b/src/main/java/electroblob/wizardry/client/gui/GuiSelectHUDSkin.java @@ -6,10 +6,13 @@ import javax.annotation.Nullable; import com.google.common.collect.Lists; +import electroblob.wizardry.Wizardry; import electroblob.wizardry.client.gui.GuiSpellDisplay.Skin; import electroblob.wizardry.registry.Spells; +import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.resources.I18n; import net.minecraftforge.fml.client.config.GuiSelectString; import net.minecraftforge.fml.client.config.IConfigElement; @@ -22,8 +25,19 @@ public class GuiSelectHUDSkin extends GuiSelectString { @Override public void initGui(){ super.initGui(); + setEntryListDimensions(); + } + + @Override + protected void actionPerformed(GuiButton button){ + super.actionPerformed(button); + setEntryListDimensions(); // Stops the entry list from resizing when a button is pressed + } + + private void setEntryListDimensions(){ this.entryList.setDimensions(150, height, 43, height-43); this.entryList.left = 10; + this.entryList.maxEntryWidth = 120; this.entryList.headerPadding = 5; } @@ -36,7 +50,7 @@ public class GuiSelectHUDSkin extends GuiSelectString { if(this.currentValue instanceof String){ - this.drawString(this.fontRenderer, "Preview:", 170, 44, 0xffffff); + this.drawString(this.fontRenderer, I18n.format("config." + Wizardry.MODID + ":spell_hud_skin.preview"), 170, 44, 0xffffff); int previewLeft = 170; int previewRight = width-10;