This commit is contained in:
ardi@ist-einmalig.de 2009-09-27 18:19:53 +00:00
parent 6a6f02ecf8
commit 16b4e62c51
73 changed files with 3317 additions and 3573 deletions

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: David Jelinek (djelinek@hotmail.com) \n"
"Language-Team: r719 - last version on http://volny.cz/djelinek/_USBLoderGX/czech.lang \n"
@ -46,6 +46,9 @@ msgstr "2 (Mladistvý 12+)"
msgid "20 min"
msgstr "20 minut"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Zralý 16+)"
@ -55,6 +58,9 @@ msgstr "3 minuty"
msgid "30 min"
msgstr "30 minut"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D Obaly"
@ -284,9 +290,6 @@ msgstr "Nelze nastavit USB"
msgid "Cover Download"
msgstr "Stažení obalu"
msgid "Cover Path"
msgstr "Cesta k obalum"
msgid "Coverpath Change"
msgstr "Zmena cesty k obalom"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Zárí"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Nastavit jako hudbu na pozadí?"
@ -1193,3 +1199,6 @@ msgstr "z "
msgid "seconds left"
msgstr "sekund zbývá"
#~ msgid "Cover Path"
#~ msgstr "Cesta k obalum"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: dorf[dk]\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Unge teenagere 12+)"
msgid "20 min"
msgstr "20 min."
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Modne teenagere 12+)"
@ -55,6 +58,9 @@ msgstr "3 min."
msgid "30 min"
msgstr "30 min."
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D-Covers"
@ -284,9 +290,6 @@ msgstr "Kunne ikke sætte USB."
msgid "Cover Download"
msgstr "Cover-download"
msgid "Cover Path"
msgstr "Sti til covers"
msgid "Coverpath Change"
msgstr "Ændringer af sti til covers"
@ -911,6 +914,9 @@ msgstr "Valgt DOL"
msgid "Sept"
msgstr "Sept"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Indstil som baggrundsmusik?"
@ -1194,6 +1200,9 @@ msgstr "af"
msgid "seconds left"
msgstr "sekunder tilbage"
#~ msgid "Cover Path"
#~ msgstr "Sti til covers"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Lad være med at fortælle holdet bag USB Loader GX om fejl i denne fil."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: tj_cool\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Tiener 12+)"
msgid "20 min"
msgstr "20 min"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Adolescenten 16+)"
@ -55,6 +58,9 @@ msgstr "3 min"
msgid "30 min"
msgstr "30 min"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D Hoesjes"
@ -284,9 +290,6 @@ msgstr "Kan USB niet instellen"
msgid "Cover Download"
msgstr "Download hoesjes"
msgid "Cover Path"
msgstr "Locatie hoesjes"
msgid "Coverpath Change"
msgstr "Hoesjesmap wijzigen"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Sept"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Instellen als achtergrondmuziek?"
@ -1194,6 +1200,9 @@ msgstr "van"
msgid "seconds left"
msgstr "seconden over:"
#~ msgid "Cover Path"
#~ msgstr "Locatie hoesjes"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Val het USB loader GX team niet lastig over fouten in dit bestand."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr ""
msgid "20 min"
msgstr ""
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr ""
@ -55,6 +58,9 @@ msgstr ""
msgid "30 min"
msgstr ""
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr ""
@ -284,9 +290,6 @@ msgstr ""
msgid "Cover Download"
msgstr ""
msgid "Cover Path"
msgstr ""
msgid "Coverpath Change"
msgstr ""
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr ""
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: c64rmx\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Teinit 12+)"
msgid "20 min"
msgstr ""
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Teinit 16+)"
@ -55,6 +58,9 @@ msgstr ""
msgid "30 min"
msgstr ""
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D Kannet"
@ -284,9 +290,6 @@ msgstr "USB:tä ei voitu asettaa"
msgid "Cover Download"
msgstr "Kansien lataus"
msgid "Cover Path"
msgstr "Kansien polku"
msgid "Coverpath Change"
msgstr "Kansipolun vaihto"
@ -911,6 +914,9 @@ msgstr "Valittu DOL"
msgid "Sept"
msgstr "syys"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Aseta taustamusiikiksi?"
@ -1194,6 +1200,9 @@ msgstr "josta"
msgid "seconds left"
msgstr "sekuntia jäljellä"
#~ msgid "Cover Path"
#~ msgstr "Kansien polku"
#~ msgid "No partitions found"
#~ msgstr "Osioita ei löytynyt"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Kin8\n"
"Language-Team: Badablek, Amour, ikya, dj_skual & Kin8\n"
@ -46,6 +46,9 @@ msgstr "2 (Adolescents 12+)"
msgid "20 min"
msgstr "20 min."
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Matures 16+)"
@ -55,6 +58,9 @@ msgstr "3 min."
msgid "30 min"
msgstr "30 min."
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "Jaquettes 3D"
@ -284,9 +290,6 @@ msgstr "Accès USB impossible."
msgid "Cover Download"
msgstr "Téléchargement Jaquettes"
msgid "Cover Path"
msgstr "Dossier Jaquettes"
msgid "Coverpath Change"
msgstr "Dossier des Jaquettes"
@ -911,6 +914,9 @@ msgstr "Choix du DOL"
msgid "Sept"
msgstr "Sept"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Utiliser comme fond sonore ?"
@ -1194,6 +1200,9 @@ msgstr "sur"
msgid "seconds left"
msgstr "secondes restantes"
#~ msgid "Cover Path"
#~ msgstr "Dossier Jaquettes"
#~ msgid "You need to start this game one time to create a save file, then exit and start it again."
#~ msgstr "Vous devez lancer ce jeu une fois pour créer une sauvegarde, puis éteindre et le lancer à nouveau."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: wishmasterf\n"
"Language-Team: Snoozer, wishmasterf\n"
@ -46,6 +46,9 @@ msgstr "2 (Jugendliche 12+)"
msgid "20 min"
msgstr "20 min"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Erwachsene 16+)"
@ -55,6 +58,9 @@ msgstr "3 min"
msgid "30 min"
msgstr "30 min"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D Cover"
@ -284,9 +290,6 @@ msgstr "Konnte USB nicht setzen."
msgid "Cover Download"
msgstr "Cover Download"
msgid "Cover Path"
msgstr "Cover Pfad"
msgid "Coverpath Change"
msgstr "Cover Pfad ändern"
@ -911,6 +914,9 @@ msgstr "Ausgewähltes DOL"
msgid "Sept"
msgstr "Sept"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Als Hintergrundmusik wählen?"
@ -1194,6 +1200,9 @@ msgstr "von"
msgid "seconds left"
msgstr "Sekunden verbleiben"
#~ msgid "Cover Path"
#~ msgstr "Cover Pfad"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Beschweren Sie sich nicht bei uns über hier angezeigte Fehler."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Tusk\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Tinédzserek 14+)"
msgid "20 min"
msgstr ""
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Kamaszok 16+)"
@ -55,6 +58,9 @@ msgstr ""
msgid "30 min"
msgstr ""
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D Borítók"
@ -284,9 +290,6 @@ msgstr ""
msgid "Cover Download"
msgstr "Boritó Letöltés"
msgid "Cover Path"
msgstr "Boritó Útvonala"
msgid "Coverpath Change"
msgstr ""
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Szep"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Beállítod háttérzenének?"
@ -1194,6 +1200,9 @@ msgstr " "
msgid "seconds left"
msgstr "hátralévõ másodperc"
#~ msgid "Cover Path"
#~ msgstr "Boritó Útvonala"
#~ msgid "No partitions found"
#~ msgstr "Nem találtam particiót"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-08-05 10:00+0200\n"
"Last-Translator: Cambo \n"
"Language-Team: FoxeJoe & Cambo\n"
@ -46,6 +46,9 @@ msgstr "2 (Ragazzini 12+)"
msgid "20 min"
msgstr "20 minuti"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Ragazzi 16+)"
@ -55,6 +58,9 @@ msgstr "3 minuti"
msgid "30 min"
msgstr "30 minuti"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "Copertine 3D"
@ -284,9 +290,6 @@ msgstr "Non è stato possibile impostare la porta USB."
msgid "Cover Download"
msgstr "Scaricamento Copertine"
msgid "Cover Path"
msgstr "Percorso Copertine"
msgid "Coverpath Change"
msgstr "Modifica Percorso Copertine"
@ -911,6 +914,9 @@ msgstr "File DOL selezionato"
msgid "Sept"
msgstr "settembre"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Imposto come Musica Sottofondo?"
@ -1194,6 +1200,9 @@ msgstr "di"
msgid "seconds left"
msgstr "secondi mancanti"
#~ msgid "Cover Path"
#~ msgstr "Percorso Copertine"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Non infastidire il team di sviluppo dell'USB Loader GX per errori in questo file."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: hosigumayuugi\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (中学生 12+)"
msgid "20 min"
msgstr "20分"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (高校生 16+)"
@ -55,6 +58,9 @@ msgstr "3分"
msgid "30 min"
msgstr "30分"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D カバー"
@ -284,9 +290,6 @@ msgstr "USBをセットできません"
msgid "Cover Download"
msgstr "カバー ダウンロード"
msgid "Cover Path"
msgstr "カバーパス"
msgid "Coverpath Change"
msgstr "カバーパスの変更"
@ -911,6 +914,9 @@ msgstr "DOLの場所"
msgid "Sept"
msgstr "9月"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "BGMに設定しますか"
@ -1194,6 +1200,9 @@ msgstr ""
msgid "seconds left"
msgstr "完了までの秒数"
#~ msgid "Cover Path"
#~ msgstr "カバーパス"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "GXの開発チームは、このファイルに関するエラーに対応しません。"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: nextos@korea.com\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (12세 이상)"
msgid "20 min"
msgstr "20 분"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (16세 이상)"
@ -55,6 +58,9 @@ msgstr "3 분"
msgid "30 min"
msgstr "30 분"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D 커버"
@ -284,9 +290,6 @@ msgstr "USB 를 설정할수 없음."
msgid "Cover Download"
msgstr "표지 다운로드"
msgid "Cover Path"
msgstr "표지 경로"
msgid "Coverpath Change"
msgstr "커퍼경로 변경"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "9월"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "벼경음악 설정?"
@ -1194,6 +1200,9 @@ msgstr "중"
msgid "seconds left"
msgstr "초 남았습니다"
#~ msgid "Cover Path"
#~ msgstr "표지 경로"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "이화일의 에러로 USB Loader GX 팀에 연락하지 마세요."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: raschi\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Ungdom 12+)"
msgid "20 min"
msgstr "20 min"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Ungdom 16+)"
@ -55,6 +58,9 @@ msgstr "3 min"
msgid "30 min"
msgstr "30 min"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D cover"
@ -284,9 +290,6 @@ msgstr "Kan ikke velge USB."
msgid "Cover Download"
msgstr "Cover nedlasting"
msgid "Cover Path"
msgstr "Cover sti"
msgid "Coverpath Change"
msgstr "Endre cover sti"
@ -911,6 +914,9 @@ msgstr "Valgt DOL fil"
msgid "Sept"
msgstr "Sep"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Bruk som bakgrunnsmusikk?"
@ -1194,6 +1200,9 @@ msgstr "av"
msgid "seconds left"
msgstr "sekunder gjenstår"
#~ msgid "Cover Path"
#~ msgstr "Cover sti"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Ikke bry USB Loader GX teamet med feil i denne filen."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: ziom666 (zadania_prog@vp.pl)\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (mlodziez 12+)"
msgid "20 min"
msgstr ""
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (dojrzaly 16+)"
@ -55,6 +58,9 @@ msgstr ""
msgid "30 min"
msgstr ""
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "Okladki 3D"
@ -284,9 +290,6 @@ msgstr "Nie mozna ustawic USB"
msgid "Cover Download"
msgstr "Pobierz okladki"
msgid "Cover Path"
msgstr "Sciezka okladek"
msgid "Coverpath Change"
msgstr "Zmien Sciezke okladek"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Wrzesien"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Ustawic jako muzyke w tle?"
@ -1194,6 +1200,9 @@ msgstr "z"
msgid "seconds left"
msgstr "sekund pozostalo"
#~ msgid "Cover Path"
#~ msgstr "Sciezka okladek"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Nie informuj team USB Loader GX o bledach w tym pliku."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-08-11 19:45\n"
"Last-Translator: boto12\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Adolescente 12+)"
msgid "20 min"
msgstr "20 minutos"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Adulto 16+)"
@ -55,6 +58,9 @@ msgstr "3 minutos"
msgid "30 min"
msgstr "30 minutos"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "Capas 3D"
@ -284,9 +290,6 @@ msgstr "Não foi possível configurar a porta USB."
msgid "Cover Download"
msgstr "Download de Capas"
msgid "Cover Path"
msgstr "Pasta Capas"
msgid "Coverpath Change"
msgstr "Alterar Pasta das Capas"
@ -911,6 +914,9 @@ msgstr "DOL selecionado"
msgid "Sept"
msgstr "Set"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Definir como música de fundo?"
@ -1194,5 +1200,8 @@ msgstr "de"
msgid "seconds left"
msgstr "segundos restantes"
#~ msgid "Cover Path"
#~ msgstr "Pasta Capas"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Não incomode a equipe do USB Loader GX por erros neste arquivo."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-08-11 12:25\n"
"Last-Translator: Sky8000\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Adolescente 12+)"
msgid "20 min"
msgstr "20 minutos"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Adulto 16+)"
@ -55,6 +58,9 @@ msgstr "3 minutos"
msgid "30 min"
msgstr "30 minutos"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "Capas 3D"
@ -284,9 +290,6 @@ msgstr "Não foi possível configurar a porta USB."
msgid "Cover Download"
msgstr "Download de Capas"
msgid "Cover Path"
msgstr "Pasta Capas"
msgid "Coverpath Change"
msgstr "Alterar Pasta das Capas"
@ -911,6 +914,9 @@ msgstr "DOL Seleccionado"
msgid "Sept"
msgstr "Set"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Definir como música de fundo?"
@ -1194,6 +1200,9 @@ msgstr "de"
msgid "seconds left"
msgstr "segundos restantes"
#~ msgid "Cover Path"
#~ msgstr "Pasta Capas"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Não incomodes a equipa do USB Loader GX por erros neste ficheiro."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Kir\n"
"Language-Team: Kir\n"
@ -46,6 +46,9 @@ msgstr "2 (Подростки 12+)"
msgid "20 min"
msgstr ""
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Подростки 16+)"
@ -55,6 +58,9 @@ msgstr ""
msgid "30 min"
msgstr ""
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D Обложки"
@ -284,9 +290,6 @@ msgstr "Не могу настроить USB"
msgid "Cover Download"
msgstr "Скачать обложку"
msgid "Cover Path"
msgstr "Путь к обложкам"
msgid "Coverpath Change"
msgstr "Изменить путь к обложкам"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Сен"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "установить как фоновую музыку"
@ -1194,6 +1200,9 @@ msgstr "из"
msgid "seconds left"
msgstr "секунд осталось"
#~ msgid "Cover Path"
#~ msgstr "Путь к обложкам"
#~ msgid "Leaving so you can restart..."
#~ msgstr "Выхожу для перезапуска..."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: knife.hu\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (12岁以上)"
msgid "20 min"
msgstr "20 分钟"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (16岁以上)"
@ -55,6 +58,9 @@ msgstr "3 分钟"
msgid "30 min"
msgstr "30 分钟"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D 封面"
@ -284,9 +290,6 @@ msgstr "无法设置 USB."
msgid "Cover Download"
msgstr "下载封面"
msgid "Cover Path"
msgstr "封面路径"
msgid "Coverpath Change"
msgstr "变更封面路径"
@ -911,6 +914,9 @@ msgstr "已选择 DOL"
msgid "Sept"
msgstr "九月"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "设置成背景音乐?"
@ -1194,6 +1200,9 @@ msgstr "的"
msgid "seconds left"
msgstr "剩余秒数"
#~ msgid "Cover Path"
#~ msgstr "封面路径"
#~ msgid "No partitions found"
#~ msgstr "找不到分区"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: Penn\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "2 (Adolescente 12+)"
msgid "20 min"
msgstr "20 min"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Maduro 16+)"
@ -55,6 +58,9 @@ msgstr "3 min"
msgid "30 min"
msgstr "30 min"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "Carátulas 3D"
@ -284,9 +290,6 @@ msgstr "No se pudo configurar USB."
msgid "Cover Download"
msgstr "Descarga de Carátulas"
msgid "Cover Path"
msgstr "Ruta Carátulas"
msgid "Coverpath Change"
msgstr "Cambio ruta Carátulas"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Sept"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "¿Poner como másica de fondo?"
@ -1194,6 +1200,9 @@ msgstr "de"
msgid "seconds left"
msgstr "segundos restantes"
#~ msgid "Cover Path"
#~ msgstr "Ruta Carátulas"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "No molestes al equipo del USB Loader GX sobre errores en este archivo."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-08-02 12:20+0200\n"
"Last-Translator: Katsurou\n"
"Language-Team: Katsurou, pirateX\n"
@ -46,6 +46,9 @@ msgstr "2 (Tonåringar 12+)"
msgid "20 min"
msgstr "20 min"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (Mogen 16+)"
@ -55,6 +58,9 @@ msgstr "3 min"
msgid "30 min"
msgstr "30 min"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D-Omslag"
@ -284,9 +290,6 @@ msgstr "Kunde inte ställa in USB."
msgid "Cover Download"
msgstr "Omslagsnedladdning"
msgid "Cover Path"
msgstr "Omslagsmapp"
msgid "Coverpath Change"
msgstr "Ändra omslagsmapp"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "Sept"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "Ställ in som bakgrundsmusik?"
@ -1194,6 +1200,9 @@ msgstr "av"
msgid "seconds left"
msgstr "sekunder kvar"
#~ msgid "Cover Path"
#~ msgstr "Omslagsmapp"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "Rapportera inte fel i denna fil till USB Loader GX teamet."

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: kyogc\n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr "(青少年 12歲以上)"
msgid "20 min"
msgstr "20分鐘"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "(青年 16歲以上)"
@ -55,6 +58,9 @@ msgstr "3分鐘"
msgid "30 min"
msgstr "30分鐘"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3D封面"
@ -284,9 +290,6 @@ msgstr "無法設置USB"
msgid "Cover Download"
msgstr "下載封面"
msgid "Cover Path"
msgstr "封面路徑"
msgid "Coverpath Change"
msgstr "變更封面路徑"
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr "九月"
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "設定背景音樂"
@ -1194,6 +1200,9 @@ msgstr "剩餘空間 總容量"
msgid "seconds left"
msgstr "剩餘秒數"
#~ msgid "Cover Path"
#~ msgstr "封面路徑"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "檔案錯誤"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-09-19 14:00+0700\n"
"Last-Translator: Nitro_subzero \n"
"Language-Team: Nitro_subzero\n"
@ -46,6 +46,9 @@ msgstr "2 (วัยรุ่น 12+)"
msgid "20 min"
msgstr "20 นาที"
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr "3 (เต็มวัย 16+)"
@ -55,6 +58,9 @@ msgstr "3 นาที"
msgid "30 min"
msgstr "30 นาที"
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "หน้าปก 3D"
@ -284,9 +290,6 @@ msgstr "ไม่สามารถตั้งค่า USB ได้"
msgid "Cover Download"
msgstr "ดาวน์โหลดปก"
msgid "Cover Path"
msgstr "ที่เก็บ ปก"
msgid "Coverpath Change"
msgstr "ที่เก็บ ปก ถูกเปลี่ยนแปลง"
@ -911,6 +914,9 @@ msgstr "DOL ที่เลือก"
msgid "Sept"
msgstr "กย."
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr "เลือกเป็น Background music?"
@ -1194,6 +1200,9 @@ msgstr "ของ"
msgid "seconds left"
msgstr "วินาทีที่เหลือ"
#~ msgid "Cover Path"
#~ msgstr "ที่เก็บ ปก"
#~ msgid "Don't bother the USB Loader GX Team about errors in this file."
#~ msgstr "อย่ารบกวนผู้พัฒนา USB Loader GX ถ้ามีข้อผิดพลาดกับไฟล์นี้ "

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2009-09-20 04:59+0200\n"
"POT-Creation-Date: 2009-09-27 20:15+0200\n"
"PO-Revision-Date: 2009-07-18 15:18+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -46,6 +46,9 @@ msgstr ""
msgid "20 min"
msgstr ""
msgid "2D Cover Path"
msgstr ""
msgid "3 (Mature 16+)"
msgstr ""
@ -55,6 +58,9 @@ msgstr ""
msgid "30 min"
msgstr ""
msgid "3D Cover Path"
msgstr ""
msgid "3D Covers"
msgstr "3B Kapaklar"
@ -284,9 +290,6 @@ msgstr ""
msgid "Cover Download"
msgstr "Kapak Indirme"
msgid "Cover Path"
msgstr "Kapak Yolu"
msgid "Coverpath Change"
msgstr ""
@ -911,6 +914,9 @@ msgstr ""
msgid "Sept"
msgstr ""
msgid "Set Search-Filter"
msgstr ""
msgid "Set as backgroundmusic?"
msgstr ""
@ -1194,6 +1200,9 @@ msgstr "/"
msgid "seconds left"
msgstr "saniye kaldi"
#~ msgid "Cover Path"
#~ msgstr "Kapak Yolu"
#~ msgid "No partitions found"
#~ msgstr "Bölüm bulunamadi"

View File

