add filesize function to get size of dols.

change homebrew icon image and move it a bit.

hide the homebrew button if godmode!=1

maybe fix issue 722.  i don't have a spare drive to test it.

fix grammatical error in the settings.

fix long game name overflow on the gameinfo screen

switch the homebrew buttons to use the new HBCwindowprompt().  none of the meta.xml data is passed yet so the prompt looks pretty naked.
This commit is contained in:
giantpune 2009-07-20 07:23:30 +00:00
parent 9f89e0d0bd
commit 83f5dc29de
30 changed files with 225 additions and 109 deletions

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: David Jelinek (djelinek@hotmail.com) \n"
"Language-Team: Last version on http://startgolf.tym.cz/czech.lang \n"
@ -198,6 +198,9 @@ msgstr "Stažení obalu"
msgid "Cover Path"
msgstr "Cesta k obalum"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Cesta k obalum zmenena"
@ -258,9 +261,6 @@ msgstr "Zobrazení"
msgid "Do you really want to delete:"
msgstr "Opravdu smazat:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Prejete si zmenit jazyk?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Cover-download"
msgid "Cover Path"
msgstr "Sti til covers"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Sti til Covers ændret"
@ -258,9 +261,6 @@ msgstr "Spilinfo."
msgid "Do you really want to delete:"
msgstr "Vil du slette:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Vil du ændre sprog?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Download hoesjes"
msgid "Cover Path"
msgstr "Locatie hoesjes"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Locatie hoesjes gewijzigd"
@ -258,9 +261,6 @@ msgstr "Tonen"
msgid "Do you really want to delete:"
msgstr "Wil je echt verwijderen:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Wil je de taal wijzigen?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr ""
msgid "Cover Path"
msgstr ""
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr ""
@ -258,9 +261,6 @@ msgstr ""
msgid "Do you really want to delete:"
msgstr ""
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "kansien lataus"
msgid "Cover Path"
msgstr "kansien sijainti"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "kansien sijainti muutettu"
@ -258,9 +261,6 @@ msgstr "Näyttö"
msgid "Do you really want to delete:"
msgstr "Haluatko varmasti formatoida:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Kin8\n"
"Language-Team: Badablek, Amour, ikya, OuahOuah & Kin8\n"
@ -198,6 +198,9 @@ msgstr "Téléchargement Jaquettes"
msgid "Cover Path"
msgstr "Dossier Jaquettes"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Dossier des jaquettes modifié"
@ -258,9 +261,6 @@ msgstr "Affichage"
msgid "Do you really want to delete:"
msgstr "Voulez-vous vraiment supprimer ?"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Changer de langue ?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Cover Download"
msgid "Cover Path"
msgstr "Cover Pfad"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Cover Pfad geändert"
@ -258,9 +261,6 @@ msgstr "Anzeige"
msgid "Do you really want to delete:"
msgstr "Löschvorgang bestätigen:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Möchten Sie die Sprache ändern?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Tusk\n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Boritó Letöltés"
msgid "Cover Path"
msgstr "Boritó Útvonala"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Boritó Útvonala megváltozott"
@ -258,9 +261,6 @@ msgstr "Kijelzõ"
msgid "Do you really want to delete:"
msgstr "Biztosan ki akarod törölni?:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Megakarod változtatni a nyevet?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 23:50+0200\n"
"Last-Translator: Cambo \n"
"Language-Team: FoxeJoe & Cambo\n"
@ -198,6 +198,9 @@ msgstr "Scaricamento Copertina"
msgid "Cover Path"
msgstr "Percorso Copertine"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Percorso Copertine Modificato"
@ -258,9 +261,6 @@ msgstr "Display"
msgid "Do you really want to delete:"
msgstr "Vuoi veramente Eliminare:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Vuoi cambiare lingua?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "カバー ダウンロード"
msgid "Cover Path"
msgstr "カバーパス"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "カバーパスを変更しました"
@ -258,9 +261,6 @@ msgstr "ディスプレイ"
msgid "Do you really want to delete:"
msgstr "削除しますか:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "言語設定を変更しますか?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "표지 다운로드"
msgid "Cover Path"
msgstr "표지 경로"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "표지 경로 변경됨"
@ -258,9 +261,6 @@ msgstr "화면 표시"
msgid "Do you really want to delete:"
msgstr "정말로 삭제하겠습니까:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Cover nedlasting"
msgid "Cover Path"
msgstr "Cover sti"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Cover sti endret"
@ -258,9 +261,6 @@ msgstr "Vis"
msgid "Do you really want to delete:"
msgstr "Er du sikker på at du vil slette:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Vil du endre språk?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Baixar Capas"
msgid "Cover Path"
msgstr "Local Capas"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Local Capas alterado"
@ -258,9 +261,6 @@ msgstr "Exibir"
msgid "Do you really want to delete:"
msgstr "Quer realmente apagar:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Você deseja alterar o idioma?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Sky8000\n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Download de Capas"
msgid "Cover Path"
msgstr "Pasta Capas"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Pasta das Capas alterada"
@ -258,9 +261,6 @@ msgstr "Mostrar"
msgid "Do you really want to delete:"
msgstr "Quer mesmo REMOVER o jogo:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Deseja alterar o idioma?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Kir\n"
"Language-Team: Kir\n"
@ -198,6 +198,9 @@ msgstr "Скачать обложку"
msgid "Cover Path"
msgstr "Путь к обложкам"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Путь к обложкам был изменен."
@ -258,9 +261,6 @@ msgstr "Отображать"
msgid "Do you really want to delete:"
msgstr "Вы хотите удалить:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Вы хотите сменить язык ?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "下载封面"
msgid "Cover Path"
msgstr "封面存放路径"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "封面路径已变更"
@ -258,9 +261,6 @@ msgstr "显示"
msgid "Do you really want to delete:"
msgstr "确定删除:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr ""

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Descarga de Carátulas"
msgid "Cover Path"
msgstr "Ruta Carátulas"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Ruta de Carátulas cambiada"
@ -258,9 +261,6 @@ msgstr "Mostrar"
msgid "Do you really want to delete:"
msgstr "¿Realmente quieres borrar?:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "¿Quieres cambiar idioma?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Katsurou\n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Omslagsnedladdning"
msgid "Cover Path"
msgstr "Omslagsmapp"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Omslagsmapp ändrad"
@ -258,9 +261,6 @@ msgstr "Visning"
msgid "Do you really want to delete:"
msgstr "Vill du verkligen radera:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "Vill du byta språk?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "下載封面"
msgid "Cover Path"
msgstr "封面路徑"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "封面路徑已變更"
@ -258,9 +261,6 @@ msgstr "顯示"
msgid "Do you really want to delete:"
msgstr "確定刪除:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr "變更語言?"

