ui: Unfinished item rotating

This commit is contained in:
Alexey 2026-03-12 10:32:55 +03:00
commit 55c4e3a1d1
3 changed files with 77 additions and 4 deletions

View file

@ -20,6 +20,11 @@ pub enum InputAction {
Interact,
}
#[derive(Actionlike, PartialEq, Eq, Hash, Debug, Clone, Reflect, Serialize, Deserialize)]
pub enum UiAction {
Rotate,
}
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default, States)]
pub enum GameState {
#[default]
@ -29,14 +34,21 @@ pub enum GameState {
impl InputAction {
pub fn default_input_map() -> InputMap<Self> {
let input_map = InputMap::default()
InputMap::default()
.with_axis(Self::Move, VirtualAxis::ad())
.with_axis(Self::Move, GamepadAxis::LeftStickX)
.with(Self::ToggleInventory, KeyCode::KeyI)
.with(Self::ToggleInventory, GamepadButton::Select)
.with(Self::Interact, KeyCode::KeyE)
.with(Self::Interact, GamepadButton::East);
input_map
.with(Self::Interact, GamepadButton::East)
}
}
impl UiAction {
pub fn default_input_map() -> InputMap<Self> {
InputMap::default()
.with(Self::Rotate, KeyCode::KeyR)
.with(Self::Rotate, GamepadButton::West)
}
}