mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
MNTM: Add flipper Shell Color spoofing support
This commit is contained in:
@@ -2,8 +2,24 @@
|
||||
|
||||
enum VarItemListIndex {
|
||||
VarItemListIndexFlipperName, // TODO: Split into name, mac, serial
|
||||
VarItemListIndexShellColor,
|
||||
};
|
||||
|
||||
const char* const shell_color_names[FuriHalVersionColorCount] = {
|
||||
"Real",
|
||||
"Black",
|
||||
"White",
|
||||
"Transparent",
|
||||
};
|
||||
static void momentum_app_scene_misc_spoof_shell_color_changed(VariableItem* item) {
|
||||
MomentumApp* app = variable_item_get_context(item);
|
||||
uint8_t index = variable_item_get_current_value_index(item);
|
||||
variable_item_set_current_value_text(item, shell_color_names[index]);
|
||||
momentum_settings.spoof_color = index;
|
||||
app->save_settings = true;
|
||||
app->require_reboot = true;
|
||||
}
|
||||
|
||||
void momentum_app_scene_misc_spoof_var_item_list_callback(void* context, uint32_t index) {
|
||||
MomentumApp* app = context;
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, index);
|
||||
@@ -17,6 +33,15 @@ void momentum_app_scene_misc_spoof_on_enter(void* context) {
|
||||
item = variable_item_list_add(var_item_list, "Flipper Name", 0, NULL, app);
|
||||
variable_item_set_current_value_text(item, app->device_name);
|
||||
|
||||
item = variable_item_list_add(
|
||||
var_item_list,
|
||||
"Shell Color",
|
||||
FuriHalVersionColorCount,
|
||||
momentum_app_scene_misc_spoof_shell_color_changed,
|
||||
app);
|
||||
variable_item_set_current_value_index(item, momentum_settings.spoof_color);
|
||||
variable_item_set_current_value_text(item, shell_color_names[momentum_settings.spoof_color]);
|
||||
|
||||
variable_item_list_set_enter_callback(
|
||||
var_item_list, momentum_app_scene_misc_spoof_var_item_list_callback, app);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user