diff options
author | Lulonaut <67191924+Lulonaut@users.noreply.github.com> | 2022-02-09 00:16:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-08 18:16:09 -0500 |
commit | 346788609546690084f21210c52940b7a4b6c99c (patch) | |
tree | 8f78a9ff197ea9992afc541bcc0694c1797cd0ce | |
parent | a703867e3ac945446dde06fbc2984835e790ffe3 (diff) | |
download | NotEnoughUpdates-346788609546690084f21210c52940b7a4b6c99c.tar.gz NotEnoughUpdates-346788609546690084f21210c52940b7a4b6c99c.tar.bz2 NotEnoughUpdates-346788609546690084f21210c52940b7a4b6c99c.zip |
bug fixes (#75)
* professional fix
* fix neuec presets not copying some attributes
* make it better and dismiss review from nea :)
* add strikethrough fix to changelog (sorry nea)
3 files changed, 8 insertions, 25 deletions
diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index ccf13781..ee124398 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -74,6 +74,7 @@ - Fixed /locraw detection, [previously allowed chat messages to trigger it](https://github.com/NotEnoughUpdates/NotEnoughUpdates/issues/35) - IRONM00N - Fixed experiment timer in todo overlay - efefury - Fixed replace click events with /pv working in other modes +- Fixed /neuec presets not applying the strikethrough attribute - Lulonaut ### **Other** - New icons was added in storage_icons.png - Moved the help icon in /neucustomize over a little diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDropdown.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDropdown.java index e75d9a54..2271c4ad 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDropdown.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDropdown.java @@ -6,7 +6,9 @@ import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; +import net.minecraft.client.renderer.GlStateManager; import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; public class GuiOptionEditorDropdown extends GuiOptionEditor { private final String[] values; @@ -25,7 +27,6 @@ public class GuiOptionEditorDropdown extends GuiOptionEditor { @Override public void render(int x, int y, int width) { super.render(x, y, width); - if (!open) { int height = getHeight(); @@ -66,6 +67,9 @@ public class GuiOptionEditorDropdown extends GuiOptionEditor { int main = 0xff202026; int blue = 0xff2355ad; + + GlStateManager.pushMatrix(); + GL11.glTranslated(0, 0, 100); Gui.drawRect(left, top, left + 1, top + dropdownHeight, blue); //Left Gui.drawRect(left + 1, top, left + dropdownWidth, top + 1, blue); //Top Gui.drawRect(left + dropdownWidth - 1, top + 1, left + dropdownWidth, top + dropdownHeight, blue); //Right @@ -73,7 +77,6 @@ public class GuiOptionEditorDropdown extends GuiOptionEditor { Gui.drawRect(left + 1, top + 1, left + dropdownWidth - 1, top + dropdownHeight - 1, main); //Middle Gui.drawRect(left + 1, top + 14 - 1, left + dropdownWidth - 1, top + 14, blue); //Bar - int dropdownY = 13; for (String option : values) { if (option.isEmpty()) { @@ -87,6 +90,7 @@ public class GuiOptionEditorDropdown extends GuiOptionEditor { TextRenderUtils.drawStringScaledMaxWidth(selectedString, fr, left + 3, top + 3, false, dropdownWidth - 16, 0xffa0a0a0); + GlStateManager.popMatrix(); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java index 60cdf1c8..11793e86 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -54,8 +54,6 @@ public class GuiEnchantColour extends GuiScreen { private final HashMap<Integer, String> modifiers = new HashMap<>(); private final List<GuiElementTextField[]> guiElementTextFields = new ArrayList<>(); - private List<String> enchantNamesPretty = null; - private final JsonArray enchantPresets = null; private final LerpingInteger scroll = new LerpingInteger(0, 100); private final LerpingInteger scrollSideBar = new LerpingInteger(0, 100); @@ -65,25 +63,7 @@ public class GuiEnchantColour extends GuiScreen { public static int OBFUSCATED_MODIFIER = 0b100; public static int UNDERLINE_MODIFIER = 0b1000; public static int STRIKETHROUGH_MODIFIER = 0b10000; - private final Gson gson = new Gson(); - private static final Pattern settingPattern = Pattern.compile(".*:[>=<]:[0-9]+:[a-zA-Z0-9]+(:[a-zA-Z0-9])?"); - - private List<String> getEnchantNamesPretty() { - if (enchantNamesPretty == null) { - JsonObject enchantsJson = Constants.ENCHANTS; - if (!enchantsJson.has("enchants_pretty")) { - return Lists.newArrayList("ERROR"); - } else { - JsonArray pretty = enchantsJson.getAsJsonArray("enchants_pretty"); - - enchantNamesPretty = new ArrayList<>(); - for (int i = 0; i < pretty.size(); i++) { - enchantNamesPretty.add(pretty.get(i).getAsString()); - } - } - } - return enchantNamesPretty; - } + private static final Pattern settingPattern = Pattern.compile(".*:[>=<]:[0-9]+:[a-zA-Z0-9]+(:[a-zA-Z0-9]+)?"); private ItemStack maxedBook; private int maxedBookFound =0; @@ -505,8 +485,6 @@ public class GuiEnchantColour extends GuiScreen { return; } - System.out.println(jsonString); - JsonArray presetArray; try { presetArray = new JsonParser().parse(jsonString).getAsJsonArray(); |