Commit d74ea594f997d28179b1fc629fc2e6438a253fed
1 parent
83b09f04
more verbose logging for JInput and option to disable enumeration
Showing
4 changed files
with
13 additions
and
4 deletions
java/common/com/mumfrey/liteloader/core/LiteLoader.java
| ... | ... | @@ -210,7 +210,7 @@ public final class LiteLoader |
| 210 | 210 | this.enumerator = environment.getEnumerator(); |
| 211 | 211 | |
| 212 | 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 | 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 | 96 | public static final String OPTION_LOADING_BAR = "loadingbar"; |
| 97 | 97 | public static final String OPTION_FORCE_UPDATE = "allowForceUpdate"; |
| 98 | 98 | public static final String OPTION_UPDATE_CHECK_INTR = "updateCheckInterval"; |
| 99 | + public static final String OPTION_JINPUT_DISABLE = "disableJInput"; | |
| 99 | 100 | |
| 100 | 101 | // Enumerator properties |
| 101 | 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 | 26 | import com.mumfrey.liteloader.common.GameEngine; |
| 27 | 27 | import com.mumfrey.liteloader.core.LiteLoader; |
| 28 | 28 | import com.mumfrey.liteloader.core.LiteLoaderMods; |
| 29 | +import com.mumfrey.liteloader.launch.LoaderEnvironment; | |
| 30 | +import com.mumfrey.liteloader.launch.LoaderProperties; | |
| 29 | 31 | import com.mumfrey.liteloader.util.jinput.ComponentRegistry; |
| 30 | 32 | |
| 31 | 33 | /** |
| ... | ... | @@ -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 | 88 | if (LiteLoader.getInstance() != null && LiteLoader.getInput() != null) |
| 87 | 89 | { |
| 88 | 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 | 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 | 102 | @Override | ... | ... |
java/common/com/mumfrey/liteloader/util/jinput/ComponentRegistry.java
| ... | ... | @@ -38,6 +38,7 @@ public class ComponentRegistry |
| 38 | 38 | { |
| 39 | 39 | try |
| 40 | 40 | { |
| 41 | + LiteLoaderLogger.info("JInput Component Registry is initialising..."); | |
| 41 | 42 | this.enumerate(ControllerEnvironment.getDefaultEnvironment()); |
| 42 | 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 | 54 | |
| 54 | 55 | for (Controller controller : environment.getControllers()) |
| 55 | 56 | { |
| 57 | + LiteLoaderLogger.info("Inspecting %s controller %s on %s...", controller.getType(), controller.getName(), controller.getPortType()); | |
| 56 | 58 | for (Component component : controller.getComponents()) |
| 57 | 59 | { |
| 58 | 60 | this.addComponent(controller, component); | ... | ... |