DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

ref: 408a9a9848876ac96affdc5fcee0802c732ebb4c deck-builder/sdbclient/src/cfg/mod.rs -rw-r--r-- 1.3 KiB
408a9a98Jonni Liljamo Serde for Cfg structs 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * This file is part of sdbclient
 * Copyright (C) 2022 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use bevy::prelude::*;

use serde::{Deserialize, Serialize};
/// Stores a directories::ProjectDirs for easy access
#[derive(Resource, Debug, Component, Clone)]
pub struct CfgDirs(pub directories::ProjectDirs);

/// Various settings that can be changed from the... Settings.
#[derive(Serialize, Deserialize, Resource, Debug, Component, PartialEq, Clone)]
pub struct CfgSettings {
    /// Master Volume
    pub volume_master: u32,
    /// Fulsscreen
    pub fullscreen: bool,
    /// Resolution
    pub resolution: (f32, f32),
}

/// User details and status
#[derive(Serialize, Deserialize, Resource, Debug, Component, PartialEq, Clone)]
pub struct CfgUser {
    /// User logged in status
    pub logged_in: bool,
    /// User Token
    pub user_token: String,
    /// User ID
    pub id: String,
    /// Username
    pub username: String,
    /// User email
    pub email: String,
}

/// 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 {
    /// API Server
    pub api_server: String,
}