aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorWalker Selby <git@walkerselby.com>2023-12-07 07:28:51 -0800
committerGitHub <noreply@github.com>2023-12-07 10:28:51 -0500
commit59210b3f24e90e839d560a16f2cca4973d703cd3 (patch)
tree940e2be0cfcfefe47bace13fad0c0b0b25b88ed3 /src/main/java
parent04fcb56e738b6a4c91ef82e1bad066fd5d8c52d5 (diff)
downloadChatting-59210b3f24e90e839d560a16f2cca4973d703cd3.tar.gz
Chatting-59210b3f24e90e839d560a16f2cca4973d703cd3.tar.bz2
Chatting-59210b3f24e90e839d560a16f2cca4973d703cd3.zip
Localize Key Name to Operating System (#26)HEADmain
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/polyfrost/chatting/mixin/GuiChatMixin.java12
1 files changed, 11 insertions, 1 deletions
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<String> 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;