forked from Clones/Controlify
separate resource pack
This commit is contained in:
@ -22,6 +22,8 @@ import dev.isxander.controlify.utils.DebugLog;
|
||||
import dev.isxander.controlify.utils.ToastUtils;
|
||||
import dev.isxander.controlify.virtualmouse.VirtualMouseHandler;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
|
||||
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.CrashReport;
|
||||
import net.minecraft.CrashReportCategory;
|
||||
@ -29,6 +31,7 @@ import net.minecraft.ReportedException;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screens.Screen;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.slf4j.Logger;
|
||||
@ -144,6 +147,13 @@ public class Controlify implements ControlifyApi {
|
||||
|
||||
LOGGER.info("Pre-initializing Controlify...");
|
||||
|
||||
ResourceManagerHelper.registerBuiltinResourcePack(
|
||||
Controlify.id("extra_mappings"),
|
||||
FabricLoader.getInstance().getModContainer("controlify").orElseThrow(),
|
||||
Component.translatable("controlify.resource_pack.extra_mappings"),
|
||||
ResourcePackActivationType.DEFAULT_ENABLED
|
||||
);
|
||||
|
||||
this.inGameInputHandler = new InGameInputHandler(Controller.DUMMY); // initialize with dummy controller before connection in case of no controller
|
||||
this.virtualMouseHandler = new VirtualMouseHandler();
|
||||
|
||||
@ -427,4 +437,8 @@ public class Controlify implements ControlifyApi {
|
||||
if (instance == null) instance = new Controlify();
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static ResourceLocation id(String path) {
|
||||
return new ResourceLocation("controlify", path);
|
||||
}
|
||||
}
|
||||
|
@ -229,25 +229,5 @@
|
||||
"controlify.joystick_mapping.unmapped.axis_direction.negative": "(Negative)",
|
||||
"controlify.joystick_mapping.unmapped.axis_direction.positive": "(Positive)",
|
||||
|
||||
"controlify.joystick_mapping.tm_t16000.axis.roll": "Roll",
|
||||
"controlify.joystick_mapping.tm_t16000.axis.pitch": "Pitch",
|
||||
"controlify.joystick_mapping.tm_t16000.axis.yaw": "Yaw",
|
||||
"controlify.joystick_mapping.tm_t16000.axis.throttle": "Throttle",
|
||||
"controlify.joystick_mapping.tm_t16000.button.trigger": "Trigger",
|
||||
"controlify.joystick_mapping.tm_t16000.button.a": "A",
|
||||
"controlify.joystick_mapping.tm_t16000.button.x": "X",
|
||||
"controlify.joystick_mapping.tm_t16000.button.b": "B",
|
||||
"controlify.joystick_mapping.tm_t16000.left_1": "Left 1",
|
||||
"controlify.joystick_mapping.tm_t16000.left_2": "Left 2",
|
||||
"controlify.joystick_mapping.tm_t16000.left_3": "Left 3",
|
||||
"controlify.joystick_mapping.tm_t16000.left_4": "Left 4",
|
||||
"controlify.joystick_mapping.tm_t16000.left_5": "Left 5",
|
||||
"controlify.joystick_mapping.tm_t16000.left_6": "Left 6",
|
||||
"controlify.joystick_mapping.tm_t16000.right_1": "Right 1",
|
||||
"controlify.joystick_mapping.tm_t16000.right_2": "Right 2",
|
||||
"controlify.joystick_mapping.tm_t16000.right_3": "Right 3",
|
||||
"controlify.joystick_mapping.tm_t16000.right_4": "Right 4",
|
||||
"controlify.joystick_mapping.tm_t16000.right_5": "Right 5",
|
||||
"controlify.joystick_mapping.tm_t16000.right_6": "Right 6",
|
||||
"controlify.joystick_mapping.tm_t16000.hat": "Hat"
|
||||
"controlify.resource_pack.extra_mappings": "Extra Mappings"
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"name": "Thrustmaster T16000M",
|
||||
"theme": "thrustmaster",
|
||||
"mapping": "tm_t16000m",
|
||||
|
||||
"hids": [
|
||||
[0x044f, 0xb10a]
|
||||
]
|
||||
}
|
||||
]
|
@ -0,0 +1,23 @@
|
||||
{
|
||||
"controlify.joystick_mapping.tm_t16000.axis.roll": "Roll",
|
||||
"controlify.joystick_mapping.tm_t16000.axis.pitch": "Pitch",
|
||||
"controlify.joystick_mapping.tm_t16000.axis.yaw": "Yaw",
|
||||
"controlify.joystick_mapping.tm_t16000.axis.throttle": "Throttle",
|
||||
"controlify.joystick_mapping.tm_t16000.button.trigger": "Trigger",
|
||||
"controlify.joystick_mapping.tm_t16000.button.a": "A",
|
||||
"controlify.joystick_mapping.tm_t16000.button.x": "X",
|
||||
"controlify.joystick_mapping.tm_t16000.button.b": "B",
|
||||
"controlify.joystick_mapping.tm_t16000.left_1": "Left 1",
|
||||
"controlify.joystick_mapping.tm_t16000.left_2": "Left 2",
|
||||
"controlify.joystick_mapping.tm_t16000.left_3": "Left 3",
|
||||
"controlify.joystick_mapping.tm_t16000.left_4": "Left 4",
|
||||
"controlify.joystick_mapping.tm_t16000.left_5": "Left 5",
|
||||
"controlify.joystick_mapping.tm_t16000.left_6": "Left 6",
|
||||
"controlify.joystick_mapping.tm_t16000.right_1": "Right 1",
|
||||
"controlify.joystick_mapping.tm_t16000.right_2": "Right 2",
|
||||
"controlify.joystick_mapping.tm_t16000.right_3": "Right 3",
|
||||
"controlify.joystick_mapping.tm_t16000.right_4": "Right 4",
|
||||
"controlify.joystick_mapping.tm_t16000.right_5": "Right 5",
|
||||
"controlify.joystick_mapping.tm_t16000.right_6": "Right 6",
|
||||
"controlify.joystick_mapping.tm_t16000.hat": "Hat"
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
{
|
||||
"axes": [
|
||||
{
|
||||
"ids": [0],
|
||||
"identifier": "roll",
|
||||
"deadzone": true,
|
||||
"rest": 0.0,
|
||||
"axis_names": [
|
||||
["right", "left"]
|
||||
]
|
||||
},
|
||||
{
|
||||
"ids": [1],
|
||||
"identifier": "pitch",
|
||||
"deadzone": true,
|
||||
"rest": 0.0,
|
||||
"axis_names": [
|
||||
["down", "up"]
|
||||
]
|
||||
},
|
||||
{
|
||||
"ids": [2],
|
||||
"identifier": "yaw",
|
||||
"deadzone": true,
|
||||
"rest": 0.0,
|
||||
"axis_names": [
|
||||
["right", "left"]
|
||||
]
|
||||
},
|
||||
{
|
||||
"ids": [3],
|
||||
"identifier": "throttle",
|
||||
"rest": 0.0,
|
||||
"deadzone": false,
|
||||
"range": [0.0, 1.0],
|
||||
"axis_names": [
|
||||
["down", "up"]
|
||||
]
|
||||
}
|
||||
],
|
||||
"buttons": [
|
||||
{
|
||||
"button": 0,
|
||||
"name": "trigger"
|
||||
},
|
||||
{
|
||||
"button": 1,
|
||||
"name": "a"
|
||||
},
|
||||
{
|
||||
"button": 2,
|
||||
"name": "x"
|
||||
},
|
||||
{
|
||||
"button": 3,
|
||||
"name": "b"
|
||||
},
|
||||
{
|
||||
"button": 4,
|
||||
"name": "left_1"
|
||||
},
|
||||
{
|
||||
"button": 5,
|
||||
"name": "left_2"
|
||||
},
|
||||
{
|
||||
"button": 6,
|
||||
"name": "left_3"
|
||||
},
|
||||
{
|
||||
"button": 7,
|
||||
"name": "left_4"
|
||||
},
|
||||
{
|
||||
"button": 8,
|
||||
"name": "left_5"
|
||||
},
|
||||
{
|
||||
"button": 9,
|
||||
"name": "left_6"
|
||||
},
|
||||
{
|
||||
"button": 10,
|
||||
"name": "right_1"
|
||||
},
|
||||
{
|
||||
"button": 11,
|
||||
"name": "right_2"
|
||||
},
|
||||
{
|
||||
"button": 12,
|
||||
"name": "right_3"
|
||||
},
|
||||
{
|
||||
"button": 13,
|
||||
"name": "right_4"
|
||||
},
|
||||
{
|
||||
"button": 14,
|
||||
"name": "right_5"
|
||||
},
|
||||
{
|
||||
"button": 15,
|
||||
"name": "right_6"
|
||||
}
|
||||
],
|
||||
"hats": [
|
||||
{
|
||||
"name": "hat",
|
||||
"hat": 0
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"pack": {
|
||||
"pack_format": 13,
|
||||
"description": "Adds extra Controlify joystick mappings. §bMust restart."
|
||||
}
|
||||
}
|
BIN
src/main/resources/resourcepacks/extra_mappings/pack.png
Normal file
BIN
src/main/resources/resourcepacks/extra_mappings/pack.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 32 KiB |
Reference in New Issue
Block a user