Migrate layouts to schema v2

This commit is contained in:
redphx 2024-01-31 07:28:12 +07:00
parent 38dc1a6518
commit 11cbcd03d3
2 changed files with 525 additions and 318 deletions

View File

@ -1,277 +1,284 @@
{ {
"schema_version": 2,
"name": "Palworld", "name": "Palworld",
"layout": { "default_layout": "type-a",
"left": { "layouts": {
"inner": [ "type-a": {
{ "name": "Type A",
"type": "joystick", "content": {
"axis": { "left": {
"input": "axisXY", "inner": [
"output": "leftJoystick", {
"deadzone": { "type": "joystick",
"threshold": 0.01, "axis": {
"radial": true "input": "axisXY",
} "output": "leftJoystick",
}, "deadzone": {
"action": "leftThumb", "threshold": 0.01,
"actionThreshold": 2, "radial": true
"styles": {
"default": {
"knob": {
"faceImage": {
"type": "icon",
"value": "walk"
} }
} },
}, "action": "leftThumb",
"activated": { "actionThreshold": 2,
"knob": { "styles": {
"faceImage": { "default": {
"type": "icon", "knob": {
"value": "run" "faceImage": {
} "type": "icon",
} "value": "walk"
} }
} }
} },
], "activated": {
"outer": [ "knob": {
null, "faceImage": {
[ "type": "icon",
{ "value": "run"
"type": "joystick", }
"axis": {
"input": "axisXY",
"output": "leftJoystick",
"deadzone": {
"threshold": -0.3,
"radial": true
}
},
"action": "rightTrigger",
"styles": {
"default": {
"knob": {
"faceImage": {
"type": "icon",
"value": "rightTrigger"
} }
} }
} }
} }
}, ],
null "outer": [
], null,
{ [
"type": "directionalPad", {
"scale": 1.2 "type": "joystick",
}, "axis": {
{ "input": "axisXY",
"type": "button", "output": "leftJoystick",
"action": "rightThumb" "deadzone": {
}, "threshold": -0.3,
{ "radial": true
"type": "touchpad", }
"axis": [ },
"action": "rightTrigger",
"styles": {
"default": {
"knob": {
"faceImage": {
"type": "icon",
"value": "rightTrigger"
}
}
}
}
},
null
],
{ {
"input": "axisX", "type": "directionalPad",
"output": "leftJoystickX", "scale": 1.2
"sensitivity": 20
}, },
{ {
"input": "axisY", "type": "button",
"output": "leftJoystickY", "action": "rightThumb"
"sensitivity": 10
}
],
"renderAsButton": true,
"action": [
"leftBumper"
]
},
{
"type": "touchpad",
"axis": [
{
"input": "axisX",
"output": "leftJoystickX",
"sensitivity": 20
}, },
{ {
"input": "axisY", "type": "touchpad",
"output": "leftJoystickY", "axis": [
"sensitivity": 10 {
} "input": "axisX",
], "output": "leftJoystickX",
"renderAsButton": true, "sensitivity": 20
"action": [ },
"rightBumper" {
] "input": "axisY",
}, "output": "leftJoystickY",
{ "sensitivity": 10
"type": "touchpad", }
"axis": [ ],
{ "renderAsButton": true,
"input": "axisX", "action": [
"output": "leftJoystickX", "leftBumper"
"sensitivity": 20 ]
}, },
{ {
"input": "axisY", "type": "touchpad",
"output": "leftJoystickY", "axis": [
"sensitivity": 10 {
"input": "axisX",
"output": "leftJoystickX",
"sensitivity": 20
},
{
"input": "axisY",
"output": "leftJoystickY",
"sensitivity": 10
}
],
"renderAsButton": true,
"action": [
"rightBumper"
]
},
{
"type": "touchpad",
"axis": [
{
"input": "axisX",
"output": "leftJoystickX",
"sensitivity": 20
},
{
"input": "axisY",
"output": "leftJoystickY",
"sensitivity": 10
}
],
"renderAsButton": true,
"action": [
"leftTrigger"
]
} }
],
"renderAsButton": true,
"action": [
"leftTrigger"
] ]
} },
] "right": {
}, "inner": [
"right": { {
"inner": [ "type": "joystick",
{ "axis": {
"type": "joystick", "input": "axisXY",
"axis": { "output": "rightJoystick",
"input": "axisXY", "deadzone": {
"output": "rightJoystick", "threshold": 0.01,
"deadzone": { "radial": true
"threshold": 0.01, }
"radial": true },
} "styles": {
}, "default": {
"styles": { "knob": {
"default": { "faceImage": {
"knob": { "type": "icon",
"faceImage": { "value": "look"
"type": "icon", }
"value": "look" }
} }
} }
} }
} ],
} "outer": [
], [
"outer": [ {
[ "type": "button",
"action": "leftTrigger",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "aim"
}
}
},
"toggle": true
},
null
],
{
"type": "button",
"action": "gamepadB",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "roll"
}
}
}
},
{
"type": "button",
"action": "gamepadA",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "jump"
}
}
}
},
{
"type": "blank"
},
{
"type": "touchpad",
"axis": [
{
"input": "axisX",
"output": "rightJoystickX",
"sensitivity": 20
},
{
"input": "axisY",
"output": "rightJoystickY",
"sensitivity": 10
}
],
"renderAsButton": true,
"action": [
"rightTrigger",
"leftTrigger"
],
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "fire"
}
}
}
},
{
"type": "button",
"action": "gamepadX",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "reload"
}
}
}
},
{
"type": "button",
"action": "gamepadY",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "weaponSelect"
}
}
}
}
]
},
"upper": {
"right": [
{
"type": "button",
"action": "menu"
},
{
"type": "button",
"action": "view"
}
]
},
"sensors": [
{ {
"type": "button", "type": "gyroscope",
"action": "leftTrigger", "axis": {
"styles": { "input": "axisXY",
"default": { "output": "rightJoystick",
"faceImage": { "sensitivity": 1
"type": "icon",
"value": "aim"
}
}
},
"toggle": true
},
null
],
{
"type": "button",
"action": "gamepadB",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "roll"
}
} }
} }
}, ]
{
"type": "button",
"action": "gamepadA",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "jump"
}
}
}
},
{
"type": "blank"
},
{
"type": "touchpad",
"axis": [
{
"input": "axisX",
"output": "rightJoystickX",
"sensitivity": 20
},
{
"input": "axisY",
"output": "rightJoystickY",
"sensitivity": 10
}
],
"renderAsButton": true,
"action": [
"rightTrigger",
"leftTrigger"
],
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "fire"
}
}
}
},
{
"type": "button",
"action": "gamepadX",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "reload"
}
}
}
},
{
"type": "button",
"action": "gamepadY",
"styles": {
"default": {
"faceImage": {
"type": "icon",
"value": "weaponSelect"
}
}
}
}
]
},
"upper": {
"right": [
{
"type": "button",
"action": "menu"
},
{
"type": "button",
"action": "view"
}
]
},
"sensors": [
{
"type": "gyroscope",
"axis": {
"input": "axisXY",
"output": "rightJoystick",
"sensitivity": 1
}
} }
] }
} }
} }

