bevy_basic_ui/settings/
resources.rs

1use bevy::{
2    asset::{Asset, Handle},
3    ecs::system::Resource,
4    reflect::TypePath,
5};
6
7use serde::Deserialize;
8
9#[derive(Resource)]
10pub struct SettingsVals(pub Vec<SettingsVal>);
11
12#[derive(Deserialize, Clone, Debug)]
13pub struct SettingsVal {
14    pub tag: String,
15    pub value: u32,
16}
17
18#[derive(Deserialize)]
19pub struct SettingsCategory {
20    pub name: String,
21    pub contents: Vec<SettingsVal>,
22}
23
24#[derive(Asset, TypePath, Deserialize)]
25pub struct AllSettings {
26    pub categories: Vec<SettingsCategory>,
27}
28
29#[derive(Resource)]
30pub struct TomlAsset(pub Handle<AllSettings>);