pub fn update_state(&self, state: &mut key_value::State, timer: &Timer) {
        let total_playtime = total_playtime::calculate(timer);

        state.background = self.settings.background;
        state.key_color = self.settings.label_color;
        state.value_color = self.settings.value_color;
        state.semantic_color = Default::default();

        state.key.clear();
        state.key.push_str("Total Playtime");

        state.value.clear();
        if self.settings.show_days {
            let _ = write!(state.value, "{}", Days::new().format(total_playtime));
        } else {
            let _ = write!(state.value, "{}", Regular::new().format(total_playtime));
        }

        state.key_abbreviations.clear();
        state.key_abbreviations.push("Playtime".into());

        state.display_two_rows = self.settings.display_two_rows;
        state.updates_frequently = timer.current_phase().is_running();
    }
/// Updates the component's state based on the timer provided.
Updates the component's state based on the timer provided.
Updates the component ' s state based on the timer provided .
pub fn update_state(&self, state: &mut key_value::State, timer: &Timer) {
        let total_playtime = total_playtime::calculate(timer);
        state.background = self.settings.background;
        state.key_color = self.settings.label_color;
        state.value_color = self.settings.value_color;
        state.semantic_color = Default::default();
        state.key.clear();
        state.key.push_str("Total Playtime");
        state.value.clear();
        if self.settings.show_days {
            let _ = write!(state.value, "{}", Days::new().format(total_playtime));
        } else {
            let _ = write!(state.value, "{}", Regular::new().format(total_playtime));
        }
        state.key_abbreviations.clear();
        state.key_abbreviations.push("Playtime".into());
        state.display_two_rows = self.settings.display_two_rows;
        state.updates_frequently = timer.current_phase().is_running();
    }
pub fn update_state ( & self , state : & mut key_value :: State , timer : & Timer ) { let total_playtime = total_playtime :: calculate ( timer ) ; state . background = self . settings . background ; state . key_color = self . settings . label_color ; state . value_color = self . settings . value_color ; state . semantic_color = Default :: default ( ) ; state . key . clear ( ) ; state . key . push_str ( " " ) ; state . value . clear ( ) ; if self . settings . show_days { let _ = write ! ( state value " " Days new ( ) format ( total_playtime ) ) ; } else { let _ = write ! ( state value " " Regular new ( ) format ( total_playtime ) ) ; } state . key_abbreviations . clear ( ) ; state . key_abbreviations . push ( " " . into ( ) ) ; state . display_two_rows = self . settings . display_two_rows ; state . updates_frequently = timer . current_phase ( ) . is_running ( ) ; }
Updates the component's state based on the timer provided.
Updates the component ' s state based on the timer provided .
&self
state
&mut key_value::State
timer
&Timer
&self
state
&mut key_value::State
timer
&Timer