View File

@ -1,80 +1,280 @@
{ {
"schema_version": 2,
"name": "Brotato", "name": "Brotato",
"layout": { "default_layout": "one-handed-left",
"left": { "layouts": {
"inner": [ "one-handed-left": {
{ "name": "One-handed (Left)",
"type": "joystick", "content": {
"relative": false, "left": {
"axis": { "inner": [
"input": "axisXY", {
"output": "leftJoystick" "type": "joystick",
} "relative": false,
} "axis": {
], "input": "axisXY",
"outer": [ "output": "leftJoystick"
null,
null,
[
{
"type": "directionalPad",
"styles": {
"idle": {
"opacity": 0.5
} }
} }
} ],
] "outer": [
] null,
}, {
"right": { "type": "button",
"inner": [ "action": "gamepadA",
{ "styles": {
"type": "button", "idle": {
"action": "gamepadA" "opacity": 0.5
} }
], }
"outer": [
{
"type": "blank"
},
{
"type": "button",
"action": "gamepadB"
},
null,
{
"type": "blank"
},
[
{
"type": "joystick",
"axis": {
"input": "axisXY",
"output": "rightJoystick"
}, },
"styles": { [
"idle": { {
"knob": { "type": "directionalPad",
"styles": {
"idle": {
"opacity": 0.5
}
}
}
],
null,
null,
{
"type": "button",
"action": "leftBumper",
"styles": {
"idle": {
"opacity": 0.5
}
}
},
{
"type": "button",
"action": "gamepadB",
"styles": {
"idle": {
"opacity": 0.5 "opacity": 0.5
} }
} }
} }
} ]
]
]
},
"upper": {
"right": [
{
"type": "button",
"action": "menu"
}, },
{ "upper": {
"type": "button", "right": [
"action": "rightBumper" {
"type": "button",
"action": "menu"
}
]
} }
] }
},
"one-handed-right": {
"name": "One-handed (Right)",
"content": {
"right": {
"inner": [
{
"type": "joystick",
"relative": false,
"axis": {
"input": "axisXY",
"output": "leftJoystick"
}
}
],
"outer": [
{
"type": "button",
"action": "gamepadB",
"styles": {
"idle": {
"opacity": 0.5
}
}
},
{
"type": "button",
"action": "rightBumper",
"styles": {
"idle": {
"opacity": 0.5
}
}
},
null,
null,
[
{
"type": "directionalPad",
"styles": {
"idle": {
"opacity": 0.5
}
}
}
],
{
"type": "button",
"action": "gamepadA",
"styles": {
"idle": {
"opacity": 0.5
}
}
}
]
},
"upper": {
"right": [
{
"type": "button",
"action": "menu"
}
]
}
}
},
"simplified": {
"name": "Simplified",
"content": {
"left": {
"inner": [
{
"type": "joystick",
"relative": false,
"axis": {
"input": "axisXY",
"output": "leftJoystick"
}
}
],
"outer": [
null,
null,
[
{
"type": "directionalPad",
"styles": {
"idle": {
"opacity": 0.5
}
}
}
]
]
},
"right": {
"inner": [
{
"type": "button",
"action": "gamepadA"
}
],
"outer": [
{
"type": "blank"
},
{
"type": "button",
"action": "gamepadB"
}
]
},
"upper": {
"right": [
{
"type": "button",
"action": "menu"
},
{
"type": "button",
"action": "rightBumper"
}
]
}
}
},
"simplified-full": {
"name": "Simplified (2 joysticks)",
"content": {
"left": {
"inner": [
{
"type": "joystick",
"relative": false,
"axis": {
"input": "axisXY",
"output": "leftJoystick"
}
}
],
"outer": [
null,
null,
[
{
"type": "directionalPad",
"styles": {
"idle": {
"opacity": 0.5
}
}
}
]
]
},
"right": {
"inner": [
{
"type": "button",
"action": "gamepadA"
}
],
"outer": [
{
"type": "blank"
},
{
"type": "button",
"action": "gamepadB"
},
null,
{
"type": "blank"
},
[
{
"type": "joystick",
"axis": {
"input": "axisXY",
"output": "rightJoystick"
},
"styles": {
"idle": {
"knob": {
"opacity": 0.5
}
}
}
}
]
]
},
"upper": {
"right": [
{
"type": "button",
"action": "menu"
},
{
"type": "button",
"action": "rightBumper"
}
]
}
}
} }
} }
} }