@ -90,8 +90,8 @@ FreeTypeGX::~FreeTypeGX() {
*/
wchar_t* FreeTypeGX::charToWideChar(char* strChar) {
wchar_t *strWChar;
strWChar = new wchar_t[strlen(strChar) + 1];
try {strWChar = new wchar_t[strlen(strChar) + 1];}
catch (...) { return 0; }
// UTF-8
int bt;
bt = mbstowcs(strWChar, strChar, strlen(strChar));

View File

@ -1,289 +0,0 @@
/****************************************************************************
* USB Loader GX Team
* buffer.cpp
*
* Loading covers in a background thread
***************************************************************************/
#include <gccore.h>
#include <unistd.h>
#include "libwiigui/gui.h"
#include "usbloader/disc.h"
#include "settings/cfg.h"
#include "buffer.h"
#include "main.h"
#define BUFFERSIZE 9
extern struct discHdr * gameList;
extern u32 gameCnt;
static lwp_t bufferthread = LWP_THREAD_NULL;
static bool BufferHalt = true;
static int loading = 0;
static int offset = 0;
static int direction = 1;
static bool changed = false;
static bool firstime = true;
static GuiImageData NoCoverData(nocover_png);
static GuiImageData * cover[BUFFERSIZE];
static GuiImage * coverImg[BUFFERSIZE];
static GuiImage * NoCover[BUFFERSIZE];
GuiImage * ImageBuffer(int imagenumber) {
if ((BUFFERSIZE-1 > imagenumber) && direction >= 0) {
return coverImg[imagenumber];
}
if ((0 < imagenumber) && direction < 0) {
return coverImg[imagenumber];
}
if (loading == BUFFERSIZE) {
return coverImg[imagenumber];
}
return NoCover[imagenumber];
}
void LoadImages() {
if (!changed || BufferHalt)
return;
char ID[4];
char IDfull[7];
char imgPath[200];
for (u32 i = offset; (int) i < offset+BUFFERSIZE; i++) {
struct discHdr *header;
if (i > gameCnt-1)
header = &gameList[i-gameCnt];
else
header = &gameList[i];
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, IDfull); //Load full id image
//firsttime loading images into memory
if (firstime) {
if (coverImg[loading]) {
delete coverImg[loading];
coverImg[loading] = NULL;
}
if (cover[loading]) {
delete cover[loading];
cover[loading] = NULL;
}
cover[loading] = new GuiImageData(imgPath,0);
if (!cover[loading]->GetImage()) {
delete cover[loading];
cover[loading] = NULL;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, ID); //Load short id image
cover[loading] = new GuiImageData(imgPath, 0);
if (!cover[loading]->GetImage()) {
delete cover[loading];
cover[loading] = NULL;
snprintf(imgPath, sizeof(imgPath), "%snoimage.png", CFG.theme_path); //Load no image
cover[loading] = new GuiImageData(imgPath, nocover_png);
}
}
coverImg[loading] = new GuiImage(cover[loading]);
} else {
if (direction >= 0) {
if (loading < BUFFERSIZE-1) {
if (coverImg[loading]) {
delete coverImg[loading];
coverImg[loading] = NULL;
}
if (loading == 0) {
if (cover[loading]) {
delete cover[loading];
cover[loading] = NULL;
}
cover[loading] = new GuiImageData(NULL, 0);
cover[loading] = cover[loading+1];
} else {
cover[loading] = cover[loading+1];
}
coverImg[loading] = new GuiImage(cover[loading]);
} else {
cover[loading] = new GuiImageData(imgPath,0);
if (!cover[loading]->GetImage()) {
delete cover[loading];
cover[loading] = NULL;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, ID); //Load short id image
cover[loading] = new GuiImageData(imgPath, 0);
if (!cover[loading]->GetImage()) {
delete cover[loading];
cover[loading] = NULL;
snprintf(imgPath, sizeof(imgPath), "%snoimage.png", Settings.covers_path); //Load no image
cover[loading] = new GuiImageData(imgPath, nocover_png);
}
}
if (coverImg[loading]) {
delete coverImg[loading];
coverImg[loading] = NULL;
}
coverImg[loading] = new GuiImage(cover[loading]);
}
} else if (direction < 0) {
if (BUFFERSIZE-loading-1 > 0) {
if (coverImg[BUFFERSIZE-loading-1]) {
delete coverImg[BUFFERSIZE-loading-1];
coverImg[BUFFERSIZE-loading-1] = NULL;
}
if (BUFFERSIZE-loading-1 == BUFFERSIZE-1) {
if (cover[BUFFERSIZE-loading-1]) {
delete cover[BUFFERSIZE-loading-1];
cover[BUFFERSIZE-loading-1] = NULL;
}
cover[BUFFERSIZE-loading-1] = new GuiImageData(NULL, 0);
cover[BUFFERSIZE-loading-1] = cover[BUFFERSIZE-loading-1-1];
} else {
cover[BUFFERSIZE-loading-1] = cover[BUFFERSIZE-loading-1-1];
coverImg[BUFFERSIZE-loading-1] = new GuiImage(cover[BUFFERSIZE-loading-1]);
}
} else {
header = &gameList[offset];
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, IDfull); //Load full id image
cover[0] = new GuiImageData(imgPath,0);
if (!cover[0]->GetImage()) {
delete cover[0];
cover[0] = NULL;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, ID); //Load short id image
cover[0] = new GuiImageData(imgPath, 0);
if (!cover[0]->GetImage()) {
delete cover[0];
cover[0] = NULL;
snprintf(imgPath, sizeof(imgPath), "%snoimage.png", Settings.covers_path); //Load no image
cover[0] = new GuiImageData(imgPath, nocover_png);
}
}
if (coverImg[0]) {
delete coverImg[0];
coverImg[0] = NULL;
}
coverImg[0] = new GuiImage(cover[0]);
}
}
}
loading++;
}
loading = BUFFERSIZE;
changed = false;
firstime = false;
}
void NewOffset(int off, int d) {
if (offset == off || loading < BUFFERSIZE)
return;
direction = d;
offset = off;
loading = 0;
changed = true;
}
/****************************************************************************
* HaltBuffer
***************************************************************************/
void HaltBufferThread() {
BufferHalt = true;
firstime = true;
changed = true;
loading = 0;
offset = 0;
direction = 0;
// wait for thread to finish
while (!LWP_ThreadIsSuspended(bufferthread))
usleep(100);
for (int i = 0; i < BUFFERSIZE; i++) {
delete cover[i];
cover[i] = NULL;
delete coverImg[i];
coverImg[i] = NULL;
delete NoCover[i];
NoCover[i] = NULL;
}
}
/****************************************************************************
* ResumeBufferThread
***************************************************************************/
void ResumeBufferThread(int offset) {
BufferHalt = false;
firstime = true;
changed = true;
loading = 0;
offset = offset;
direction = 0;
for (u8 i = 0; i < BUFFERSIZE; i++) {
if (NoCover[i] != NULL) {
delete NoCover[i];
NoCover[i] = NULL;
}
NoCover[i] = new GuiImage(&NoCoverData);
}
LWP_ResumeThread(bufferthread);
}
/*********************************************************************************
* Bufferthread
*********************************************************************************/
static void * bufferinitcallback(void *arg) {
while (1) {
if (BufferHalt)
LWP_SuspendThread(bufferthread);
LoadImages();
}
return NULL;
}
/****************************************************************************
* InitBufferThread with priority 50
***************************************************************************/
void InitBufferThread() {
LWP_CreateThread(&bufferthread, bufferinitcallback, NULL, NULL, 0, 50);
}
/****************************************************************************
* ShutdownThread
***************************************************************************/
void ShutdownBufferThread() {
LWP_JoinThread (bufferthread, NULL);
bufferthread = LWP_THREAD_NULL;
}

View File

@ -1,18 +0,0 @@
/****************************************************************************
* USB Loader GX Team
* buffer.cpp
*
* Loading covers in a background thread
***************************************************************************/
#ifndef _BUFFER_H_
#define _BUFFER_H_
GuiImage * ImageBuffer(int imagenumber);
void NewOffset(int off, int d);
void InitBufferThread();
void ShutdownBufferThread();
void ResumeBufferThread(int offset);
void HaltBufferThread();
#endif

View File

