Allow other controllers in debug match
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
+10
-8
@@ -8,9 +8,7 @@ use bevy_ggrs::prelude::Session;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
AppState,
|
||||
args::Args,
|
||||
fighter::{
|
||||
AppState, args::Args, fighter::{
|
||||
FighterId, FighterRoster,
|
||||
animation::AnimKind,
|
||||
attack::{AttackKind, FighterAttackScriptAssets},
|
||||
@@ -18,11 +16,7 @@ use crate::{
|
||||
manifest::{FighterManifest, FighterManifestRegistry},
|
||||
spawn_fighter,
|
||||
visual::FighterAnimations,
|
||||
},
|
||||
math::{int::FGi32, vec::FGVec2},
|
||||
netcode::{GGRSCfg, session::create_session},
|
||||
scripting::FighterAttackScript,
|
||||
stage::{
|
||||
}, input::{LocalInputAssignments, LocalInputSource}, math::{int::FGi32, vec::FGVec2}, netcode::{GGRSCfg, session::create_session}, scripting::FighterAttackScript, stage::{
|
||||
self,
|
||||
manifest::{StageId, StageManifest, StageManifestRegistry},
|
||||
},
|
||||
@@ -146,6 +140,8 @@ pub fn initiate_match(
|
||||
pub fn initiate_default_match(
|
||||
mut commands: Commands,
|
||||
args: Res<Args>,
|
||||
gamepads: Query<Entity, With<Gamepad>>,
|
||||
mut assigments: ResMut<LocalInputAssignments>,
|
||||
mut next_state: ResMut<NextState<AppState>>,
|
||||
completed: Option<Res<crate::replay::ReplayComplete>>,
|
||||
) {
|
||||
@@ -176,6 +172,12 @@ pub fn initiate_default_match(
|
||||
})
|
||||
.collect();
|
||||
|
||||
assigments.push((0, LocalInputSource::Keyboard));
|
||||
|
||||
for (idx, entity) in gamepads.iter().take(args.players-1).enumerate() {
|
||||
assigments.push((idx+1, LocalInputSource::Gamepad(entity)));
|
||||
}
|
||||
|
||||
initiate_match(
|
||||
&mut commands,
|
||||
&mut next_state,
|
||||
|
||||
Reference in New Issue
Block a user