DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

1fdcbaef30bf4c21ad0d35c16dc7826d83d9f330 — Jonni Liljamo 1 year, 11 months ago a8f056d
Change CfgHidden to CfgDev
M sdbclient/src/cfg/mod.rs => sdbclient/src/cfg/mod.rs +2 -2
@@ 13,7 13,7 @@ use serde::{Deserialize, Serialize};
// Constants for file names
pub const FILE_CFG_SETTINGS: &str = "cfgsettings.json";
pub const FILE_CFG_USER: &str = "cfguser.json";
pub const FILE_CFG_HIDDEN: &str = ".cfghidden.json";
pub const FILE_CFG_DEV: &str = ".cfgdev.json";

/// Stores a directories::ProjectDirs for easy access
#[derive(Resource, Debug, Component, Clone)]


@@ 47,7 47,7 @@ pub struct CfgUser {

/// Settings that the user has no access to, or can only access through developer settings
#[derive(Serialize, Deserialize, Resource, Debug, Component, PartialEq, Clone)]
pub struct CfgHidden {
pub struct CfgDev {
    /// API Server
    pub api_server: String,
}

M sdbclient/src/main.rs => sdbclient/src/main.rs +1 -1
@@ 87,7 87,7 @@ fn main() {
        username: "".to_string(),
        email: "".to_string(),
    })
    .insert_resource(cfg::CfgHidden {
    .insert_resource(cfg::CfgDev {
        api_server: "http://localhost:8080/api".to_string(),
    });


M sdbclient/src/plugins/connection_check/mod.rs => sdbclient/src/plugins/connection_check/mod.rs +3 -3
@@ 14,7 14,7 @@ use bevy_console::PrintConsoleLine;

use futures_lite::future;

use crate::{api, cfg::CfgHidden};
use crate::{api, cfg::CfgDev};

/// This plugin will check if we can connect to the API
pub struct ConnectionCheckPlugin;


@@ 31,8 31,8 @@ impl Plugin for ConnectionCheckPlugin {
#[derive(Component)]
struct ConnectionCheck(Task<api::APIInfo>);

fn start_connection_check(mut commands: Commands, cfg_hidden: Res<CfgHidden>) {
    let api_address = cfg_hidden.api_server.clone();
fn start_connection_check(mut commands: Commands, cfg_dev: Res<CfgDev>) {
    let api_address = cfg_dev.api_server.clone();
    let thread_pool = AsyncComputeTaskPool::get();
    let task = thread_pool.spawn(async move {
        let api_info = api::info(api_address);

M sdbclient/src/plugins/menu/accountlogin/mod.rs => sdbclient/src/plugins/menu/accountlogin/mod.rs +3 -3
@@ 16,7 16,7 @@ use futures_lite::future;

use crate::{
    api::{self, user::ResponseToken},
    cfg::{self, CfgDirs, CfgHidden, CfgUser},
    cfg::{self, CfgDev, CfgDirs, CfgUser},
    util,
};



@@ 57,10 57,10 @@ struct LoginCall(Task<ResponseToken>);

fn start_login_call(
    mut commands: Commands,
    cfg_hidden: Res<CfgHidden>,
    cfg_dev: Res<CfgDev>,
    inputs: Res<ui::InputsUserLogin>,
) {
    let api_address = cfg_hidden.api_server.clone();
    let api_address = cfg_dev.api_server.clone();
    let i = inputs.clone();

    let thread_pool = AsyncComputeTaskPool::get();

M sdbclient/src/plugins/menu/accountregister/mod.rs => sdbclient/src/plugins/menu/accountregister/mod.rs +3 -3
@@ 19,7 19,7 @@ use crate::{
        self,
        user::{ResponseRegister, ResponseToken},
    },
    cfg::{self, CfgDirs, CfgHidden, CfgUser},
    cfg::{self, CfgDev, CfgDirs, CfgUser},
    util,
};



@@ 65,10 65,10 @@ struct RegisterCall(Task<RegisterCallResponse>);

fn start_register_call(
    mut commands: Commands,
    cfg_hidden: Res<CfgHidden>,
    cfg_dev: Res<CfgDev>,
    inputs: Res<ui::InputsUserRegister>,
) {
    let api_address = cfg_hidden.api_server.clone();
    let api_address = cfg_dev.api_server.clone();
    let i = inputs.clone();

    let thread_pool = AsyncComputeTaskPool::get();