Add stocks UI (#52)
CI / build-and-test (push) Successful in 1m16s
CI / production-build (push) Successful in 9m38s

Reviewed-on: #52
Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #52.
This commit is contained in:
2026-09-20 11:34:45 +00:00
committed by EIREXE
parent 1276562890
commit 15f07edaaf
3 changed files with 91 additions and 9 deletions
+21 -2
View File
@@ -1,10 +1,15 @@
use bevy::prelude::*;
use crate::AppState;
use crate::{
AppState,
match_loading::{MatchConfig, MatchRules},
match_runtime::MatchState,
};
pub mod battle_ui;
pub mod errors;
pub mod fighter_info;
pub mod stock_icon;
#[derive(Default)]
pub struct InGameUIPlugin;
@@ -13,6 +18,20 @@ impl Plugin for InGameUIPlugin {
fn build(&self, app: &mut App) {
app.add_systems(OnEnter(AppState::InMatch), battle_ui::spawn_battle_ui)
.add_systems(OnExit(AppState::InMatch), battle_ui::cleanup_battle_ui)
.add_systems(PostUpdate, fighter_info::update_fighter_info_damage);
.add_systems(PostUpdate, fighter_info::update_fighter_info_damage)
.add_systems(
PostUpdate,
fighter_info::update_fighter_info_stocks.run_if(
resource_exists::<MatchState>
.and_then(resource_exists::<MatchConfig>)
.and_then(|match_config: Res<MatchConfig>| {
if let MatchRules::Stock { .. } = match_config.rules {
true
} else {
false
}
}),
),
);
}
}