From 11cbcd03d31941342a0aa214bcd2984fe0249549 Mon Sep 17 00:00:00 2001 From: redphx <96280+redphx@users.noreply.github.com> Date: Wed, 31 Jan 2024 07:28:12 +0700 Subject: [PATCH] Migrate layouts to schema v2 --- touch-layouts/1797327516.json | 511 +++++++++++++++++----------------- touch-layouts/2008767227.json | 332 +++++++++++++++++----- 2 files changed, 525 insertions(+), 318 deletions(-) diff --git a/touch-layouts/1797327516.json b/touch-layouts/1797327516.json index ff7d10c..8adf976 100644 --- a/touch-layouts/1797327516.json +++ b/touch-layouts/1797327516.json @@ -1,277 +1,284 @@ { + "schema_version": 2, "name": "Palworld", - "layout": { - "left": { - "inner": [ - { - "type": "joystick", - "axis": { - "input": "axisXY", - "output": "leftJoystick", - "deadzone": { - "threshold": 0.01, - "radial": true - } - }, - "action": "leftThumb", - "actionThreshold": 2, - "styles": { - "default": { - "knob": { - "faceImage": { - "type": "icon", - "value": "walk" + "default_layout": "type-a", + "layouts": { + "type-a": { + "name": "Type A", + "content": { + "left": { + "inner": [ + { + "type": "joystick", + "axis": { + "input": "axisXY", + "output": "leftJoystick", + "deadzone": { + "threshold": 0.01, + "radial": true } - } - }, - "activated": { - "knob": { - "faceImage": { - "type": "icon", - "value": "run" - } - } - } - } - } - ], - "outer": [ - null, - [ - { - "type": "joystick", - "axis": { - "input": "axisXY", - "output": "leftJoystick", - "deadzone": { - "threshold": -0.3, - "radial": true - } - }, - "action": "rightTrigger", - "styles": { - "default": { - "knob": { - "faceImage": { - "type": "icon", - "value": "rightTrigger" + }, + "action": "leftThumb", + "actionThreshold": 2, + "styles": { + "default": { + "knob": { + "faceImage": { + "type": "icon", + "value": "walk" + } + } + }, + "activated": { + "knob": { + "faceImage": { + "type": "icon", + "value": "run" + } } } } } - }, - null - ], - { - "type": "directionalPad", - "scale": 1.2 - }, - { - "type": "button", - "action": "rightThumb" - }, - { - "type": "touchpad", - "axis": [ + ], + "outer": [ + null, + [ + { + "type": "joystick", + "axis": { + "input": "axisXY", + "output": "leftJoystick", + "deadzone": { + "threshold": -0.3, + "radial": true + } + }, + "action": "rightTrigger", + "styles": { + "default": { + "knob": { + "faceImage": { + "type": "icon", + "value": "rightTrigger" + } + } + } + } + }, + null + ], { - "input": "axisX", - "output": "leftJoystickX", - "sensitivity": 20 + "type": "directionalPad", + "scale": 1.2 }, { - "input": "axisY", - "output": "leftJoystickY", - "sensitivity": 10 - } - ], - "renderAsButton": true, - "action": [ - "leftBumper" - ] - }, - { - "type": "touchpad", - "axis": [ - { - "input": "axisX", - "output": "leftJoystickX", - "sensitivity": 20 + "type": "button", + "action": "rightThumb" }, { - "input": "axisY", - "output": "leftJoystickY", - "sensitivity": 10 - } - ], - "renderAsButton": true, - "action": [ - "rightBumper" - ] - }, - { - "type": "touchpad", - "axis": [ - { - "input": "axisX", - "output": "leftJoystickX", - "sensitivity": 20 + "type": "touchpad", + "axis": [ + { + "input": "axisX", + "output": "leftJoystickX", + "sensitivity": 20 + }, + { + "input": "axisY", + "output": "leftJoystickY", + "sensitivity": 10 + } + ], + "renderAsButton": true, + "action": [ + "leftBumper" + ] }, { - "input": "axisY", - "output": "leftJoystickY", - "sensitivity": 10 + "type": "touchpad", + "axis": [ + { + "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": [ - { - "type": "joystick", - "axis": { - "input": "axisXY", - "output": "rightJoystick", - "deadzone": { - "threshold": 0.01, - "radial": true - } - }, - "styles": { - "default": { - "knob": { - "faceImage": { - "type": "icon", - "value": "look" + }, + "right": { + "inner": [ + { + "type": "joystick", + "axis": { + "input": "axisXY", + "output": "rightJoystick", + "deadzone": { + "threshold": 0.01, + "radial": true + } + }, + "styles": { + "default": { + "knob": { + "faceImage": { + "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", - "action": "leftTrigger", - "styles": { - "default": { - "faceImage": { - "type": "icon", - "value": "aim" - } - } - }, - "toggle": true - }, - null - ], - { - "type": "button", - "action": "gamepadB", - "styles": { - "default": { - "faceImage": { - "type": "icon", - "value": "roll" - } + "type": "gyroscope", + "axis": { + "input": "axisXY", + "output": "rightJoystick", + "sensitivity": 1 } } - }, - { - "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 - } + ] } - ] + } } } diff --git a/touch-layouts/2008767227.json b/touch-layouts/2008767227.json index 7e7e6df..583f867 100644 --- a/touch-layouts/2008767227.json +++ b/touch-layouts/2008767227.json @@ -1,80 +1,280 @@ { + "schema_version": 2, "name": "Brotato", - "layout": { - "left": { - "inner": [ - { - "type": "joystick", - "relative": false, - "axis": { - "input": "axisXY", - "output": "leftJoystick" - } - } - ], - "outer": [ - null, - null, - [ - { - "type": "directionalPad", - "styles": { - "idle": { - "opacity": 0.5 + "default_layout": "one-handed-left", + "layouts": { + "one-handed-left": { + "name": "One-handed (Left)", + "content": { + "left": { + "inner": [ + { + "type": "joystick", + "relative": false, + "axis": { + "input": "axisXY", + "output": "leftJoystick" } } - } - ] - ] - }, - "right": { - "inner": [ - { - "type": "button", - "action": "gamepadA" - } - ], - "outer": [ - { - "type": "blank" - }, - { - "type": "button", - "action": "gamepadB" - }, - null, - { - "type": "blank" - }, - [ - { - "type": "joystick", - "axis": { - "input": "axisXY", - "output": "rightJoystick" + ], + "outer": [ + null, + { + "type": "button", + "action": "gamepadA", + "styles": { + "idle": { + "opacity": 0.5 + } + } }, - "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 } } } - } - ] - ] - }, - "upper": { - "right": [ - { - "type": "button", - "action": "menu" + ] }, - { - "type": "button", - "action": "rightBumper" + "upper": { + "right": [ + { + "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" + } + ] + } + } } } }