In prepare for adding editor related features, like swipe mapping and dynamic/static(free/fixed) joystick mode switcher.
Should not alter the behavior of the original code. If anything appears different it must be a bug.
Why this is necessary
Keymap editor code was the Voider version and hard to understand and modify.
Main changes
Folder Keymap and Menu reorganized to Editor and Keymap.
Class ControlData is removed, instead directly operate on underlying data structure.
Original Menu folder moved to new Editor/Views/CircleMenu.
Original ControlModel.swift split into multiple files under Elements folders under Editor/Models, Editor/Views and Editor/Controllers folders.
Most code are under Editor folder. New Keymap folder has only two files Keymapping.swift for file read/write and KeyCodeNames.swift for key code/name definition.
The data structure definition that's meant to keep synced with its PlayCover version is now moved from Keymapping.swift to Editor/Models/Elements/Element.swift.
Original EditorController.swift split into Editor/Views/EditorView.swift and Editor/Controllers/EditorController.swift.
Class JoystickButtonModel renamed to ChildButtonModel because it's used by both JoystickModel and DraggableButtonModel.
What's better
There are more files and every file now has less code.
UI-related code follows MVC pattern and is easy to modify.
In prepare for adding editor related features, like swipe mapping and dynamic/static(free/fixed) joystick mode switcher.
Should not alter the behavior of the original code. If anything appears different it must be a bug.
Why this is necessary
Keymap editor code was the Voider version and hard to understand and modify.
Main changes
Keymap
andMenu
reorganized toEditor
andKeymap
.ControlData
is removed, instead directly operate on underlying data structure.Menu
folder moved to newEditor/Views/CircleMenu
.ControlModel.swift
split into multiple files underElements
folders underEditor/Models
,Editor/Views
andEditor/Controllers
folders.Editor
folder. NewKeymap
folder has only two filesKeymapping.swift
for file read/write andKeyCodeNames.swift
for key code/name definition.Keymapping.swift
toEditor/Models/Elements/Element.swift
.EditorController.swift
split intoEditor/Views/EditorView.swift
andEditor/Controllers/EditorController.swift
.JoystickButtonModel
renamed toChildButtonModel
because it's used by bothJoystickModel
andDraggableButtonModel
.What's better