Commit d74ea594f997d28179b1fc629fc2e6438a253fed

Authored by Mumfrey
1 parent 83b09f04

more verbose logging for JInput and option to disable enumeration

java/common/com/mumfrey/liteloader/core/LiteLoader.java
@@ -210,7 +210,7 @@ public final class LiteLoader @@ -210,7 +210,7 @@ public final class LiteLoader
210 this.enumerator = environment.getEnumerator(); 210 this.enumerator = environment.getEnumerator();
211 211
212 this.configManager = new ConfigManager(); 212 this.configManager = new ConfigManager();
213 - this.input = new Input(new File(environment.getCommonConfigFolder(), "liteloader.keys.properties")); 213 + this.input = new Input(environment, properties);
214 214
215 this.mods = new LiteLoaderMods(this, environment, properties, this.configManager); 215 this.mods = new LiteLoaderMods(this, environment, properties, this.configManager);
216 216
java/common/com/mumfrey/liteloader/launch/LoaderProperties.java
@@ -96,6 +96,7 @@ public interface LoaderProperties @@ -96,6 +96,7 @@ public interface LoaderProperties
96 public static final String OPTION_LOADING_BAR = "loadingbar"; 96 public static final String OPTION_LOADING_BAR = "loadingbar";
97 public static final String OPTION_FORCE_UPDATE = "allowForceUpdate"; 97 public static final String OPTION_FORCE_UPDATE = "allowForceUpdate";
98 public static final String OPTION_UPDATE_CHECK_INTR = "updateCheckInterval"; 98 public static final String OPTION_UPDATE_CHECK_INTR = "updateCheckInterval";
  99 + public static final String OPTION_JINPUT_DISABLE = "disableJInput";
99 100
100 // Enumerator properties 101 // Enumerator properties
101 public static final String OPTION_SEARCH_MODS = "search.mods"; 102 public static final String OPTION_SEARCH_MODS = "search.mods";
java/common/com/mumfrey/liteloader/util/Input.java
@@ -26,6 +26,8 @@ import com.mumfrey.liteloader.api.CoreProvider; @@ -26,6 +26,8 @@ import com.mumfrey.liteloader.api.CoreProvider;
26 import com.mumfrey.liteloader.common.GameEngine; 26 import com.mumfrey.liteloader.common.GameEngine;
27 import com.mumfrey.liteloader.core.LiteLoader; 27 import com.mumfrey.liteloader.core.LiteLoader;
28 import com.mumfrey.liteloader.core.LiteLoaderMods; 28 import com.mumfrey.liteloader.core.LiteLoaderMods;
  29 +import com.mumfrey.liteloader.launch.LoaderEnvironment;
  30 +import com.mumfrey.liteloader.launch.LoaderProperties;
29 import com.mumfrey.liteloader.util.jinput.ComponentRegistry; 31 import com.mumfrey.liteloader.util.jinput.ComponentRegistry;
30 32
31 /** 33 /**
@@ -81,16 +83,20 @@ public final class Input implements CoreProvider @@ -81,16 +83,20 @@ public final class Input implements CoreProvider
81 /** 83 /**
82 * 84 *
83 */ 85 */
84 - public Input(File keyMapSettingsFile) 86 + public Input(LoaderEnvironment environment, LoaderProperties properties)
85 { 87 {
86 if (LiteLoader.getInstance() != null && LiteLoader.getInput() != null) 88 if (LiteLoader.getInstance() != null && LiteLoader.getInput() != null)
87 { 89 {
88 throw new IllegalStateException("Only one instance of Input is allowed, use LiteLoader.getInput() to get the active instance"); 90 throw new IllegalStateException("Only one instance of Input is allowed, use LiteLoader.getInput() to get the active instance");
89 } 91 }
90 92
91 - this.keyMapSettingsFile = keyMapSettingsFile; 93 + this.keyMapSettingsFile = new File(environment.getCommonConfigFolder(), "liteloader.keys.properties");
92 this.jInputComponentRegistry = new ComponentRegistry(); 94 this.jInputComponentRegistry = new ComponentRegistry();
93 - this.jInputComponentRegistry.enumerate(); 95 +
  96 + if (!properties.getAndStoreBooleanProperty(LoaderProperties.OPTION_JINPUT_DISABLE, false))
  97 + {
  98 + this.jInputComponentRegistry.enumerate();
  99 + }
94 } 100 }
95 101
96 @Override 102 @Override
java/common/com/mumfrey/liteloader/util/jinput/ComponentRegistry.java
@@ -38,6 +38,7 @@ public class ComponentRegistry @@ -38,6 +38,7 @@ public class ComponentRegistry
38 { 38 {
39 try 39 try
40 { 40 {
  41 + LiteLoaderLogger.info("JInput Component Registry is initialising...");
41 this.enumerate(ControllerEnvironment.getDefaultEnvironment()); 42 this.enumerate(ControllerEnvironment.getDefaultEnvironment());
42 LiteLoaderLogger.info("JInput Component Registry initialised, found %d controller(s) %d component(s)", ControllerEnvironment.getDefaultEnvironment().getControllers().length, components.size()); 43 LiteLoaderLogger.info("JInput Component Registry initialised, found %d controller(s) %d component(s)", ControllerEnvironment.getDefaultEnvironment().getControllers().length, components.size());
43 } 44 }
@@ -53,6 +54,7 @@ public class ComponentRegistry @@ -53,6 +54,7 @@ public class ComponentRegistry
53 54
54 for (Controller controller : environment.getControllers()) 55 for (Controller controller : environment.getControllers())
55 { 56 {
  57 + LiteLoaderLogger.info("Inspecting %s controller %s on %s...", controller.getType(), controller.getName(), controller.getPortType());
56 for (Component component : controller.getComponents()) 58 for (Component component : controller.getComponents())
57 { 59 {
58 this.addComponent(controller, component); 60 this.addComponent(controller, component);