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
use bevy::{
    asset::{Asset, Handle},
    ecs::system::Resource,
    reflect::TypePath,
};

use serde::Deserialize;

#[derive(Resource, Asset, TypePath)]
pub struct SettingsVals(pub Vec<SettingsVal>);

#[derive(Deserialize, Asset, TypePath, Clone, Debug)]
pub struct SettingsVal {
    pub tag: String,
    pub value: u32,
}

#[derive(Asset, TypePath, Deserialize)]
pub struct SettingsCategory {
    pub name: String,
    pub contents: Vec<SettingsVal>,
}

#[derive(Asset, TypePath, Deserialize)]
pub struct AllSettings {
    pub categories: Vec<SettingsCategory>,
}

#[derive(Resource)]
pub struct TomlAsset(pub Handle<AllSettings>);