imports from rev0 [hamachi-mp's old development branch]:

- show_all option
- different (more elegant) fix for the empty page switch crash issue
This commit is contained in:
Christopher Roy Bratusek 2012-03-19 09:46:10 +01:00
parent b6ea8cea69
commit 5cc895dfed
10 changed files with 175 additions and 152 deletions

Binary file not shown.

View File

@ -43,10 +43,16 @@ int MenuMain()
int app_pos = -1;
int apps_row = 3;
int apps_numers = Options.apps * apps_row;
int apps_numers = Options.apps;
int gesamt_apps;
const u8* temp_apps_btn = NULL;
const u8* temp_apps_btnOver = NULL;
GuiTrigger trigA;
GuiTrigger trigB;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
const u8* temp_apps_btn = NULL;
const u8* temp_apps_btnOver = NULL;
const u8* temp_normal_grid_inactive = NULL;
const u8* temp_normal_grid_active = NULL;
const u8* temp_sd_usb_active = NULL;
@ -68,7 +74,7 @@ int MenuMain()
temp_normal_grid_inactive = Theme.grid_inactive;
temp_normal_grid_active = Theme.grid_active;
}
else if(!Settings.grid)
else
{
temp_apps_btn = Theme.apps_list;
temp_apps_btnOver = Theme.apps_list_hover;
@ -125,11 +131,6 @@ int MenuMain()
temp_wii_gc_inactive = Theme.wii_gc_inactive;
}
GuiTrigger trigA;
GuiTrigger trigB;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
// Seite der zuletzt gestarteten app
if(Settings.last_app_pos != -1)
{
@ -148,11 +149,17 @@ int MenuMain()
}
else
{
// Kategorie Alle nur anzeigen, wenn aktiviert oder keine andere vorhanden ist
if(!Options.show_all && Settings.current_category == 0 && AvailableCategory.categories.size() -1 > 0)
Settings.current_category++;
vechomebrew_list_choice = vechomebrew_list_category[Settings.current_category];
// Kategoriename
Settings.category_name = AvailableCategory.categories[Settings.current_category];
}
gesamt_apps = vechomebrew_list_choice.size();
GuiText categoryTxt(Settings.category_name.c_str(), 28, (GXColor){Theme.category_1, Theme.category_2, Theme.category_3, 255});
categoryTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
categoryTxt.SetPosition(0,30);
@ -215,8 +222,8 @@ int MenuMain()
GuiImage normal_grid_BtnImg(&normal_grid_BtnImgData);
GuiImage network_BtnImg(&network_BtnImgData);
GuiImage * appsBtnImg[vechomebrew_list_choice.size()];
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
appsBtnImg[i] = new GuiImage(&apps_btn);
for(int i=0; i < gesamt_apps; i++)
appsBtnImg[i] = new GuiImage(&apps_btn);
// button over
GuiImage rightBtnImgOver(&apps_next_hover);
@ -232,8 +239,8 @@ int MenuMain()
GuiImage normal_grid_BtnImgOver(&normal_grid_BtnImgDataOver);
GuiImage network_BtnImgOver(&network_BtnImgDataOver);
GuiImage * appsBtnImgOver[vechomebrew_list_choice.size()];
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
appsBtnImgOver[i] = new GuiImage(&apps_btnOver);
for(int i=0; i < gesamt_apps; i++)
appsBtnImgOver[i] = new GuiImage(&apps_btnOver);
GuiButton rightBtn(apps_next.GetWidth(), apps_next.GetHeight());
rightBtn.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
@ -367,7 +374,7 @@ int MenuMain()
// auflisten der apps
int anzahl_pro_seite = 0;
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
for(int i=0; i < gesamt_apps; i++)
{
if(anzahl_pro_seite == apps_numers) // Apps pro Seite
{
@ -430,7 +437,7 @@ int MenuMain()
else
{
AppsBtnTxt1 = new GuiText(vechomebrew_list_choice[i].name.c_str(), 20, (GXColor){Theme.apps_1, Theme.apps_2, Theme.apps_3, 255});
AppsBtnTxt2 = new GuiText("....................................................", 24, (GXColor){Theme.apps_1, Theme.apps_2, Theme.apps_3, 100});
AppsBtnTxt2 = new GuiText("----------------------------------------------------", 24, (GXColor){Theme.apps_1, Theme.apps_2, Theme.apps_3, 100});
AppsBtnTxt3 = new GuiText(tr(vechomebrew_list_choice[i].info.c_str()), 20, (GXColor){Theme.apps_1, Theme.apps_2, Theme.apps_3, 255});
viewicon->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
@ -489,7 +496,7 @@ int MenuMain()
// wenn nicht seite 1
if(Settings.current_page != 1)
{
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
for(int i=0; i < gesamt_apps; i++)
{
AppsBtn[i]->SetVisible(false);
AppsBtn[i]->SetSelectable(false);
@ -497,7 +504,7 @@ int MenuMain()
for(int i = 0; i < apps_numers; i++)
{
if((Settings.current_page-1)*apps_numers+i < (signed)vechomebrew_list_choice.size())
if((Settings.current_page-1)*apps_numers+i < gesamt_apps)
{
AppsBtn[(Settings.current_page-1)*apps_numers+i]->SetVisible(true);
AppsBtn[(Settings.current_page-1)*apps_numers+i]->SetSelectable(true);
@ -550,7 +557,7 @@ int MenuMain()
HaltGui();
Apps.Append(&categoryTxt);
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
for(int i=0; i < gesamt_apps; i++)
Apps.Append(AppsBtn[i]);
Apps.Append(AppsBtnFree);
Apps.Append(AppsBtnMove);
@ -584,7 +591,7 @@ int MenuMain()
if(app_pos != -1)
{
// mainWindow->ChangeFocus(&Apps);
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
for(int i=0; i < gesamt_apps; i++)
{
if(i == app_pos)
AppsBtn[i]->SetState(STATE_SELECTED);
@ -761,20 +768,20 @@ int MenuMain()
}
// eine Seite weiter bzw zurück
else if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && !Options.navigation) ||
if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT || rightBtn.GetState() == STATE_CLICKED ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_LEFT || leftBtn.GetState() == STATE_CLICKED)
{
// eine Seite weiter
// Abbrechen Seite zurück
if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_RIGHT || rightBtn.GetState() == STATE_CLICKED)
previous_page = false;
// eine Seite zurück
// Abbrechen Seite weiter
if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation) ||
PAD_ButtonsDown(0) & PAD_BUTTON_LEFT || leftBtn.GetState() == STATE_CLICKED)
@ -785,51 +792,32 @@ int MenuMain()
if(next_page || rightBtn.GetState() == STATE_CLICKED || (WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && Options.navigation))
{
rightBtn.ResetState();
//Settings.current_page++;
if(Settings.current_page < Settings.total_page)
{
Settings.current_page++;
// Settings.current_page = 1;
Settings.Apps_from = EFFECT_SLIDE_RIGHT;
Settings.Apps_to = EFFECT_SLIDE_LEFT;
next_page = false;
change = true;
}
else if (Settings.total_page != 1)
{
Settings.current_page++;
if(Settings.current_page > Settings.total_page)
Settings.current_page = 1;
Settings.Apps_from = EFFECT_SLIDE_LEFT;
Settings.Apps_to = EFFECT_SLIDE_RIGHT;
next_page = false;
Settings.Apps_from = EFFECT_SLIDE_RIGHT;
Settings.Apps_to = EFFECT_SLIDE_LEFT;
next_page = false;
if(Settings.total_page != 1)
change = true;
}
else { change = false; }
}
if(previous_page || leftBtn.GetState() == STATE_CLICKED || (WPAD_ButtonsDown(0) & (WPAD_BUTTON_MINUS | WPAD_CLASSIC_BUTTON_MINUS) && Options.navigation))
{
leftBtn.ResetState();
if(Settings.current_page <= Settings.total_page && Settings.current_page > 1)
{ // Settings.current_page = Settings.total_page;
Settings.current_page--;
Settings.Apps_from = EFFECT_SLIDE_LEFT;
Settings.Apps_to = EFFECT_SLIDE_RIGHT;
previous_page = false;
change = true;
}
else if (Settings.total_page != 1)
{
Settings.current_page--;
if(Settings.current_page == 0)
Settings.current_page = Settings.total_page;
Settings.Apps_from = EFFECT_SLIDE_RIGHT;
Settings.Apps_to = EFFECT_SLIDE_LEFT;
previous_page = false;
Settings.Apps_from = EFFECT_SLIDE_LEFT;
Settings.Apps_to = EFFECT_SLIDE_RIGHT;
previous_page = false;
if(Settings.total_page != 1)
change = true;
}
else { change = false; }
}
if(change)
@ -847,14 +835,14 @@ int MenuMain()
for(int i = 0; i < apps_numers; i++)
{
// vorherige seite ausblenden
if((page-1)*apps_numers+i < (signed)vechomebrew_list_choice.size())
if((page-1)*apps_numers+i < gesamt_apps)
{
AppsBtn[(page-1)*apps_numers+i]->SetVisible(false);
AppsBtn[(page-1)*apps_numers+i]->SetSelectable(false);
AppsBtn[(page-1)*apps_numers+i]->ResetState();
}
// aktuelle seite einblenden
if((Settings.current_page-1)*apps_numers+i < (signed)vechomebrew_list_choice.size())
if((Settings.current_page-1)*apps_numers+i < gesamt_apps)
{
AppsBtn[(Settings.current_page-1)*apps_numers+i]->SetVisible(true);
AppsBtn[(Settings.current_page-1)*apps_numers+i]->SetSelectable(true);
@ -869,7 +857,7 @@ int MenuMain()
}
// felder in ursprungsposition setzen
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
for(int i=0; i < gesamt_apps; i++)
AppsBtn[i]->SetPosition(pos_x[i], pos_y[i]);
// beim seitenwechsel, leeres feld positionieren
@ -890,8 +878,8 @@ int MenuMain()
sprintf(buffer, tr("Page %i of %i"), Settings.current_page, Settings.total_page);
pageTxt->SetText(buffer);
}
}
// eine Kategorie weiter
else if((WPAD_ButtonsDown(0) & (WPAD_BUTTON_PLUS | WPAD_CLASSIC_BUTTON_PLUS) && !Options.navigation) ||
(WPAD_ButtonsDown(0) & (WPAD_BUTTON_RIGHT | WPAD_CLASSIC_BUTTON_RIGHT) && Options.navigation) ||
@ -920,19 +908,17 @@ int MenuMain()
}
// für die grid ansicht, navigation der einzelnen zellen
previous_page = false;
next_page = false;
for(int i = 0; i< apps_numers/apps_row; i++)
for(int i = 1; i < apps_numers/apps_row +1; i++)
{
if(Apps.GetSelected() == i * apps_row + 1 + (Settings.current_page -1) * apps_numers)
if(Apps.GetSelected() == (i -1) * apps_row + (Settings.current_page -1) * apps_numers)
previous_page = true;
if(Apps.GetSelected() == (i+1) * apps_row + (Settings.current_page -1) * apps_numers || Apps.GetSelected() == (signed)vechomebrew_list_choice.size())
if(Apps.GetSelected() == i * apps_row -1 + (Settings.current_page -1) * apps_numers || Apps.GetSelected() == gesamt_apps -1)
next_page = true;
}
// list apps
for(int i = (Settings.current_page-1)*apps_numers; i < Settings.current_page*apps_numers && i < (signed)vechomebrew_list_choice.size(); i++)
for(int i = (Settings.current_page-1)*apps_numers; i < Settings.current_page*apps_numers && i < gesamt_apps; i++)
{
// show apps info
if(AppsBtn[i]->GetState() == STATE_CLICKED && button == "A")
@ -978,7 +964,7 @@ int MenuMain()
}
mainWindow->ChangeFocus(&Apps);
for(int x=0; x < (signed)vechomebrew_list_choice.size(); x++)
for(int x=0; x < gesamt_apps; x++)
{
if(x == i)
AppsBtn[x]->SetState(STATE_SELECTED);
@ -1077,7 +1063,7 @@ int MenuMain()
}
AppsBtnFree->SetPosition(pos_x[i], pos_y[i]);
for(i = 0; i < apps_numers && (Settings.current_page-1)*apps_numers+i < (signed)vechomebrew_list_choice.size(); i++)
for(i = 0; i < apps_numers && (Settings.current_page-1)*apps_numers+i < gesamt_apps; i++)
{
int x = (Settings.current_page-1)*apps_numers+i;
// buttons 1 kleiner button 2
@ -1153,7 +1139,7 @@ int MenuMain()
else
{
// felder in ursprungsposition setzen
for(int i=0; i < (signed)vechomebrew_list_choice.size(); i++)
for(int i=0; i < gesamt_apps; i++)
AppsBtn[i]->SetPosition(pos_x[i], pos_y[i]);
if(Settings.current_page == move.page)
AppsBtn[move.nr]->SetVisible(true);

View File

@ -23,6 +23,7 @@ int temp_last_category;
int temp_slide_effect;
int temp_apps;
bool temp_quick_start;
bool temp_show_all;
int temp_device_icon;
bool temp_navigation;
string temp_device_dat;
@ -38,10 +39,11 @@ int MenuSettingsFile()
int i = 0;
bool firstRun = true;
int focus = 0;
int last_category = Options.last_category;
bool quick_start = Options.quick_start;
int device_icon = Options.device_icon;
int last_category = Options.last_category;
bool quick_start = Options.quick_start;
bool show_all = Options.show_all;
int device_icon = Options.device_icon;
bool childlock;
if(strcasecmp(Settings.code,"NULL") == 0 )
childlock = 0;
@ -54,7 +56,7 @@ int MenuSettingsFile()
device_dat = "SD";
else if(Settings.device_dat == "usb1")
device_dat = "USB";
OptionList options;
sprintf(options.name[i++], tr("Theme"));
sprintf(options.name[i++], tr("Language"));
@ -63,6 +65,7 @@ int MenuSettingsFile()
sprintf(options.name[i++], tr("Category remember"));
sprintf(options.name[i++], tr("Number of Apps"));
sprintf(options.name[i++], tr("Quick Start"));
sprintf(options.name[i++], tr("Show All"));
sprintf(options.name[i++], tr("Storage Device"));
sprintf(options.name[i++], tr("Device icon"));
sprintf(options.name[i++], tr("Childlock"));
@ -127,7 +130,7 @@ int MenuSettingsFile()
while(menu == MENU_NONE)
{
usleep(100);
ret = optionBrowser.GetChangedOption();
ret2 = optionBrowser.GetClickedOption();
@ -143,7 +146,7 @@ int MenuSettingsFile()
change = 5;
sprintf (options.value[ret], "%i", change);
break;
case CATEGORY_REMEMBER:
change = last_category;
change++;
@ -151,7 +154,7 @@ int MenuSettingsFile()
change = AvailableCategory.categories.size();
last_category = change;
break;
case NUMBER_OF_APPS:
change = atoi(options.value[ret]);
change++;
@ -159,11 +162,15 @@ int MenuSettingsFile()
change = 5;
sprintf (options.value[ret], "%i", change);
break;
case QUICK_START:
quick_start = 1;
break;
case SHOW_ALL:
show_all = 1;
break;
case DEVICE_ICON:
change = device_icon;
change++;
@ -171,12 +178,12 @@ int MenuSettingsFile()
change = 3;
device_icon = change;
break;
case STORAGE_DEVICE:
device_dat = "USB";
sprintf (options.value[STORAGE_DEVICE], device_dat.c_str());
break;
case NAVIGATION:
navigation = 1;
break;
@ -184,7 +191,7 @@ int MenuSettingsFile()
HaltResumeGui();
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_LEFT | WPAD_CLASSIC_BUTTON_LEFT) || PAD_ButtonsDown(0) & PAD_BUTTON_LEFT)
{
change = 0;
@ -197,7 +204,7 @@ int MenuSettingsFile()
change = 0;
sprintf (options.value[ret], "%i", change);
break;
case CATEGORY_REMEMBER:
change = last_category;
change--;
@ -205,7 +212,7 @@ int MenuSettingsFile()
change = 0;
last_category = change;
break;
case NUMBER_OF_APPS:
change = atoi(options.value[ret]);
change--;
@ -213,11 +220,15 @@ int MenuSettingsFile()
change = 4;
sprintf (options.value[ret], "%i", change);
break;
case QUICK_START:
quick_start = 0;
break;
case SHOW_ALL:
show_all = 0;
break;
case DEVICE_ICON:
change = device_icon;
change--;
@ -225,12 +236,12 @@ int MenuSettingsFile()
change = 0;
device_icon = change;
break;
case STORAGE_DEVICE:
device_dat = "SD";
sprintf (options.value[STORAGE_DEVICE], device_dat.c_str());
break;
case NAVIGATION:
navigation = 0;
break;
@ -238,57 +249,58 @@ int MenuSettingsFile()
HaltResumeGui();
optionBrowser.TriggerUpdate();
}
if(ret2 != -1)
{
// einstellungen temporär speichern
/******************************************************************************/
Options.temp_theme = options.value[THEME];
Options.temp_language = options.value[LANGUAGE];
Options.temp_language = options.value[LANGUAGE];
Options.temp_font = options.value[FONT];
temp_slide_effect = atoi(options.value[SLIDE_EFFECT]);
temp_last_category = last_category;
temp_apps = atoi(options.value[NUMBER_OF_APPS]);
temp_apps = atoi(options.value[NUMBER_OF_APPS]);
temp_quick_start = quick_start;
temp_show_all = show_all;
temp_device_icon = device_icon;
temp_device_dat = device_dat;
temp_navigation = navigation;
/******************************************************************************/
// in weitere einstellungen gehen
switch (ret2)
{
case THEME:
menu = MENU_SETTINGS_THEME;
break;
case LANGUAGE:
menu = MENU_SETTINGS_LANGUAGE;
break;
case FONT:
menu = MENU_SETTINGS_FONT;
break;
case CHILDLOCK:
menu = MENU_SETTINGS_CHILDLOCK;
break;
case DISPLAY:
menu = MENU_SETTINGS_DISPLAY;
break;
case NETWORK:
menu = MENU_SETTINGS_NETWORK;
break;
}
}
if(firstRun)
{
firstRun = false;
if(Options.temp_last_setting == 1)
{
sprintf (options.value[THEME], Options.temp_theme.c_str());
@ -299,10 +311,11 @@ int MenuSettingsFile()
sprintf (options.value[STORAGE_DEVICE], temp_device_dat.c_str());
sprintf (options.value[DISPLAY], " ");
sprintf (options.value[NETWORK], " ");
last_category = temp_last_category;
quick_start = temp_quick_start;
device_icon = temp_device_icon;
last_category = temp_last_category;
quick_start = temp_quick_start;
show_all = temp_show_all;
device_icon = temp_device_icon;
if(strcasecmp(Options.temp_code,"NULL") == 0 )
childlock = 0;
else
@ -325,22 +338,27 @@ int MenuSettingsFile()
if(change != -1)
{
change = -1;
if(!last_category)
sprintf (options.value[CATEGORY_REMEMBER], tr("last"));
else
sprintf (options.value[CATEGORY_REMEMBER], AvailableCategory.categories[last_category - 1].c_str());
if(!quick_start)
sprintf (options.value[QUICK_START], tr("No"));
else
sprintf (options.value[QUICK_START], tr("Yes"));
if(!show_all)
sprintf (options.value[SHOW_ALL], tr("No"));
else
sprintf (options.value[SHOW_ALL], tr("Yes"));
if(!childlock)
sprintf (options.value[CHILDLOCK], tr("No"));
else
sprintf (options.value[CHILDLOCK], tr("Yes"));
if(device_icon == 0)
sprintf (options.value[DEVICE_ICON], tr("Off"));
else if(device_icon == 1)
@ -349,15 +367,15 @@ int MenuSettingsFile()
sprintf (options.value[DEVICE_ICON], tr("Dialog box"));
else if(device_icon == 3)
sprintf (options.value[DEVICE_ICON], tr("All"));
if(!navigation)
sprintf (options.value[NAVIGATION], tr("No"));
else
sprintf (options.value[NAVIGATION], tr("Yes"));
optionBrowser.TriggerUpdate();
}
if(WPAD_ButtonsDown(0) & (WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B) || PAD_ButtonsDown(0) & PAD_BUTTON_B)
{
if(focus == 0)
@ -372,7 +390,7 @@ int MenuSettingsFile()
}
HaltResumeGui();
}
if(backBtn.GetState() == STATE_CLICKED)
{
strcpy (Options.temp_code, Settings.code);
@ -380,7 +398,7 @@ int MenuSettingsFile()
Options.temp_newrevtext = Options.newrevtext;
menu = MENU_SETTINGS;
}
if(saveBtn.GetState() == STATE_CLICKED)
{
// Theme ändern
@ -394,12 +412,12 @@ int MenuSettingsFile()
#ifdef HW_RVL
pointer = new GuiImageData(Theme.player_point);
#endif
mainWindow->Remove(bgImg);
bgImg = new GuiImage(new GuiImageData(Theme.background));
mainWindow->Append(bgImg);
}
// Schriftart ändern
if(stricmp(Options.font, options.value[FONT]) != 0 || GetMenuSettingsFontDL())
{
@ -409,63 +427,64 @@ int MenuSettingsFile()
SetFont();
ResumeGui();
}
strcpy(Settings.code, Options.temp_code);
Options.slide_effect = atoi(options.value[SLIDE_EFFECT]);
Options.last_category = last_category;
Options.slide_effect = atoi(options.value[SLIDE_EFFECT]);
Options.last_category = last_category;
Options.apps = atoi(options.value[NUMBER_OF_APPS]);
Options.quick_start = quick_start;
Options.show_all = show_all;
Options.device_icon = device_icon;
device_dat = options.value[STORAGE_DEVICE];
device_dat = options.value[STORAGE_DEVICE];
Options.navigation = navigation;
Options.network = Options.temp_network;
Options.newrevtext = Options.temp_newrevtext;
if(device_dat == "SD")
Settings.device_dat = "sd1";
else if(device_dat == "USB")
Settings.device_dat = "usb1";
// Sprache ändern zum schluss wegen STANDARD
if(stricmp(Options.language, options.value[LANGUAGE]) != 0 || GetMenuSettingsLanguageDL())
{
sprintf (Options.language, options.value[LANGUAGE]);
bool theme = 0, language = 0, font = 0;
if(stricmp(Options.theme, tr("STANDARD")) == 0)
theme = 1;
if(stricmp(Options.language, tr("STANDARD")) == 0)
language = 1;
if(stricmp(Options.font, tr("STANDARD")) == 0)
font = 1;
/*********************************************************************/
if(stricmp(Options.language, tr("STANDARD")) == 0)
translate();
else
ini_Open(check_path(Settings.device_dat + ":/config/HBF/languages/") + Options.language + ".lang");
/*********************************************************************/
AvailableCategory.categories[0] = tr(Settings.category_name_all);
if(theme)
sprintf(Options.theme, tr("STANDARD"));
if(language)
sprintf(Options.language, tr("STANDARD"));
if(font)
sprintf(Options.font, tr("STANDARD"));
}
menu = MENU_SETTINGS;
}
}
HaltGui();
Options.temp_last_setting = 0;
mainWindow->Remove(&optionBrowser);
mainWindow->Remove(&w);
return menu;

View File

@ -25,6 +25,7 @@ enum
CATEGORY_REMEMBER,
NUMBER_OF_APPS,
QUICK_START,
SHOW_ALL,
STORAGE_DEVICE,
DEVICE_ICON,
CHILDLOCK,
@ -40,4 +41,4 @@ enum
DISPLAY_BOTTOM,
DISPLAY_LEFT,
DISPLAY_RIGHT
};
};

View File

@ -20,7 +20,7 @@ void Category_rename_move(string button)
Settings.unassigned = false;
else
Settings.unassigned = true;
Settings.current_page = 1;
}
// Kategorie umbenennen
@ -29,7 +29,7 @@ void Category_rename_move(string button)
char new_category_name[256];
sprintf (new_category_name, Settings.category_name.c_str());
OnScreenKeyboard(new_category_name, 256, false);
if(strcasecmp(new_category_name,"NULL") != 0 )
KategorieUmbenennen(Settings.category_name, new_category_name);
}
@ -58,13 +58,17 @@ void Next_Category()
Settings.current_category++;
if(Settings.current_category > (signed)AvailableCategory.categories.size() -1)
Settings.current_category = 0;
// Kategorie Alle nur anzeigen, wenn aktiviert oder keine andere vorhanden ist
if(!Options.show_all && Settings.current_category == 0 && AvailableCategory.categories.size() -1 > 0)
Settings.current_category++;
Settings.current_page = 1;
Settings.unassigned = false;
if(Settings.current_category != 0)
copy_app_in_category();
Settings.Apps_from = EFFECT_SLIDE_RIGHT;
Settings.Apps_to = EFFECT_SLIDE_LEFT;
}
@ -72,15 +76,20 @@ void Next_Category()
void Previous_Category()
{
Settings.current_category--;
// Kategorie Alle nur anzeigen, wenn aktiviert oder keine andere vorhanden ist
if(!Options.show_all && Settings.current_category == 0)
Settings.current_category--;
if(Settings.current_category < 0)
Settings.current_category = AvailableCategory.categories.size() -1;
Settings.current_page = 1;
Settings.unassigned = false;
if(Settings.current_category != 0)
copy_app_in_category();
Settings.Apps_from = EFFECT_SLIDE_LEFT;
Settings.Apps_to = EFFECT_SLIDE_RIGHT;
}
@ -100,9 +109,9 @@ void AppEraseDelate(int choice, const char* name, const char* foldername)
if( eraseDir(name) )
{
DeleteDir(foldername);
app_list();
if(Settings.current_category != 0)
copy_app_in_category();
else

View File

@ -96,7 +96,10 @@ void load()
if(get_setting(source, "quick_start") != "")
Options.quick_start = atoi(get_setting(source, "quick_start").c_str());
if(get_setting(source, "show_all") != "")
Options.show_all = atoi(get_setting(source, "show_all").c_str());
if(get_setting(source, "navigation") != "")
Options.navigation = atoi(get_setting(source, "navigation").c_str());
@ -161,4 +164,4 @@ void load()
while(getline(in, line))
appios.push_back(app_ios(line.substr(0, line.find(" = ")), atoi(line.substr(line.find(" = ") +3).c_str())));
}
}
}

