mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
Add #[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
to gamepad types. (#583)
Seems these may have been missed in the gamepad implementation, copied them from keyboard.rs.
This commit is contained in:
parent
cd9e502b12
commit
d52f9e32aa
1 changed files with 7 additions and 0 deletions
|
@ -1,16 +1,20 @@
|
|||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct Gamepad(pub usize);
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum GamepadEventType {
|
||||
Connected,
|
||||
Disconnected,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct GamepadEvent(pub Gamepad, pub GamepadEventType);
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum GamepadButtonType {
|
||||
South,
|
||||
East,
|
||||
|
@ -34,9 +38,11 @@ pub enum GamepadButtonType {
|
|||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct GamepadButton(pub Gamepad, pub GamepadButtonType);
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub enum GamepadAxisType {
|
||||
LeftStickX,
|
||||
LeftStickY,
|
||||
|
@ -49,4 +55,5 @@ pub enum GamepadAxisType {
|
|||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct GamepadAxis(pub Gamepad, pub GamepadAxisType);
|
||||
|
|
Loading…
Reference in a new issue