mirror of
https://github.com/TeamMidnightDust/VisualOverhaul.git
synced 2025-12-18 06:25:10 +01:00
VisualOverhaul 5.1.0 - Code overhaul!
- Update to 1.20.4 - Switch Forge version to NeoForge - Update resourcepacks & add round relic disc (thanks to @SuperNoobYT) - Furnaces will now show results when finished (closes #61) - Fix crash related to sound events (closes #60, #52) - Fix crash related to button icons (closes #59, #55, #54, likely #49) - Fix log spam when mod is only present on server (closes #33) - Fix jukeboxes staying powered after playback has finished (closes #53)
This commit is contained in:
@@ -23,13 +23,12 @@ public class IconicButtons {
|
||||
private String buttonId;
|
||||
private Text prevText;
|
||||
private Identifier iconId;
|
||||
public IconicButtons(ClickableWidget widget) {
|
||||
init(widget);
|
||||
}
|
||||
public IconicButtons() {}
|
||||
public void init(ClickableWidget widget) {
|
||||
if (widget == null || widget.getMessage() == null || widget.getMessage().getContent() == null) return;
|
||||
prevText = widget.getMessage();
|
||||
buttonId = (widget.getMessage().getContent() instanceof TranslatableTextContent translatableTextContent) ? translatableTextContent.getKey().toLowerCase() : "";
|
||||
if (VOConfig.buttonIcons && !buttonId.equals("")) {
|
||||
if (VOConfig.buttonIcons && !buttonId.isEmpty()) {
|
||||
if (VOConfig.debug) System.out.println(buttonId);
|
||||
iconId = Identifier.tryParse("iconic:textures/gui/icons/" + buttonId.toLowerCase()+".png");
|
||||
if (buttonId.endsWith(".midnightconfig.title"))
|
||||
@@ -55,7 +54,7 @@ public class IconicButtons {
|
||||
}
|
||||
}
|
||||
public void renderIcons(DrawContext context, ClickableWidget widget, float alpha) {
|
||||
if (widget.getMessage() == null) return;
|
||||
if (widget.getMessage() == null || widget.getWidth() <= 20) return;
|
||||
if (prevText != widget.getMessage()) init(widget);
|
||||
if (VOConfig.buttonIcons && !buttonId.equals("") && iconId != null) {
|
||||
int scaledWidth = client.getWindow().getScaledWidth();
|
||||
|
||||
Reference in New Issue
Block a user