diff --git a/src/main/java/com/teammoeg/frostedheart/content/tips/Tip.java b/src/main/java/com/teammoeg/frostedheart/content/tips/Tip.java index 24c34b2fa..234fc2ee2 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/tips/Tip.java +++ b/src/main/java/com/teammoeg/frostedheart/content/tips/Tip.java @@ -382,13 +382,13 @@ public Builder fromJson(JsonObject json) { if (json.has("id")) { String s = json.get("id").getAsString(); if (s.isBlank()) { - error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.no_id").component()); + error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.no_id").component()); id = "exception"; return this; } id = s; } else { - error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.no_id").component()); + error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.no_id").component()); id = "exception"; return this; } @@ -403,7 +403,7 @@ public Builder fromJson(JsonObject json) { } } if (this.contents.isEmpty()) { - error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.empty").component()); + error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.empty").component()); return this; } @@ -414,7 +414,7 @@ public Builder fromJson(JsonObject json) { if (image != null) { image(image); } else { - error(ErrorType.LOAD, Lang.str(id), Lang.tips("error.invalid_image", location).component()); + error(ErrorType.LOAD, Lang.str("ID: " + id), Lang.tips("error.load.invalid_image", location).component()); return this; } } @@ -464,18 +464,18 @@ private void imageSize(ResourceLocation location) { } } catch (IOException e) { LOGGER.error("Invalid texture resource location {}", location, e); - error(ErrorType.LOAD, e, Lang.tips("error.invalid_image").component()); + error(ErrorType.LOAD, e, Lang.tips("error.load.invalid_image").component()); } } this.image = null; - error(ErrorType.LOAD, Lang.tips("error.invalid_image").component()); + error(ErrorType.LOAD, Lang.tips("error.load.invalid_image").component()); } private int getColorOrElse(JsonObject json, String name, int defColor) { try { return Integer.parseUnsignedInt(json.get(name).getAsString(), 16); } catch (NumberFormatException e) { - line(Lang.tips("error.invalid_digit", name).component()); + line(Lang.tips("error.load.invalid_digit", name).component()); return defColor; } } diff --git a/src/main/java/com/teammoeg/frostedheart/content/tips/TipManager.java b/src/main/java/com/teammoeg/frostedheart/content/tips/TipManager.java index 32f602809..a555da660 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/tips/TipManager.java +++ b/src/main/java/com/teammoeg/frostedheart/content/tips/TipManager.java @@ -75,7 +75,7 @@ public Tip getTip(String id) { if (tip != null) { return tip; } - return Tip.builder(id).error(Tip.ErrorType.OTHER, Lang.str(id), Lang.tips("error.tip_not_exists").component()).build(); + return Tip.builder(id).error(Tip.ErrorType.OTHER, Lang.str(id), Lang.tips("error.load.tip_not_exists").component()).build(); } /** @@ -116,7 +116,7 @@ public void loadFromFile() { } private void displayException(Tip.ErrorType type, String id, Exception e) { - Tip exception = Tip.builder("exception").error(type, e, Lang.str(id)).build(); + Tip exception = Tip.builder("exception").error(type, e, Lang.str("ID: " + id)).build(); display.force(exception); } diff --git a/src/main/java/com/teammoeg/frostedheart/content/tips/client/gui/widget/TipWidget.java b/src/main/java/com/teammoeg/frostedheart/content/tips/client/gui/widget/TipWidget.java index bbe492185..2ac5507e9 100644 --- a/src/main/java/com/teammoeg/frostedheart/content/tips/client/gui/widget/TipWidget.java +++ b/src/main/java/com/teammoeg/frostedheart/content/tips/client/gui/widget/TipWidget.java @@ -268,7 +268,7 @@ private class RenderContext { void update(Tip tip) { BGColor = FHColorHelper.setAlpha(tip.getBackgroundColor(), (isGuiOpened() ? 0.8F : 0.5F)); - fontColor = tip.getFontColor(); + fontColor = FHColorHelper.setAlpha(tip.getFontColor(), 1.0F); // 跟随视角晃动 Minecraft MC = ClientUtils.mc();