Skip to content

Commit

Permalink
joystick configuration page: Reorganize component codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Aug 25, 2023
1 parent d48cae3 commit 6a398a2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/views/ConfigurationJoystickView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ onUnmounted(() => {
controllerStore.enableForwarding = true
})
const currentJoystick = ref<Joystick>()
const currentInputs = ref()
const remappingInput = ref(false)
const justRemappedInput = ref<boolean>()
const inputClickedDialog = ref(false)
watch(inputClickedDialog, () => (justRemappedInput.value = undefined))
const availableButtons = computed(() => {
const actualButtons = controllerStore.availableButtons.map((btn) => {
const prettyBtn = controllerStore.allPrettyButtonNames.find(
Expand All @@ -230,11 +238,6 @@ const setCurrentInputs = (joystick: Joystick, inputs: JoystickInput[]): void =>
currentInputs.value = inputs
inputClickedDialog.value = true
}
const currentJoystick = ref<Joystick>()
const currentInputs = ref()
const remappingInput = ref(false)
const justRemappedInput = ref<boolean>()
const inputClickedDialog = ref(false)
/**
* Remaps the input of a given joystick. The function waits for a button press on the joystick and then
Expand Down Expand Up @@ -273,8 +276,6 @@ const remapInput = async (joystick: Joystick, input: JoystickInput): Promise<voi
justRemappedInput.value = false
}
watch(inputClickedDialog, () => (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.
Expand Down

0 comments on commit 6a398a2

Please sign in to comment.