Skip to content

Commit f6d5da2

Browse files
CopilotFloEdelmann
andauthored
Make fractional slot numbers more obvious in WheelSlot UI (#5411)
Co-authored-by: Flo Edelmann <git@flo-edelmann.de>
1 parent afb90bf commit f6d5da2

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

ui/components/PropertyInputNumber.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</template>
1616

1717
<script>
18-
import { anyProp, booleanProp, objectProp, oneOfTypesProp, stringProp } from 'vue-ts-types';
18+
import { anyProp, booleanProp, numberProp, objectProp, oneOfTypesProp, stringProp } from 'vue-ts-types';
1919
2020
export default {
2121
props: {
@@ -26,6 +26,7 @@ export default {
2626
maximum: oneOfTypesProp([Number, String]).optional, // can be the string `invalid`
2727
value: anyProp().required,
2828
lazy: booleanProp().withDefault(false),
29+
stepOverride: numberProp().optional,
2930
},
3031
emits: {
3132
input: value => true,
@@ -71,6 +72,9 @@ export default {
7172
return null;
7273
},
7374
step() {
75+
if (this.stepOverride !== undefined) {
76+
return this.stepOverride;
77+
}
7478
return this.schemaProperty.type === `integer` ? 1 : `any`;
7579
},
7680

ui/components/editor/EditorProportionalPropertySwitcher.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
v-model="slotNumberStart"
2020
:name="`capability${capability.uuid}-${propertyName}Start`"
2121
:required="required"
22-
:schema-property="slotNumberSchema" />
22+
:schema-property="slotNumberSchema"
23+
:step-override="0.5" />
2324

2425
<PropertyInputEntity
2526
v-else-if="entitySchema"
@@ -72,7 +73,8 @@
7273
v-model="slotNumberEnd"
7374
:name="`capability${capability.uuid}-${propertyName}End`"
7475
:required="required"
75-
:schema-property="slotNumberSchema" />
76+
:schema-property="slotNumberSchema"
77+
:step-override="0.5" />
7678

7779
<PropertyInputEntity
7880
v-else-if="entitySchema"
@@ -109,7 +111,8 @@
109111
v-model="slotNumberStepped"
110112
:name="`capability${capability.uuid}-${propertyName}`"
111113
:required="required"
112-
:schema-property="slotNumberSchema" />
114+
:schema-property="slotNumberSchema"
115+
:step-override="0.5" />
113116

114117
<PropertyInputEntity
115118
v-else-if="entitySchema"

ui/components/editor/capabilities/CapabilityWheelShake.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
multiple-inputs
77
:name="`capability${capability.uuid}-slotNumber`"
88
label="Slot number"
9-
hint="Leave the slot number empty if this capability doesn't select a wheel slot, but only activates wheel shaking for a WheelSlot capability in another channel."
9+
hint="Leave the slot number empty if this capability doesn't select a wheel slot, but only activates wheel shaking for a WheelSlot capability in another channel. Use 1.5 to indicate a wheel position halfway between slots 1 and 2."
1010
style="display: inline-block; margin-bottom: 12px;">
1111
<EditorProportionalPropertySwitcher
1212
:capability="capability"

ui/components/editor/capabilities/CapabilityWheelSlot.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
:formstate="formstate"
66
multiple-inputs
77
:name="`capability${capability.uuid}-slotNumber`"
8-
label="Slot number">
8+
label="Slot number"
9+
hint="Use 1.5 to indicate a wheel position halfway between slots 1 and 2."
10+
style="display: inline-block; margin-bottom: 12px;">
911
<EditorProportionalPropertySwitcher
1012
:capability="capability"
1113
:formstate="formstate"

ui/components/editor/capabilities/CapabilityWheelSlotRotation.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
multiple-inputs
77
:name="`capability${capability.uuid}-slotNumber`"
88
label="Slot number"
9-
hint="Leave the slot number empty if this capability doesn't select a wheel slot, but only activates wheel slot rotation for a WheelSlot capability in another channel."
9+
hint="Leave the slot number empty if this capability doesn't select a wheel slot, but only activates wheel slot rotation for a WheelSlot capability in another channel. Use 1.5 to indicate a wheel position halfway between slots 1 and 2."
1010
style="display: inline-block; margin-bottom: 12px;">
1111
<EditorProportionalPropertySwitcher
1212
:capability="capability"

0 commit comments

Comments
 (0)