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 serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState,
|
AppState, args::Args, fighter::{
|
||||||
args::Args,
|
|
||||||
fighter::{
|
|
||||||
FighterId, FighterRoster,
|
FighterId, FighterRoster,
|
||||||
animation::AnimKind,
|
animation::AnimKind,
|
||||||
attack::{AttackKind, FighterAttackScriptAssets},
|
attack::{AttackKind, FighterAttackScriptAssets},
|
||||||
@@ -18,11 +16,7 @@ use crate::{
|
|||||||
manifest::{FighterManifest, FighterManifestRegistry},
|
manifest::{FighterManifest, FighterManifestRegistry},
|
||||||
spawn_fighter,
|
spawn_fighter,
|
||||||
visual::FighterAnimations,
|
visual::FighterAnimations,
|
||||||
},
|
}, input::{LocalInputAssignments, LocalInputSource}, math::{int::FGi32, vec::FGVec2}, netcode::{GGRSCfg, session::create_session}, scripting::FighterAttackScript, stage::{
|
||||||
math::{int::FGi32, vec::FGVec2},
|
|
||||||
netcode::{GGRSCfg, session::create_session},
|
|
||||||
scripting::FighterAttackScript,
|
|
||||||
stage::{
|
|
||||||
self,
|
self,
|
||||||
manifest::{StageId, StageManifest, StageManifestRegistry},
|
manifest::{StageId, StageManifest, StageManifestRegistry},
|
||||||
},
|
},
|
||||||
@@ -146,6 +140,8 @@ pub fn initiate_match(
|
|||||||
pub fn initiate_default_match(
|
pub fn initiate_default_match(
|
||||||
mut commands: Commands,
|
mut commands: Commands,
|
||||||
args: Res<Args>,
|
args: Res<Args>,
|
||||||
|
gamepads: Query<Entity, With<Gamepad>>,
|
||||||
|
mut assigments: ResMut<LocalInputAssignments>,
|
||||||
mut next_state: ResMut<NextState<AppState>>,
|
mut next_state: ResMut<NextState<AppState>>,
|
||||||
completed: Option<Res<crate::replay::ReplayComplete>>,
|
completed: Option<Res<crate::replay::ReplayComplete>>,
|
||||||
) {
|
) {
|
||||||
@@ -176,6 +172,12 @@ pub fn initiate_default_match(
|
|||||||
})
|
})
|
||||||
.collect();
|
.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(
|
initiate_match(
|
||||||
&mut commands,
|
&mut commands,
|
||||||
&mut next_state,
|
&mut next_state,
|
||||||
|
|||||||
Reference in New Issue
Block a user