mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2026-02-07 18:02:26 +00:00
Fix two bugs which caused some OnOffs to work incorrectly (#454)
This commit is contained in:
@@ -1295,9 +1295,13 @@ impl<'a> SubMenu<'a> {
|
||||
let titles = T::to_toggle_strs();
|
||||
for i in 0..values.len() {
|
||||
let checked: bool = (values[i] & initial_value) > 0
|
||||
|| (!values[i] == 0 && initial_value == &0);
|
||||
|| (!values[i] == 0 && initial_value == &0);
|
||||
instance.add_toggle(values[i], titles[i], checked);
|
||||
}
|
||||
// Select the first option if there's nothing selected atm but it's a single option submenu
|
||||
if is_single_option && instance.toggles.iter().all(|t| !t.checked) {
|
||||
instance.toggles[0].checked = true;
|
||||
}
|
||||
instance
|
||||
}
|
||||
pub fn new_with_slider<S: SliderTrait>(
|
||||
|
||||
Reference in New Issue
Block a user