Skip to content

Commit a46bef2

Browse files
committed
fix various issues, make wheelmenu configurable
1 parent fe01d6d commit a46bef2

39 files changed

+954
-804
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
package com.teammoeg.chorda.client;
2+
3+
import org.lwjgl.glfw.GLFW;
4+
5+
import com.mojang.blaze3d.platform.InputConstants;
6+
7+
import net.minecraft.client.Minecraft;
8+
import net.minecraft.client.gui.screens.Screen;
9+
10+
public class CInputHelper {
11+
12+
public CInputHelper() {
13+
}
14+
public boolean shift(int modifiers) {
15+
return (modifiers & GLFW.GLFW_MOD_SHIFT) != 0;
16+
}
17+
18+
public boolean control(int modifiers) {
19+
return (modifiers & GLFW.GLFW_MOD_CONTROL) != 0;
20+
}
21+
22+
public boolean alt(int modifiers) {
23+
return (modifiers & GLFW.GLFW_MOD_ALT) != 0;
24+
}
25+
26+
public boolean start(int modifiers) {
27+
return (modifiers & GLFW.GLFW_MOD_SUPER) != 0;
28+
}
29+
30+
public boolean numLock(int modifiers) {
31+
return (modifiers & GLFW.GLFW_MOD_NUM_LOCK) != 0;
32+
}
33+
34+
public boolean capsLock(int modifiers) {
35+
return (modifiers & GLFW.GLFW_MOD_CAPS_LOCK) != 0;
36+
}
37+
public boolean onlyControl(int modifiers) {
38+
return control(modifiers) && !shift(modifiers) && !alt(modifiers);
39+
}
40+
public boolean esc(int keyCode) {
41+
return keyCode==GLFW.GLFW_KEY_ESCAPE;
42+
}
43+
44+
public boolean escOrInventory(int keyCode,int scanCode) {
45+
46+
return esc(keyCode) || Minecraft.getInstance().options.keyInventory.matches(keyCode, scanCode);
47+
}
48+
49+
public boolean enter(int keyCode) {
50+
return keyCode==GLFW.GLFW_KEY_ENTER;
51+
}
52+
53+
public boolean backspace(int keyCode) {
54+
return keyCode==GLFW.GLFW_KEY_BACKSPACE;
55+
}
56+
57+
public boolean cut(int keyCode) {
58+
return Screen.isCut(keyCode);
59+
}
60+
61+
public boolean paste(int keyCode) {
62+
return Screen.isPaste(keyCode);
63+
}
64+
65+
public boolean copy(int keyCode) {
66+
return Screen.isCopy(keyCode);
67+
}
68+
69+
public boolean selectAll(int keyCode) {
70+
return Screen.isSelectAll(keyCode);
71+
}
72+
73+
public boolean deselectAll(int keyCode) {
74+
return keyCode == GLFW.GLFW_KEY_D && Screen.hasControlDown() && !Screen.hasShiftDown() && !Screen.hasAltDown();
75+
}
76+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.teammoeg.chorda.client;
2+
3+
import com.teammoeg.chorda.client.icon.CIcons.CIcon;
4+
5+
import dev.ftb.mods.ftblibrary.icon.Icon;
6+
import net.minecraft.client.gui.GuiGraphics;
7+
8+
public class FHIconWrapper extends Icon {
9+
private final CIcon icon;
10+
11+
public FHIconWrapper(CIcon icon) {
12+
this.icon = icon;
13+
}
14+
15+
@Override
16+
public void draw(GuiGraphics arg0, int arg1, int arg2, int arg3, int arg4) {
17+
icon.draw(arg0, arg1, arg2, arg3, arg4);
18+
}
19+
20+
}

0 commit comments

Comments
 (0)