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
- am:u
- ns:s
- ptm:sysm
- mcu::HWC
SystemControlInfo:
Dependency:

View File

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