DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

4538b08aabecbd285792590a752edbca6062c942 — Jonni Liljamo 1 year, 9 months ago d3a6677
feat(client): add separate networking plugin, a few event stubs
M client/src/main.rs => client/src/main.rs +1 -1
@@ 107,7 107,7 @@ fn main() {
        NaiaClientConfig::default(),
        protocol(),
    ))
    .add_startup_system(init_networking);
    .add_plugin(plugins::networking::NetworkingPlugin);

    app.run();
}

M client/src/plugins/menu/ui/connect/ui.rs => client/src/plugins/menu/ui/connect/ui.rs +1 -0
@@ 14,6 14,7 @@ use crate::util::egui::{menuwindow, password};
#[derive(Default, Resource)]
pub struct ConnectScreenData {
    pub state: ConnectState,
    pub connecting: bool,
    pub username: String,
    pub email: String,
    pub password: String,

M client/src/plugins/mod.rs => client/src/plugins/mod.rs +1 -0
@@ 8,4 8,5 @@

pub mod config;
pub mod menu;
pub mod networking;
pub mod phases;

A client/src/plugins/networking/mod.rs => client/src/plugins/networking/mod.rs +21 -0
@@ 0,0 1,21 @@
/*
 * This file is part of laurelin/client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;

mod systems;

pub struct NetworkingPlugin;

impl Plugin for NetworkingPlugin {
    fn build(&self, app: &mut App) {
        app.add_system_to_stage(CoreStage::PreUpdate, systems::events::connect_events)
            .add_system_to_stage(CoreStage::PreUpdate, systems::events::reject_events)
            .add_system_to_stage(CoreStage::PreUpdate, systems::events::disconnect_events);
    }
}

A client/src/plugins/networking/systems/events.rs => client/src/plugins/networking/systems/events.rs +13 -0
@@ 0,0 1,13 @@
/*
 * This file is part of laurelin/client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

pub fn connect_events() {}

pub fn reject_events() {}

pub fn disconnect_events() {}

A client/src/plugins/networking/systems/mod.rs => client/src/plugins/networking/systems/mod.rs +9 -0
@@ 0,0 1,9 @@
/*
 * This file is part of laurelin/client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

pub mod events;