View File

@ -100,6 +100,7 @@ void save()
save_settings << "last_app_name = \"" << Settings.startingAppName << "\"" << endl;
save_settings << "apps_nr = \"" << Options.apps << "\"" << endl;
save_settings << "quick_start = \"" << Options.quick_start << "\"" << endl;
save_settings << "show_all = \"" << Options.show_all << "\"" << endl;
save_settings << "navigation = \"" << Options.navigation << "\"" << endl;
save_settings << "network = \"" << Options.network << "\"" << endl;
save_settings << "newrevtext = \"" << Options.newrevtext << "\"" << endl;
@ -155,4 +156,4 @@ void save()
// save category
AvailableCategorySave(Settings.dir_dat);
}
}

View File

@ -149,9 +149,10 @@ DefaultOptions()
Options.slide_effect = 1;
Options.last_category = 1;
Options.apps = 4;
Options.quick_start = 0;
Options.navigation = 0;
Options.apps = 4;
Options.quick_start = 0;
Options.show_all = 1;
Options.navigation = 0;
Options.temp_network = 0;
Options.temp_newrevtext = 1;
}

View File

@ -118,9 +118,10 @@ struct SOptions
char theme[256];
char language[256];
char font[256];
int apps;
int apps;
bool quick_start;
int device_icon;
bool show_all;
int device_icon;
bool navigation;
bool network;
bool newrevtext;

View File

@ -12,7 +12,9 @@
- 'Return to System Menu' now ignores Priiloader and always enters System Menu
- Basic (= non-working) support for Homebew on DVD
- No longer show the HBC if it's installed
- BUGFIX: changing pages in an empty category no longer crashes
- New option for disabling the 'All' category (takes effect only if atleast
one other category exists (obviously)) [ZERO]
- BUGFIX: changing pages in an empty category no longer crashes [ZERO]
- Accessing devices formatted as EXT2/3/4 should now be noticeably faster
- compiled with devkitppc 25-1 and libogc 1.8.10 (support for latest WiiMotes)
- For theme designers: the following new icons have been added: