mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2024-11-20 00:46:34 +00:00
Fix Save State Slots menu crash (#526)
* Update options.rs * Update save_states.rs * Update options.rs
This commit is contained in:
parent
9b9070cff2
commit
dbfa60bebc
2 changed files with 12 additions and 8 deletions
|
@ -156,7 +156,7 @@ unsafe fn get_slot() -> usize {
|
|||
if MENU.randomize_slots == OnOff::On {
|
||||
RANDOM_SLOT
|
||||
} else {
|
||||
MENU.save_state_slot as u32 as usize
|
||||
MENU.save_state_slot.as_idx() as usize
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -594,8 +594,8 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor)
|
|||
{
|
||||
// Don't begin saving state if Nana's delayed input is captured
|
||||
MIRROR_STATE = 1.0;
|
||||
save_state_player(MENU.save_state_slot as u32 as usize).state = Save;
|
||||
save_state_cpu(MENU.save_state_slot as u32 as usize).state = Save;
|
||||
save_state_player(MENU.save_state_slot.as_idx() as usize).state = Save;
|
||||
save_state_cpu(MENU.save_state_slot.as_idx() as usize).state = Save;
|
||||
notifications::clear_notifications("Save State");
|
||||
notifications::notification(
|
||||
"Save State".to_string(),
|
||||
|
|
|
@ -1112,11 +1112,11 @@ impl_serde_for_bitflags!(SaveDamage);
|
|||
Debug, Clone, Copy, PartialEq, FromPrimitive, EnumIter, Serialize_repr, Deserialize_repr,
|
||||
)]
|
||||
pub enum SaveStateSlot {
|
||||
One = 0,
|
||||
Two = 1,
|
||||
Three = 2,
|
||||
Four = 3,
|
||||
Five = 4,
|
||||
One = 0x0,
|
||||
Two = 0x1,
|
||||
Three = 0x2,
|
||||
Four = 0x4,
|
||||
Five = 0x8,
|
||||
}
|
||||
|
||||
impl SaveStateSlot {
|
||||
|
@ -1129,6 +1129,10 @@ impl SaveStateSlot {
|
|||
SaveStateSlot::Five => "5",
|
||||
})
|
||||
}
|
||||
|
||||
pub fn as_idx(self) -> u32 {
|
||||
log_2(self as i32 as u32)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToggleTrait for SaveStateSlot {
|
||||
|
|
Loading…
Reference in a new issue