1
0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2026-01-16 15:30:24 +00:00
Files
UltimateTrainingModpack/training_mod_tui/src/gauge.rs
asimon-1 fa451986e0 Randomized percent on load (#394)
* Create save states tab

* Initial work - crashes on boot

* Change usizes to u32's.
Refactor toggle "checked" logic.
Add blujay's panic tracker.

* Rename tui mins/maxes

* Fix misc. TUI bugs

* Fix panic caused by prematurely setting the submenu state to GaugeState::None

Set submenu state to GaugeState::MinHover when opening a slider menu so that the slider is immediately loaded

When changing from GaugeState::Min/MaxSelected to Min/MaxHover, commit changes from App.current_sub_menu_slider to SubMenu.slider so that it can be exported to JSON

* Merge save_damage and save_state_pct_rand_enable settings

* Add comments to training_mod_tui::lib.rs

* Add icon

* Initial work on web slider

Todo:
Styling polish
Bugfix for initial settings load
Handle dragging using gamepad

* Style and fix web slider

* Add separate settings for player random damage

* TUI styling fixes

* Paginate TUI tabs

* Address CR comments
2022-11-01 13:52:38 -07:00

28 lines
510 B
Rust

pub enum GaugeState {
MinHover,
MaxHover,
MinSelected,
MaxSelected,
None,
}
pub struct DoubleEndedGauge {
pub state: GaugeState,
pub selected_min: u32,
pub selected_max: u32,
pub abs_min: u32,
pub abs_max: u32,
}
impl DoubleEndedGauge {
pub fn new() -> DoubleEndedGauge {
DoubleEndedGauge {
state: GaugeState::None,
selected_min: 0,
selected_max: 150,
abs_min: 0,
abs_max: 150,
}
}
}