@ -42,14 +42,14 @@ int CheatMenu(const char * gameID) {
GuiTrigger trigB;
trigB.SetButtonOnlyTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiText backBtnTxt(tr("Back") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
GuiButton backBtn(&backBtnImg,&backBtnImg, 2, 3, -140, 400, &trigA, NULL, &btnClick,1);
backBtn.SetLabel(&backBtnTxt);
backBtn.SetTrigger(&trigB);
GuiText createBtnTxt(tr("Create") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText createBtnTxt(tr("Create") , 22, THEME.prompttext);
createBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage createBtnImg(&btnOutline);
GuiButton createBtn(&createBtnImg,&createBtnImg, 2, 3, 160, 400, &trigA, NULL, &btnClick,1);

View File

@ -173,6 +173,12 @@ extern const u32 keyboard_mediumkey_over_png_size;
extern const u8 keyboard_largekey_over_png[];
extern const u32 keyboard_largekey_over_png_size;
extern const u8 keyboard_backspace_over_png[];
extern const u32 keyboard_backspace_over_png_size;
extern const u8 keyboard_clear_over_png[];
extern const u32 keyboard_clear_over_png_size;
extern const u8 menu_button_png[];
extern const u32 menu_button_size;
@ -311,6 +317,9 @@ extern const u32 not_favorite_png_size;
extern const u8 favIcon_png[];
extern const u32 favIcon_png_size;
extern const u8 searchIcon_png[];
extern const u32 searchIcon_png_size;
extern const u8 abcIcon_png[];
extern const u32 abcIcon_png_size;
@ -326,23 +335,8 @@ extern const u32 arrangeGrid_png_size;
extern const u8 arrangeCarousel_png[];
extern const u32 arrangeCarousel_png_size;
extern const u8 favIcon_gray_png[];
extern const u32 favIcon_gray_png_size;
extern const u8 abcIcon_gray_png[];
extern const u32 abcIcon_gray_png_size;
extern const u8 playCountIcon_gray_png[];
extern const u32 playCountIcon_gray_png_size;
extern const u8 arrangeGrid_gray_png[];
extern const u32 arrangeGrid_gray_png_size;
extern const u8 arrangeList_gray_png[];
extern const u32 arrangeList_gray_png_size;
extern const u8 arrangeCarousel_gray_png[];
extern const u32 arrangeCarousel_gray_png_size;
extern const u8 searchBar_png[];
extern const u32 searchBar_png_png_size;
extern const u8 settings_title_png[];
extern const u32 settings_title_png_size;

View File

@ -138,7 +138,7 @@ int MenuHomebrewBrowse() {
}
/*** Buttons ***/
GuiText backBtnTxt(tr("Back") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1016 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 778 B

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -476,8 +476,6 @@ private:
GuiElement *element;
};
#define LOCK(e) SimpleLock LOCK(e)
//disabled because of problems with FW 4.0
//#define LOCK(e)
//!Allows GuiElements to be grouped together into a "window"
class GuiWindow : public GuiElement
@ -571,6 +569,8 @@ class GuiImageData
//!Gets the image height
//!\return image height
int GetHeight();
//!Sets the image to grayscale
void SetGrayscale(void);
protected:
u8 * data; //!< Image data
int height; //!< Height of image
@ -651,6 +651,7 @@ class GuiImage : public GuiElement
void SetStripe(int s);
s32 z;
void SetSkew(int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX4, int YY4);
void SetSkew(int *skew /* int skew[8] */ );
int xx1;
int yy1;
int xx2;
@ -696,6 +697,7 @@ class GuiText : public GuiElement
//!\param t Text
void SetText(const char * t);
void SetTextf(const char *format, ...) __attribute__((format(printf,2,3)));
void SetText(const wchar_t * t);
//!Sets up preset values to be used by GuiText(t)
//!Useful when printing multiple text elements, all with the same attributes set
//!\param sz Font size
@ -771,7 +773,7 @@ class GuiTooltip : public GuiElement
public:
//!Constructor
//!\param t Text
GuiTooltip(const char *t);
GuiTooltip(const char *t, int Alpha=255);
//!Destructor
~ GuiTooltip();
@ -889,6 +891,7 @@ class GuiButton : public GuiElement
//!Deactivate/Activate pointing on Games while B scrolling
void ScrollIsOn(int f);
void SetSkew(int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX4, int YY4);
void SetSkew(int *skew /* int skew[8] */ );
protected:
GuiImage * image; //!< Button image (default)
GuiImage * imageOver; //!< Button image for STATE_SELECTED

View File

@ -44,6 +44,8 @@ GuiButton::GuiButton(int w, int h)
selectable = true;
holdable = false;
clickable = true;
time1 = time2 = 0;
}
GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, int y, GuiTrigger* trig, GuiSound* sndOver, GuiSound* sndClick, u8 grow)
@ -53,7 +55,7 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x,
image = img;
image->SetParent(this);
imageOver = imgOver;
imageOver->SetParent(this);
if(imageOver) imageOver->SetParent(this);
imageHold = NULL;
imageClick = NULL;
icon = NULL;
@ -87,6 +89,7 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x,
effectAmountOver = 4;
effectTargetOver = 110;
}
time1 = time2 = 0;
}
GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x, int y, GuiTrigger* trig, GuiSound* sndOver, GuiSound* sndClick, u8 grow, GuiTooltip* tt, int ttx, int tty, int h_align, int v_align)
@ -96,7 +99,7 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x,
image = img;
image->SetParent(this);
imageOver = imgOver;
imageOver->SetParent(this);
if(imageOver) imageOver->SetParent(this);
imageHold = NULL;
imageClick = NULL;
icon = NULL;
@ -135,6 +138,8 @@ GuiButton::GuiButton(GuiImage* img, GuiImage* imgOver, int hor, int vert, int x,
toolTip->SetParent(this);
toolTip->SetAlignment(h_align, v_align);
toolTip->SetPosition(ttx,tty);
time1 = time2 = 0;
}
/**
@ -263,7 +268,8 @@ void GuiButton::RemoveSoundClick()
}
void GuiButton::SetSkew(int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX4, int YY4)
{
if(image)
{
image->xx1 = XX1;
image->yy1 = YY1;
image->xx2 = XX2;
@ -272,6 +278,13 @@ void GuiButton::SetSkew(int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int X
image->yy3 = YY3;
image->xx4 = XX4;
image->yy4 = YY4;
}
}
void GuiButton::SetSkew(int *skew)
{
if(image)
image->SetSkew(skew);
}
@ -308,7 +321,7 @@ void GuiButton::Draw()
void GuiButton::DrawTooltip()
{
LOCK(this);
if(state == STATE_SELECTED && toolTip)
if(this->IsVisible() && state == STATE_SELECTED && toolTip)
{
if (time2 == 0)
{
@ -344,7 +357,7 @@ void GuiButton::ScrollIsOn(int f)
void GuiButton::Update(GuiTrigger * t)
{
LOCK(this);
if(state == STATE_CLICKED || state == STATE_DISABLED || !t)
if(!this->IsVisible() || state == STATE_CLICKED || state == STATE_DISABLED || !t)
return;
else if(parentElement && parentElement->GetState() == STATE_DISABLED)
return;

View File

@ -179,17 +179,17 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
for(int i=0; i < size; i++)
{
optionTxt[i] = new GuiText(options->GetName(i), 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
optionTxt[i] = new GuiText(options->GetName(i), 20, THEME.settingstext);
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
optionTxt[i]->SetPosition(24,0);
optionTxt[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED);
optionBg[i] = new GuiImage(bgOptionsEntry);
optionVal[i] = new GuiText(NULL, 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
optionVal[i] = new GuiText(NULL, 20, THEME.settingstext);
optionVal[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
optionValOver[i] = new GuiText(NULL, 20, (GXColor){THEME.settingsTxt_r, THEME.settingsTxt_g, THEME.settingsTxt_b, 0xff});
optionValOver[i] = new GuiText(NULL, 20, THEME.settingstext);
optionValOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
optionBtn[i] = new GuiButton(width-28,GAMESELECTSIZE);

View File

@ -13,7 +13,7 @@
/**
* Constructor for the Object class.
*/
mutex_t GuiElement::mutex = 0;
mutex_t GuiElement::mutex = LWP_MUTEX_NULL;
GuiElement::GuiElement()
{
xoffset = 0;
@ -65,7 +65,7 @@ GuiElement::GuiElement()
// default alignment - align to top left
alignmentVert = ALIGN_TOP;
alignmentHor = ALIGN_LEFT;
if(mutex == 0) LWP_MutexInit(&mutex, true);
if(mutex == LWP_MUTEX_NULL) LWP_MutexInit(&mutex, true);
}
/**

View File

@ -124,13 +124,13 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
for(int i=0; i < pagesize; i++)
{
gameTxt[i] = new GuiText(get_title(&gameList[i]), 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff});
gameTxt[i] = new GuiText(get_title(&gameList[i]), 20, THEME.gametext);
gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxt[i]->SetPosition(24,0);
gameTxt[i]->SetMaxWidth(maxTextWidth, GuiText::DOTTED);
gameTxtOver[i] = new GuiText(get_title(&gameList[i]), 20, (GXColor){THEME.gameText_r, THEME.gameText_g, THEME.gameText_b, 0xff});
gameTxtOver[i] = new GuiText(get_title(&gameList[i]), 20, THEME.gametext);
gameTxtOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxtOver[i]->SetPosition(24,0);
gameTxtOver[i]->SetMaxWidth(maxTextWidth, GuiText::SCROLL);
@ -413,7 +413,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
game[selectedItem+1]->SetState(STATE_SELECTED, t->chan);
selectedItem++;
}
scrollbarBoxBtn->Draw();
// scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);
}
if (!(ButtonsHold() & WPAD_BUTTON_A))
@ -436,7 +436,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
game[selectedItem-1]->SetState(STATE_SELECTED, t->chan);
selectedItem--;
}
scrollbarBoxBtn->Draw();
// scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);
}
if (!(ButtonsHold() & WPAD_BUTTON_A))
@ -470,7 +470,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
game[selectedItem-1]->SetState(STATE_SELECTED, t->chan);
selectedItem--;
}
scrollbarBoxBtn->Draw();
// scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);
}
}
@ -491,7 +491,7 @@ void GuiGameBrowser::Update(GuiTrigger * t)
game[selectedItem+1]->SetState(STATE_SELECTED, t->chan);
selectedItem++;
}
scrollbarBoxBtn->Draw();
// scrollbarBoxBtn->Draw();
usleep(10000 * scrolldelay);
}
}

View File

@ -7,7 +7,7 @@
class GuiGameBrowser : public GuiElement
{
public:
GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, const char *themePath, const u8 *imagebg, int selected = 0, int offset = 0);
GuiGameBrowser(int w, int h, struct discHdr *l, int gameCnt, const char *themePath, const u8 *imagebg, int selected = 0, int offset = 0);
~GuiGameBrowser();
int FindMenuItem(int c, int d);
int GetClickedOption();

View File

@ -8,12 +8,13 @@
#include "gui.h"
#include "../wpad.h"
#include "../menu.h"
#include <unistd.h>
#include "gui_image_async.h"
#include "gui_gamecarousel.h"
#include "../settings/cfg.h"
#include "../main.h"
#include "../buffer.h"
#include <string.h>
#include <math.h>
@ -27,24 +28,34 @@
#define SPEED_STEP 4
#define SPEED_LIMIT 250
static inline int OFFSETLIMIT(int Offset, int gameCnt)
{
while(Offset < 0) Offset+=gameCnt;
return Offset%gameCnt;
}
#define GetGameIndex(pageEntry, listOffset, gameCnt) OFFSETLIMIT(listOffset+pageEntry, gameCnt)
static GuiImageData *GameCarouselLoadCoverImage(void * Arg)
{
return LoadCoverImage((struct discHdr *)Arg, true, false);
}
/**
* Constructor for the GuiGameCarousel class.
*/
GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, const char *themePath, const u8 *imagebg, int selected, int offset)
GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, const char *themePath, const u8 *imagebg, int selected, int offset) :
noCover(nocover_png)
{
width = w;
height = h;
gameCnt = count;
gameList = l;
pagesize = (gameCnt < PAGESIZE) ? gameCnt : PAGESIZE;
pagesize = (gameCnt < 11) ? gameCnt : 11;
listOffset = 0;
selectable = true;
selectedItem = 0;
if (selectedItem==0)selectedItem=(pagesize+1)/2;
selectedItem = -1;
focus = 1; // allow focus
firstPic = 0;
clickedItem = -1;
speed = SHIFT_SPEED;
speed = 0;
char imgPath[100];
trigA = new GuiTrigger;
@ -96,11 +107,7 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, co
btnRight->SetTrigger(trigPlus);
btnRight->SetEffectGrow();
ResumeBufferThread(listOffset);
ttgame = new GuiTooltip(" ");
gamename = new GuiText(" ", 18, (GXColor) {THEME.info_r, THEME.info_g, THEME.info_b, 255});
gamename = new GuiText(" ", 18, THEME.info);
gamename->SetParent(this);
gamename->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
gamename->SetPosition(0, 330);
@ -108,19 +115,57 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, co
gameIndex = new int[pagesize];
game = new GuiButton * [pagesize];
titleTT = new GuiTooltip * [pagesize];
coverImg = new GuiImageAsync * [pagesize];
for(int i=0; i < pagesize; i++)
{
//------------------------
// Index
//------------------------
gameIndex[i] = GetGameIndex(i, listOffset, gameCnt);
//------------------------
// Tooltip
//------------------------
titleTT[i] = new GuiTooltip(get_title(&gameList[gameIndex[i]]), THEME.tooltipAlpha);
//------------------------
// Image
//------------------------
coverImg[i] = new(std::nothrow) GuiImageAsync(GameCarouselLoadCoverImage, &gameList[gameIndex[i]], sizeof(struct discHdr), &noCover);
if(coverImg[i])
coverImg[i]->SetWidescreen(CFG.widescreen);
//------------------------
// GameButton
//------------------------
for(int i=0; i < pagesize; i++) {
game[i] = new GuiButton(122,244);
game[i]->SetParent(this);
game[i]->SetAlignment(ALIGN_CENTRE,ALIGN_MIDDLE);
game[i]->SetPosition(0,740);
game[i]->SetImage(ImageBuffer((listOffset+i) % gameCnt));
game[i]->SetImage(coverImg[i]);
game[i]->SetScale(SCALE);
game[i]->SetRumble(false);
game[i]->SetTrigger(trigA);
game[i]->SetSoundClick(btnSoundClick);
game[i]->SetClickable(true);
game[i]->SetEffect(EFFECT_GOROUND, IN_SPEED, 90-(pagesize-2*i-1)*DEG_OFFSET/2, RADIUS, 180, 1, 0, RADIUS);
switch((i*3)/pagesize)
{
case 0:
game[i]->SetToolTip(titleTT[i], 122/2, -244/4, ALIGN_LEFT, ALIGN_MIDDLE);
break;
case 1:
game[i]->SetToolTip(titleTT[i], 0, -244/4, ALIGN_CENTRE, ALIGN_MIDDLE);
break;
case 2:
game[i]->SetToolTip(titleTT[i], -122/2, -244/4, ALIGN_RIGHT, ALIGN_MIDDLE);
break;
default:
break;
}
}
}
@ -130,8 +175,6 @@ GuiGameCarousel::GuiGameCarousel(int w, int h, struct discHdr * l, int count, co
*/
GuiGameCarousel::~GuiGameCarousel()
{
HaltBufferThread();
delete imgRight;
delete imgLeft;
delete btnLeftImg;
@ -146,15 +189,18 @@ GuiGameCarousel::~GuiGameCarousel()
delete trigMinus;
delete btnSoundClick;
delete btnSoundOver;
delete ttgame;
delete gamename;
for(int i=0; i<pagesize; i++) {
delete coverImg[i];
delete titleTT[i];
delete game[i];
}
delete [] gameIndex;
delete [] coverImg;
delete [] game;
}
@ -168,7 +214,7 @@ void GuiGameCarousel::SetFocus(int f)
for(int i=0; i<pagesize; i++)
game[i]->ResetState();
if(f == 1)
if(f == 1 && selectedItem>=0)
game[selectedItem]->SetState(STATE_SELECTED);
}
@ -189,21 +235,19 @@ void GuiGameCarousel::ResetState()
int GuiGameCarousel::GetOffset()
{
LOCK(this);
return listOffset;
}
int GuiGameCarousel::GetClickedOption()
{
LOCK(this);
int found = -1;
if (clickedItem>=0 && clickedItem<=pagesize){
if (game[(clickedItem+1) % pagesize]->GetState()==STATE_SELECTED){
found = (clickedItem+listOffset+1) % gameCnt;
game[(clickedItem+1) % pagesize]->SetState(STATE_SELECTED);
if (clickedItem>=0)
{
game[clickedItem]->SetState(STATE_SELECTED);
} else {
game[clickedItem]->SetState(STATE_SELECTED);
found= (clickedItem+listOffset) % gameCnt;}
found = gameIndex[clickedItem];
clickedItem=-1;
}
return found;
@ -212,41 +256,20 @@ int GuiGameCarousel::GetClickedOption()
int GuiGameCarousel::GetSelectedOption()
{
LOCK(this);
int found = -1;
for(int i=pagesize-1; i>-1; i--) {
if(game[i]->GetState() == STATE_SELECTED) {
for(int i=0; i<pagesize; i++)
{
if(game[i]->GetState() == STATE_SELECTED)
{
game[i]->SetState(STATE_SELECTED);
found = (listOffset+i) % gameCnt;
found = gameIndex[i];
break;
}
}
return found;
}
/****************************************************************************
* FindMenuItem
*
* Help function to find the next visible menu item on the list
***************************************************************************/
int GuiGameCarousel::FindMenuItem(int currentItem, int direction)
{
int nextItem = currentItem + direction;
if(nextItem < 0 || nextItem >= gameCnt)
if(gameCnt <= pagesize)
return -1;
else
nextItem = (nextItem < 0) ? nextItem + gameCnt : nextItem - gameCnt;
if(strlen(get_title(&gameList[nextItem])) > 0)
return nextItem;
else
return FindMenuItem(nextItem, direction);
}
/**
* Draw the button on screen
*/
@ -256,32 +279,23 @@ void GuiGameCarousel::Draw()
if(!this->IsVisible() || !gameCnt)
return;
int next = listOffset;
for(int i=0; i<pagesize; i++) {
if(next >= 0) {
game[i]->SetImage(ImageBuffer(i));
for(int i=0; i<pagesize; i++)
game[i]->Draw();
next = this->FindMenuItem(next, 1);
} else break;
}
//!Draw tooltip after the Images to have it on top
for(int i=0; i<pagesize; i++) {
if(next >= 0) {
if(Settings.tooltips == TooltipsOn)
game[i]->DrawTooltip();
next = this->FindMenuItem(next, 1);
} else break;
}
gamename->Draw();
if(gameCnt > pagesize) {
if(gameCnt > 6)
{
btnRight->Draw();
btnLeft->Draw();
}
//!Draw tooltip after the Images to have it on top
if (focus && Settings.tooltips == TooltipsOn)
for(int i=0; i<pagesize; i++)
game[i]->DrawTooltip();
this->UpdateEffects();
}
@ -292,136 +306,216 @@ void GuiGameCarousel::Update(GuiTrigger * t)
if(state == STATE_DISABLED || !t || !gameCnt)
return;
if(!(game[0]->GetEffect() || game[0]->GetEffectOnOver())) {
for(int i=0; i<pagesize; i++) {
game[i]->SetEffectGrow();
}
}
if(speed > SPEED_LIMIT)
speed = SPEED_LIMIT;
btnRight->Update(t);
btnLeft->Update(t);
if(btnRight->GetState() == STATE_CLICKED) {
if(Settings.xflip==sysmenu ||Settings.xflip==yes) {
NewOffset(listOffset, 1);
} else {
NewOffset(listOffset, -1);
}
} else if(btnLeft->GetState() == STATE_CLICKED) {
if(Settings.xflip==sysmenu ||Settings.xflip==yes) {
NewOffset(listOffset, -1);
} else {
NewOffset(listOffset, 1);
}
if(game[0]->GetEffect() & EFFECT_GOROUND || game[pagesize-1]->GetEffect() & EFFECT_GOROUND)
{
return; // skip when rotate
}
int next = listOffset;
for(int i=0; i<pagesize; i++) {
if(next >= 0) {
if(game[i]->GetState() == STATE_DISABLED) {
game[i]->SetVisible(true);
game[i]->SetState(STATE_DEFAULT);
game[i]->RemoveToolTip();
}
game[i]->SetEffectOnOver(EFFECT_SCALE, 1, 130);
gameIndex[i] = next;
next = this->FindMenuItem(next, 1);
} else {
game[i]->SetVisible(false);
game[i]->SetState(STATE_DISABLED);
}
if(focus) {
if(i != selectedItem && game[i]->GetState() == STATE_SELECTED)
game[i]->ResetState();
else if(i == selectedItem && game[i]->GetState() == STATE_DEFAULT)
game[selectedItem]->SetState(STATE_SELECTED, t->chan);
}
// find selected + clicked
int selectedItem_old = selectedItem;
selectedItem = -1;
clickedItem = -1;
for(int i=pagesize-1; i>=0; i--)
{
game[i]->Update(t);
if(game[i]->GetState() == STATE_SELECTED) {
if(game[i]->GetState() == STATE_SELECTED)
{
selectedItem = i;
}
if(game[i]->GetState() == STATE_CLICKED) {
if(game[i]->GetState() == STATE_CLICKED)
{
clickedItem = i;
}
}
///Tooltip stuff
struct discHdr *header = &gameList[this->GetSelectedOption()];
ttgame->SetText(get_title(header));
game[selectedItem]->SetToolTip(ttgame, 0, 0);
ttgame->SetPosition(0, 20);
if(selectedItem < PAGESIZE/2+1)
ttgame->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
/// OnOver-Effect + GameText + Tooltop
if(selectedItem_old != selectedItem)
{
if(selectedItem>=0)
{
game[selectedItem]->SetEffect(EFFECT_SCALE, 1, 130);
char *gameTitle = get_title(&gameList[gameIndex[selectedItem]]);
gamename->SetText(gameTitle);
}
else
ttgame->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
gamename->SetText((char*)NULL);
if(selectedItem_old>=0)
{
game[selectedItem_old]->SetEffect(EFFECT_SCALE, -1, 100);
game[selectedItem_old]->RemoveToolTip();
}
}
// navigation
if(focus && gameCnt>6)
{
///GameText
gamename->SetText(get_title(header));
/// navigation
if(!focus || gameCnt <= pagesize || (game[0]->GetEffect() && game[pagesize-1]->GetEffect()))
return; // skip navigation
if (((btnLeft->GetState() == STATE_CLICKED) &&(Settings.xflip!=sysmenu)&&(Settings.xflip!=yes))
||((btnRight->GetState() == STATE_CLICKED) &&((Settings.xflip==sysmenu)||(Settings.xflip==yes)))){
u16 buttons = ButtonsHold();
if(!((buttons & WPAD_BUTTON_A) || (buttons & WPAD_BUTTON_MINUS) || t->Left() ||
(buttons & WPAD_BUTTON_PLUS) || t->Right())) {
int newspeed = 0;
// Left/Right Navigation
if (btnLeft->GetState() == STATE_CLICKED)
{
WPAD_ScanPads();
u16 buttons = 0;
for(int i=0; i<4; i++)
buttons |= WPAD_ButtonsHeld(i);
if(!((buttons & WPAD_BUTTON_A) || (buttons & WPAD_BUTTON_MINUS) || t->Left()))
{
btnLeft->ResetState();
btnRight->ResetState();
speed = SHIFT_SPEED;
return;
}
for(int i=0; i<pagesize; i++) {
game[i]->StopEffect();
if (Settings.xflip==sysmenu || Settings.xflip==yes || Settings.xflip==disk3d)
newspeed = SHIFT_SPEED;
else
newspeed = -SHIFT_SPEED;
}
listOffset = (listOffset+1 < gameCnt) ? listOffset+1 : 0;
firstPic = (firstPic+1 < pagesize) ? firstPic+1 : 0;
game[pagesize-1]->SetPosition(0, RADIUS);
for (int i=0; i<pagesize; i++) {
game[i]->SetEffect(EFFECT_GOROUND, -speed, DEG_OFFSET, RADIUS, 270-(pagesize-2*i-3)*DEG_OFFSET/2, 1, 0, RADIUS);
}
speed+=SPEED_STEP;
}
else if (((btnRight->GetState() == STATE_CLICKED) &&(Settings.xflip!=sysmenu)&&(Settings.xflip!=yes))
||((btnLeft->GetState() == STATE_CLICKED) &&((Settings.xflip==sysmenu)||(Settings.xflip==yes)))){
u16 buttons = ButtonsHold();
if(!((buttons & WPAD_BUTTON_A) || (buttons & WPAD_BUTTON_MINUS) || t->Left() ||
(buttons & WPAD_BUTTON_PLUS) || t->Right())) {
btnLeft->ResetState();
else if(btnRight->GetState() == STATE_CLICKED)
{
WPAD_ScanPads();
u16 buttons = 0;
for(int i=0; i<4; i++)
buttons |= WPAD_ButtonsHeld(i);
if(!((buttons & WPAD_BUTTON_A) || (buttons & WPAD_BUTTON_PLUS) || t->Right()))
{
btnRight->ResetState();
speed = SHIFT_SPEED;
return;
}
for(int i=0; i<pagesize; i++) {
game[i]->StopEffect();
if (Settings.xflip==sysmenu ||Settings.xflip==yes || Settings.xflip==disk3d)
newspeed = -SHIFT_SPEED;
else
newspeed = SHIFT_SPEED;
}
listOffset = (listOffset-1 < 0) ? gameCnt-1 : listOffset-1;
firstPic = (firstPic-1 < 0) ? pagesize-1 : firstPic-1;
if(newspeed)
{
if(speed==0)
speed = newspeed;
else if(speed>0)
{
if((speed+=SPEED_STEP) > SPEED_LIMIT)
speed = SPEED_LIMIT;
}
else
{
if((speed-=SPEED_STEP) < -SPEED_LIMIT)
speed = -SPEED_LIMIT;
}
}
else
speed = 0;
game[0]->SetPosition(0, RADIUS);
for(int i=0; i<pagesize; i++) {
if(speed > 0) // rotate right
{
GuiButton *tmpButton;
GuiTooltip *tmpTT;
listOffset = OFFSETLIMIT(listOffset - 1, gameCnt); // set the new listOffset
// Save right Button + TollTip and destroy right Image + Image-Data
delete coverImg[pagesize-1]; coverImg[pagesize-1] = NULL;game[pagesize-1]->SetImage(NULL);
tmpButton = game[pagesize-1];
tmpTT = titleTT[pagesize-1];
// Move all Page-Entries one step right
for (int i=pagesize-1; i>=1; i--)
{
titleTT[i] = titleTT[i-1];
coverImg[i] = coverImg[i-1];
game[i] = game[i-1];
gameIndex[i] = gameIndex[i-1];
}
// set saved Button & gameIndex to right
gameIndex[0] = listOffset;
titleTT[0] = tmpTT;
titleTT[0] ->SetText(get_title(&gameList[gameIndex[0]]));
coverImg[0] = new GuiImageAsync(GameCarouselLoadCoverImage, &gameList[gameIndex[0]], sizeof(struct discHdr), &noCover);
coverImg[0] ->SetWidescreen(CFG.widescreen);
game[0] = tmpButton;
game[0] ->SetImage(coverImg[0]);
for(int i=0; i<pagesize; i++)
{
game[i]->StopEffect();
game[i]->ResetState();
game[i]->SetEffect(EFFECT_GOROUND, speed, DEG_OFFSET, RADIUS, 270-(pagesize-2*i+1)*DEG_OFFSET/2, 1, 0, RADIUS);
game[i]->UpdateEffects(); // rotate one step for liquid scrolling
// Set Tooltip-Position
switch((i*3)/pagesize)
{
case 0:
game[i]->SetToolTip(titleTT[i], 122/4, -244/4, ALIGN_LEFT, ALIGN_MIDDLE);
break;
case 1:
game[i]->SetToolTip(titleTT[i], 0, -244/4, ALIGN_CENTRE, ALIGN_MIDDLE);
break;
case 2:
game[i]->SetToolTip(titleTT[i], -122/4, -244/4, ALIGN_RIGHT, ALIGN_MIDDLE);
break;
default:
break;
}
}
}
else if(speed < 0) // rotate left
{
GuiButton *tmpButton;
GuiTooltip *tmpTT;
listOffset = OFFSETLIMIT(listOffset + 1, gameCnt); // set the new listOffset
// Save left Button + TollTip and destroy left Image + Image-Data
delete coverImg[0]; coverImg[0] = NULL;game[0]->SetImage(NULL);
tmpButton = game[0];
tmpTT = titleTT[0];
// Move all Page-Entries one step left
for (int i=0; i<(pagesize-1); i++)
{
titleTT[i] = titleTT[i+1];
coverImg[i] = coverImg[i+1];
game[i] = game[i+1];
gameIndex[i] = gameIndex[i+1];
}
// set saved Button & gameIndex to right
int ii = pagesize-1;
gameIndex[ii] = OFFSETLIMIT(listOffset + ii, gameCnt);
titleTT[ii] = tmpTT;
titleTT[ii] ->SetText(get_title(&gameList[gameIndex[0]]));
coverImg[ii] = new GuiImageAsync(GameCarouselLoadCoverImage, &gameList[gameIndex[ii]], sizeof(struct discHdr), &noCover);
coverImg[ii] ->SetWidescreen(CFG.widescreen);
game[ii] = tmpButton;
game[ii] ->SetImage(coverImg[ii]);
for(int i=0; i<pagesize; i++)
{
game[i]->StopEffect();
game[i]->ResetState();
game[i]->SetEffect(EFFECT_GOROUND, speed, DEG_OFFSET, RADIUS, 270-(pagesize-2*i-3)*DEG_OFFSET/2, 1, 0, RADIUS);
game[i]->UpdateEffects(); // rotate one step for liquid scrolling
// Set Tooltip-Position
switch((i*3)/pagesize)
{
case 0:
game[i]->SetToolTip(titleTT[i], 122/4, -244/4, ALIGN_LEFT, ALIGN_MIDDLE);
break;
case 1:
game[i]->SetToolTip(titleTT[i], 0, -244/4, ALIGN_CENTRE, ALIGN_MIDDLE);
break;
case 2:
game[i]->SetToolTip(titleTT[i], -122/4, -244/4, ALIGN_RIGHT, ALIGN_MIDDLE);
break;
default:
break;
}
}
speed+=SPEED_STEP;
}
}
if(updateCB)
updateCB(this);
}

View File

@ -3,7 +3,7 @@
#include "gui.h"
#include "../usbloader/disc.h"
class GuiImageAsync;
class GuiGameCarousel : public GuiElement
{
public:
@ -20,11 +20,11 @@ class GuiGameCarousel : public GuiElement
void Reload(struct discHdr * l, int count);
//GuiText * optionVal[PAGESIZE];
protected:
GuiImageData noCover;
int selectedItem;
int listOffset;
int scrollbaron;
int pagesize;
int firstPic;
int speed;
int clickedItem;
@ -32,10 +32,9 @@ class GuiGameCarousel : public GuiElement
int gameCnt;
int * gameIndex;
GuiButton ** game;
GuiTooltip * ttgame;
GuiTooltip ** titleTT;
GuiImageAsync ** coverImg;
GuiText * gamename;

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
#include "gui.h"
#include "../usbloader/disc.h"
class GuiImageAsync;
class GuiGameGrid : public GuiElement
{
public:
@ -17,32 +17,26 @@ class GuiGameGrid : public GuiElement
void Draw();
void Update(GuiTrigger * t);
int GetOffset();
void Reload(struct discHdr * l, int count);
void Reload(struct discHdr * l, int count, int Rows, int ListOffset);
void ChangeRows(int n);
protected:
GuiImageData noCover;
int selectedItem;
int listOffset;
int scrollbaron;
int pagesize;
int firstPic;
int speed;
int clickedItem;
int rows;
int drawTTs;
int goLeft;
int goRight;
struct discHdr * gameList;
int gameCnt;
int * gameIndex;
int * bob;
GuiButton ** game;
GuiTooltip ** titleTT;
GuiImageAsync ** coverImg;
GuiImage ** coverImg;
GuiImageData ** cover;
GuiText * debugTxt;
GuiButton * btnRight;
GuiButton * btnLeft;
@ -55,9 +49,6 @@ class GuiGameGrid : public GuiElement
GuiImageData * imgLeft;
GuiImageData * imgRight;
GuiTooltip * titleTT;
GuiSound * btnSoundOver;
GuiSound * btnSoundClick;
GuiTrigger * trigA;

View File

@ -34,9 +34,18 @@ GuiImage::GuiImage()
GuiImage::GuiImage(GuiImageData * img)
{
if(img)
{
image = img->GetImage();
width = img->GetWidth();
height = img->GetHeight();
}
else
{
image = NULL;
width = 0;
height = 0;
}
imageangle = 0;
tile = -1;
stripe = 0;
@ -111,13 +120,8 @@ GuiImage::GuiImage(int w, int h, GXColor c)
DCFlushRange(image, len);
}
GuiImage::GuiImage(GuiImage &srcimage)
GuiImage::GuiImage(GuiImage &srcimage) : GuiElement()
{
if((imgType == IMAGE_COLOR || imgType == IMAGE_COPY) && image) {
free(image);
image = NULL;
}
width = srcimage.GetWidth();
height = srcimage.GetHeight();
int len = width * height * 4;
@ -141,13 +145,8 @@ GuiImage::GuiImage(GuiImage &srcimage)
imgType = IMAGE_COPY;
}
GuiImage::GuiImage(GuiImage *srcimage)
GuiImage::GuiImage(GuiImage *srcimage) : GuiElement()
{
if((imgType == IMAGE_COLOR || imgType == IMAGE_COPY) && image) {
free(image);
image = NULL;
}
width = srcimage->GetWidth();
height = srcimage->GetHeight();
int len = width * height * 4;
@ -307,7 +306,7 @@ void GuiImage::SetGrayscale(void)
for(int x = 0; x < width; x++) {
for(int y = 0; y < height; y++) {
offset = (((y >> 2)<<4)*this->GetWidth()) + ((x >> 2)<<6) + (((y%4 << 2) + x%4 ) << 1);
offset = (((y >> 2)<<4)*width) + ((x >> 2)<<6) + (((y%4 << 2) + x%4 ) << 1);
color.r = *(image+offset+1);
color.g = *(image+offset+32);
color.b = *(image+offset+33);
@ -340,6 +339,18 @@ void GuiImage::SetSkew(int XX1, int YY1,int XX2, int YY2,int XX3, int YY3,int XX
xx4 = XX4;
yy4 = YY4;
}
void GuiImage::SetSkew(int *skew)
{
xx1 = *skew++;
yy1 = *skew++;
xx2 = *skew++;
yy2 = *skew++;
xx3 = *skew++;
yy3 = *skew++;
xx4 = *skew++;
yy4 = *skew;
}

View File

@ -0,0 +1,196 @@
/****************************************************************************
* libwiigui
*
* Tantric 2009
*
* gui_imagea_sync.cpp
*
* GUI class definitions
***************************************************************************/
#include "gui.h"
//#include <string.h>
#include <unistd.h>
#include "gui_image_async.h"
static mutex_t debugLock = LWP_MUTEX_NULL;
void debug(int Line, const char* Format, ...)
{
if(debugLock==0) LWP_MutexInit(&debugLock, false);
LWP_MutexLock(debugLock);
FILE *fp = fopen("SD:/debug.txt", "a");
if(fp)
{
char theTime[10];
time_t rawtime = time(0); //this fixes code dump caused by the clock
struct tm * timeinfo = localtime (&rawtime);
strftime(theTime, sizeof(theTime), "%H:%M:%S", timeinfo);
char format[10+strlen(Format)+strlen(theTime)];
sprintf(format, "%s %i - %s\n", theTime, Line, Format);
va_list va;
va_start(va, Format);
vfprintf(fp, format, va);
va_end(va);
fclose(fp);
}
LWP_MutexUnlock(debugLock);
}
//#define DEBUG(format, ...) debug(__LINE__, format, ##__VA_ARGS__)
#define DEBUG(format, ...)
static void *memdup(const void* src, size_t len)
{
void *dst = malloc(len);
if(dst) memcpy(dst, src, len);
return dst;
}
static std::vector<GuiImageAsync *> List;
static u32 ThreadCount = 0;
static lwp_t Thread = LWP_THREAD_NULL;
static mutex_t ListLock = LWP_MUTEX_NULL;
static mutex_t InUseLock = LWP_MUTEX_NULL;
static GuiImageAsync *InUse = NULL;
static bool Quit = false;
static bool CanSleep = true;
void *GuiImageAsyncThread(void *arg)
{
while(!Quit)
{
LWP_MutexLock(ListLock);
if(List.size())
{
LWP_MutexLock(InUseLock);
InUse = List.front();
List.erase(List.begin());
LWP_MutexUnlock(ListLock);
if(InUse)
{
GuiImageData *data = InUse->callback(InUse->arg);
InUse->loadet_imgdata = data;
if(InUse->loadet_imgdata && InUse->loadet_imgdata->GetImage())
{
// InUse->SetImage(InUse->loadet_imgdata); cant use here. There can occur a deadlock
// Sets the image directly without lock. This is not fine, but it prevents a deadlock
InUse->image = InUse->loadet_imgdata->GetImage();
InUse->width = InUse->loadet_imgdata->GetWidth();
InUse->height = InUse->loadet_imgdata->GetHeight();
}
}
InUse = NULL;
LWP_MutexUnlock(InUseLock);
}
else
{
LWP_MutexUnlock(ListLock);
if(!Quit && CanSleep)
LWP_SuspendThread(Thread);
}
CanSleep = true;
}
Quit = false;
return NULL;
}
static u32 GuiImageAsyncThreadInit()
{
if(0 == ThreadCount++)
{
CanSleep = false;
LWP_MutexInit(&ListLock, false);
LWP_MutexInit(&InUseLock, false);
LWP_CreateThread(&Thread, GuiImageAsyncThread, NULL, NULL, 0, 75);
// while(!CanSleep)
// usleep(20);
}
return ThreadCount;
}
static u32 GuiImageAsyncThreadExit()
{
if(--ThreadCount == 0)
{
Quit = true;
LWP_ResumeThread(Thread);
// while(Quit)
// usleep(20);
LWP_JoinThread(Thread, NULL);
LWP_MutexDestroy(ListLock);
LWP_MutexDestroy(InUseLock);
Thread = LWP_THREAD_NULL;
ListLock = LWP_MUTEX_NULL;
InUseLock = LWP_MUTEX_NULL;
}
return ThreadCount;
}
static void GuiImageAsyncThread_AddImage(GuiImageAsync* Image)
{
LWP_MutexLock(ListLock);
List.push_back(Image);
LWP_MutexUnlock(ListLock);
CanSleep = false;
// if(LWP_ThreadIsSuspended(Thread))
LWP_ResumeThread(Thread);
}
static void GuiImageAsyncThread_RemoveImage(GuiImageAsync* Image)
{
LWP_MutexLock(ListLock);
for(std::vector<GuiImageAsync *>::iterator iter=List.begin(); iter != List.end(); iter++)
{
if(*iter == Image)
{
List.erase(iter);
LWP_MutexUnlock(ListLock);
return;
}
}
if(InUse == Image)
{
LWP_MutexLock(InUseLock);
LWP_MutexUnlock(InUseLock);
}
LWP_MutexUnlock(ListLock);
}
/**
* Constructor for the GuiImageAsync class.
*/
GuiImageData *StdImageLoaderCallback(void *arg)
{
return new GuiImageData((char*)arg, NULL);
}
GuiImageAsync::GuiImageAsync(const char *Filename, GuiImageData * PreloadImg) :
GuiImage(PreloadImg),
loadet_imgdata(NULL),
callback(StdImageLoaderCallback),
arg(strdup(Filename))
{
GuiImageAsyncThreadInit();
GuiImageAsyncThread_AddImage(this);
}
GuiImageAsync::GuiImageAsync(ImageLoaderCallback Callback, void *Arg, int ArgLen, GuiImageData * PreloadImg) :
GuiImage(PreloadImg),
loadet_imgdata(NULL),
callback(Callback),
arg(memdup(Arg, ArgLen))
{
DEBUG("Constructor %p", this);
GuiImageAsyncThreadInit();
GuiImageAsyncThread_AddImage(this);
}
GuiImageAsync::~GuiImageAsync()
{
GuiImageAsyncThread_RemoveImage(this);
GuiImageAsyncThreadExit();
DEBUG("Deconstructor %p (loadet_imgdata=%p)", this, loadet_imgdata);
if(loadet_imgdata) delete loadet_imgdata;
if(arg) free(arg);
}

View File

@ -0,0 +1,27 @@
#ifndef _GUIIMAGEASYNC_H_
#define _GUIIMAGEASYNC_H_
#// arg is a pointer created with malloc()
// when the image is destroied then will also the arg deleted with free()
typedef GuiImageData * (*ImageLoaderCallback)(void *arg);
class GuiImageAsync : public GuiImage
{
public:
GuiImageAsync(const char *Filename, GuiImageData * PreloadImg);
GuiImageAsync(ImageLoaderCallback Callback, void *arg, int arglen, GuiImageData * PreloadImg);
~GuiImageAsync();
private:
GuiImageData *loadet_imgdata;
friend void loader(GuiImageAsync *InUse);
friend void Setter(GuiImageAsync *InUse);
friend void *GuiImageAsyncThread(void *arg);
ImageLoaderCallback callback;
void *arg;
};
#endif /*_GUIIMAGEASYNC_H_*/

View File

@ -179,3 +179,23 @@ int GuiImageData::GetHeight()
{
return height;
}
void GuiImageData::SetGrayscale(void)
{
GXColor color;
u32 offset, gray;
for(int x = 0; x < width; x++) {
for(int y = 0; y < height; y++) {
offset = (((y >> 2)<<4)*width) + ((x >> 2)<<6) + (((y%4 << 2) + x%4 ) << 1);
color.r = *(data+offset+1);
color.g = *(data+offset+32);
color.b = *(data+offset+33);
gray = (77*color.r + 150*color.g + 28*color.b)/255;
*(data+offset+1) = gray;
*(data+offset+32) = gray;
*(data+offset+33) = gray;
}
}
}

View File

@ -0,0 +1,172 @@
#include "gui.h"
#include "gui_searchbar.h"
#include "../wpad.h"
#include "../main.h"
#include "../settings/cfg.h"
#include "../usbloader/getentries.h"
extern GuiWindow * mainWindow;
class cSearchButton
{
public:
cSearchButton(wchar_t *Char, GuiImageData *keyImageData, GuiImageData *keyOverImageData, int x, int y, GuiTrigger* trig, GuiSound* sndOver, GuiSound* sndClick)
:
wchar(*Char),
image(keyImageData),
imageOver(keyOverImageData),
text(NULL, 20, (GXColor){0, 0, 0, 0xff}),
button(&image, &imageOver, ALIGN_LEFT, ALIGN_TOP, x, y, trig, sndOver, sndClick, 1)
{
text.SetText(Char);
button.SetLabel(&text);
}
wchar_t wchar;
GuiImage image;
GuiImage imageOver;
GuiText text;
GuiButton button;
private:
};
GuiSearchBar::GuiSearchBar(const wchar_t *SearchChars)
:
inSide(0),
text(NULL, 22, (GXColor) {0, 0, 0, 255}),
buttons(0),
keyImageData(keyboard_key_png),
keyOverImageData(keyboard_key_over_png),
sndOver(button_over_pcm, button_over_pcm_size, SOUND_PCM, Settings.sfxvolume),
sndClick(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume)
{
char imgPath[100];
trig.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
cnt = wcslen(SearchChars);
buttons = new cSearchButton*[cnt];
wchar_t charstr[2] = {0, 0};
int lines = (cnt+9)/10;
int buttonsPerLine = (cnt+lines-1)/lines;
width = 10+buttonsPerLine*42+10;
int x_start=10, x=0, y_start=10+42, y=0;
if(width < 200) { x_start += (200-width)>>1; width=200; }
for(int i=0; i<cnt; i++, x++)
{
if(x >= buttonsPerLine) x=0;
if(x == 0) y++;
charstr[0] = SearchChars[i];
buttons[i] = new cSearchButton(charstr, &keyImageData, &keyOverImageData, x_start+x*42, y_start-42+y*42, &trig, &sndOver, &sndClick);
this->Append(&(buttons[i]->button));
}
height = 10+42+y*42+10;
text.SetText(gameFilter);
text.SetPosition(10, 15);
text.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
text.SetWidescreen(CFG.widescreen);
text.SetMaxWidth(width-(10+2*42+10), GuiText::SCROLL);
this->Append(&text);
snprintf(imgPath, sizeof(imgPath), "%skeyboard_backspace_over.png", CFG.theme_path);
imgBacspaceBtn = new GuiImageData(imgPath, keyboard_backspace_over_png);
BacspaceBtnImg_Over = new GuiImage(imgBacspaceBtn);
BacspaceBtnImg = new GuiImage(BacspaceBtnImg_Over); BacspaceBtnImg->SetGrayscale();
BacspaceBtn = new GuiButton(BacspaceBtnImg,BacspaceBtnImg_Over, ALIGN_RIGHT, ALIGN_TOP, -52, 10, &trig, &sndOver, &sndClick,1);
this->Append(BacspaceBtn);
snprintf(imgPath, sizeof(imgPath), "%skeyboard_clear_over.png", CFG.theme_path);
imgClearBtn = new GuiImageData(imgPath, keyboard_clear_over_png);
ClearBtnImg_Over = new GuiImage(imgClearBtn);
ClearBtnImg = new GuiImage(ClearBtnImg_Over); ClearBtnImg->SetGrayscale();
ClearBtn = new GuiButton(ClearBtnImg,ClearBtnImg_Over, ALIGN_RIGHT, ALIGN_TOP, -10, 10, &trig, &sndOver, &sndClick,1);
this->Append(ClearBtn);
// SetPosition(100,100);
}
GuiSearchBar::~GuiSearchBar()
{
if(buttons)
{
for(int i=0; i<cnt; i++)
delete buttons[i];
delete [] buttons;
}
delete ClearBtn;
delete ClearBtnImg;
delete ClearBtnImg_Over;
delete imgClearBtn;
delete BacspaceBtn;
delete BacspaceBtnImg;
delete BacspaceBtnImg_Over;
delete imgBacspaceBtn;
}
void GuiSearchBar::Draw()
{
Menu_DrawRectangle(this->GetLeft(),this->GetTop(),width, height,(GXColor){0, 0, 0, 0xa0},1);
Menu_DrawRectangle(this->GetLeft()+10,this->GetTop()+15,width-(10+2*42+10), 22,(GXColor){255, 255, 255, 255},1);
GuiWindow::Draw();
}
void GuiSearchBar::Update(GuiTrigger * t)
{
LOCK(this);
if(_elements.size() == 0 || (state == STATE_DISABLED && parentElement))
return;
#ifdef HW_RVL
// cursor
if(t->wpad.ir.valid && state != STATE_DISABLED)
{
if(this->IsInside(t->wpad.ir.x, t->wpad.ir.y))
{
if(inSide == 0)
{
mainWindow->SetState(STATE_DISABLED);
this->SetState(STATE_DEFAULT);
}
inSide |= 1 << t->chan;
}
else if(inSide)
{
inSide &= ~(1 << t->chan);
if(inSide == 0)
mainWindow->SetState(STATE_DEFAULT);
}
}
#endif
GuiWindow::Update(t);
}
wchar_t GuiSearchBar::GetClicked()
{
if(buttons)
{
for(int i=0; i<cnt; i++)
{
if(buttons[i]->button.GetState() == STATE_CLICKED)
{
buttons[i]->button.ResetState();
return buttons[i]->wchar;
}
}
}
if(BacspaceBtn->GetState() == STATE_CLICKED)
return 8;
if(ClearBtn->GetState() == STATE_CLICKED)
return 7;
return 0;
}
/*
private:
SearchButtons *buttons;
}*/

View File

@ -0,0 +1,38 @@
#include "gui.h"
class cSearchButton;
class GuiSearchBar : public GuiWindow
{
public:
GuiSearchBar(const wchar_t *SearchChars);
~GuiSearchBar();
void Draw();
void Update(GuiTrigger * t);
wchar_t GetClicked();
private:
u16 inSide;
GuiText text;
GuiImageData* imgBacspaceBtn;
GuiImage* BacspaceBtnImg;
GuiImage* BacspaceBtnImg_Over;
GuiButton* BacspaceBtn;
GuiImageData* imgClearBtn;
GuiImage* ClearBtnImg;
GuiImage* ClearBtnImg_Over;
GuiButton* ClearBtn;
cSearchButton **buttons;
int cnt;
GuiImageData keyImageData;
GuiImageData keyOverImageData;
GuiTrigger trig;
GuiSound sndOver;
GuiSound sndClick;
};

View File

@ -149,6 +149,23 @@ void GuiText::SetTextf(const char *format, ...)
}
va_end(va);
}
void GuiText::SetText(const wchar_t * t)
{
LOCK(this);
if(text)
delete [] text;
text = NULL;
if(t)
{
int len = wcslen(t);
text = new wchar_t[len+1];
if(text) wcscpy(text, t);
}
scrollPos2 = 0;
scrollDelay = 0;
}
void GuiText::SetPresets(int sz, GXColor c, int w, int wrap, u16 s, int h, int v)
{

View File

@ -18,7 +18,7 @@ static GuiImageData tooltipRight(tooltip_right_png);
/**
* Constructor for the GuiTooltip class.
*/
GuiTooltip::GuiTooltip(const char *t)
GuiTooltip::GuiTooltip(const char *t, int Alpha/*=255*/)
:
leftImage(&tooltipLeft), tileImage(&tooltipTile), rightImage(&tooltipRight)
{
@ -31,6 +31,7 @@ leftImage(&tooltipLeft), tileImage(&tooltipTile), rightImage(&tooltipRight)
tileImage.SetParentAngle(false);
rightImage.SetParentAngle(false);
SetText(t);
SetAlpha(Alpha);
}
/*

View File

@ -16,7 +16,9 @@
#include "libwiigui/gui_gamegrid.h"
#include "libwiigui/gui_gamecarousel.h"
#include "libwiigui/gui_gamebrowser.h"
#include "libwiigui/gui_searchbar.h"
#include "libwiigui/gui_customoptionbrowser.h"
#include "libwiigui/gui_image_async.h"
#include "usbloader/usbstorage.h"
#include "usbloader/wbfs.h"
#include "usbloader/disc.h"
@ -44,7 +46,6 @@
#include "wpad.h"
#include "listfiles.h"
#include "fatmounter.h"
#include "buffer.h"
#include "xml/xml.h"
#include "wad/title.h"
@ -80,8 +81,6 @@ extern FreeTypeGX *fontClock;
extern u8 shutdown;
extern u8 reset;
extern int cntMissFiles;
extern struct discHdr * gameList;
extern u32 gameCnt;
extern s32 gameSelected, gameStart;
extern const u8 data1;
extern u8 boothomebrew;
@ -129,7 +128,7 @@ static void * UpdateGUI (void *arg) {
} else {
if (!ExitRequested) {
mainWindow->Draw();
if (Settings.tooltips == TooltipsOn && THEME.showToolTip != 0 && mainWindow->GetState() != STATE_DISABLED)
if (Settings.tooltips == TooltipsOn && THEME.show_tooltip != 0 && mainWindow->GetState() != STATE_DISABLED)
mainWindow->DrawTooltip();
#ifdef HW_RVL
@ -197,7 +196,6 @@ static void * UpdateGUI (void *arg) {
void InitGUIThreads() {
LWP_CreateThread(&guithread, UpdateGUI, NULL, NULL, 0, 75);
InitProgressThread();
InitBufferThread();
InitNetworkThread();
if (Settings.autonetwork)
@ -247,9 +245,75 @@ void rockout(int f = 0) {
ResumeGui();
}
/****************************************************************************
* LoadCoverImage
***************************************************************************/
GuiImageData *LoadCoverImage(struct discHdr *header, bool Prefere3D, bool noCover)
{
if(!header) return NULL;
GuiImageData *Cover = NULL;
char ID[4];
char IDfull[7];
char Path[100];
bool flag = Prefere3D;
snprintf(ID, sizeof(ID), "%c%c%c", header->id[0], header->id[1], header->id[2]);
snprintf(IDfull, sizeof(IDfull), "%s%c%c%c", ID, header->id[3], header->id[4], header->id[5]);
for(int i=0; i<2; ++i)
{
char *coverPath = flag ? Settings.covers_path : Settings.covers2d_path; flag = !flag;
//Load full id image
snprintf(Path, sizeof(Path), "%s%s.png", coverPath, IDfull);
delete Cover; Cover = new(std::nothrow) GuiImageData(Path, NULL);
//Load short id image
if (!Cover || !Cover->GetImage())
{
snprintf(Path, sizeof(Path), "%s%s.png", coverPath, ID);
delete Cover; Cover = new(std::nothrow) GuiImageData(Path, NULL);
}
if(Cover && Cover->GetImage())
break;
}
//Load no image
if (noCover && (!Cover || !Cover->GetImage()))
{
flag = Prefere3D;
for(int i=0; i<2; ++i)
{
const char *nocoverPath = (flag ? "%snoimage.png" : "%snoimage2d.png"); flag = !flag;
snprintf(Path, sizeof(Path), nocoverPath, CFG.theme_path);
delete Cover; Cover = new(std::nothrow) GuiImageData(Path, (Prefere3D ? nocover_png : nocoverFlat_png));
if (Cover && Cover->GetImage())
break;
}
}
if(Cover && !Cover->GetImage())
{
delete Cover;
Cover = NULL;
}
return Cover;
}
/****************************************************************************
* MenuDiscList
***************************************************************************/
GuiButton *Toolbar[7];
void DiscListWinUpdateCallback(void * e)
{
GuiWindow *w = (GuiWindow *)e;
for(int i=0; i<7; ++i)
{
if(Toolbar[i]->GetState() == STATE_SELECTED)
{
w->Remove(Toolbar[i]);
w->Append(Toolbar[i]); // draw the selected Icon allways on top
break;
}
}
}
int MenuDiscList() {
@ -268,7 +332,7 @@ int MenuDiscList() {
WDVD_GetCoverStatus(&covert);
u32 covertOld=covert;
wchar_t searchChar;
//SCREENSAVER
//WPad_SetIdleTime(300); //needs the time in seconds
int check = 0; //to skip the first cycle when wiimote isn't completely connected
@ -334,28 +398,36 @@ int MenuDiscList() {
snprintf(imgPath, sizeof(imgPath), "%sfavIcon.png", CFG.theme_path);
GuiImageData imgfavIcon(imgPath, favIcon_png);
snprintf(imgPath, sizeof(imgPath), "%sfavIcon_gray.png", CFG.theme_path);
GuiImageData imgfavIcon_gray(imgPath, favIcon_gray_png);
// snprintf(imgPath, sizeof(imgPath), "%sfavIcon_gray.png", CFG.theme_path);
// GuiImageData imgfavIcon_gray(imgPath, favIcon_gray_png);
snprintf(imgPath, sizeof(imgPath), "%ssearchIcon.png", CFG.theme_path);
GuiImageData imgsearchIcon(imgPath, searchIcon_png);
// snprintf(imgPath, sizeof(imgPath), "%ssearchIcon_gray.png", CFG.theme_path);
// GuiImageData imgsearchIcon_gray(imgPath, searchIcon_gray_png);
snprintf(imgPath, sizeof(imgPath), "%sabcIcon.png", CFG.theme_path);
GuiImageData imgabcIcon(imgPath, abcIcon_png);
snprintf(imgPath, sizeof(imgPath), "%sabcIcon_gray.png", CFG.theme_path);
GuiImageData imgabcIcon_gray(imgPath, abcIcon_gray_png);
// snprintf(imgPath, sizeof(imgPath), "%sabcIcon_gray.png", CFG.theme_path);
// GuiImageData imgabcIcon_gray(imgPath, abcIcon_gray_png);
snprintf(imgPath, sizeof(imgPath), "%splayCountIcon.png", CFG.theme_path);
GuiImageData imgplayCountIcon(imgPath, playCountIcon_png);
snprintf(imgPath, sizeof(imgPath), "%splayCountIcon_gray.png", CFG.theme_path);
GuiImageData imgplayCountIcon_gray(imgPath, playCountIcon_gray_png);
// snprintf(imgPath, sizeof(imgPath), "%splayCountIcon_gray.png", CFG.theme_path);
// GuiImageData imgplayCountIcon_gray(imgPath, playCountIcon_gray_png);
snprintf(imgPath, sizeof(imgPath), "%sarrangeGrid.png", CFG.theme_path);
GuiImageData imgarrangeGrid(imgPath, arrangeGrid_png);
snprintf(imgPath, sizeof(imgPath), "%sarrangeGrid_gray.png", CFG.theme_path);
GuiImageData imgarrangeGrid_gray(imgPath, arrangeGrid_gray_png);
// snprintf(imgPath, sizeof(imgPath), "%sarrangeGrid_gray.png", CFG.theme_path);
// GuiImageData imgarrangeGrid_gray(imgPath, arrangeGrid_gray_png);
snprintf(imgPath, sizeof(imgPath), "%sarrangeList.png", CFG.theme_path);
GuiImageData imgarrangeList(imgPath, arrangeList_png);
snprintf(imgPath, sizeof(imgPath), "%sarrangeList_gray.png", CFG.theme_path);
GuiImageData imgarrangeList_gray(imgPath, arrangeList_gray_png);
// snprintf(imgPath, sizeof(imgPath), "%sarrangeList_gray.png", CFG.theme_path);
// GuiImageData imgarrangeList_gray(imgPath, arrangeList_gray_png);
snprintf(imgPath, sizeof(imgPath), "%sarrangeCarousel.png", CFG.theme_path);
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), "%sarrangeCarousel_gray.png", CFG.theme_path);
// GuiImageData imgarrangeCarousel_gray(imgPath, arrangeCarousel_gray_png);
snprintf(imgPath, sizeof(imgPath), "%ssearchBar.png", CFG.theme_path);
GuiImageData imgsearchBar(imgPath, searchBar_png);
snprintf(imgPath, sizeof(imgPath), "%sbrowser.png", CFG.theme_path);
GuiImageData homebrewImgData(imgPath, browser_png);
snprintf(imgPath, sizeof(imgPath), "%sbrowser_over.png", CFG.theme_path);
@ -374,17 +446,17 @@ int MenuDiscList() {
char spaceinfo[30];
sprintf(spaceinfo,"%.2fGB %s %.2fGB %s",freespace,tr("of"),(freespace+used),tr("free"));
GuiText usedSpaceTxt(spaceinfo, 18, (GXColor) {THEME.info_r, THEME.info_g, THEME.info_b, 255});
usedSpaceTxt.SetAlignment(THEME.hddInfoAlign, ALIGN_TOP);
usedSpaceTxt.SetPosition(THEME.hddInfo_x, THEME.hddInfo_y);
GuiText usedSpaceTxt(spaceinfo, 18, THEME.info);
usedSpaceTxt.SetAlignment(THEME.hddinfo_align, ALIGN_TOP);
usedSpaceTxt.SetPosition(THEME.hddinfo_x, THEME.hddinfo_y);
char GamesCnt[15];
sprintf(GamesCnt,"%s: %i",tr("Games"), gameCnt);
GuiText gamecntTxt(GamesCnt, 18, (GXColor) {THEME.info_r, THEME.info_g, THEME.info_b, 255});
GuiText gamecntTxt(GamesCnt, 18, THEME.info);
GuiButton gamecntBtn(100,18);
gamecntBtn.SetAlignment(THEME.gameCntAlign, ALIGN_TOP);
gamecntBtn.SetPosition(THEME.gameCnt_x,THEME.gameCnt_y);
gamecntBtn.SetAlignment(THEME.gamecount_align, ALIGN_TOP);
gamecntBtn.SetPosition(THEME.gamecount_x,THEME.gamecount_y);
gamecntBtn.SetLabel(&gamecntTxt);
gamecntBtn.SetEffectGrow();
gamecntBtn.SetTrigger(&trigA);
@ -460,21 +532,35 @@ int MenuDiscList() {
favoriteBtnTT.SetWidescreen(CFG.widescreen);
favoriteBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage favoriteBtnImg(&imgfavIcon);
GuiImage favoriteBtnImg_g(&imgfavIcon_gray);
favoriteBtnImg.SetWidescreen(CFG.widescreen);
GuiImage favoriteBtnImg_g(favoriteBtnImg);favoriteBtnImg_g.SetGrayscale();
// GuiImage favoriteBtnImg_g(&imgfavIcon_gray);
favoriteBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton favoriteBtn(&favoriteBtnImg_g,&favoriteBtnImg_g, 2, 3, THEME.favorite_x, THEME.favorite_y, &trigA, &btnSoundOver, &btnClick,1, &favoriteBtnTT, -15, 52, 0, 3);
GuiButton favoriteBtn(&favoriteBtnImg_g,&favoriteBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_favorite_x, THEME.gamelist_favorite_y, &trigA, &btnSoundOver, &btnClick,1, &favoriteBtnTT, -15, 52, 0, 3);
favoriteBtn.SetAlpha(180);
GuiTooltip searchBtnTT(tr("Set Search-Filter"));
if (Settings.wsprompt == yes)
searchBtnTT.SetWidescreen(CFG.widescreen);
searchBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage searchBtnImg(&imgsearchIcon);
searchBtnImg.SetWidescreen(CFG.widescreen);
GuiImage searchBtnImg_g(searchBtnImg); searchBtnImg_g.SetGrayscale();
// GuiImage searchBtnImg_g(&imgsearchIcon_gray);
searchBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton searchBtn(&searchBtnImg_g,&searchBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_search_x, THEME.gamelist_search_y, &trigA, &btnSoundOver, &btnClick,1, &searchBtnTT, -15, 52, 0, 3);
searchBtn.SetAlpha(180);
GuiTooltip abcBtnTT(tr("Sort alphabetically"));
if (Settings.wsprompt == yes)
abcBtnTT.SetWidescreen(CFG.widescreen);
abcBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage abcBtnImg(&imgabcIcon);
abcBtnImg.SetWidescreen(CFG.widescreen);
GuiImage abcBtnImg_g(&imgabcIcon_gray);
GuiImage abcBtnImg_g(abcBtnImg); abcBtnImg_g.SetGrayscale();
// GuiImage abcBtnImg_g(&imgabcIcon_gray);
abcBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton abcBtn(&abcBtnImg_g,&abcBtnImg_g, 2, 3, THEME.abc_x, THEME.abc_y, &trigA, &btnSoundOver, &btnClick,1,&abcBtnTT, -15, 52, 0, 3);
GuiButton abcBtn(&abcBtnImg_g,&abcBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_abc_x, THEME.gamelist_abc_y, &trigA, &btnSoundOver, &btnClick,1,&abcBtnTT, -15, 52, 0, 3);
abcBtn.SetAlpha(180);
GuiTooltip countBtnTT(tr("Sort order by most played"));
@ -483,9 +569,10 @@ int MenuDiscList() {
countBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage countBtnImg(&imgplayCountIcon);
countBtnImg.SetWidescreen(CFG.widescreen);
GuiImage countBtnImg_g(&imgplayCountIcon_gray);
GuiImage countBtnImg_g(countBtnImg); countBtnImg_g.SetGrayscale();
// GuiImage countBtnImg_g(&imgplayCountIcon_gray);
countBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton countBtn(&countBtnImg_g,&countBtnImg_g, 2, 3, THEME.count_x, THEME.count_y, &trigA, &btnSoundOver, &btnClick,1, &countBtnTT, -15, 52, 0, 3);
GuiButton countBtn(&countBtnImg_g,&countBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_count_x, THEME.gamelist_count_y, &trigA, &btnSoundOver, &btnClick,1, &countBtnTT, -15, 52, 0, 3);
countBtn.SetAlpha(180);
GuiTooltip listBtnTT(tr("Display as a list"));
@ -494,9 +581,10 @@ int MenuDiscList() {
listBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage listBtnImg(&imgarrangeList);
listBtnImg.SetWidescreen(CFG.widescreen);
GuiImage listBtnImg_g(&imgarrangeList_gray);
GuiImage listBtnImg_g(listBtnImg); listBtnImg_g.SetGrayscale();
// GuiImage listBtnImg_g(&imgarrangeList_gray);
listBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton listBtn(&listBtnImg_g,&listBtnImg_g, 2, 3, THEME.list_x, THEME.list_y, &trigA, &btnSoundOver, &btnClick,1, &listBtnTT, 15, 52, 1, 3);
GuiButton listBtn(&listBtnImg_g,&listBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_list_x, THEME.gamelist_list_y, &trigA, &btnSoundOver, &btnClick,1, &listBtnTT, 15, 52, 1, 3);
listBtn.SetAlpha(180);
GuiTooltip gridBtnTT(tr("Display as a grid"));
@ -505,9 +593,10 @@ int MenuDiscList() {
gridBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage gridBtnImg(&imgarrangeGrid);
gridBtnImg.SetWidescreen(CFG.widescreen);
GuiImage gridBtnImg_g(&imgarrangeGrid_gray);
GuiImage gridBtnImg_g(gridBtnImg); gridBtnImg_g.SetGrayscale();
// GuiImage gridBtnImg_g(&imgarrangeGrid_gray);
gridBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton gridBtn(&gridBtnImg_g,&gridBtnImg_g, 2, 3, THEME.grid_x, THEME.grid_y, &trigA, &btnSoundOver, &btnClick,1, &gridBtnTT, 15, 52, 1, 3);
GuiButton gridBtn(&gridBtnImg_g,&gridBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_grid_x, THEME.gamelist_grid_y, &trigA, &btnSoundOver, &btnClick,1, &gridBtnTT, 15, 52, 1, 3);
gridBtn.SetAlpha(180);
GuiTooltip carouselBtnTT(tr("Display as a carousel"));
@ -516,9 +605,10 @@ int MenuDiscList() {
carouselBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiImage carouselBtnImg(&imgarrangeCarousel);
carouselBtnImg.SetWidescreen(CFG.widescreen);
GuiImage carouselBtnImg_g(&imgarrangeCarousel_gray);
GuiImage carouselBtnImg_g(carouselBtnImg); carouselBtnImg_g.SetGrayscale();
// GuiImage carouselBtnImg_g(&imgarrangeCarousel_gray);
carouselBtnImg_g.SetWidescreen(CFG.widescreen);
GuiButton carouselBtn(&carouselBtnImg_g,&carouselBtnImg_g, 2, 3, THEME.carousel_x, THEME.carousel_y, &trigA, &btnSoundOver, &btnClick,1, &carouselBtnTT, 15, 52, 1, 3);
GuiButton carouselBtn(&carouselBtnImg_g,&carouselBtnImg_g, ALIGN_LEFT, ALIGN_TOP, THEME.gamelist_carousel_x, THEME.gamelist_carousel_y, &trigA, &btnSoundOver, &btnClick,1, &carouselBtnTT, 15, 52, 1, 3);
carouselBtn.SetAlpha(180);
GuiTooltip homebrewBtnTT(tr("Homebrew Launcher"));
@ -529,13 +619,24 @@ int MenuDiscList() {
GuiImage homebrewImgOver(&homebrewImgDataOver);
homebrewImg.SetWidescreen(CFG.widescreen);
homebrewImgOver.SetWidescreen(CFG.widescreen);
GuiButton homebrewBtn(&homebrewImg,&homebrewImgOver, 0, 3, THEME.homebrew_x, THEME.homebrew_y, &trigA, &btnSoundOver, &btnClick,1,&homebrewBtnTT,15,-30,1,5);
GuiButton homebrewBtn(&homebrewImg,&homebrewImgOver, ALIGN_LEFT, ALIGN_TOP, THEME.homebrew_x, THEME.homebrew_y, &trigA, &btnSoundOver, &btnClick,1,&homebrewBtnTT,15,-30,1,5);
if (Settings.fave) {
favoriteBtn.SetImage(&favoriteBtnImg);
favoriteBtn.SetImageOver(&favoriteBtnImg);
favoriteBtn.SetAlpha(255);
}
static bool show_searchwindow = false;
if(gameFilter && *gameFilter)
{
if(show_searchwindow && gameCnt==1)
show_searchwindow = false;
if(!show_searchwindow)
searchBtn.SetEffect(EFFECT_PULSE, 10, 105);
searchBtn.SetImage(&searchBtnImg);
searchBtn.SetImageOver(&searchBtnImg);
searchBtn.SetAlpha(255);
}
if (Settings.sort==all) {
abcBtn.SetImage(&abcBtnImg);
abcBtn.SetImageOver(&abcBtnImg);
@ -559,37 +660,29 @@ int MenuDiscList() {
carouselBtn.SetAlpha(255);
}
if (Settings.gameDisplay==list) {
if (CFG.widescreen) {
favoriteBtn.SetPosition(THEME.favorite_x, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x, THEME.abc_y);
countBtn.SetPosition(THEME.count_x, THEME.count_y);
listBtn.SetPosition(THEME.list_x, THEME.list_y);
gridBtn.SetPosition(THEME.grid_x, THEME.grid_y);
carouselBtn.SetPosition(THEME.carousel_x, THEME.carousel_y);
} else {
favoriteBtn.SetPosition(THEME.favorite_x-20, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-12, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-4, THEME.count_y);
listBtn.SetPosition(THEME.list_x+4, THEME.list_y);
gridBtn.SetPosition(THEME.grid_x+12, THEME.grid_y);
carouselBtn.SetPosition(THEME.carousel_x+20, THEME.carousel_y);
}
} else {
if (CFG.widescreen) {
favoriteBtn.SetPosition(THEME.favorite_x-THEME.sortBarOffset, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-THEME.sortBarOffset, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-THEME.sortBarOffset, THEME.count_y);
listBtn.SetPosition(THEME.list_x-THEME.sortBarOffset, THEME.list_y);
gridBtn.SetPosition(THEME.grid_x-THEME.sortBarOffset, THEME.grid_y);
carouselBtn.SetPosition(THEME.carousel_x-THEME.sortBarOffset, THEME.carousel_y);
} else {
favoriteBtn.SetPosition(THEME.favorite_x-20-THEME.sortBarOffset, THEME.favorite_y);
abcBtn.SetPosition(THEME.abc_x-12-THEME.sortBarOffset, THEME.abc_y);
countBtn.SetPosition(THEME.count_x-4-THEME.sortBarOffset, THEME.count_y);
listBtn.SetPosition(THEME.list_x+4-THEME.sortBarOffset, THEME.list_y);
gridBtn.SetPosition(THEME.grid_x+12-THEME.sortBarOffset, THEME.grid_y);
carouselBtn.SetPosition(THEME.carousel_x+20-THEME.sortBarOffset, THEME.carousel_y);
}
favoriteBtn.SetPosition(THEME.gamelist_favorite_x, THEME.gamelist_favorite_y);
searchBtn.SetPosition(THEME.gamelist_search_x, THEME.gamelist_search_y);
abcBtn.SetPosition(THEME.gamelist_abc_x, THEME.gamelist_abc_y);
countBtn.SetPosition(THEME.gamelist_count_x, THEME.gamelist_count_y);
listBtn.SetPosition(THEME.gamelist_list_x, THEME.gamelist_list_y);
gridBtn.SetPosition(THEME.gamelist_grid_x, THEME.gamelist_grid_y);
carouselBtn.SetPosition(THEME.gamelist_carousel_x, THEME.gamelist_carousel_y);
} else if(Settings.gameDisplay==grid) {
favoriteBtn.SetPosition(THEME.gamegrid_favorite_x, THEME.gamegrid_favorite_y);
searchBtn.SetPosition(THEME.gamegrid_search_x, THEME.gamegrid_search_y);
abcBtn.SetPosition(THEME.gamegrid_abc_x, THEME.gamegrid_abc_y);
countBtn.SetPosition(THEME.gamegrid_count_x, THEME.gamegrid_count_y);
listBtn.SetPosition(THEME.gamegrid_list_x, THEME.gamegrid_list_y);
gridBtn.SetPosition(THEME.gamegrid_grid_x, THEME.gamegrid_grid_y);
carouselBtn.SetPosition(THEME.gamegrid_carousel_x, THEME.gamegrid_carousel_y);
} else if(Settings.gameDisplay==carousel) {
favoriteBtn.SetPosition(THEME.gamecarousel_favorite_x, THEME.gamecarousel_favorite_y);
searchBtn.SetPosition(THEME.gamecarousel_search_x, THEME.gamecarousel_favorite_y);
abcBtn.SetPosition(THEME.gamecarousel_abc_x, THEME.gamecarousel_abc_y);
countBtn.SetPosition(THEME.gamecarousel_count_x, THEME.gamecarousel_count_y);
listBtn.SetPosition(THEME.gamecarousel_list_x, THEME.gamecarousel_list_y);
gridBtn.SetPosition(THEME.gamecarousel_grid_x, THEME.gamecarousel_grid_y);
carouselBtn.SetPosition(THEME.gamecarousel_carousel_x, THEME.gamecarousel_carousel_y);
}
@ -600,7 +693,7 @@ int MenuDiscList() {
DownloadBtnTT.SetAlpha(THEME.tooltipAlpha);
GuiButton DownloadBtn(0,0);
DownloadBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
DownloadBtn.SetPosition(THEME.cover_x,THEME.cover_y);
DownloadBtn.SetPosition(THEME.covers_x,THEME.covers_y);
GuiTooltip IDBtnTT(tr("Click to change game ID"));
if (Settings.wsprompt == yes)
@ -631,8 +724,8 @@ int MenuDiscList() {
GuiGameGrid * gameGrid = NULL;
GuiGameCarousel * gameCarousel = NULL;
if (Settings.gameDisplay==list) {
gameBrowser = new GuiGameBrowser(THEME.selection_w, THEME.selection_h, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
gameBrowser->SetPosition(THEME.selection_x, THEME.selection_y);
gameBrowser = new GuiGameBrowser(THEME.gamelist_w, THEME.gamelist_h, gameList, gameCnt, CFG.theme_path, bg_options_png, startat, offset);
gameBrowser->SetPosition(THEME.gamelist_x, THEME.gamelist_y);
gameBrowser->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
} else if (Settings.gameDisplay==grid) {
gameGrid = new GuiGameGrid(THEME.gamegrid_w,THEME.gamegrid_h, gameList, gameCnt, CFG.theme_path, bg_options_png, 0, 0);
@ -645,22 +738,22 @@ int MenuDiscList() {
gameCarousel->SetAlignment(ALIGN_LEFT, ALIGN_CENTRE);
}
GuiText clockTimeBack("88:88", 40, (GXColor) {THEME.clock_r, THEME.clock_g, THEME.clock_b, 40});
clockTimeBack.SetAlignment(THEME.clockAlign, ALIGN_TOP);
GuiText clockTimeBack("88:88", 40, (GXColor) {THEME.clock.r, THEME.clock.g, THEME.clock.b, THEME.clock.a/6});
clockTimeBack.SetAlignment(THEME.clock_align, ALIGN_TOP);
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y);
clockTimeBack.SetFont(fontClock);
GuiText clockTime(theTime, 40, (GXColor) {THEME.clock_r, THEME.clock_g, THEME.clock_b, 240});
clockTime.SetAlignment(THEME.clockAlign, ALIGN_TOP);
GuiText clockTime(theTime, 40, THEME.clock);
clockTime.SetAlignment(THEME.clock_align, ALIGN_TOP);
clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
clockTime.SetFont(fontClock);
HaltGui();
GuiWindow w(screenwidth, screenheight);
if (THEME.showHDD == -1 || THEME.showHDD == 1) { //force show hdd info
if (THEME.show_hddinfo == -1 || THEME.show_hddinfo == 1) { //force show hdd info
w.Append(&usedSpaceTxt);
}
if (THEME.showGameCnt == -1 || THEME.showGameCnt == 1) { //force show game cnt info
if (THEME.show_gamecount == -1 || THEME.show_gamecount == 1) { //force show game cnt info
w.Append(&gamecntBtn);
}
w.Append(&sdcardBtn);
@ -672,12 +765,25 @@ int MenuDiscList() {
w.Append(&settingsBtn);
w.Append(&DownloadBtn);
w.Append(&idBtn);
// Begin Toolbar
w.Append(&favoriteBtn);
Toolbar[0] = &favoriteBtn;
w.Append(&searchBtn);
Toolbar[1] = &searchBtn;
w.Append(&abcBtn);
Toolbar[2] = &abcBtn;
w.Append(&countBtn);
Toolbar[3] = &countBtn;
w.Append(&listBtn);
Toolbar[4] = &listBtn;
w.Append(&gridBtn);
Toolbar[5] = &gridBtn;
w.Append(&carouselBtn);
Toolbar[6] = &carouselBtn;
w.SetUpdateCallback(DiscListWinUpdateCallback);
// End Toolbar
if (Settings.godmode == 1)
w.Append(&homebrewBtn);
@ -697,6 +803,13 @@ int MenuDiscList() {
}
mainWindow->Append(&w);
GuiSearchBar *searchBar=NULL;
if(show_searchwindow) {
searchBar = new GuiSearchBar(gameFilterNextList);
if(searchBar)
mainWindow->Append(searchBar);
}
ResumeGui();
while (menu == MENU_NONE) {
@ -973,6 +1086,62 @@ int MenuDiscList() {
}
else if (searchBtn.GetState() == STATE_CLICKED) {
show_searchwindow=!show_searchwindow;
HaltGui();
if(searchBar)
{
mainWindow->Remove(searchBar);
delete searchBar;
searchBar = NULL;
}
if(show_searchwindow)
{
if(gameFilter && *gameFilter)
{
searchBtn.StopEffect();
searchBtn.SetEffectGrow();
}
searchBar = new GuiSearchBar(gameFilterNextList);
if(searchBar)
mainWindow->Append(searchBar);
}
else
{
if(gameFilter && *gameFilter)
searchBtn.SetEffect(EFFECT_PULSE, 10, 105);
}
searchBtn.ResetState();
ResumeGui();
}
else if (searchBar && (searchChar=searchBar->GetClicked())) {
if(searchChar > 27)
{
int len = gameFilter ? wcslen(gameFilter) : 0;
wchar_t newFilter[len+2];
if(gameFilter)
wcscpy(newFilter, gameFilter);
newFilter[len] = searchChar;
newFilter[len+1] = 0;
__Menu_GetEntries(0, newFilter);
}
else if(searchChar == 7) // Clear
{
__Menu_GetEntries(0, L"");
}
else if(searchChar == 8) // Backspace
{
__Menu_GetEntries(0, gameFilterPrev);
}
menu = MENU_DISCLIST;
break;
}
else if (abcBtn.GetState() == STATE_CLICKED) {
if (Settings.sort != all) {
Settings.sort=all;
@ -1097,7 +1266,7 @@ int MenuDiscList() {
selectedold = selectimg;//update displayed cover, game ID, and region if the selected game changes
struct discHdr *header = &gameList[selectimg];
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
snprintf (IDfull,sizeof(IDfull),"%s%c%c%c", ID, header->id[3], header->id[4], header->id[5]);
w.Remove(&DownloadBtn);
if (GameIDTxt) {
@ -1144,18 +1313,7 @@ int MenuDiscList() {
cover = NULL;
}
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, IDfull);
cover = new GuiImageData(imgPath,0); //load short id
if (!cover->GetImage()) { //if could not load the short id image
delete cover;
snprintf(imgPath, sizeof(imgPath), "%s%s.png", Settings.covers_path, ID);
cover = new GuiImageData(imgPath, 0); //load full id image
if (!cover->GetImage()) {
delete cover;
snprintf(imgPath, sizeof(imgPath), "%snoimage.png", CFG.theme_path);
cover = new GuiImageData(imgPath, nocover_png); //load no image
}
}
cover = LoadCoverImage(header);
if (coverImg) {
delete coverImg;
@ -1168,7 +1326,7 @@ int MenuDiscList() {
w.Append(&DownloadBtn);
if ((Settings.sinfo == GameID) || (Settings.sinfo == Both)) {
GameIDTxt = new GuiText(IDfull, 22, (GXColor) {THEME.info_r, THEME.info_g, THEME.info_b, 255});
GameIDTxt = new GuiText(IDfull, 22, THEME.info);
GameIDTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
//GameIDTxt->SetPosition(THEME.id_x,THEME.id_y);
idBtn.SetEffect(EFFECT_FADE, 20);
@ -1177,7 +1335,7 @@ int MenuDiscList() {
}
if ((Settings.sinfo == GameRegion) || (Settings.sinfo == Both)) {
GameRegionTxt = new GuiText(gameregion, 22, (GXColor) {THEME.info_r, THEME.info_g, THEME.info_b, 255});
GameRegionTxt = new GuiText(gameregion, 22, THEME.info);
GameRegionTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
GameRegionTxt->SetPosition(THEME.region_x, THEME.region_y);
GameRegionTxt->SetEffect(EFFECT_FADE, 20);
@ -1204,6 +1362,12 @@ int MenuDiscList() {
}
if ((gameSelected >= 0) && (gameSelected < (s32)gameCnt)) {
if(searchBar)
{
HaltGui();
mainWindow->Remove(searchBar);
ResumeGui();
}
rockout();
struct discHdr *header = &gameList[gameSelected];
WBFS_GameSize(header->id, &size);
@ -1387,6 +1551,12 @@ int MenuDiscList() {
}
if(searchBar)
{
HaltGui();
mainWindow->Append(searchBar);
ResumeGui();
}
}
// to skip the first call of windowScreensaver at startup when wiimote is not connected
if (IsWpadConnected()) {
@ -1439,6 +1609,8 @@ int MenuDiscList() {
HaltGui();
mainWindow->RemoveAll();
mainWindow->Append(bgImg);
delete searchBar;
searchBar = NULL;
delete gameBrowser;
gameBrowser = NULL;
delete gameGrid;

View File

@ -30,5 +30,7 @@ enum {
MENU_HOMEBREWBROWSE,
BOOTHOMEBREW
};
class GuiImageData;
GuiImageData *LoadCoverImage(struct discHdr *header, bool Prefere3D=true, bool noCover=true);
#endif

View File

@ -163,7 +163,7 @@ int DiscBrowse(struct discHdr * header) {
settingsbackgroundbtn.SetPosition(0, 0);
settingsbackgroundbtn.SetImage(&settingsbackground);
GuiText cancelBtnTxt(tr("Back"), 22, (GXColor) { THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText cancelBtnTxt(tr("Back"), 22, THEME.prompttext);
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {

View File

@ -155,11 +155,11 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
progressbarImg.SetPosition(25, 40);
GuiText titleTxt(title, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60);
GuiText msg1Txt(msg1, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255} );
GuiText msg1Txt(msg1, 22, THEME.prompttext );
msg1Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
if (msg2)
msg1Txt.SetPosition(0,120);
@ -167,28 +167,28 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
msg1Txt.SetPosition(0,100);
msg1Txt.SetMaxWidth(430, GuiText::DOTTED);
GuiText msg2Txt(msg2, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255} );
GuiText msg2Txt(msg2, 22, THEME.prompttext );
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msg2Txt.SetPosition(0,125);
msg2Txt.SetMaxWidth(430, GuiText::DOTTED);
GuiText prsTxt("%", 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText prsTxt("%", 22, THEME.prompttext);
prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
prsTxt.SetPosition(-188,40);
GuiText timeTxt(NULL, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText timeTxt(NULL, 22, THEME.prompttext);
timeTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
timeTxt.SetPosition(280,-50);
GuiText sizeTxt(NULL, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText sizeTxt(NULL, 22, THEME.prompttext);
sizeTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
sizeTxt.SetPosition(50, -50);
GuiText speedTxt(NULL, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText speedTxt(NULL, 22, THEME.prompttext);
speedTxt.SetAlignment(ALIGN_LEFT, ALIGN_BOTTOM);
speedTxt.SetPosition(50, -74);
GuiText prTxt(NULL, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText prTxt(NULL, 26, THEME.prompttext);
prTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
prTxt.SetPosition(200, 40);

View File

@ -85,7 +85,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) {
GuiTrigger trigB;
trigB.SetSimpleTrigger(-1, WPAD_BUTTON_B | WPAD_CLASSIC_BUTTON_B, PAD_BUTTON_B);
GuiText okBtnTxt(tr("OK"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText okBtnTxt(tr("OK"), 22, THEME.prompttext);
GuiImage okBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
okBtnTxt.SetWidescreen(CFG.widescreen);
@ -93,7 +93,7 @@ int OnScreenKeyboard(char * var, u32 maxlen, int min) {
}
GuiButton okBtn(&okBtnImg,&okBtnImg, 0, 4, 5, 15, &trigA, &btnSoundOver, &btnClick,1);
okBtn.SetLabel(&okBtnTxt);
GuiText cancelBtnTxt(tr("Cancel"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText cancelBtnTxt(tr("Cancel"), 22, THEME.prompttext);
GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
cancelBtnTxt.SetWidescreen(CFG.widescreen);
@ -458,15 +458,15 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(title, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,55);
GuiText msgTxt(msg, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 22, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msgTxt.SetPosition(0,-40);
msgTxt.SetMaxWidth(430);
GuiText btn1Txt(btn1Label, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(btn1Label, 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -477,7 +477,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
btn1.SetLabel(&btn1Txt);
btn1.SetState(STATE_SELECTED);
GuiText btn2Txt(btn2Label, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn2Txt(btn2Label, 22, THEME.prompttext);
GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn2Txt.SetWidescreen(CFG.widescreen);
@ -488,7 +488,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
if (!btn3Label && !btn4Label)
btn2.SetTrigger(&trigB);
GuiText btn3Txt(btn3Label, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn3Txt(btn3Label, 22, THEME.prompttext);
GuiImage btn3Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn3Txt.SetWidescreen(CFG.widescreen);
@ -499,7 +499,7 @@ WindowPrompt(const char *title, const char *msg, const char *btn1Label,
if (!btn4Label)
btn3.SetTrigger(&trigB);
GuiText btn4Txt(btn4Label, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn4Txt(btn4Label, 22, THEME.prompttext);
GuiImage btn4Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn4Txt.SetWidescreen(CFG.widescreen);
@ -1033,7 +1033,7 @@ int GameWindowPrompt() {
GuiTooltip nameBtnTT(tr("Rename Game on WBFS"));
if (Settings.wsprompt == yes)
nameBtnTT.SetWidescreen(CFG.widescreen);
GuiText nameTxt("", 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText nameTxt("", 22, THEME.prompttext);
if (Settings.wsprompt == yes)
nameTxt.SetWidescreen(CFG.widescreen);
nameTxt.SetMaxWidth(350, GuiText::SCROLL);
@ -1051,7 +1051,7 @@ int GameWindowPrompt() {
nameBtn.SetEffectGrow();
}
GuiText sizeTxt(NULL, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255}); //TODO: get the size here
GuiText sizeTxt(NULL, 22, THEME.prompttext); //TODO: get the size here
sizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
sizeTxt.SetPosition(-60,70);
@ -1067,7 +1067,7 @@ int GameWindowPrompt() {
diskImg2.SetAngle(angle);
diskImg2.SetBeta(180);
GuiText playcntTxt(NULL, 18, (GXColor) {THEME.info_r, THEME.info_g, THEME.info_b, 255});
GuiText playcntTxt(NULL, 18, THEME.info);
playcntTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
playcntTxt.SetPosition(-115,45);
@ -1081,7 +1081,7 @@ int GameWindowPrompt() {
btn1.SetTrigger(&trigA);
btn1.SetState(STATE_SELECTED);
GuiText btn2Txt(tr("Back"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn2Txt(tr("Back"), 22, THEME.prompttext);
GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn2Txt.SetWidescreen(CFG.widescreen);
@ -1099,7 +1099,7 @@ int GameWindowPrompt() {
btn2.SetLabel(&btn2Txt);
btn2.SetTrigger(&trigB);
GuiText btn3Txt(tr("Settings"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn3Txt(tr("Settings"), 22, THEME.prompttext);
GuiImage btn3Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn3Txt.SetWidescreen(CFG.widescreen);
@ -1182,6 +1182,8 @@ int GameWindowPrompt() {
if (diskCover)
delete diskCover;
snprintf(imgPath,sizeof(imgPath),"%s%s.png", Settings.disc_path, IDFull); //changed to current full id
diskCover = new GuiImageData(imgPath,0);
@ -1484,15 +1486,15 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(title, 26, (GXColor) { THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60);
GuiText msgTxt(msg, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 22, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msgTxt.SetPosition(0,-40);
msgTxt.SetMaxWidth(430);
GuiText btn1Txt(btn1Label, 22, (GXColor) { THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(btn1Label, 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -1512,7 +1514,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
btn1.SetTrigger(&trigB);
btn1.SetState(STATE_SELECTED);
GuiText btn2Txt(btn2Label, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn2Txt(btn2Label, 22, THEME.prompttext);
GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn2Txt.SetWidescreen(CFG.widescreen);
@ -1533,7 +1535,7 @@ DiscWait(const char *title, const char *msg, const char *btn1Label, const char *
}
}
GuiText timerTxt(NULL, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText timerTxt(NULL, 26, THEME.prompttext);
timerTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
timerTxt.SetPosition(0,160);
@ -1621,7 +1623,7 @@ FormatingPartition(const char *title, partitionEntry *entry) {
dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(title, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60);
@ -1676,12 +1678,12 @@ bool SearchMissingImages(int choice2) {
dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(tr("Checking existing artwork"), 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(tr("Checking existing artwork"), 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60);
char msg[20] = " ";
GuiText msgTxt(msg, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 22, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msgTxt.SetPosition(0,-40);
@ -1711,15 +1713,17 @@ bool SearchMissingImages(int choice2) {
struct discHdr* header = &gameList[i];
if (choice2 != 3) {
char *covers_path = choice2==1 ? Settings.covers2d_path : Settings.covers_path;
snprintf (filename,sizeof(filename),"%c%c%c.png", header->id[0], header->id[1], header->id[2]);
found2 = findfile(filename, Settings.covers_path);
found2 = findfile(filename, covers_path);
snprintf (filename,sizeof(filename),"%c%c%c%c.png", header->id[0], header->id[1], header->id[2], header->id[3]);
found3 = findfile(filename, Settings.covers_path);
found3 = findfile(filename, covers_path);
snprintf(filename,sizeof(filename),"%c%c%c%c%c%c.png",header->id[0], header->id[1], header->id[2],
header->id[3], header->id[4], header->id[5]); //full id
found1 = findfile(filename, Settings.covers_path);
found1 = findfile(filename, covers_path);
if (!found1 && !found2 && !found3) { //if could not find any image
snprintf(missingFiles[cntMissFiles],11,"%s",filename);
cntMissFiles++;
@ -1787,16 +1791,16 @@ bool NetworkInitPrompt() {
dialogBoxImg.SetWidescreen(CFG.widescreen);
}
GuiText titleTxt(tr("Initializing Network"), 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(tr("Initializing Network"), 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60);
char msg[20] = " ";
GuiText msgTxt(msg, 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 22, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msgTxt.SetPosition(0,-40);
GuiText btn1Txt(tr("Cancel"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -1908,23 +1912,23 @@ ProgressDownloadWindow(int choice2) {
progressbarImg.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
progressbarImg.SetPosition(25, 40);
GuiText titleTxt(tr("Downloading file"), 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(tr("Downloading file"), 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,60);
GuiText msgTxt(NULL, 20, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(NULL, 20, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msgTxt.SetPosition(0,130);
GuiText msg2Txt(NULL, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg2Txt(NULL, 26, THEME.prompttext);
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msg2Txt.SetPosition(0,100);
GuiText prTxt(NULL, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText prTxt(NULL, 26, THEME.prompttext);
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
prTxt.SetPosition(0, 40);
GuiText btn1Txt(tr("Cancel"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -1979,6 +1983,12 @@ ProgressDownloadWindow(int choice2) {
cntMissFiles = 0;
}
}
if (stat(Settings.covers2d_path, &st) != 0) {
if (subfoldercreate(Settings.covers2d_path) != 1) {
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"));
cntMissFiles = 0;
}
}
if (stat(Settings.disc_path,&st) != 0) {
if (subfoldercreate(Settings.disc_path) != 1) {
WindowPrompt(tr("Error !"),tr("Can't create directory"),tr("OK"));
@ -2180,10 +2190,10 @@ ProgressDownloadWindow(int choice2) {
//Creates URL depending from which Country the game is
switch (missingFiles[i][3]) {
case 'J':
sprintf(URLFile,"%sJA/%s",server3d,missingFiles[i]);
sprintf(URLFile,"%sJA/%s",server2d,missingFiles[i]);
break;
case 'W':
sprintf(URLFile,"%sZH/%s",server3d,missingFiles[i]);
sprintf(URLFile,"%sZH/%s",server2d,missingFiles[i]);
break;
case 'K':
sprintf(URLFile,"%sKO/%s",server2d,missingFiles[i]);
@ -2205,7 +2215,7 @@ ProgressDownloadWindow(int choice2) {
break;
}
sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[i]);
sprintf(imgPath,"%s%s", Settings.covers2d_path, missingFiles[i]);
file = downloadfile(URLFile);
if (!(file.size == 36864 || file.size <= 1024 || file.size == 7386 || file.size <= 1174 || file.size == 4446 || file.data == NULL)) {
@ -2248,7 +2258,7 @@ ProgressDownloadWindow(int choice2) {
}
/**Temporary redownloading 1st image because of a fucking corruption bug **/
#if 0 // is no longer necessary, since libfat is fixed
char URLFile[100];
struct block file = downloadfile(URLFile);
if (choice2 == 2) {
@ -2273,7 +2283,7 @@ ProgressDownloadWindow(int choice2) {
if (choice2 == 1) {
while (tries<serverCnt2d) {
sprintf(URLFile,"%s%s",server2d,missingFiles[0]);
sprintf(imgPath,"%s%s", Settings.covers_path, missingFiles[0]);
sprintf(imgPath,"%s%s", Settings.covers2d_path, missingFiles[0]);
file = downloadfile(URLFile);
if (!(file.size == 36864 || file.size <= 1024 || file.size <= 1174 || file.size == 7386 || file.size == 4446 || file.data == NULL))break;
tries++;
@ -2290,7 +2300,7 @@ ProgressDownloadWindow(int choice2) {
free(file.data);
}
}
#endif
HaltGui();
mainWindow->Remove(&promptWindow);
mainWindow->SetState(STATE_DEFAULT);
@ -2385,24 +2395,24 @@ int ProgressUpdateWindow() {
char title[50];
sprintf(title, "%s", tr("Checking for Updates"));
GuiText titleTxt(title, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,50);
char msg[50];
sprintf(msg, "%s", tr("Initializing Network"));
GuiText msgTxt(msg, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 26, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msgTxt.SetPosition(0,140);
char msg2[50] = " ";
GuiText msg2Txt(msg2, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg2Txt(msg2, 26, THEME.prompttext);
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msg2Txt.SetPosition(0, 50);
GuiText prTxt(NULL, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText prTxt(NULL, 26, THEME.prompttext);
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
prTxt.SetPosition(0, 7);
GuiText btn1Txt(tr("Cancel"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -2720,24 +2730,24 @@ int ProgressUpdateWindow() {
char title[50];
sprintf(title, "%s", tr("Checking for Updates"));
GuiText titleTxt(title, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,50);
char msg[50];
sprintf(msg, "%s", tr("Initializing Network"));
GuiText msgTxt(msg, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 26, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msgTxt.SetPosition(0,140);
char msg2[50] = " ";
GuiText msg2Txt(msg2, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg2Txt(msg2, 26, THEME.prompttext);
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msg2Txt.SetPosition(0, 50);
GuiText prTxt(NULL, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText prTxt(NULL, 26, THEME.prompttext);
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
prTxt.SetPosition(0, 7);
GuiText btn1Txt(tr("Cancel"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -3013,20 +3023,20 @@ int CodeDownload(const char *id) {
char title[50];
sprintf(title, "%s", tr("Code Download"));
GuiText titleTxt(title, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,50);
char msg[50];
sprintf(msg, "%s", tr("Initializing Network"));
GuiText msgTxt(msg, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msgTxt(msg, 26, THEME.prompttext);
msgTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msgTxt.SetPosition(0,140);
char msg2[50] = " ";
GuiText msg2Txt(msg2, 26, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg2Txt(msg2, 26, THEME.prompttext);
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
msg2Txt.SetPosition(0, 50);
GuiText btn1Txt(tr("Cancel"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Cancel"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -3238,7 +3248,7 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
char tmp[510];
GuiText nameTxt(name,30 , (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText nameTxt(name,30 , THEME.prompttext);
nameTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
nameTxt.SetPosition(0,-15);
nameTxt.SetMaxWidth(430, GuiText::SCROLL);
@ -3246,27 +3256,27 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
if (strcmp(coder,""))
snprintf(tmp, sizeof(tmp), tr("Coded by: %s"),coder);
GuiText coderTxt(tmp, 16, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255} );
GuiText coderTxt(tmp, 16, THEME.prompttext );
coderTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
coderTxt.SetPosition(180,30);
coderTxt.SetMaxWidth(280);
if (strcmp(version,""))
snprintf(tmp, sizeof(tmp), tr("Version: %s"),version);
GuiText versionTxt(tmp,16 , (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText versionTxt(tmp,16 , THEME.prompttext);
versionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
versionTxt.SetPosition(40,65);
versionTxt.SetMaxWidth(430);
//if (release_date)
//snprintf(tmp, sizeof(tmp), tr("Released: %s"),release_date);
GuiText release_dateTxt(release_date,16 , (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText release_dateTxt(release_date,16 , THEME.prompttext);
release_dateTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
release_dateTxt.SetPosition(40,85);
release_dateTxt.SetMaxWidth(430);
int pagesize = 6;
GuiText long_descriptionTxt(long_description, 20, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText long_descriptionTxt(long_description, 20, THEME.prompttext);
long_descriptionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
long_descriptionTxt.SetPosition(46,117);
long_descriptionTxt.SetMaxWidth(360);
@ -3294,11 +3304,11 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
snprintf(filesizeCH, sizeof(filesizeCH), "%s MB",temp2);
}
GuiText filesizeTxt(filesizeCH, 16, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText filesizeTxt(filesizeCH, 16, THEME.prompttext);
filesizeTxt.SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
filesizeTxt.SetPosition(-40,12);
GuiText btn1Txt(tr("Load"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Load"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn1Txt.SetWidescreen(CFG.widescreen);
@ -3309,7 +3319,7 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
btn1.SetLabel(&btn1Txt);
btn1.SetState(STATE_SELECTED);
GuiText btn2Txt(tr("Back"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn2Txt(tr("Back"), 22, THEME.prompttext);
GuiImage btn2Img(&btnOutline);
if (Settings.wsprompt == yes) {
btn2Txt.SetWidescreen(CFG.widescreen);

View File

@ -247,7 +247,7 @@ int TitleBrowser(u32 type) {
settingsbackgroundbtn.SetPosition(0, 0);
settingsbackgroundbtn.SetImage(&settingsbackground);
GuiText cancelBtnTxt(tr("Back"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText cancelBtnTxt(tr("Back"), 22, THEME.prompttext);
cancelBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage cancelBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {

View File

@ -319,7 +319,7 @@ main:
usbBtn.SetTrigger(&trigA);
usbBtn.SetEffectGrow();
GuiText okBtnTxt(tr("Ok"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText okBtnTxt(tr("Ok"), 22, THEME.prompttext);
GuiImage okBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
okBtnTxt.SetWidescreen(CFG.widescreen);

View File

@ -115,7 +115,7 @@ int MenuSettings() {
GuiImage settingsbackground(&settingsbg);
GuiText backBtnTxt(tr("Back") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
@ -1172,16 +1172,17 @@ int MenuSettings() {
titleTxt.SetText(tr("Custom Paths"));
exit = false;
for (int i = 0; i <= MAXOPTIONS; i++) options2.SetName(i, NULL);
if (Settings.godmode)
options2.SetName(0, "%s", tr("Cover Path"));
options2.SetName(1, "%s", tr("Discimage Path"));
options2.SetName(2, "%s", tr("ThemePath"));
options2.SetName(3, "%s", tr("XMLPath"));
options2.SetName(4, "%s", tr("Updatepath"));
options2.SetName(5, "%s", tr("Cheatcodes Path"));
options2.SetName(6, "%s", tr("TXTCheatcodes Path"));
options2.SetName(7, "%s", tr("Dol Path"));
options2.SetName(8, "%s", tr("Homebrew Apps Path"));
// if (Settings.godmode)
options2.SetName(0, "%s", tr("3D Cover Path"));
options2.SetName(1, "%s", tr("2D Cover Path"));
options2.SetName(2, "%s", tr("Discimage Path"));
options2.SetName(3, "%s", tr("ThemePath"));
options2.SetName(4, "%s", tr("XMLPath"));
options2.SetName(5, "%s", tr("Updatepath"));
options2.SetName(6, "%s", tr("Cheatcodes Path"));
options2.SetName(7, "%s", tr("TXTCheatcodes Path"));
options2.SetName(8, "%s", tr("Dol Path"));
options2.SetName(9, "%s", tr("Homebrew Apps Path"));
for (int i = 0; i <= MAXOPTIONS; i++) options2.SetValue(i, NULL);
w.Append(&optionBrowser2);
optionBrowser2.SetClickable(true);
@ -1197,14 +1198,15 @@ int MenuSettings() {
VIDEO_WaitVSync ();
options2.SetValue(0, "%s", Settings.covers_path);
options2.SetValue(1, "%s", Settings.disc_path);
options2.SetValue(2, "%s", CFG.theme_path);
options2.SetValue(3, "%s", Settings.titlestxt_path);
options2.SetValue(4, "%s", Settings.update_path);
options2.SetValue(5, "%s", Settings.Cheatcodespath);
options2.SetValue(6, "%s", Settings.TxtCheatcodespath);
options2.SetValue(7, "%s", Settings.dolpath);
options2.SetValue(8, "%s", Settings.homebrewapps_path);
options2.SetValue(1, "%s", Settings.covers2d_path);
options2.SetValue(2, "%s", Settings.disc_path);
options2.SetValue(3, "%s", CFG.theme_path);
options2.SetValue(4, "%s", Settings.titlestxt_path);
options2.SetValue(5, "%s", Settings.update_path);
options2.SetValue(6, "%s", Settings.Cheatcodespath);
options2.SetValue(7, "%s", Settings.TxtCheatcodespath);
options2.SetValue(8, "%s", Settings.dolpath);
options2.SetValue(9, "%s", Settings.homebrewapps_path);
if (backBtn.GetState() == STATE_CLICKED) {
backBtn.ResetState();
@ -1249,7 +1251,7 @@ int MenuSettings() {
w.Remove(&backBtn);
char entered[43] = "";
strncpy(entered, Settings.covers_path, sizeof(entered));
titleTxt.SetText(tr("Cover Path"));
titleTxt.SetText(tr("3D Cover Path"));
int result = BrowseDevice(entered);
//int result = OnScreenKeyboard(entered,43,0);
titleTxt.SetText(tr("Custom Paths"));
@ -1271,6 +1273,33 @@ int MenuSettings() {
}
break;
case 1:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
char entered[43] = "";
strncpy(entered, Settings.covers2d_path, sizeof(entered));
titleTxt.SetText(tr("2D Cover Path"));
int result = BrowseDevice(entered);
//int result = OnScreenKeyboard(entered,43,0);
titleTxt.SetText(tr("Custom Paths"));
w.Append(&optionBrowser2);
w.Append(&backBtn);
if ( result == 1 ) {
int len = (strlen(entered)-1);
if (entered[len] !='/')
strncat (entered, "/", 1);
strncpy(Settings.covers2d_path, entered, sizeof(Settings.covers2d_path));
WindowPrompt(tr("Coverpath Changed"),0,tr("OK"));
// if(!isSdInserted()) {
if (!isInserted(bootDevice)) {
WindowPrompt(tr("No SD-Card inserted!"), tr("Insert an SD-Card to save."), tr("OK"));
}
}
} else {
WindowPrompt(tr("Coverpath Change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 2:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1297,7 +1326,7 @@ int MenuSettings() {
WindowPrompt(tr("Discpath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 2:
case 3:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1355,7 +1384,7 @@ int MenuSettings() {
WindowPrompt(tr("Themepath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 3:
case 4:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1387,7 +1416,7 @@ int MenuSettings() {
WindowPrompt(tr("XMLPath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 4:
case 5:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1409,7 +1438,7 @@ int MenuSettings() {
} else
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"));
break;
case 5:
case 6:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1431,7 +1460,7 @@ int MenuSettings() {
} else
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"));
break;
case 6:
case 7:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1453,7 +1482,7 @@ int MenuSettings() {
} else
WindowPrompt(0,tr("Console should be unlocked to modify it."),tr("OK"));
break;
case 7:
case 8:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1480,7 +1509,7 @@ int MenuSettings() {
WindowPrompt(tr("Dolpath change"),tr("Console should be unlocked to modify it."),tr("OK"));
}
break;
case 8:
case 9:
if ( Settings.godmode == 1) {
w.Remove(&optionBrowser2);
w.Remove(&backBtn);
@ -1785,7 +1814,7 @@ int GameSettings(struct discHdr * header) {
GuiImage settingsbackground(&settingsbg);
GuiText backBtnTxt(tr("Back") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
@ -1799,7 +1828,7 @@ int GameSettings(struct discHdr * header) {
GuiButton homo(1,1);
homo.SetTrigger(&trigHome);
GuiText saveBtnTxt(tr("Save"), 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText saveBtnTxt(tr("Save"), 22, THEME.prompttext);
saveBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage saveBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {

View File

@ -81,7 +81,7 @@ bool MenuOGG() {
oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
oggmenubackground.SetPosition(0, 0);
GuiText backBtnTxt(tr("Back") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
@ -99,7 +99,7 @@ bool MenuOGG() {
backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow();
GuiText defaultBtnTxt(tr("Default") , 22, (GXColor) { THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText defaultBtnTxt(tr("Default") , 22, THEME.prompttext);
defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage defaultBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
@ -363,7 +363,7 @@ int MenuLanguageSelect() {
oggmenubackground.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
oggmenubackground.SetPosition(0, 0);
GuiText backBtnTxt(tr("Back") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText backBtnTxt(tr("Back") , 22, THEME.prompttext);
backBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage backBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
@ -381,7 +381,7 @@ int MenuLanguageSelect() {
backBtn.SetTrigger(&trigB);
backBtn.SetEffectGrow();
GuiText defaultBtnTxt(tr("Default") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText defaultBtnTxt(tr("Default") , 22, THEME.prompttext);
defaultBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage defaultBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {
@ -398,7 +398,7 @@ int MenuLanguageSelect() {
defaultBtn.SetTrigger(&trigA);
defaultBtn.SetEffectGrow();
GuiText updateBtnTxt(tr("Update Files") , 22, (GXColor) {THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText updateBtnTxt(tr("Update Files") , 22, THEME.prompttext);
updateBtnTxt.SetMaxWidth(btnOutline.GetWidth()-30);
GuiImage updateBtnImg(&btnOutline);
if (Settings.wsprompt == yes) {

View File

@ -192,6 +192,7 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode
if (widescreen == -1) {
snprintf(Settings.covers_path, sizeof(Settings.covers_path), "%s/images/", bootDevice); //default image path
snprintf(Settings.covers2d_path, sizeof(Settings.covers2d_path), "%s/images/2D/", bootDevice); //default image path
snprintf(Settings.disc_path, sizeof(Settings.disc_path), "%s/images/disc/", bootDevice);
snprintf(Settings.titlestxt_path, sizeof(Settings.titlestxt_path), "%s/config/", bootDevice);//default path for disc images
char * empty = "";
@ -205,13 +206,13 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode
snprintf(Settings.TxtCheatcodespath, sizeof(Settings.TxtCheatcodespath), "%s/txtcodes/", bootDevice);
snprintf(Settings.dolpath, sizeof(Settings.dolpath), "%s/", bootDevice);
sprintf(Settings.ogg_path, "notset");
}
//always set Theme defaults
//all alignments are left top here
THEME.selection_x = 200;
THEME.selection_y = 49;//40;
THEME.selection_w = 396;
THEME.selection_h = 280;
THEME.batteryUnused = 70;
THEME.gamelist_x = 200;
THEME.gamelist_y = 49;//40;
THEME.gamelist_w = 396;
THEME.gamelist_h = 280;
THEME.gamegrid_w = 640;
THEME.gamegrid_h = 400;
THEME.gamegrid_x = 0;
@ -220,79 +221,99 @@ void CFG_Default(int widescreen) { // -1 = non forced Mode
THEME.gamecarousel_h = 400;
THEME.gamecarousel_x = 0;
THEME.gamecarousel_y = -20;
THEME.clock_r = 138;
THEME.clock_g = 138;
THEME.clock_b = 138;
THEME.settingsTxt_r = 0;
THEME.settingsTxt_g = 0;
THEME.settingsTxt_b = 0;
THEME.cover_x = 26;
THEME.cover_y = 58;
THEME.homebrew_x = 410;
THEME.homebrew_y = 405;
THEME.showID = 1;
// THEME.maxcharacters = 36;
THEME.covers_x = 26;
THEME.covers_y = 58;
THEME.show_id = 1;
THEME.id_x = 68;
THEME.id_y = 305;
THEME.show_region = 1;
THEME.region_x = 68;
THEME.region_y = 30;
THEME.sdcard_x = 160;
THEME.sdcard_y = 395;
THEME.homebrew_x = 410;
THEME.homebrew_y = 405;
THEME.power_x = 576;
THEME.tooltipAlpha = 255;
THEME.power_y = 355;
THEME.home_x = 489;//215;
THEME.home_y = 371;
THEME.setting_x = 64;//-210
THEME.setting_y = 371;
THEME.showHDD = 1; //default
THEME.showGameCnt = 1; //default
THEME.showToolTip = 1; //1 means use settings, 0 means force turn off
THEME.install_x = 16;//-280
THEME.install_y = 355;
THEME.showBattery = 1;
THEME.showRegion = 1;
THEME.hddInfo_x = 0;
THEME.hddInfo_y = 400;
THEME.hddInfoAlign = CFG_ALIGN_CENTRE;
THEME.gameCnt_x = 0;
THEME.gameCnt_y = 420;
THEME.gameCntAlign = CFG_ALIGN_CENTRE;
THEME.battery1_x = 245;
THEME.battery1_y = 400;
THEME.battery2_x = 335;
THEME.battery2_y = 400;
THEME.battery3_x = 245;
THEME.battery3_y = 425;
THEME.battery4_x = 335;
THEME.battery4_y = 425;
THEME.info_r = 55;
THEME.info_g = 190;
THEME.info_b = 237;
THEME.prompttxt_r = 0;
THEME.prompttxt_g = 0;
THEME.prompttxt_b = 0;
THEME.clock = (GXColor) {138, 138, 138, 240};
THEME.clock_align = CFG_ALIGN_CENTRE;
THEME.clock_x = 0;
THEME.clock_y = 335;//330;
THEME.clockAlign = CFG_ALIGN_CENTRE;
THEME.sdcard_x = 160;
THEME.sdcard_y = 395;
THEME.gameText_r = 0;
THEME.gameText_g = 0;
THEME.gameText_b = 0;
THEME.info = (GXColor) {55, 190, 237, 255};
THEME.show_hddinfo = 1; //default
THEME.hddinfo_align = CFG_ALIGN_CENTRE;
THEME.hddinfo_x = 0;
THEME.hddinfo_y = 400;
THEME.show_gamecount = 1; //default
THEME.gamecount_align = CFG_ALIGN_CENTRE;
THEME.gamecount_x = 0;
THEME.gamecount_y = 420;
THEME.show_tooltip = 1; //1 means use settings, 0 means force turn off
THEME.tooltipAlpha = 255;
THEME.prompttext = (GXColor) {0, 0, 0, 255};
THEME.settingstext = (GXColor) {0, 0, 0, 255};
THEME.gametext = (GXColor) {0, 0, 0, 255};
THEME.pagesize = 9;
THEME.favorite_x = 4;
THEME.favorite_y = 13;
THEME.abc_x = 36;
THEME.abc_y = 13;
THEME.list_x = 100;
THEME.list_y = 13;
THEME.grid_x = 132;
THEME.grid_y = 13;
THEME.carousel_x = 164;
THEME.carousel_y = 13;
THEME.count_x = 68;
THEME.count_y = 13;
THEME.sortBarOffset = 100;
}
THEME.gamelist_favorite_x = CFG.widescreen ? 288 : 260;
THEME.gamelist_favorite_y = 13;
THEME.gamelist_search_x = CFG.widescreen ? 320 : 300;
THEME.gamelist_search_y = 13;
THEME.gamelist_abc_x = CFG.widescreen ? 352 : 340;
THEME.gamelist_abc_y = 13;
THEME.gamelist_count_x = CFG.widescreen ? 384 : 380;
THEME.gamelist_count_y = 13;
THEME.gamelist_list_x = CFG.widescreen ? 416 : 420;
THEME.gamelist_list_y = 13;
THEME.gamelist_grid_x = CFG.widescreen ? 448 : 460;
THEME.gamelist_grid_y = 13;
THEME.gamelist_carousel_x = CFG.widescreen ? 480 : 500;
THEME.gamelist_carousel_y = 13;
THEME.gamegrid_favorite_x = CFG.widescreen ? 208 : 180;
THEME.gamegrid_favorite_y = 13;
THEME.gamegrid_search_x = CFG.widescreen ? 240 : 220;
THEME.gamegrid_search_y = 13;
THEME.gamegrid_abc_x = CFG.widescreen ? 272 : 260;
THEME.gamegrid_abc_y = 13;
THEME.gamegrid_count_x = CFG.widescreen ? 304 : 300;
THEME.gamegrid_count_y = 13;
THEME.gamegrid_list_x = CFG.widescreen ? 336 : 340;
THEME.gamegrid_list_y = 13;
THEME.gamegrid_grid_x = CFG.widescreen ? 368 : 380;
THEME.gamegrid_grid_y = 13;
THEME.gamegrid_carousel_x = CFG.widescreen ? 400 : 420;
THEME.gamegrid_carousel_y = 13;
THEME.gamecarousel_favorite_x = CFG.widescreen ? 208 : 180;
THEME.gamecarousel_favorite_y = 13;
THEME.gamecarousel_search_x = CFG.widescreen ? 240 : 220;
THEME.gamecarousel_search_y = 13;
THEME.gamecarousel_abc_x = CFG.widescreen ? 272 : 260;
THEME.gamecarousel_abc_y = 13;
THEME.gamecarousel_count_x = CFG.widescreen ? 304 : 300;
THEME.gamecarousel_count_y = 13;
THEME.gamecarousel_list_x = CFG.widescreen ? 336 : 340;
THEME.gamecarousel_list_y = 13;
THEME.gamecarousel_grid_x = CFG.widescreen ? 368 : 380;
THEME.gamecarousel_grid_y = 13;
THEME.gamecarousel_carousel_x = CFG.widescreen ? 400 : 420;
THEME.gamecarousel_carousel_y = 13;
}
void Global_Default(void) {
@ -301,9 +322,9 @@ void Global_Default(void) {
Settings.language = ConsoleLangDefault;
Settings.ocarina = off;
Settings.hddinfo = hr12;
Settings.sinfo = ((THEME.showID) ? GameID : Neither);
Settings.sinfo = ((THEME.show_id) ? GameID : Neither);
Settings.rumble = RumbleOn;
if (THEME.showRegion) {
if (THEME.show_region) {
Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion);
}
Settings.volume = 80;
@ -453,6 +474,11 @@ void path_set(char *name, char *val) {
return;
}
if (strcmp(name, "cover2d_path") == 0) {
strcopy(Settings.covers2d_path, val, sizeof(Settings.covers2d_path));
return;
}
if (strcmp(name, "disc_path") == 0) {
strcopy(Settings.disc_path, val, sizeof(Settings.disc_path));
return;
@ -502,324 +528,243 @@ void path_set(char *name, char *val) {
}
#define CFG_COORDS2(name) \
if (strcmp(cfg_name, #name "_coords") == 0) { \
short x,y; \
if (sscanf(val, "%hd,%hd", &x, &y) == 2) { \
THEME.name##_x = x; \
THEME.name##_y = y; \
} \
}
#define CFG_COORDS4(name) \
if (strcmp(cfg_name, #name "_coords") == 0) { \
short x,y,w,h; \
if (sscanf(val, "%hd,%hd,%hd,%hd", &x, &y, &w, &h) == 4) { \
THEME.name##_x = x; \
THEME.name##_y = y; \
THEME.name##_w = w; \
THEME.name##_h = h; \
} \
}
#define CFG_COLOR(name) \
if (strcmp(cfg_name, #name "_color") == 0) { \
short r,g,b,a; \
int c = sscanf(val, "%hd,%hd,%hd,%hd", &r, &g, &b, &a); \
if(c >= 3) { \
THEME.name.r = r; \
THEME.name.g = g; \
THEME.name.b = b; \
if(c >= 4) \
THEME.name.a = a; \
} \
}
#define CFG_VAL(name) \
if (strcmp(cfg_name, #name) == 0) { \
short v; \
if (sscanf(val, "%hd", &v) == 1) { \
THEME.name = v; \
} \
}
#define CFG_BOOL(name) if(cfg_bool(#name, &THEME.name));
#define CFG_ALIGN(name) if(cfg_map_auto(#name "_align", map_alignment, &THEME.name##_align));
#define OLD_FAV_ICON 1
#define OLD_ABC_ICON 2
#define OLD_COUNT_ICON 4
#define OLD_LIST_ICON 8
#define OLD_GRID_ICON 16
#define OLD_CAROUSEL_ICON 32
short WorkAroundIconSet=0;
short WorkAroundBarOffset=100;
void theme_set(char *name, char *val) {
cfg_name = name;
cfg_val = val;
if (strcmp(cfg_name, "gamelist_coords") == 0) {
int x,y,w,h;
if (sscanf(val, "%d,%d,%d,%d", &x, &y, &w, &h) == 4) {
THEME.selection_x = x - (x % 4);
THEME.selection_y = y;
THEME.selection_w = w;
THEME.selection_h = h;
}
}
CFG_COORDS4(gamelist)
else CFG_COORDS4(gamegrid)
else CFG_COORDS4(gamecarousel)
if (strcmp(cfg_name, "gamegrid_coords") == 0) {
int x,y,w,h;
if (sscanf(val, "%d,%d,%d,%d", &x, &y, &w, &h) == 4) {
THEME.gamegrid_x = x - (x % 4);
THEME.gamegrid_y = y;
THEME.gamegrid_w = w;
THEME.gamegrid_h = h;
}
}
else CFG_COORDS2(covers)
if (strcmp(cfg_name, "gamecarousel_coords") == 0) {
int x,y,w,h;
if (sscanf(val, "%d,%d,%d,%d", &x, &y, &w, &h) == 4) {
THEME.gamecarousel_x = x - (x % 4);
THEME.gamecarousel_y = y;
THEME.gamecarousel_w = w;
THEME.gamecarousel_h = h;
}
}
else CFG_BOOL(show_id)
else CFG_COORDS2(id)
else if (strcmp(cfg_name, "covers_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.cover_x = x - (x % 4);
THEME.cover_y = y;
}
}
else CFG_BOOL(show_region)
else CFG_COORDS2(region)
else if (strcmp(cfg_name, "id_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.id_x = x - (x % 4);
THEME.id_y = y;
}
}
else CFG_COORDS2(sdcard)
else CFG_COORDS2(homebrew)
else CFG_COORDS2(power)
else CFG_COORDS2(home)
else CFG_COORDS2(setting)
else CFG_COORDS2(install)
else if (strcmp(cfg_name, "hddinfo_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.hddInfo_x = x - (x % 4);
THEME.hddInfo_y = y;
}
}
else CFG_COORDS2(clock)
else CFG_ALIGN(clock)
else CFG_COLOR(clock)
else if (strcmp(cfg_name, "gamecount_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.gameCnt_x = x - (x % 4);
THEME.gameCnt_y = y;
}
}
else CFG_COLOR(info)
else CFG_BOOL(show_hddinfo)
else CFG_ALIGN(hddinfo)
else CFG_COORDS2(hddinfo)
else if (strcmp(cfg_name, "region_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.region_x = x - (x % 4);
THEME.region_y = y;
}
}
else CFG_BOOL(show_gamecount)
else CFG_ALIGN(gamecount)
else CFG_COORDS2(gamecount)
else if (strcmp(cfg_name, "homebrew_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.homebrew_x = x - (x % 4);
THEME.homebrew_y = y;
}
}
else CFG_BOOL(show_tooltip)
else CFG_VAL(tooltipAlpha)
else if (strcmp(cfg_name, "power_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.power_x = x - (x % 4);
THEME.power_y = y;
}
}
else CFG_COLOR(prompttext)
else CFG_COLOR(settingstext)
else CFG_COLOR(gametext)
else if (strcmp(cfg_name, "home_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.home_x = x - (x % 4);
THEME.home_y = y;
}
}
else CFG_VAL(pagesize)
else if (strcmp(cfg_name, "setting_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.setting_x = x - (x % 4);
THEME.setting_y = y;
}
}
else CFG_COORDS2(gamelist_favorite)
else CFG_COORDS2(gamegrid_favorite)
else CFG_COORDS2(gamecarousel_favorite)
else if (strcmp(cfg_name, "install_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.install_x = x - (x % 4);
THEME.install_y = y;
}
}
else CFG_COORDS2(gamelist_search)
else CFG_COORDS2(gamegrid_search)
else CFG_COORDS2(gamecarousel_search)
else if (strcmp(cfg_name, "battery1_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.battery1_x = x - (x % 4);
THEME.battery1_y = y;
}
}
else CFG_COORDS2(gamelist_abc)
else CFG_COORDS2(gamegrid_abc)
else CFG_COORDS2(gamecarousel_abc)
else if (strcmp(cfg_name, "battery2_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.battery2_x = x - (x % 4);
THEME.battery2_y = y;
}
}
else CFG_COORDS2(gamelist_count)
else CFG_COORDS2(gamegrid_count)
else CFG_COORDS2(gamecarousel_count)
else if (strcmp(cfg_name, "battery3_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.battery3_x = x - (x % 4);
THEME.battery3_y = y;
}
}
else CFG_COORDS2(gamelist_list)
else CFG_COORDS2(gamegrid_list)
else CFG_COORDS2(gamecarousel_list)
else if (strcmp(cfg_name, "battery4_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.battery4_x = x - (x % 4);
THEME.battery4_y = y;
}
}
else CFG_COORDS2(gamelist_grid)
else CFG_COORDS2(gamegrid_grid)
else CFG_COORDS2(gamecarousel_grid)
else if (strcmp(cfg_name, "clock_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.clock_x = x - (x % 4);
THEME.clock_y = y;
}
}
else if (strcmp(cfg_name, "sdcard_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.sdcard_x = x - (x % 4);
THEME.sdcard_y = y;
}
}
else CFG_COORDS2(gamelist_carousel)
else CFG_COORDS2(gamegrid_carousel)
else CFG_COORDS2(gamecarousel_carousel)
//**********************************
// Workaround for old Themes
//**********************************
else if (strcmp(cfg_name, "favorite_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.favorite_x = x - (x % 4);
THEME.favorite_y = y;
if(!CFG.widescreen) x-=20;
// old themes have no search_coords
// set the searchIcon to the Position of the favIcon
THEME.gamelist_search_x = x;
THEME.gamegrid_search_x = THEME.gamecarousel_search_x = x-WorkAroundBarOffset;
THEME.gamelist_search_y = THEME.gamegrid_search_y = THEME.gamecarousel_search_y = y;
// place the favIcon to the left side of the searchIcon
if(!CFG.widescreen) x-= CFG.widescreen ? 32 : 40;
THEME.gamelist_favorite_x = x;
THEME.gamegrid_favorite_x = THEME.gamecarousel_favorite_x = x-WorkAroundBarOffset;
THEME.gamelist_favorite_y = THEME.gamegrid_favorite_y = THEME.gamecarousel_favorite_y = y;
WorkAroundIconSet |= OLD_FAV_ICON;
}
}
else if (strcmp(cfg_name, "abc_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.abc_x = x - (x % 4);
THEME.abc_y = y;
if(!CFG.widescreen) x-=12;
THEME.gamelist_abc_x = x;
THEME.gamegrid_abc_x = THEME.gamecarousel_abc_x = x-WorkAroundBarOffset;
THEME.gamelist_abc_y = THEME.gamegrid_abc_y = THEME.gamecarousel_abc_y = y;
WorkAroundIconSet |= OLD_ABC_ICON;
}
}
else if (strcmp(cfg_name, "count_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.count_x = x - (x % 4);
THEME.count_y = y;
if(!CFG.widescreen) x-=4;
THEME.gamelist_count_x = x;
THEME.gamegrid_count_x = THEME.gamecarousel_count_x = x-WorkAroundBarOffset;
THEME.gamelist_count_y = THEME.gamegrid_count_y = THEME.gamecarousel_count_y = y;
WorkAroundIconSet |= OLD_COUNT_ICON;
}
}
else if (strcmp(cfg_name, "carousel_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.carousel_x = x - (x % 4);
THEME.carousel_y = y;
}
}
else if (strcmp(cfg_name, "grid_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.grid_x = x - (x % 4);
THEME.grid_y = y;
}
}
else if (strcmp(cfg_name, "list_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
THEME.list_x = x - (x % 4);
THEME.list_y = y;
if(!CFG.widescreen) x+=4;
THEME.gamelist_list_x = x;
THEME.gamegrid_list_x = THEME.gamecarousel_list_x = x-WorkAroundBarOffset;
THEME.gamelist_list_y = THEME.gamegrid_list_y = THEME.gamecarousel_list_y = y;
WorkAroundIconSet |= OLD_LIST_ICON;
}
}
else if (strcmp(cfg_name, "grid_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
if(!CFG.widescreen) x+=12;
THEME.gamelist_grid_x = x;
THEME.gamegrid_grid_x = THEME.gamecarousel_grid_x = x-WorkAroundBarOffset;
THEME.gamelist_grid_y = THEME.gamegrid_grid_y = THEME.gamecarousel_grid_y = y;
WorkAroundIconSet |= OLD_GRID_ICON;
}
}
else if (strcmp(cfg_name, "carousel_coords") == 0) {
short x,y;
if (sscanf(val, "%hd,%hd", &x, &y) == 2) {
if(!CFG.widescreen) x+=20;
THEME.gamelist_carousel_x = x;
THEME.gamegrid_carousel_x = THEME.gamecarousel_carousel_x = x-WorkAroundBarOffset;
THEME.gamelist_carousel_y = THEME.gamegrid_carousel_y = THEME.gamecarousel_carousel_y = y;
WorkAroundIconSet |= OLD_CAROUSEL_ICON;
}
}
else if (strcmp(cfg_name, "sortBarOffset") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.sortBarOffset = x;
short o;
if (sscanf(val, "%hd", &o) == 1) {
if(WorkAroundIconSet & OLD_FAV_ICON)
{
THEME.gamegrid_favorite_x += WorkAroundBarOffset - o;
THEME.gamecarousel_favorite_x += WorkAroundBarOffset - o;
THEME.gamegrid_search_x += WorkAroundBarOffset - o;
THEME.gamecarousel_search_x += WorkAroundBarOffset - o;
}
if(WorkAroundIconSet & OLD_ABC_ICON)
{
THEME.gamegrid_abc_x += WorkAroundBarOffset - o;
THEME.gamecarousel_abc_x += WorkAroundBarOffset - o;
}
if(WorkAroundIconSet & OLD_COUNT_ICON)
{
THEME.gamegrid_count_x += WorkAroundBarOffset - o;
THEME.gamecarousel_count_x += WorkAroundBarOffset - o;
}
if(WorkAroundIconSet & OLD_LIST_ICON)
{
THEME.gamegrid_list_x += WorkAroundBarOffset - o;
THEME.gamecarousel_list_x += WorkAroundBarOffset - o;
}
if(WorkAroundIconSet & OLD_GRID_ICON)
{
THEME.gamegrid_grid_x += WorkAroundBarOffset - o;
THEME.gamecarousel_grid_x += WorkAroundBarOffset - o;
}
if(WorkAroundIconSet & OLD_CAROUSEL_ICON)
{
THEME.gamegrid_carousel_x += WorkAroundBarOffset - o;
THEME.gamecarousel_carousel_x += WorkAroundBarOffset - o;
}
WorkAroundBarOffset = o;
}
}
else if (strcmp(cfg_name, "info_color") == 0) {
short x,y,z;
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
THEME.info_r = x;
THEME.info_g = y;
THEME.info_b = z;
}
}
else if (strcmp(cfg_name, "gametext_color") == 0) {
short x,y,z;
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
THEME.gameText_r = x;
THEME.gameText_g = y;
THEME.gameText_b = z;
}
}
else if (strcmp(cfg_name, "prompttext_color") == 0) {
short x,y,z;
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
THEME.prompttxt_r = x;
THEME.prompttxt_g = y;
THEME.prompttxt_b = z;
}
}
else if (strcmp(cfg_name, "clock_color") == 0) {
short x,y,z;
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
THEME.clock_r = x;
THEME.clock_g = y;
THEME.clock_b = z;
}
}
else if (strcmp(cfg_name, "settingstext_color") == 0) {
short x,y,z;
if (sscanf(val, "%hd,%hd, %hd", &x, &y, &z) == 3) {
THEME.settingsTxt_r = x;
THEME.settingsTxt_g = y;
THEME.settingsTxt_b = z;
}
}
else if (strcmp(cfg_name, "pagesize") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.pagesize = x;
}
}
else if (strcmp(cfg_name, "batteryUnused") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.batteryUnused = x;
}
} else if (strcmp(cfg_name, "tooltipAlpha") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.tooltipAlpha = x;
}
}
/*
else if (strcmp(cfg_name, "maxcharacters") == 0) {
short x;
if (sscanf(val, "%hd", &x) == 1) {
THEME.maxcharacters = x;
}
}
*/
cfg_bool("show_id", &THEME.showID);
cfg_bool("show_tooltip", &THEME.showToolTip);
cfg_bool("show_hddinfo", &THEME.showHDD);
cfg_bool("show_gamecount", &THEME.showGameCnt);
cfg_bool("show_region", &THEME.showRegion);
cfg_bool("show_battery", &THEME.showBattery);
cfg_map_auto("hddinfo_align", map_alignment, &THEME.hddInfoAlign);
cfg_map_auto("gamecount_align", map_alignment, &THEME.gameCntAlign);
cfg_map_auto("clock_align", map_alignment, &THEME.clockAlign);
/*
else if (strcmp(cfg_name, "entry_lines") == 0) {
int x;
if (sscanf(val, "%d", &x) == 1) {
ENTRIES_PER_PAGE = x;
}
}
else if (strcmp(cfg_name, "max_characters") == 0) {
int x;
if (sscanf(val, "%d", &x) == 1) {
MAX_CHARACTERS = x;
}
}*/
}
void global_cfg_set(char *name, char *val) {
@ -1206,6 +1151,7 @@ bool cfg_save_global() { // save global settings
fprintf(f, "wsprompt = %d\n", Settings.wsprompt);
fprintf(f, "parentalcontrol = %d\n ", Settings.parentalcontrol);
fprintf(f, "cover_path = %s\n ", Settings.covers_path);
fprintf(f, "cover2d_path = %s\n ", Settings.covers2d_path);
if (CFG.widescreen) {
fprintf(f, "wtheme_path = %s\n ", CFG.theme_path);
} else {
@ -1559,9 +1505,9 @@ bool cfg_load_global() {
Settings.keyset = us;
Settings.hddinfo = hr12;
Settings.gameDisplay = list;
Settings.sinfo = ((THEME.showID) ? GameID : Neither);
Settings.sinfo = ((THEME.show_id) ? GameID : Neither);
Settings.rumble = RumbleOn;
if (THEME.showRegion) {
if (THEME.show_region) {
Settings.sinfo = ((Settings.sinfo == GameID) ? Both : GameRegion);
}
Settings.volume = 80;
@ -1655,6 +1601,7 @@ void CFG_Load(void) {
cfg_parsefile(pathname, &widescreen_set); //first set widescreen
cfg_parsefile(pathname, &path_set); //then set config and layout options
WorkAroundIconSet=0; WorkAroundBarOffset=100; // set Workaroundstuff to defaults
snprintf(pathname, sizeof(pathname), "%sGXtheme.cfg", CFG.theme_path);
cfg_parsefile(pathname, &theme_set); //finally set theme information

View File

@ -51,94 +51,129 @@ extern "C" {
struct THEME {
int selection_x;
int selection_y;
int selection_w;
int selection_h;
int gamegrid_x;
int gamegrid_y;
int gamegrid_w;
int gamegrid_h;
int tooltipAlpha;
int gamecarousel_x;
int gamecarousel_y;
int gamecarousel_w;
int gamecarousel_h;
short cover_x;
short cover_y;
short showID;
// short maxcharacters;
short batteryUnused;
short homebrew_x;
short homebrew_y;
short gamelist_x;
short gamelist_y;
short gamelist_w;
short gamelist_h;
short gamegrid_x;
short gamegrid_y;
short gamegrid_w;
short gamegrid_h;
short gamecarousel_x;
short gamecarousel_y;
short gamecarousel_w;
short gamecarousel_h;
short covers_x;
short covers_y;
short show_id;
short id_x;
short id_y;
short show_region;
short region_x;
short region_y;
short sdcard_x;
short sdcard_y;
short homebrew_x;
short homebrew_y;
short power_x;
short power_y;
short home_x;
short home_y;
short battery1_x;
short battery2_x;
short battery3_x;
short battery4_x;
short battery1_y;
short battery2_y;
short battery3_y;
short battery4_y;
short setting_x;
short setting_y;
short install_x;
short install_y;
GXColor clock;
short clock_align;
short clock_x;
short clock_y;
GXColor info;
short show_hddinfo;
short hddinfo_align;
short hddinfo_x;
short hddinfo_y;
short show_gamecount;
short gamecount_align;
short gamecount_x;
short gamecount_y;
short show_tooltip;
int tooltipAlpha;
GXColor prompttext;
GXColor settingstext;
GXColor gametext;
short pagesize;
// Toolbar Icons in GameList
/*
short favorite_x;
short favorite_y;
short search_x;
short search_y;
short abc_x;
short abc_y;
short count_x;
short count_y;
short list_x;
short list_y;
short grid_x;
short grid_y;
short carousel_x;
short carousel_y;
short count_x;
short count_y;
short sortBarOffset;
// short showPower;
// short showHome;
short setting_x;
short setting_y;
short install_x;
short install_y;
short showHDD;
short hddInfoAlign;
short hddInfo_x;
short hddInfo_y;
short showGameCnt;
short gameCntAlign;
short gameCnt_x;
short gameCnt_y;
short showRegion;
short showBattery;
short showToolTip;
//color
short info_r;
short info_g;
short info_b;
short prompttxt_r;
short prompttxt_g;
short prompttxt_b;
short settingsTxt_r;
short settingsTxt_g;
short settingsTxt_b;
short clock_r;
short clock_g;
short clock_b;
short clock_x;
short clock_y;
short clockAlign;
short sdcard_x;
short sdcard_y;
short gameText_r;
short gameText_g;
short gameText_b;
short pagesize;
*/
// Toolbar Icons in GameList
short gamelist_favorite_x;
short gamelist_favorite_y;
short gamelist_search_x;
short gamelist_search_y;
short gamelist_abc_x;
short gamelist_abc_y;
short gamelist_count_x;
short gamelist_count_y;
short gamelist_list_x;
short gamelist_list_y;
short gamelist_grid_x;
short gamelist_grid_y;
short gamelist_carousel_x;
short gamelist_carousel_y;
// Toolbar Icons in GameGrid
short gamegrid_favorite_x;
short gamegrid_favorite_y;
short gamegrid_search_x;
short gamegrid_search_y;
short gamegrid_abc_x;
short gamegrid_abc_y;
short gamegrid_count_x;
short gamegrid_count_y;
short gamegrid_list_x;
short gamegrid_list_y;
short gamegrid_grid_x;
short gamegrid_grid_y;
short gamegrid_carousel_x;
short gamegrid_carousel_y;
// Toolbar Icons in GameCarousel
short gamecarousel_favorite_x;
short gamecarousel_favorite_y;
short gamecarousel_search_x;
short gamecarousel_search_y;
short gamecarousel_abc_x;
short gamecarousel_abc_y;
short gamecarousel_count_x;
short gamecarousel_count_y;
short gamecarousel_list_x;
short gamecarousel_list_y;
short gamecarousel_grid_x;
short gamecarousel_grid_y;
short gamecarousel_carousel_x;
short gamecarousel_carousel_y;
};
extern struct CFG CFG;
@ -342,6 +377,7 @@ extern "C" {
u8 screensaver;
short godmode;
char covers_path[100];
char covers2d_path[100];
char theme_path[100];
char wtheme_path[100];
char disc_path[100];

View File

@ -1,6 +1,8 @@
#ifndef _DISC_H_
#define _DISC_H_
#include <gccore.h> /* for define ATTRIBUTE_PACKED */
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -3,12 +3,44 @@
#include "settings/cfg.h"
#include "usbloader/wbfs.h"
#include "main.h"
#include <wctype.h>
#include "getentries.h"
#include <algorithm>
#include <vector>
struct discHdr * gameList=NULL;
s32 gameSelected=0, gameStart=0;
u32 gameCnt=0;
wchar_t *gameFilter=NULL;
wchar_t *gameFilterNextList=NULL;
wchar_t *gameFilterPrev=NULL;
/****************************************************************************
* wcsdup based on new wchar_t [...]
***************************************************************************/
wchar_t *wcsdup(const wchar_t *src)
{
int len = wcslen(src)+1;
wchar_t *dst = new wchar_t[len];
if(dst) wcscpy(dst, src);
return dst;
}
inline int wcsnicmp(const wchar_t *s1, const wchar_t *s2, int len)
{
if (len <= 0)
return (0);
do
{
int r = towupper(*s1) - towupper(*s2++);
if (r) return r;
if (*s1++ == 0)
break;
} while (--len != 0);
return (0);
}
struct discHdr * gameList;
u32 gameCnt;
s32 gameSelected, gameStart;
/****************************************************************************
* EntryCmp
@ -52,17 +84,158 @@ s32 __Menu_EntryCmpCount(const void *a, const void *b) {
return ret;
}
/****************************************************************************
* Get PrevFilter
***************************************************************************/
int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t **PgameFilterPrev)
{
std::vector<wchar_t *> nameList;
struct discHdr *buffer = NULL;
u32 cnt, len, i;
s32 ret;
wchar_t *new_gameFilterPrev = wcsdup(gameFilter);
/* Get list length */
ret = WBFS_GetCount(&cnt);
if (ret < 0)
return ret;
/* Buffer length */
len = sizeof(struct discHdr) * cnt;
/* Allocate memory */
buffer = (struct discHdr *)memalign(32, len);
if (!buffer)
return -1;
/* Clear buffer */
memset(buffer, 0, len);
/* Get header list */
ret = WBFS_GetHeaders(buffer, cnt, sizeof(struct discHdr));
if (ret < 0) {
if (buffer) free(buffer);
return ret;
}
/* Fill nameList */
for (i = 0; i < cnt; i++)
{
struct discHdr *header = &buffer[i];
/* Filter Favorite */
if (Settings.fave && t==0)
{
struct Game_NUM* game_num = CFG_get_game_num(header->id);
if (!game_num || game_num->favorite==0)
continue;
}
/* Filter Pparental */
if (Settings.parentalcontrol && !Settings.godmode && t==0)
if(get_block(header) >= Settings.parentalcontrol)
continue;
wchar_t *wname = FreeTypeGX::charToWideChar(get_title(header));
if(wname) nameList.push_back(wname);
}
/* delete buffer */
if(buffer) free(buffer);
/* Find Prev-Filter */
len = wcslen(new_gameFilterPrev);
while(len)
{
cnt = 0;
new_gameFilterPrev[--len] = 0;
for(std::vector<wchar_t *>::iterator iter = nameList.begin(); iter < nameList.end(); iter++)
{
if(!wcsncmp(*iter, new_gameFilterPrev, len))
cnt++;
}
if(cnt > gameFiltered)
break;
}
/* Clean name List */
for(std::vector<wchar_t *>::iterator iter = nameList.begin(); iter < nameList.end(); iter++)
delete [] *iter;
if(PgameFilterPrev)
*PgameFilterPrev = new_gameFilterPrev;
return 0;
}
/****************************************************************************
* Get GameFilter NextList
***************************************************************************/
int int_cmp(const void *a, const void *b) { return *((u32*)a)-*((u32*)b); }
int __Menu_GetGameFilter_NextList(discHdr *gameList, u32 gameCnt, wchar_t **PgameFilter, wchar_t **PgameFilterNextList)
{
u32 filter_len = wcslen(*PgameFilter);
u32 i, lastChar=0;
wchar_t *p;
u32 *nextList = new u32[gameCnt]; if(nextList==NULL) return -1;
for(i=0; i<gameCnt; i++)
{
u32 nextFilterChar = 0x10000;
wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(&gameList[i]));
if(gameName == NULL) goto error;
if(wcslen(gameName) > filter_len && (filter_len == 0 || !wcsnicmp(*PgameFilter, gameName, filter_len)))
nextFilterChar = towupper(gameName[filter_len]);
nextList[i] = nextFilterChar;
}
qsort(nextList, gameCnt, sizeof(u32), int_cmp);
*PgameFilterNextList = new wchar_t[gameCnt+1];
if(*PgameFilterNextList == NULL) goto error;
p = *PgameFilterNextList;
lastChar = 0;
for(i=0; i<gameCnt; i++)
{
u32 Char = nextList[i];
if(lastChar != Char)
{
if(Char == 0x10000)
break;
*p++ = lastChar = Char;
}
}
*p = 0;
if(wcslen(*PgameFilterNextList) == 1) // only one nextChar
{
wchar_t *newFilter = new wchar_t[filter_len + 2];
if(newFilter == NULL) goto error;
wcscpy(newFilter, *PgameFilter);
wcscat(newFilter, *PgameFilterNextList);
delete [] *PgameFilter; *PgameFilter = newFilter;
delete [] *PgameFilterNextList; *PgameFilterNextList = NULL;
return __Menu_GetGameFilter_NextList(gameList, gameCnt, PgameFilter, PgameFilterNextList);
}
return 0;
error:
if(nextList) delete [] nextList;
if(*PgameFilterNextList) delete [] *PgameFilterNextList;
return -1;
}
/****************************************************************************
* Get Gamelist
***************************************************************************/
int __Menu_GetEntries(int t) {
int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameCnt) {
struct discHdr *buffer = NULL;
struct discHdr *buffer2 = NULL;
struct discHdr *header = NULL;
u32 cnt, len;
u32 cnt, cnt2=0, len;
s32 ret;
/* Get list length */
@ -87,64 +260,40 @@ int __Menu_GetEntries(int t) {
if (buffer) free(buffer);
return ret;
}
for (u32 i = 0; i < cnt; i++) {
struct discHdr *header = &buffer[i];
/* Filters */
if (Settings.fave && t==0) {
u32 cnt2 = 0;
for (u32 i = 0; i < cnt; i++) {
header = &buffer[i];
u8 favorite = 0;
struct Game_NUM* game_num = CFG_get_game_num(header->id);
if (game_num) {
favorite = game_num->favorite;
}
if (favorite==1) {
buffer2 = (discHdr *) realloc(buffer2, (cnt2+1) * sizeof(struct discHdr));
if (!buffer2) {
free(buffer);
return -1;
}
memcpy((buffer2 + cnt2), (buffer + i), sizeof(struct discHdr));
cnt2++;
}
}
if (buffer2) {
free(buffer);
buffer = buffer2;
buffer2 = NULL;
} else {
memset(buffer, 0, len);
}
cnt = cnt2;
if (!game_num || game_num->favorite==0)
continue;
}
if (Settings.parentalcontrol && !Settings.godmode && t==0) {
u32 cnt2 = 0;
for (u32 i = 0; i < cnt; i++) {
header = &buffer[i];
if (get_block(header) < Settings.parentalcontrol) {
buffer2 = (discHdr *) realloc(buffer2, (cnt2+1) * sizeof(struct discHdr));
if (!buffer2) {
free(buffer);
return -1;
if (get_block(header) >= Settings.parentalcontrol)
continue;
}
memcpy((buffer2 + cnt2), (buffer + i), sizeof(struct discHdr));
if(gameFilter && *gameFilter && t==0) {
u32 filter_len = wcslen(gameFilter);
wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) {
delete [] gameName;
continue;
}
}
if(i != cnt2)
buffer[cnt2] = buffer[i];
cnt2++;
}
}
if (buffer2) {
free(buffer);
buffer = buffer2;
buffer2 = NULL;
} else {
memset(buffer, 0, len);
}
if(cnt > cnt2)
{
cnt = cnt2;
buffer = (struct discHdr *)realloc(buffer, sizeof(struct discHdr) * cnt);
}
if (!buffer)
return -1;
if (Settings.sort==pcount) {
qsort(buffer, cnt, sizeof(struct discHdr), __Menu_EntryCmpCount);
@ -152,17 +301,58 @@ int __Menu_GetEntries(int t) {
qsort(buffer, cnt, sizeof(struct discHdr), __Menu_EntryCmp);
}
/* Free memory */
if (gameList)
free(gameList);
/* Set values */
gameList = buffer;
buffer = NULL;
gameCnt = cnt;
/* Reset variables */
gameSelected = gameStart = 0;
if(PgameList) *PgameList = buffer; else free(buffer);
if(PgameCnt) *PgameCnt = cnt;
return 0;
}
int __Menu_GetEntries(int t, const wchar_t* Filter) {
u32 new_gameCnt = 0;
struct discHdr *new_gameList = NULL;
wchar_t *new_gameFilter = NULL;
wchar_t *new_gameFilterNextList = NULL;
wchar_t *new_gameFilterPrev = NULL;
new_gameFilter = wcsdup(Filter ? Filter : (gameFilter ? gameFilter : L"") );
if(new_gameFilter == NULL) return -1;
for(;;)
{
if(__Menu_GetGameList(t, new_gameFilter, &new_gameList, &new_gameCnt) < 0)
return -1;
if(new_gameCnt > 0 || new_gameFilter[0] == 0)
break;
new_gameFilter[wcslen(new_gameFilter)-1] = 0;
}
/* init GameFilterNextList */
if(__Menu_GetGameFilter_NextList(new_gameList, new_gameCnt, &new_gameFilter, &new_gameFilterNextList) < 0)
goto error;
/* init GameFilterPrev */
if(__Menu_GetPrevFilter(t, new_gameFilter, new_gameCnt, &new_gameFilterPrev) < 0)
goto error;
/* Set values */
if(gameList) free(gameList);
if(gameFilter) delete [] gameFilter;
if(gameFilterNextList) delete [] gameFilterNextList;
if(gameFilterPrev) delete [] gameFilterPrev;
gameList = new_gameList;
gameCnt = new_gameCnt;
gameFilter = new_gameFilter;
gameFilterNextList = new_gameFilterNextList;
gameFilterPrev = new_gameFilterPrev;
/* Reset variables */
gameSelected = gameStart = 0;
return 0;
error: // clean up
if(new_gameList) free(new_gameList);
if(new_gameFilter) delete [] new_gameFilter;
if(new_gameFilterNextList) delete [] new_gameFilterNextList;
if(new_gameFilterPrev) delete [] new_gameFilterPrev;
return -1;
}

View File

@ -8,10 +8,24 @@
#ifndef _GETENTRIES_H_
#define _GETENTRIES_H_
#include <wctype.h>
struct discHdr;
extern discHdr *gameList;
extern u32 gameCnt;
extern wchar_t *gameFilter;
extern wchar_t *gameFilterNextList;
extern wchar_t *gameFilterPrev;
//! param t
//! make this 1 if you want the function to ignore the rules
//! (settings and parental control) when making the game list.
//!
int __Menu_GetEntries(int t=0);
//! param Filter
//! set this Parameter to Filter the List
//! if this Parameter=NULL then the filter is not changed
//! if this Parameter="" then no filter is activ
//!
int __Menu_GetEntries(int t=0, const wchar_t* Filter=NULL);
#endif

View File

@ -139,7 +139,7 @@ s32 Wad_Install(FILE *fp)
if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}
GuiText btn1Txt(tr("Ok"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Ok"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes){
btn1Txt.SetWidescreen(CFG.widescreen);
@ -171,33 +171,33 @@ s32 Wad_Install(FILE *fp)
char title[50];
sprintf(title, "%s", tr("Installing wad"));
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,40);
char msg[50];
sprintf(msg, " ");
// sprintf(msg, "%s", tr("Initializing Network"));
GuiText msg1Txt(NULL, 20, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg1Txt(NULL, 20, THEME.prompttext);
msg1Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg1Txt.SetPosition(50,75);
// char msg2[50] = " ";
GuiText msg2Txt(NULL, 20, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg2Txt(NULL, 20, THEME.prompttext);
msg2Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg2Txt.SetPosition(50, 98);
GuiText msg3Txt(NULL, 20, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg3Txt(NULL, 20, THEME.prompttext);
msg3Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg3Txt.SetPosition(50, 121);
GuiText msg4Txt(NULL, 20, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg4Txt(NULL, 20, THEME.prompttext);
msg4Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg4Txt.SetPosition(50, 144);
GuiText msg5Txt(NULL, 20, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg5Txt(NULL, 20, THEME.prompttext);
msg5Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg5Txt.SetPosition(50, 167);
GuiText prTxt(NULL, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText prTxt(NULL, 26, THEME.prompttext);
prTxt.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
prTxt.SetPosition(0, 50);
@ -236,6 +236,7 @@ s32 Wad_Install(FILE *fp)
///start the wad shit
bool fail = false;
wadHeader *header = NULL;
void *pvoid;
signed_blob *p_certs = NULL, *p_crl = NULL, *p_tik = NULL, *p_tmd = NULL;
tmd *tmd_data = NULL;
@ -247,49 +248,51 @@ s32 Wad_Install(FILE *fp)
ResumeGui();
msg1Txt.SetText(tr(">> Reading WAD data..."));
HaltGui();
#define SetPointer(a, p) a=(typeof(a))p
// WAD header
//ret = __Wad_ReadAlloc(fp, (void *)header, offset, sizeof(wadHeader));
ret = __Wad_ReadAlloc(fp, (void **)&header, offset, sizeof(wadHeader));
ret = __Wad_ReadAlloc(fp, &pvoid, offset, sizeof(wadHeader));
if (ret < 0)
goto err;
else
SetPointer(header, pvoid);
offset += round_up(header->header_len, 64);
// WAD certificates
//ret = __Wad_ReadAlloc(fp, (void *)&p_certs, offset, header->certs_len);
ret = __Wad_ReadAlloc(fp, (void **)&p_certs, offset, header->certs_len);
ret = __Wad_ReadAlloc(fp, &pvoid, offset, header->certs_len);
if (ret < 0)
goto err;
else
SetPointer(p_certs, pvoid);
offset += round_up(header->certs_len, 64);
// WAD crl
if (header->crl_len) {
//ret = __Wad_ReadAlloc(fp, (void *)&p_crl, offset, header->crl_len);
ret = __Wad_ReadAlloc(fp, (void **)&p_crl, offset, header->crl_len);
ret = __Wad_ReadAlloc(fp, &pvoid, offset, header->crl_len);
if (ret < 0)
goto err;
else
SetPointer(p_crl, pvoid);
offset += round_up(header->crl_len, 64);
}
// WAD ticket
//ret = __Wad_ReadAlloc(fp, (void *)&p_tik, offset, header->tik_len);
ret = __Wad_ReadAlloc(fp, (void **)&p_tik, offset, header->tik_len);
ret = __Wad_ReadAlloc(fp, &pvoid, offset, header->tik_len);
if (ret < 0)
goto err;
else
SetPointer(p_tik, pvoid);
offset += round_up(header->tik_len, 64);
// WAD TMD
//ret = __Wad_ReadAlloc(fp, (void *)&p_tmd, offset, header->tmd_len);
ret = __Wad_ReadAlloc(fp, (void **)&p_tmd, offset, header->tmd_len);
ret = __Wad_ReadAlloc(fp, &pvoid, offset, header->tmd_len);
if (ret < 0)
goto err;
else
SetPointer(p_tmd, pvoid);
offset += round_up(header->tmd_len, 64);
ResumeGui();
msg1Txt.SetText(tr("Reading WAD data... Ok!"));
msg2Txt.SetText(tr(">> Installing ticket..."));
@ -465,7 +468,7 @@ s32 Wad_Uninstall(FILE *fp)
if (Settings.wsprompt == yes){
dialogBoxImg.SetWidescreen(CFG.widescreen);}
GuiText btn1Txt(tr("Ok"), 22, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText btn1Txt(tr("Ok"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes){
btn1Txt.SetWidescreen(CFG.widescreen);
@ -476,27 +479,27 @@ s32 Wad_Uninstall(FILE *fp)
char title[50];
sprintf(title, "%s", tr("Uninstalling wad"));
GuiText titleTxt(title, 26, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText titleTxt(title, 26, THEME.prompttext);
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(0,40);
GuiText msg1Txt(NULL, 18, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg1Txt(NULL, 18, THEME.prompttext);
msg1Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg1Txt.SetPosition(50,75);
GuiText msg2Txt(NULL, 18, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg2Txt(NULL, 18, THEME.prompttext);
msg2Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg2Txt.SetPosition(50, 98);
GuiText msg3Txt(NULL, 18, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg3Txt(NULL, 18, THEME.prompttext);
msg3Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg3Txt.SetPosition(50, 121);
GuiText msg4Txt(NULL, 18, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg4Txt(NULL, 18, THEME.prompttext);
msg4Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg4Txt.SetPosition(50, 144);
GuiText msg5Txt(NULL, 18, (GXColor){THEME.prompttxt_r, THEME.prompttxt_g, THEME.prompttxt_b, 255});
GuiText msg5Txt(NULL, 18, THEME.prompttext);
msg5Txt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
msg5Txt.SetPosition(50, 167);
@ -528,6 +531,7 @@ s32 Wad_Uninstall(FILE *fp)
///start the wad shit
wadHeader *header = NULL;
void *pvoid = NULL;
tikview *viewData = NULL;
u64 tid;
@ -537,7 +541,7 @@ s32 Wad_Uninstall(FILE *fp)
msg1Txt.SetText(tr(">> Reading WAD data..."));
// WAD header
ret = __Wad_ReadAlloc(fp, (void **)&header, 0, sizeof(wadHeader));
ret = __Wad_ReadAlloc(fp, &pvoid, 0, sizeof(wadHeader));
if (ret < 0) {
char errTxt[50];
sprintf(errTxt,"%sret = %d",tr(">> Reading WAD data...ERROR! "),ret);
@ -545,6 +549,7 @@ s32 Wad_Uninstall(FILE *fp)
//printf(" ERROR! (ret = %d)\n", ret);
goto out;
}
SetPointer(header, pvoid);
// Get title ID
ret = __Wad_GetTitleID(fp, header, &tid);