@@ -18,7 +18,6 @@ import { allAvailableAxes, allAvailableButtons } from '@/libs/joystick/protocols
1818import { modifierKeyActions , otherAvailableActions } from '@/libs/joystick/protocols/other'
1919import { Alert , AlertLevel } from '@/types/alert'
2020import {
21- type GamepadToCockpitStdMapping ,
2221 type JoystickProtocolActionsMapping ,
2322 type JoystickState ,
2423 type ProtocolAction ,
@@ -269,36 +268,6 @@ export const useControllerStore = defineStore('controller', () => {
269268 reader . readAsText ( e . target . files [ 0 ] )
270269 }
271270
272- const exportJoysticksMappingsToVehicle = async (
273- vehicleAddress : string ,
274- joystickMappings : { [ key in JoystickModel ] : GamepadToCockpitStdMapping }
275- ) : Promise < void > => {
276- await setKeyDataOnCockpitVehicleStorage ( vehicleAddress , cockpitStdMappingsKey , joystickMappings )
277- Swal . fire ( { icon : 'success' , text : 'Joystick mapping exported to vehicle.' , timer : 3000 } )
278- }
279-
280- const importJoysticksMappingsFromVehicle = async ( vehicleAddress : string ) : Promise < void > => {
281- const newMapping = await getKeyDataFromCockpitVehicleStorage ( vehicleAddress , cockpitStdMappingsKey )
282- if ( ! newMapping ) {
283- Swal . fire ( { icon : 'error' , text : 'No joystick mappings to import from vehicle.' , timer : 3000 } )
284- return
285- }
286- try {
287- Object . values ( newMapping ) . forEach ( ( mapping ) => {
288- if ( ! mapping [ 'name' ] || ! mapping [ 'axes' ] || ! mapping [ 'buttons' ] ) {
289- throw Error ( 'Invalid joystick mapping inside vehicle.' )
290- }
291- } )
292- } catch ( error ) {
293- Swal . fire ( { icon : 'error' , text : `Could not import joystick mapping from vehicle. ${ error } ` , timer : 3000 } )
294- return
295- }
296-
297- // @ts -ignore: We check for the necessary fields in the if before
298- cockpitStdMappings . value = newMapping
299- Swal . fire ( { icon : 'success' , text : 'Joystick mapping imported from vehicle.' , timer : 3000 } )
300- }
301-
302271 const exportFunctionsMapping = ( protocolActionsMapping : JoystickProtocolActionsMapping ) : void => {
303272 const blob = new Blob ( [ JSON . stringify ( protocolActionsMapping ) ] , { type : 'text/plain;charset=utf-8' } )
304273 saveAs ( blob , `cockpit-std-profile-joystick-${ protocolActionsMapping . name } .json` )
@@ -394,8 +363,6 @@ export const useControllerStore = defineStore('controller', () => {
394363 loadProtocolMapping,
395364 exportJoystickMapping,
396365 importJoystickMapping,
397- exportJoysticksMappingsToVehicle,
398- importJoysticksMappingsFromVehicle,
399366 exportFunctionsMapping,
400367 importFunctionsMapping,
401368 exportFunctionsMappingToVehicle,
0 commit comments