Fixed rsf and reboot

This commit is contained in:
2017-08-31 21:57:56 -04:00
parent 4811fa1c4c
commit 43b37d2616
3 changed files with 30 additions and 13 deletions

View File

@@ -154,6 +154,8 @@ AccessControlInfo:
- csnd:SND - csnd:SND
- am:u - am:u
- ns:s - ns:s
- ptm:sysm
- mcu::HWC
SystemControlInfo: SystemControlInfo:
Dependency: Dependency:

View File

@@ -32,6 +32,7 @@ int init_services(void)
{ {
cfguInit(); cfguInit();
open_archives(); open_archives();
ptmSysmInit();
return 0; return 0;
} }
@@ -52,6 +53,7 @@ int main(void)
Result res = get_themes(&themes_list, &theme_count); Result res = get_themes(&themes_list, &theme_count);
int selected_theme = 0; int selected_theme = 0;
int shuffle_theme_count = 0;
bool preview_mode = false; bool preview_mode = false;
while(aptMainLoop()) while(aptMainLoop())
@@ -61,8 +63,6 @@ int main(void)
draw_interface(themes_list, theme_count, selected_theme, preview_mode); draw_interface(themes_list, theme_count, selected_theme, preview_mode);
if (kDown & KEY_START)
break; //quit
if (themes_list == NULL) if (themes_list == NULL)
continue; continue;
@@ -93,13 +93,26 @@ int main(void)
{ {
single_install(*current_theme); single_install(*current_theme);
} }
else if (kDown & KEY_B) else if (kDown & KEY_B)
{ {
current_theme->in_shuffle = !(current_theme->in_shuffle); if (shuffle_theme_count < 10)
{
if (current_theme->in_shuffle) shuffle_theme_count--;
else shuffle_theme_count++;
current_theme->in_shuffle = !(current_theme->in_shuffle);
} else {
if (current_theme->in_shuffle) {
shuffle_theme_count--;
current_theme->in_shuffle = false;
}
}
} }
else if (kDown & KEY_SELECT) else if (kDown & KEY_SELECT)
{ {
shuffle_install(themes_list, theme_count); if (shuffle_theme_count > 0)
shuffle_install(themes_list, theme_count);
} }
// Movement in the UI // Movement in the UI
@@ -124,16 +137,17 @@ int main(void)
{ {
selected_theme = theme_count-1; selected_theme = theme_count-1;
} }
if (kDown & KEY_START)
{
exit_screens();
exit_services();
PTMSYSM_RebootAsync(0);
ptmSysmExit();
}
} }
free(themes_list); free(themes_list);
exit_screens();
exit_services();
ptmSysmInit();
PTMSYSM_ShutdownAsync(0);
ptmSysmExit();
return 0; return 0;
} }

View File

@@ -179,7 +179,8 @@ Result get_themes(Theme_s **themes_list, int *theme_count)
ssize_t textureID = MAX_TEXTURE + (*theme_count * 2); ssize_t textureID = MAX_TEXTURE + (*theme_count * 2);
parse_smdh(current_theme, theme_path, textureID); parse_smdh(current_theme, theme_path, textureID);
load_preview(current_theme, theme_path, textureID+1); current_theme->has_preview = false;
// load_preview(current_theme, theme_path, textureID+1);
} }
FSDIR_Close(dir_handle); FSDIR_Close(dir_handle);