skyline/app/src/main/java/emu/skyline/input/onscreen/OnScreenEditInfo.kt
lynxnb 81eb8fd231 Rework OSC edit mode handling for better extensibility
Edit mode configuration parameters are now shared between the view and the buttons in a small `OnScreenEditInfo` object, avoiding variable duplication about edit state. The `editingTouchHandler` has also been simplified to only lookup the button if one wasn't being edited already.
2023-04-02 18:16:10 +02:00

30 lines
679 B
Kotlin

/*
* SPDX-License-Identifier: MPL-2.0
* Copyright © 2023 Skyline Team and Contributors (https://github.com/skyline-emu/)
*/
package emu.skyline.input.onscreen
enum class EditMode {
None,
Move,
}
/**
* A small class that holds information about the current edit session
* This is used to share information between the [OnScreenControllerView] and the individual [OnScreenButton]s
*/
class OnScreenEditInfo {
/**
* The current edit mode
*/
var editMode : EditMode = EditMode.None
/**
* The button that is currently being edited
*/
var editButton : OnScreenButton? = null
val isEditing get() = editMode != EditMode.None
}