Skip to content

Commit

Permalink
Refresh settings immediately before applying them.
Browse files Browse the repository at this point in the history
In every case in the facade.
  • Loading branch information
ceejbot committed Jan 2, 2024
1 parent 3f7daea commit e59d1c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/controller/facade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ pub fn user_settings() -> Box<UserSettings> {

/// Let's get this party started.
pub fn initialize_hud() {
refresh_user_settings();
let settings = settings();
log::info!("Reading and applying settings. Your settings are:");
let mut ctrl = control::get();
log::info!("{settings}");

Layout::refresh();
let hud = hud_layout();
ctrl.apply_settings();
let mut ctrl = control::get();

if settings.autofade() {
log::info!("The HUD is in autofade mode and ready to go.");
Expand Down Expand Up @@ -130,10 +130,10 @@ pub fn serialize_cycles() -> Vec<u8> {

/// Cycle data loaded from cosave.
pub fn cycle_loaded_from_cosave(bytes: &CxxVector<u8>, version: u32) {
refresh_user_settings();
let mut ctrl = control::get();
if let Some(cosave_cycle) = CycleData::deserialize(bytes, version) {
ctrl.cycles = cosave_cycle;
ctrl.apply_settings();
ctrl.refresh_after_load();
log::info!("Cycles loaded and ready to rock.");
} else {
Expand Down

0 comments on commit e59d1c2

Please sign in to comment.