File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed
src/main/java/cn/yesterday17/kokoalinux Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -118,5 +118,9 @@ void prepareLocale() {
118118}
119119
120120void setDebug (long debug ) {
121- DEBUG = debug == 0 ? false : true;
121+ if (DEBUG != (debug == 0 ? false : true)) {
122+ DEBUG = debug == 0 ? false : true;
123+ printf ("[libkokoa/DEBUG] %sed debug mode\n" , (DEBUG == true ? "enter" : "exit" ));
124+ fflush (stdout );
125+ }
122126}
Original file line number Diff line number Diff line change 11package cn .yesterday17 .kokoalinux .config ;
22
33import cn .yesterday17 .kokoalinux .KokoaLinux ;
4+ import cn .yesterday17 .kokoalinux .input .InputHelper ;
45import com .google .common .collect .Sets ;
56import net .minecraftforge .common .config .Configuration ;
67import net .minecraftforge .fml .client .event .ConfigChangedEvent ;
@@ -55,6 +56,9 @@ private static void sync() {
5556 } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e ) {
5657 e .printStackTrace ();
5758 }
59+
60+ // Sync debug with libkokoa
61+ InputHelper .setDebug ();
5862 }
5963
6064 @ SubscribeEvent
Original file line number Diff line number Diff line change 77public class KokoaConfig {
88 // Used by org.lwjgl.opengl.LinuxEvent.filterEventX
99 public static boolean enableIME = true ;
10+
11+ public static boolean debug = false ;
1012}
Original file line number Diff line number Diff line change 11package cn .yesterday17 .kokoalinux .input ;
22
33import cn .yesterday17 .kokoalinux .KokoaGlobal ;
4+ import cn .yesterday17 .kokoalinux .config .KokoaConfig ;
45
56public class InputHelper {
67 // Used by org.lwjgl.opengl.LinuxDisplay.incDisplay
@@ -44,4 +45,8 @@ public static void destroyIC(long xic) {
4445 public static void toggleIC (boolean active ) {
4546 KokoaGlobal .xic = InputNative .instance .toggleIC (active ? 1 : 0 );
4647 }
48+
49+ public static void setDebug () {
50+ InputNative .instance .setDebug (KokoaConfig .debug ? 1 : 0 );
51+ }
4752}
You can’t perform that action at this time.
0 commit comments