1
0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2026-02-07 18:02:26 +00:00

Use layout.arc to Build UI (#473)

* Update lib.rs

* Remaining fixes

* Initial

* Forgot to commit

* Clippy

* Initial

* Use feature gate

* Fixes

* layout.arc actually working. Add training_mod_menu_button

* Add docstring, fix from static

* Use include_flate to keep binary smaller

* Add most menu features back

* Add help, tabs

* Add help, tabs

* Small refactor

* Fix clippy, some other issues

* Updated menu buttons, inactive text colour (btns), layouts

---------

Co-authored-by: Matthew Edell <edell.matthew@gmail.com>
This commit is contained in:
jugeeya
2023-02-09 07:51:40 -08:00
committed by GitHub
parent d23dcdf968
commit 3d6ea34eeb
9 changed files with 304 additions and 1169 deletions

View File

@@ -8,7 +8,6 @@ extern crate bitflags_serde_shim;
extern crate num_derive;
use core::f64::consts::PI;
use ramhorns::Content;
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};
#[cfg(feature = "smash")]
@@ -1238,7 +1237,7 @@ pub static DEFAULTS_MENU: TrainingModpackMenu = TrainingModpackMenu {
pub static mut MENU: TrainingModpackMenu = DEFAULTS_MENU;
#[derive(Content, Clone, Serialize)]
#[derive(Clone, Serialize)]
pub struct Slider {
pub selected_min: u32,
pub selected_max: u32,
@@ -1246,14 +1245,14 @@ pub struct Slider {
pub abs_max: u32,
}
#[derive(Content, Clone, Serialize)]
#[derive(Clone, Serialize)]
pub struct Toggle<'a> {
pub toggle_value: u32,
pub toggle_title: &'a str,
pub checked: bool,
}
#[derive(Content, Clone, Serialize)]
#[derive(Clone, Serialize)]
pub struct SubMenu<'a> {
pub submenu_title: &'a str,
pub submenu_id: &'a str,
@@ -1327,7 +1326,7 @@ impl<'a> SubMenu<'a> {
}
}
#[derive(Content, Serialize, Clone)]
#[derive(Serialize, Clone)]
pub struct Tab<'a> {
pub tab_id: &'a str,
pub tab_title: &'a str,
@@ -1370,7 +1369,7 @@ impl<'a> Tab<'a> {
}
}
#[derive(Content, Serialize, Clone)]
#[derive(Serialize, Clone)]
pub struct UiMenu<'a> {
pub tabs: Vec<Tab<'a>>,
}