Skip to content
Snippets Groups Projects
mod.rs 754 B
Newer Older
use bevy::app::{App, Plugin};
use iyes_loopless::prelude::ConditionSet;

use crate::system::flow::AppState;

mod sync_trade;
mod sync_travel;

pub struct UISyncPlugin;
impl Plugin for UISyncPlugin {
	fn build(&self, app: &mut App) {
		app.init_resource::<UITravelInfo>()
			.init_resource::<UIStatsData>()
			.init_resource::<UITradeData>()
			.add_system_set(
				ConditionSet::new()
					.run_in_state(AppState::InGame)
					.with_system(sync_travel::sync_player_travel_info_to_ui)
					.with_system(sync_stats::sync_player_stats_info_to_ui)
					.with_system(sync_trade::sync_ui_trade_data)
pub use sync_stats::UIStatsData;
pub use sync_trade::{ItemTradeData, UITradeData};
pub use sync_travel::UITravelInfo;