View File

@ -4,7 +4,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-07-19 19:46+0200\n"
"POT-Creation-Date: 2009-07-20 03:09-0400\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -198,6 +198,9 @@ msgstr "Kapak Indirme"
msgid "Cover Path"
msgstr "Kapak Yolu"
msgid "Coverpath Change"
msgstr ""
msgid "Coverpath Changed"
msgstr "Kapak Yolu Degistir"
@ -258,9 +261,6 @@ msgstr "Görüntü"
msgid "Do you really want to delete:"
msgstr "Gerçekten silmek istiyor musunuz:"
msgid "Do you want to boot?"
msgstr ""
msgid "Do you want to change language?"
msgstr ""

File diff suppressed because one or more lines are too long

View File

@ -101,6 +101,9 @@ extern const u32 bg_options_settings_png_size;
extern const u8 settings_background_png[];
extern const u32 settings_background_png_size;
extern const u8 browser_png[];
extern const u32 browser_png_size;
extern const u8 nocover_png[];
extern const u32 nocover_png_size;

View File

@ -16,6 +16,7 @@
#include "menu.h"
#include "filelist.h"
#include "sys.h"
#include "listfiles.h"
/*** Extern functions ***/
extern void ResumeGui();
@ -417,11 +418,22 @@ int MenuHomebrewBrowse()
if(MainButton1.GetState() == STATE_CLICKED) {
char temp[200];
char * shortpath = NULL;
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset)), "%s", HomebrewFiles.GetFilepath(fileoffset));
char iconpath[200];
char * shortpath = NULL;
//write iconpath
snprintf(iconpath, sizeof(iconpath), "%sicon.png", HomebrewFiles.GetFilepath(fileoffset));
//get filesize
snprintf(temp, sizeof(temp), "%s%s", HomebrewFiles.GetFilepath(fileoffset),HomebrewFiles.GetFilename(fileoffset));
u64 filesize = FileSize(temp);
//write short filename
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset)), "%s", HomebrewFiles.GetFilepath(fileoffset));
shortpath = strrchr(temp, '/');
snprintf(temp, sizeof(temp), "%s/%s", shortpath, HomebrewFiles.GetFilename(fileoffset));
int choice = WindowPrompt(tr("Do you want to boot?"), temp, tr("Yes"), tr("No"));
int choice = HBCWindowPrompt(temp, 0, 0,0, 0, iconpath, filesize);
if(choice == 1) {
boothomebrew = true;
menu = MENU_EXIT;
@ -432,11 +444,22 @@ int MenuHomebrewBrowse()
}
else if(MainButton2.GetState() == STATE_CLICKED) {
char temp[200];
char * shortpath = NULL;
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset+1)), "%s", HomebrewFiles.GetFilepath(fileoffset+1));
char iconpath[200];
char * shortpath = NULL;
//write iconpath
snprintf(iconpath, sizeof(iconpath), "%sicon.png", HomebrewFiles.GetFilepath(fileoffset+1));
//get filesize
snprintf(temp, sizeof(temp), "%s%s", HomebrewFiles.GetFilepath(fileoffset+1),HomebrewFiles.GetFilename(fileoffset+1));
u64 filesize = FileSize(temp);
//write short filename
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset+1)), "%s", HomebrewFiles.GetFilepath(fileoffset+1));
shortpath = strrchr(temp, '/');
snprintf(temp, sizeof(temp), "%s/%s", shortpath, HomebrewFiles.GetFilename(fileoffset+1));
int choice = WindowPrompt(tr("Do you want to boot?"), temp, tr("Yes"), tr("No"));
int choice = HBCWindowPrompt(temp, 0, 0,0, 0, iconpath, filesize);
if(choice == 1) {
boothomebrew = true;
menu = MENU_EXIT;
@ -446,13 +469,24 @@ int MenuHomebrewBrowse()
MainButton2.ResetState();
}
else if(MainButton3.GetState() == STATE_CLICKED) {
char temp[200];
char * shortpath = NULL;
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset+2)), "%s", HomebrewFiles.GetFilepath(fileoffset+2));
char temp[200];
char iconpath[200];
char * shortpath = NULL;
//write iconpath
snprintf(iconpath, sizeof(iconpath), "%sicon.png", HomebrewFiles.GetFilepath(fileoffset+2));
//get filesize
snprintf(temp, sizeof(temp), "%s%s", HomebrewFiles.GetFilepath(fileoffset+2),HomebrewFiles.GetFilename(fileoffset+2));
u64 filesize = FileSize(temp);
//write short filename
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset+2)), "%s", HomebrewFiles.GetFilepath(fileoffset+2));
shortpath = strrchr(temp, '/');
snprintf(temp, sizeof(temp), "%s/%s", shortpath, HomebrewFiles.GetFilename(fileoffset+2));
int choice = WindowPrompt(tr("Do you want to boot?"), temp, tr("Yes"), tr("No"));
if(choice == 1) {
int choice = HBCWindowPrompt(temp, 0, 0,0, 0, iconpath, filesize);
if(choice == 1) {
boothomebrew = true;
menu = MENU_EXIT;
snprintf(Settings.selected_homebrew, sizeof(Settings.selected_homebrew), "%s%s", HomebrewFiles.GetFilepath(fileoffset+2), HomebrewFiles.GetFilename(fileoffset+2));
@ -461,12 +495,23 @@ int MenuHomebrewBrowse()
MainButton3.ResetState();
}
else if(MainButton4.GetState() == STATE_CLICKED) {
char temp[200];
char * shortpath = NULL;
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset+3)), "%s", HomebrewFiles.GetFilepath(fileoffset+3));
char temp[200];
char iconpath[200];
char * shortpath = NULL;
//write iconpath
snprintf(iconpath, sizeof(iconpath), "%sicon.png", HomebrewFiles.GetFilepath(fileoffset+3));
//get filesize
snprintf(temp, sizeof(temp), "%s%s", HomebrewFiles.GetFilepath(fileoffset+3),HomebrewFiles.GetFilename(fileoffset+3));
u64 filesize = FileSize(temp);
//write short filename
snprintf(temp, strlen(HomebrewFiles.GetFilepath(fileoffset+3)), "%s", HomebrewFiles.GetFilepath(fileoffset+3));
shortpath = strrchr(temp, '/');
snprintf(temp, sizeof(temp), "%s/%s", shortpath, HomebrewFiles.GetFilename(fileoffset+3));
int choice = WindowPrompt(tr("Do you want to boot?"), temp, tr("Yes"), tr("No"));
int choice = HBCWindowPrompt(temp, 0, 0,0, 0, iconpath, filesize);
if(choice == 1) {
boothomebrew = true;
menu = MENU_EXIT;

View File

@ -103,3 +103,22 @@ bool checkfile(char * path)
}
return false;
}
/****************************************************************************
* FileSize
*
* Get filesize in bytes. u64 for files bigger than 4GB
***************************************************************************/
u64 FileSize(const char * filepath)
{
struct stat filestat;
if (stat(filepath, &filestat) != 0)
return 0;
return filestat.st_size;
}

