style: run cargo fmt
This commit is contained in:
@@ -4,10 +4,7 @@
|
||||
//!
|
||||
//! Yeah I know, now it's a bit ugly
|
||||
|
||||
use bevy::{
|
||||
ecs::schedule::States,
|
||||
prelude::*,
|
||||
};
|
||||
use bevy::{ecs::schedule::States, prelude::*};
|
||||
use bevy_controls::{
|
||||
contract::{
|
||||
Action, ActionInner, GameState, GameStateInner, InputsContainer, InputsContainerInner,
|
||||
@@ -113,7 +110,9 @@ fn add_bindings(mut controls: ResMut<Controls<MyAction, MyGameState>>) {
|
||||
|
||||
controls.force_push(
|
||||
MyAction::Up,
|
||||
Binding::new(ButtonCombination::Single(InputType::Keyboard(KeyCode::Space))),
|
||||
Binding::new(ButtonCombination::Single(InputType::Keyboard(
|
||||
KeyCode::Space,
|
||||
))),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -187,25 +186,19 @@ fn text_update_system(
|
||||
mut jumps_count: ResMut<JumpsCount>,
|
||||
) {
|
||||
for text in query.iter_mut() {
|
||||
|
||||
let player_inputs = inputs_container.me().expect("This is bad");
|
||||
let mut text = update_text(
|
||||
text,
|
||||
player_inputs.get(MyAction::Left),
|
||||
MOVE_LEFT_INDEX);
|
||||
text = update_text(
|
||||
text,
|
||||
player_inputs.get(MyAction::Back),
|
||||
MOVE_BACK_INDEX);
|
||||
let mut text = update_text(text, player_inputs.get(MyAction::Left), MOVE_LEFT_INDEX);
|
||||
text = update_text(text, player_inputs.get(MyAction::Back), MOVE_BACK_INDEX);
|
||||
text = update_text(
|
||||
text,
|
||||
player_inputs.get(MyAction::Forward),
|
||||
MOVE_FORWARD_INDEX);
|
||||
text = update_text(
|
||||
text,
|
||||
player_inputs.get(MyAction::Right),
|
||||
MOVE_RIGHT_INDEX);
|
||||
if player_inputs.get_just_pressed(MyAction::Up).unwrap_or(false) {
|
||||
MOVE_FORWARD_INDEX,
|
||||
);
|
||||
text = update_text(text, player_inputs.get(MyAction::Right), MOVE_RIGHT_INDEX);
|
||||
if player_inputs
|
||||
.get_just_pressed(MyAction::Up)
|
||||
.unwrap_or(false)
|
||||
{
|
||||
**jumps_count += 1;
|
||||
text.sections[JUMP_INDEX].value = format!("Up (Space) - {}", **jumps_count);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
extern crate proc_macro;
|
||||
|
||||
use proc_macro::TokenStream;
|
||||
use syn;
|
||||
use quote::quote;
|
||||
use bevy_controls::contract::{Action, ActionInner};
|
||||
use proc_macro::TokenStream;
|
||||
use quote::quote;
|
||||
use syn;
|
||||
|
||||
#[proc_macro_derive(Action)]
|
||||
pub fn action(input: TokenStream) -> TokenStream {
|
||||
|
||||
Reference in New Issue
Block a user