mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
MNTM: Ok to choose Asset Pack from full-screen list
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
- OFW: Mifare Plus detection support (by @Astrrra)
|
||||
- OFW: Felica emulation (by @RebornedBrain)
|
||||
- OFW: Write to ultralight cards is now possible (by @RebornedBrain)
|
||||
- MNTM Settings: Click Ok on Asset Pack setting to choose from a full-screen list (by @Willy-JL)
|
||||
- FBT: New `SKIP_EXTERNAL` toggle and `EXTRA_EXT_APPS` config option (by @Willy-JL)
|
||||
- Desktop: Added TV animation from OFW which was missing (internal on OFW)
|
||||
- UL: BadKB: Add Finnish keyboard layout (by @nicou)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
ADD_SCENE(momentum_app, start, Start)
|
||||
ADD_SCENE(momentum_app, interface, Interface)
|
||||
ADD_SCENE(momentum_app, interface_graphics, InterfaceGraphics)
|
||||
ADD_SCENE(momentum_app, interface_graphics_pack, InterfaceGraphicsPack)
|
||||
ADD_SCENE(momentum_app, interface_mainmenu, InterfaceMainmenu)
|
||||
ADD_SCENE(momentum_app, interface_mainmenu_add, InterfaceMainmenuAdd)
|
||||
ADD_SCENE(momentum_app, interface_mainmenu_add_main, InterfaceMainmenuAddMain)
|
||||
|
||||
@@ -181,6 +181,8 @@ bool momentum_app_scene_interface_graphics_on_event(void* context, SceneManagerE
|
||||
app->scene_manager, MomentumAppSceneInterfaceGraphics, event.event);
|
||||
consumed = true;
|
||||
switch(event.event) {
|
||||
case VarItemListIndexAssetPack:
|
||||
scene_manager_next_scene(app->scene_manager, MomentumAppSceneInterfaceGraphicsPack);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#include "../momentum_app.h"
|
||||
|
||||
void momentum_app_scene_interface_graphics_pack_submenu_callback(void* context, uint32_t index) {
|
||||
MomentumApp* app = context;
|
||||
strlcpy(
|
||||
momentum_settings.asset_pack,
|
||||
index == 0 ? "" : *CharList_get(app->asset_pack_names, index - 1),
|
||||
ASSET_PACKS_NAME_LEN);
|
||||
app->asset_pack_index = index;
|
||||
app->save_settings = true;
|
||||
app->apply_pack = true;
|
||||
scene_manager_previous_scene(app->scene_manager);
|
||||
}
|
||||
|
||||
void momentum_app_scene_interface_graphics_pack_on_enter(void* context) {
|
||||
MomentumApp* app = context;
|
||||
Submenu* submenu = app->submenu;
|
||||
|
||||
submenu_add_item(
|
||||
submenu, "Default", 0, momentum_app_scene_interface_graphics_pack_submenu_callback, app);
|
||||
|
||||
for(size_t i = 0; i < CharList_size(app->asset_pack_names); i++) {
|
||||
submenu_add_item(
|
||||
submenu,
|
||||
*CharList_get(app->asset_pack_names, i),
|
||||
i + 1,
|
||||
momentum_app_scene_interface_graphics_pack_submenu_callback,
|
||||
app);
|
||||
}
|
||||
|
||||
submenu_set_header(submenu, "Choose Asset Pack:");
|
||||
|
||||
submenu_set_selected_item(submenu, app->asset_pack_index);
|
||||
|
||||
view_dispatcher_switch_to_view(app->view_dispatcher, MomentumAppViewSubmenu);
|
||||
}
|
||||
|
||||
bool momentum_app_scene_interface_graphics_pack_on_event(void* context, SceneManagerEvent event) {
|
||||
UNUSED(context);
|
||||
bool consumed = false;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void momentum_app_scene_interface_graphics_pack_on_exit(void* context) {
|
||||
MomentumApp* app = context;
|
||||
submenu_reset(app->submenu);
|
||||
}
|
||||
Reference in New Issue
Block a user