From 6a398a2e48d1f3017441abd8c64826fd8aedcb0b Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Thu, 24 Aug 2023 16:09:40 -0300 Subject: [PATCH] joystick configuration page: Reorganize component codebase --- src/views/ConfigurationJoystickView.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/ConfigurationJoystickView.vue b/src/views/ConfigurationJoystickView.vue index 1324b2634..91be9d09e 100644 --- a/src/views/ConfigurationJoystickView.vue +++ b/src/views/ConfigurationJoystickView.vue @@ -206,6 +206,14 @@ onUnmounted(() => { controllerStore.enableForwarding = true }) +const currentJoystick = ref() +const currentInputs = ref() +const remappingInput = ref(false) +const justRemappedInput = ref() +const inputClickedDialog = ref(false) + +watch(inputClickedDialog, () => (justRemappedInput.value = undefined)) + const availableButtons = computed(() => { const actualButtons = controllerStore.availableButtons.map((btn) => { const prettyBtn = controllerStore.allPrettyButtonNames.find( @@ -230,11 +238,6 @@ const setCurrentInputs = (joystick: Joystick, inputs: JoystickInput[]): void => currentInputs.value = inputs inputClickedDialog.value = true } -const currentJoystick = ref() -const currentInputs = ref() -const remappingInput = ref(false) -const justRemappedInput = ref() -const inputClickedDialog = ref(false) /** * Remaps the input of a given joystick. The function waits for a button press on the joystick and then @@ -273,8 +276,6 @@ const remapInput = async (joystick: Joystick, input: JoystickInput): Promise (justRemappedInput.value = undefined)) - /** * Updates which physical button or axis in the joystick maps to it's correspondent virtual input. * @param {number} index - The index of the input mapping to update.