From 97c11926a13276cc1753151b46403029bbc0de9d Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Thu, 6 Jul 2023 01:37:12 +0200 Subject: [PATCH] Fix switching asset pack not updating icons/text --- .../scenes/xtreme_app_scene_interface_graphics.c | 1 + applications/main/xtreme_app/xtreme_app.c | 10 ++++++++++ applications/main/xtreme_app/xtreme_app.h | 1 + 3 files changed, 12 insertions(+) diff --git a/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_graphics.c b/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_graphics.c index 5b016815f..450b78bc2 100644 --- a/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_graphics.c +++ b/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_graphics.c @@ -24,6 +24,7 @@ static void xtreme_app_scene_interface_graphics_asset_pack_changed(VariableItem* XTREME_ASSETS_PACK_NAME_LEN); app->asset_pack_index = index; app->save_settings = true; + app->apply_pack = true; } const char* const anim_speed_names[] = diff --git a/applications/main/xtreme_app/xtreme_app.c b/applications/main/xtreme_app/xtreme_app.c index 9a84d485f..444341a87 100644 --- a/applications/main/xtreme_app/xtreme_app.c +++ b/applications/main/xtreme_app/xtreme_app.c @@ -129,6 +129,16 @@ bool xtreme_app_apply(XtremeApp* app) { popup_enable_timeout(app->popup); view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewPopup); return true; + } else if(app->apply_pack) { + popup_set_header(app->popup, "Reloading...", 64, 26, AlignCenter, AlignCenter); + popup_set_text(app->popup, "Applying asset pack...", 64, 40, AlignCenter, AlignCenter); + popup_set_callback(app->popup, NULL); + popup_set_context(app->popup, NULL); + popup_set_timeout(app->popup, 0); + popup_disable_timeout(app->popup); + view_dispatcher_switch_to_view(app->view_dispatcher, XtremeAppViewPopup); + XTREME_ASSETS_FREE(); + XTREME_ASSETS_LOAD(); } furi_record_close(RECORD_STORAGE); diff --git a/applications/main/xtreme_app/xtreme_app.h b/applications/main/xtreme_app/xtreme_app.h index c223d495b..4089eb820 100644 --- a/applications/main/xtreme_app/xtreme_app.h +++ b/applications/main/xtreme_app/xtreme_app.h @@ -65,6 +65,7 @@ typedef struct { bool save_angry; bool save_backlight; bool save_settings; + bool apply_pack; bool show_slideshow; bool require_reboot; } XtremeApp;