int titles() {
bool ren = btn_read() & BTN_VOL_UP;
bool restore = btn_read() & BTN_VOL_DOWN;
if (ren) {
if (f_stat("sxos/titles", NULL)) {
f_rename("sxos/titles.bak", "sxos/titles");
string = "titles.bak renamed to titles";
text_centre();
gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
}
else if (f_stat("atmosphere/titles", NULL)) {
f_rename("atmosphere/titles.bak", "atmosphere/titles");
string = "titles.bak renamed to titles";
text_centre();
gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
}
else {
string = "titles folder already exists";
text_centre();
gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE);
}
}
else if (restore) {
if (f_stat("sxos/titles.bak", NULL)) {
f_rename("sxos/titles", "sxos/titles.bak");
string = "titles renamed to titles.bak";
text_centre();
gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
}
else if (f_stat("atmosphere/titles.bak", NULL)) {
f_rename("atmosphere/titles", "atmosphere/titles.bak");
string = "titles renamed to titles.bak";
text_centre();
gfx_printf(&g_gfx_con, "%k%s%k", GREEN, string, MYBLUE);
}
else {
string = "titles.bak folder already exists";
text_centre();
gfx_printf(&g_gfx_con, "%k%s%k", colour_red, string, MYBLUE);
}
}
else {
if (f_stat("sxos/titles", NULL)) {
string = "sxos/titles: does not exist";
text_centre();
int font_size = (((text_scale * 8) * strlen(string)) / 2);
int x_loc = (half_width - font_size);
gfx_con_setpos(&g_gfx_con, x_loc, 155);
gfx_printf(&g_gfx_con, "%ksxos/titles: %kdoes not exist%k", MYBLUE, colour_red, MYBLUE);
}
else
{
string = "sxos/titles: exists";
text_centre();
int font_size = (((text_scale * 8) * strlen(string)) / 2);
int x_loc = (half_width - font_size);
gfx_con_setpos(&g_gfx_con, x_loc, 155);
gfx_printf(&g_gfx_con, "%ksxos/titles: %kexists%k", MYBLUE, GREEN, MYBLUE);
}
if (f_stat("atmosphere/titles", NULL)) {
string = "atmosphere/titles: does not exist";
text_centre();
int font_size = (((text_scale * 8) * strlen(string)) / 2);
int x_loc = (half_width - font_size);
gfx_con_setpos(&g_gfx_con, x_loc, 175);
gfx_printf(&g_gfx_con, "%katmosphere/titles: %kdoes not exist%k", MYBLUE, colour_red, MYBLUE);
}
else
{
string = "atmosphere/titles: exists";
text_centre();
int font_size = (((text_scale * 8) * strlen(string)) / 2);
int x_loc = (half_width - font_size);
gfx_con_setpos(&g_gfx_con, x_loc, 175);
gfx_printf(&g_gfx_con, "%katmosphere/titles: %kexists%k", MYBLUE, GREEN, MYBLUE);
}
}
return 0;
}