diff --git a/src/ext/conf/ActionList.js b/src/ext/conf/ActionList.js index 8032ea1..c3c69ac 100644 --- a/src/ext/conf/ActionList.js +++ b/src/ext/conf/ActionList.js @@ -23,7 +23,15 @@ var ActionList = { name: 'Manually specify ratio', arg: AspectRatio.Fixed, customArg: true, - hintHTML: '', + customSetter: (value) => { + const [width, height] = value.split(':'); + + if (width && height) { + return +width / +height; + } + return +width; + }, + hintHTML: 'Enter the aspect ratio as {width}:{height} or a single number, e.g. "21:9", "2.35:1", or "2.35" (without quotes).', }], scopes: { global: false, diff --git a/src/options/controls-settings/command-builder/CommandAddEdit.vue b/src/options/controls-settings/command-builder/CommandAddEdit.vue index 2ba70bc..c4d93f8 100644 --- a/src/options/controls-settings/command-builder/CommandAddEdit.vue +++ b/src/options/controls-settings/command-builder/CommandAddEdit.vue @@ -59,7 +59,8 @@
@@ -122,6 +123,13 @@ export default { this.selectedArgument = ActionList[this.selectedAction].args.find(x => x.arg == arg); this.customArgumentValue = undefined; }, + setCustomValue(value, customSetter) { + if (!customSetter) { + this.customArgumentValue = value; + } else { + this.customArgumentValue = customSetter(value); + } + }, emitCommand() { this.$emit( 'set-command',