Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust ChatLog MessageIndicator for consistency with the base game #215

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/obro1961/chatpatches/chatlog/ChatLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.client.gui.hud.MessageIndicator;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.registry.RegistryOps;
import net.minecraft.text.Text;
import net.minecraft.text.TextCodecs;
Expand Down Expand Up @@ -41,7 +40,8 @@
*/
public class ChatLog {
public static final Path PATH = FabricLoader.getInstance().getGameDir().resolve("logs").resolve("chatlog.json");
public static final MessageIndicator RESTORED_TEXT = new MessageIndicator(0x382fb5, null, null, I18n.translate("text.chatpatches.restored"));
public static final Text RESTORED_TEXT = Text.translatable("text.chatpatches.restored");
public static final MessageIndicator RESTORED_INDICATOR = new MessageIndicator(0x382fb5, null, RESTORED_TEXT, "Restored");

private static final MinecraftClient mc = MinecraftClient.getInstance();

Expand Down Expand Up @@ -276,7 +276,7 @@ public static void restore() {
data.history.forEach(mc.inGameHud.getChatHud()::addToMessageHistory);

if(!data.messages.isEmpty())
data.messages.forEach(msg -> mc.inGameHud.getChatHud().addMessage(msg, null, RESTORED_TEXT));
data.messages.forEach(msg -> mc.inGameHud.getChatHud().addMessage(msg, null, RESTORED_INDICATOR));

suspended = false;

Expand Down Expand Up @@ -371,4 +371,4 @@ public static int messageCount() {
public static int historyCount() {
return data.history.size();
}
}
}
Loading