From 59210b3f24e90e839d560a16f2cca4973d703cd3 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Thu, 7 Dec 2023 07:28:51 -0800 Subject: Localize Key Name to Operating System (#26) --- src/main/java/org/polyfrost/chatting/mixin/GuiChatMixin.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/org/polyfrost/chatting/mixin/GuiChatMixin.java b/src/main/java/org/polyfrost/chatting/mixin/GuiChatMixin.java index d434958..8d55e0a 100644 --- a/src/main/java/org/polyfrost/chatting/mixin/GuiChatMixin.java +++ b/src/main/java/org/polyfrost/chatting/mixin/GuiChatMixin.java @@ -1,5 +1,6 @@ package org.polyfrost.chatting.mixin; +import cc.polyfrost.oneconfig.libs.universal.UDesktop; import cc.polyfrost.oneconfig.libs.universal.UResolution; import org.polyfrost.chatting.chat.*; import org.polyfrost.chatting.config.ChattingConfig; @@ -35,6 +36,15 @@ import java.util.List; @Mixin(GuiChat.class) public abstract class GuiChatMixin extends GuiScreen { + /** + * Gets the modifier key name depending on the operating system + * @return "OPTION" if macOS, otherwise, "ALT" + */ + @Unique + private static String chatting$getModifierKey() { + return (UDesktop.isMac()) ? "OPTION" : "ALT"; + } + @Unique private static final List COPY_TOOLTIP = Lists.newArrayList( "\u00A7e\u00A7lCopy To Clipboard", @@ -43,7 +53,7 @@ public abstract class GuiChatMixin extends GuiScreen { "\u00A7b\u00A7lSHIFT CLICK\u00A7r \u00A78- \u00A77Screenshot Line", "", "\u00A7e\u00A7lModifiers", - "\u00A7b\u00A7lALT\u00A7r \u00A78- \u00A77Formatting Codes"); + "\u00A7b\u00A7l"+ chatting$getModifierKey() + "\u00A7r \u00A78- \u00A77Formatting Codes"); private SearchButton searchButton; -- cgit