mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Apply dolphin customizations without reboot
This commit is contained in:
@@ -97,7 +97,7 @@ bool momentum_app_apply(MomentumApp* app) {
|
||||
}
|
||||
}
|
||||
|
||||
if(app->save_level || app->save_angry) {
|
||||
if(app->save_dolphin) {
|
||||
Dolphin* dolphin = furi_record_open(RECORD_DOLPHIN);
|
||||
if(app->save_level) {
|
||||
int32_t xp = app->dolphin_level > 1 ? DOLPHIN_LEVELS[app->dolphin_level - 2] : 0;
|
||||
@@ -107,7 +107,8 @@ bool momentum_app_apply(MomentumApp* app) {
|
||||
dolphin->state->data.butthurt = app->dolphin_angry;
|
||||
}
|
||||
dolphin->state->dirty = true;
|
||||
dolphin_state_save(dolphin->state);
|
||||
dolphin_flush(dolphin);
|
||||
dolphin_reload_state(dolphin);
|
||||
furi_record_close(RECORD_DOLPHIN);
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ typedef struct {
|
||||
bool save_name;
|
||||
bool save_level;
|
||||
bool save_angry;
|
||||
bool save_dolphin;
|
||||
bool save_backlight;
|
||||
bool save_settings;
|
||||
bool apply_pack;
|
||||
|
||||
@@ -18,6 +18,7 @@ static void momentum_app_scene_misc_dolphin_dolphin_level_changed(VariableItem*
|
||||
snprintf(level_str, 4, "%li", app->dolphin_level);
|
||||
variable_item_set_current_value_text(item, level_str);
|
||||
app->save_level = true;
|
||||
app->save_dolphin = true;
|
||||
}
|
||||
|
||||
static void momentum_app_scene_misc_dolphin_dolphin_angry_changed(VariableItem* item) {
|
||||
@@ -27,6 +28,7 @@ static void momentum_app_scene_misc_dolphin_dolphin_angry_changed(VariableItem*
|
||||
snprintf(angry_str, 4, "%li", app->dolphin_angry);
|
||||
variable_item_set_current_value_text(item, angry_str);
|
||||
app->save_angry = true;
|
||||
app->save_dolphin = true;
|
||||
}
|
||||
|
||||
const char* const butthurt_timer_names[] = {
|
||||
@@ -59,7 +61,7 @@ static void momentum_app_scene_misc_dolphin_butthurt_timer_changed(VariableItem*
|
||||
variable_item_set_current_value_text(item, butthurt_timer_names[index]);
|
||||
momentum_settings.butthurt_timer = butthurt_timer_values[index];
|
||||
app->save_settings = true;
|
||||
app->require_reboot = true;
|
||||
app->save_dolphin = true;
|
||||
}
|
||||
|
||||
void momentum_app_scene_misc_dolphin_on_enter(void* context) {
|
||||
|
||||
Reference in New Issue
Block a user