Skip to content

Commit 9ef7895

Browse files
committed
make a keybind to open chat into "/action " @MrSam7K
1 parent 33d445e commit 9ef7895

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/main/java/dev/dfonline/codeclient/config/KeyBinds.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import dev.dfonline.codeclient.location.Play;
99
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
1010
import net.minecraft.block.Blocks;
11+
import net.minecraft.client.gui.screen.ChatScreen;
1112
import net.minecraft.client.network.ClientPlayerEntity;
1213
import net.minecraft.client.option.KeyBinding;
1314
import net.minecraft.client.util.InputUtil;
@@ -32,6 +33,7 @@ public class KeyBinds {
3233
public static KeyBinding teleportBackward;
3334

3435
public static KeyBinding openAction;
36+
public static KeyBinding editAction;
3537

3638
/**
3739
* Shows tags set with /item tag when held in creative mode.
@@ -57,6 +59,7 @@ public static void init() {
5759
editBind = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.codeclient.codepalette", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_Y, "category.codeclient.dev"));
5860
clipBind = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.codeclient.phaser", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_V, "category.codeclient.dev"));
5961
openAction = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.codeclient.open_action", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), "category.codeclient.dev"));
62+
editAction = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.codeclient.edit_action", InputUtil.Type.KEYSYM, InputUtil.GLFW_KEY_PERIOD, "category.codeclient.dev"));
6063

6164
teleportLeft = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.codeclient.tp.left", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), "category.codeclient.navigation"));
6265
teleportRight = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.codeclient.tp.right", InputUtil.Type.KEYSYM, InputUtil.UNKNOWN_KEY.getCode(), "category.codeclient.navigation"));
@@ -101,6 +104,10 @@ public static void tick() {
101104
}
102105
}
103106
}
107+
108+
if(editAction.wasPressed()) {
109+
mc.setScreen(new ChatScreen("/action "));
110+
}
104111
}
105112

106113
if(CodeClient.MC.getNetworkHandler() == null) return;

src/main/resources/assets/codeclient/lang/en_us.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"key.codeclient.tp.forward": "Teleport Forwards",
1818
"key.codeclient.tp.backward": "Teleport Backwards",
1919
"key.codeclient.open_action": "Open Action",
20+
"key.codeclient.edit_action": "Edit Action",
2021

2122
"codeclient.toast.unofficial_address.title": "Unofficial Address Detected",
2223
"codeclient.toast.unofficial_address": "The server address you used to connect to DiamondFire is unofficially hosted by a third party. For security reasons, we have replaced it with the official address.",

0 commit comments

Comments
 (0)