View File

@ -11,6 +11,7 @@ char * GetFileName(int i);
int GetAllDirFiles(char * filespath);
bool subfoldercreate(char * fullpath);
bool checkfile(char * path);
u64 FileSize(const char * filepath);
#ifdef __cplusplus
}

View File

@ -339,6 +339,10 @@ HBCWindowPrompt(db1, db2, db3,db4, db5, db7, db6);
GuiImageData imgarrangeCarousel(imgPath, arrangeCarousel_png);
snprintf(imgPath, sizeof(imgPath), "%sarrangeCarousel_gray.png", CFG.theme_path);
GuiImageData imgarrangeCarousel_gray(imgPath, arrangeCarousel_gray_png);
snprintf(imgPath, sizeof(imgPath), "%sbrowser.png", CFG.theme_path);
GuiImageData homebrewImgData(imgPath, browser_png);
GuiTrigger trigA;
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
@ -465,11 +469,11 @@ HBCWindowPrompt(db1, db2, db3,db4, db5, db7, db6);
GuiButton carouselBtn(&carouselBtnImg_g,&carouselBtnImg_g, 2, 3, THEME.carousel_x, THEME.carousel_y, &trigA, &btnSoundOver, &btnClick,1);
carouselBtn.SetAlpha(180);
GuiImage homebrewBtnImg(&imgarrangeList);
GuiImage homebrewBtnImg(&homebrewImgData);
homebrewBtnImg.SetWidescreen(CFG.widescreen);
GuiButton homebrewBtn(homebrewBtnImg.GetWidth(), homebrewBtnImg.GetHeight());
homebrewBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
homebrewBtn.SetPosition(430, 410);
homebrewBtn.SetPosition(425, 400);
homebrewBtn.SetImage(&homebrewBtnImg);
homebrewBtn.SetSoundOver(&btnSoundOver);
homebrewBtn.SetSoundClick(&btnClick);
@ -618,7 +622,7 @@ HBCWindowPrompt(db1, db2, db3,db4, db5, db7, db6);
w.Append(&sdcardBtn);
w.Append(&poweroffBtn);
w.Append(&gameInfo);
w.Append(&gameInfo);
if (Settings.godmode)
w.Append(&installBtn);
w.Append(&homeBtn);
@ -630,7 +634,8 @@ HBCWindowPrompt(db1, db2, db3,db4, db5, db7, db6);
w.Append(&listBtn);
w.Append(&gridBtn);
w.Append(&carouselBtn);
w.Append(&homebrewBtn);
if (Settings.godmode == 1)
w.Append(&homebrewBtn);
if((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24))
{
@ -1552,8 +1557,9 @@ static int MenuFormat()
selected = optionBrowser.GetClickedOption();
for (cnt = 0; cnt < MAX_PARTITIONS; cnt++) {
if (cnt == selected) {
for (cnt = 0; cnt < MAX_PARTITIONS; cnt++) {
if ((cnt == selected)&&((Settings.godmode == 1)||
(!strcmp("", Settings.unlockCode)))){
partitionEntry *entry = &partitions[selected];
if (entry->size) {
sprintf(text, "%s %d : %.2fGB",tr("Partition"), selected+1, entry->size * (sector_size / GBSIZE));
@ -1577,6 +1583,23 @@ static int MenuFormat()
}
}
}
else if ( (cnt == selected)&&(Settings.godmode == 0) ) {
mainWindow->Remove(&optionBrowser);
char entered[20] = "";
int result = OnScreenKeyboard(entered, 20,0);
mainWindow->Append(&optionBrowser);
if ( result == 1 ) {
if (!strcmp(entered, Settings.unlockCode)) //if password correct
{
if (Settings.godmode == 0) {
WindowPrompt(tr("Correct Password"),tr("All the features of USB Loader GX are unlocked."),tr("OK"));
Settings.godmode = 1;
}
} else {
WindowPrompt(tr("Wrong Password"),tr("USB Loader GX is protected"),tr("OK"));
}
}
}
}
if (shutdown == 1)
Sys_Shutdown();

View File

@ -2984,7 +2984,7 @@ void GetLanguageToLangCode(char *langcode) {
int
HBCWindowPrompt(const char *name, const char *coder, const char *version,
const char *release_date, const char *long_description, const char *iconPath, const char *filesize)
const char *release_date, const char *long_description, const char *iconPath, u64 filesize)
{
int choice = -1;
@ -3075,7 +3075,7 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
GuiText nameTxt(name,30 , (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
nameTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
nameTxt.SetPosition(0,-15);
nameTxt.SetMaxWidth(430);
nameTxt.SetMaxWidth(430, GuiText::SCROLL);
if (coder)
@ -3106,8 +3106,32 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
long_descriptionTxt.SetMaxWidth(360);
long_descriptionTxt.SetNumLines(pagesize);
//convert filesize from u64 to char and put unit of measurement after it
char temp2[7];
char filesizeCH[15];
f32 sizeAdjusted;
if(filesize<=1024.0)
{
sizeAdjusted = filesize;
snprintf(temp2, sizeof(temp2), "%f",sizeAdjusted);
snprintf(filesizeCH, sizeof(filesizeCH), "%s B",temp2);
GuiText filesizeTxt(filesize, 16, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
}
if(filesize>1024.0)
{
sizeAdjusted = filesize/1024.0;
snprintf(temp2, sizeof(temp2), "%f",sizeAdjusted);
snprintf(filesizeCH, sizeof(filesizeCH), "%s KB",temp2);
}
if(filesize>1048576.0)
{
sizeAdjusted = filesize/1048576.0;
snprintf(temp2, sizeof(temp2), "%f",sizeAdjusted);
snprintf(filesizeCH, sizeof(filesizeCH), "%s MB",temp2);
}
GuiText filesizeTxt(filesizeCH, 16, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
filesizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
filesizeTxt.SetPosition(-40,12);

View File

@ -30,7 +30,7 @@ int CodeDownload(const char *id);
void GetLanguageToLangCode(char *langcode);
int HBCWindowPrompt(const char *name, const char *coder, const char *version,
const char *release_date, const char *long_description,
const char *iconPath, const char *filesize);
const char *iconPath, u64 filesize);
#endif

View File

@ -493,6 +493,7 @@ int showGameInfo(char *ID)
if (strcmp(gameinfo.title,"") != 0) {
snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.title);
titleTxt = new GuiText(linebuf, titlefontsize, (GXColor){0,0,0, 255});
titleTxt->SetMaxWidth(350, GuiText::SCROLL);
//while (titleTxt->GetWidth()>250) { titleTxt->SetFontSize(titlefontsize-=2); }
titleTxt->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt->SetPosition(txtXOffset,12+titley);
gameinfoWindow.Append(titleTxt);

View File

@ -1286,7 +1286,7 @@ int MenuSettings()
}
}
} else {
WindowPrompt(tr("Coverpath Changed"),tr("Console should be unlocked to modify it."),tr("OK"));
WindowPrompt(tr("Coverpath Change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 1: