2012-01-21 21:57:41 +01:00
# include <unistd.h>
# include <fstream>
# include <sys/stat.h>
2012-08-05 15:48:15 +02:00
# include "menu.hpp"
# include "channel/nand.hpp"
# include "devicemounter/DeviceHandler.hpp"
# include "gui/GameTDB.hpp"
2012-01-27 20:38:52 +01:00
# include "loader/alt_ios.h"
2012-08-05 15:48:15 +02:00
# include "loader/cios.h"
# include "loader/disc.h"
2012-08-11 14:27:38 +02:00
# include "loader/nk.h"
2012-08-05 15:48:15 +02:00
# include "loader/wbfs.h"
# include "loader/wdvd.h"
# include "network/gcard.h"
2012-01-21 21:57:41 +01:00
static inline int loopNum ( int i , int s )
{
return i < 0 ? ( s - ( - i % s ) ) % s : i % s ;
}
void CMenu : : _hideMain ( bool instant )
{
m_btnMgr . hide ( m_mainBtnNext , instant ) ;
m_btnMgr . hide ( m_mainBtnPrev , instant ) ;
m_btnMgr . hide ( m_mainBtnConfig , instant ) ;
m_btnMgr . hide ( m_mainBtnInfo , instant ) ;
m_btnMgr . hide ( m_mainBtnQuit , instant ) ;
m_btnMgr . hide ( m_mainBtnHomebrew , instant ) ;
m_btnMgr . hide ( m_mainBtnChannel , instant ) ;
m_btnMgr . hide ( m_mainBtnUsb , instant ) ;
2012-01-21 22:15:45 +01:00
m_btnMgr . hide ( m_mainBtnDML , instant ) ;
2012-04-08 17:54:34 +02:00
m_btnMgr . hide ( m_mainBtnEmu , instant ) ;
2012-01-21 21:57:41 +01:00
m_btnMgr . hide ( m_mainBtnDVD , instant ) ;
m_btnMgr . hide ( m_mainBtnInit , instant ) ;
m_btnMgr . hide ( m_mainBtnInit2 , instant ) ;
m_btnMgr . hide ( m_mainLblInit , instant ) ;
m_btnMgr . hide ( m_mainBtnFavoritesOn , instant ) ;
m_btnMgr . hide ( m_mainBtnFavoritesOff , instant ) ;
m_btnMgr . hide ( m_mainLblLetter , instant ) ;
m_btnMgr . hide ( m_mainLblNotice , instant ) ;
2012-07-05 15:15:23 +02:00
for ( u8 i = 0 ; i < ARRAY_SIZE ( m_mainLblUser ) ; + + i )
2012-09-13 16:54:17 +02:00
if ( m_mainLblUser [ i ] ! = - 1 )
2012-01-21 21:57:41 +01:00
m_btnMgr . hide ( m_mainLblUser [ i ] , instant ) ;
}
static bool show_homebrew = true ;
2012-01-25 02:11:02 +01:00
static bool parental_homebrew = false ;
2012-02-01 23:26:51 +01:00
static bool show_channel = true ;
2012-04-08 17:54:34 +02:00
static bool show_emu = true ;
2012-01-21 21:57:41 +01:00
void CMenu : : _showMain ( void )
{
2013-09-11 20:11:23 +02:00
start_main :
2012-01-21 21:57:41 +01:00
_hideWaitMessage ( ) ;
2013-01-21 00:30:28 +01:00
# ifdef SHOWMEM
m_btnMgr . show ( m_mem1FreeSize ) ;
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mem2FreeSize ) ;
# endif
m_vid . set2DViewport ( m_cfg . getInt ( " GENERAL " , " tv_width " , 640 ) , m_cfg . getInt ( " GENERAL " , " tv_height " , 480 ) ,
2012-02-01 23:26:51 +01:00
m_cfg . getInt ( " GENERAL " , " tv_x " , 0 ) , m_cfg . getInt ( " GENERAL " , " tv_y " , 0 ) ) ;
2014-03-01 00:11:02 +01:00
_setBg ( m_mainBg , m_mainBgLQ ) ;
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainBtnInfo ) ;
m_btnMgr . show ( m_mainBtnConfig ) ;
m_btnMgr . show ( m_mainBtnQuit ) ;
switch ( m_current_view )
{
2012-02-13 18:09:26 +01:00
case COVERFLOW_DML :
if ( show_channel )
m_btnMgr . show ( m_mainBtnChannel ) ;
2012-04-08 17:54:34 +02:00
else if ( show_emu )
m_btnMgr . show ( m_mainBtnEmu ) ;
2013-09-21 18:33:16 +02:00
else if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
2012-02-13 18:09:26 +01:00
m_btnMgr . show ( m_mainBtnHomebrew ) ;
2012-04-08 17:54:34 +02:00
else
2012-01-28 09:40:19 +01:00
m_btnMgr . show ( m_mainBtnUsb ) ;
2012-01-21 21:57:41 +01:00
break ;
case COVERFLOW_CHANNEL :
2012-04-08 17:54:34 +02:00
if ( show_emu )
m_btnMgr . show ( m_mainBtnEmu ) ;
else if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainBtnHomebrew ) ;
2012-02-13 18:09:26 +01:00
else
2012-01-28 09:40:19 +01:00
m_btnMgr . show ( m_mainBtnUsb ) ;
2012-01-21 22:15:45 +01:00
break ;
2013-01-15 14:54:33 +01:00
case COVERFLOW_MAX :
2012-02-13 18:09:26 +01:00
case COVERFLOW_HOMEBREW :
2012-01-21 22:15:45 +01:00
m_btnMgr . show ( m_mainBtnUsb ) ;
2012-01-21 21:57:41 +01:00
break ;
2012-10-03 23:34:37 +02:00
case COVERFLOW_PLUGIN :
2012-04-08 17:54:34 +02:00
if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
m_btnMgr . show ( m_mainBtnHomebrew ) ;
else
m_btnMgr . show ( m_mainBtnUsb ) ;
break ;
2012-01-21 21:57:41 +01:00
default :
2014-06-24 15:33:54 +02:00
if ( m_show_dml | | m_devo_installed | | m_nintendont_installed )
2012-02-13 18:09:26 +01:00
m_btnMgr . show ( m_mainBtnDML ) ;
else if ( show_channel )
2012-02-01 21:44:40 +01:00
m_btnMgr . show ( m_mainBtnChannel ) ;
2012-04-08 17:54:34 +02:00
else if ( show_emu )
m_btnMgr . show ( m_mainBtnEmu ) ;
else if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
2012-02-01 21:44:40 +01:00
m_btnMgr . show ( m_mainBtnHomebrew ) ;
else
m_btnMgr . show ( m_mainBtnUsb ) ;
2012-01-21 21:57:41 +01:00
break ;
}
2012-07-05 15:15:23 +02:00
for ( u8 i = 0 ; i < ARRAY_SIZE ( m_mainLblUser ) ; + + i )
2012-09-13 16:54:17 +02:00
if ( m_mainLblUser [ i ] ! = - 1 )
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainLblUser [ i ] ) ;
2012-06-21 16:53:20 +02:00
if ( m_gameList . empty ( ) )
2012-01-21 21:57:41 +01:00
{
2012-05-03 01:08:11 +02:00
switch ( m_current_view )
{
case COVERFLOW_USB :
case COVERFLOW_DML :
2013-08-03 21:40:46 +02:00
m_btnMgr . setText ( m_mainLblInit , _t ( " main2 " , L " Welcome to WiiFlow. I have not found any games. Click Install to install games, or Select partition to select your partition type. " ) ) ;
2012-05-03 01:08:11 +02:00
m_btnMgr . show ( m_mainBtnInit ) ;
m_btnMgr . show ( m_mainBtnInit2 ) ;
m_btnMgr . show ( m_mainLblInit ) ;
2012-06-21 16:53:20 +02:00
break ;
2012-05-03 01:08:11 +02:00
case COVERFLOW_CHANNEL :
2012-12-22 17:47:02 +01:00
if ( NANDemuView )
2012-05-03 01:08:11 +02:00
{
_hideMain ( ) ;
if ( ! _AutoCreateNand ( ) )
2013-04-08 23:45:13 +02:00
{
while ( NANDemuView )
_setPartition ( 1 ) ;
}
2012-05-03 01:08:11 +02:00
_loadList ( ) ;
2013-09-11 20:11:23 +02:00
goto start_main ;
2012-05-03 01:08:11 +02:00
}
2012-06-21 16:53:20 +02:00
break ;
2012-05-03 01:08:11 +02:00
case COVERFLOW_HOMEBREW :
2013-08-03 21:40:46 +02:00
m_btnMgr . setText ( m_mainLblInit , _t ( " main4 " , L " Welcome to WiiFlow. I have not found any homebrew apps. Select partition to select your partition type. " ) ) ;
2012-05-03 01:08:11 +02:00
m_btnMgr . show ( m_mainBtnInit2 ) ;
m_btnMgr . show ( m_mainLblInit ) ;
2012-06-21 16:53:20 +02:00
break ;
2012-10-03 23:34:37 +02:00
case COVERFLOW_PLUGIN :
2013-08-03 21:40:46 +02:00
m_btnMgr . setText ( m_mainLblInit , _t ( " main5 " , L " Welcome to WiiFlow. I have not found any plugins. Select partition to select your partition type. " ) ) ;
2012-05-03 01:08:11 +02:00
m_btnMgr . show ( m_mainBtnInit2 ) ;
m_btnMgr . show ( m_mainLblInit ) ;
2012-06-21 16:53:20 +02:00
break ;
2012-05-26 00:05:38 +02:00
}
2012-01-21 21:57:41 +01:00
}
}
void CMenu : : LoadView ( void )
{
2013-08-13 15:12:40 +02:00
m_load_view = false ;
2012-07-26 00:12:17 +02:00
_hideMain ( true ) ;
2012-11-11 19:28:03 +01:00
CoverFlow . clear ( ) ;
2012-08-06 18:46:16 +02:00
if ( ! m_vid . showingWaitMessage ( ) )
_showWaitMessage ( ) ;
2013-07-29 23:06:50 +02:00
if ( m_clearCats )
{
m_cat . remove ( " GENERAL " , " selected_categories " ) ;
m_cat . remove ( " GENERAL " , " required_categories " ) ;
}
m_clearCats = true ;
2012-09-11 14:01:07 +02:00
m_favorites = false ;
2013-09-12 15:04:50 +02:00
if ( m_cfg . getBool ( " GENERAL " , " save_favorites_mode " , false ) )
2012-09-11 14:01:07 +02:00
m_favorites = m_cfg . getBool ( _domainFromView ( ) , " favorites " , false ) ;
2013-09-12 15:04:50 +02:00
if ( m_sourceflow )
_createSFList ( ) ;
else
_loadList ( ) ;
2013-10-19 17:31:08 +02:00
if ( m_source_autoboot = = true )
{ /* search for the requested file */
bool game_found = false ;
for ( vector < dir_discHdr > : : iterator element = m_gameList . begin ( ) ; element ! = m_gameList . end ( ) ; + + element )
{
switch ( m_autoboot_hdr . type )
{
case TYPE_CHANNEL :
case TYPE_WII_GAME :
case TYPE_GC_GAME :
if ( strcmp ( m_autoboot_hdr . id , element - > id ) = = 0 )
game_found = true ;
break ;
case TYPE_HOMEBREW :
case TYPE_PLUGIN :
if ( wcsncmp ( m_autoboot_hdr . title , element - > title , 63 ) = = 0 )
game_found = true ;
break ;
default :
break ;
}
if ( game_found = = true )
{
memcpy ( & m_autoboot_hdr , & ( * ( element ) ) , sizeof ( dir_discHdr ) ) ;
break ;
}
}
if ( game_found = = true )
{
gprintf ( " Game found, autobooting... \n " ) ;
_launch ( & m_autoboot_hdr ) ;
}
/* fail */
m_source_autoboot = false ;
}
2012-01-21 21:57:41 +01:00
_showMain ( ) ;
_initCF ( ) ;
_loadCFLayout ( m_cfg . getInt ( _domainFromView ( ) , " last_cf_mode " , 1 ) ) ;
2012-11-11 19:28:03 +01:00
CoverFlow . applySettings ( ) ;
2012-01-21 21:57:41 +01:00
2013-09-12 15:04:50 +02:00
if ( m_sourceflow )
return ;
2012-11-14 17:58:14 +01:00
const char * mode = ( m_current_view = = COVERFLOW_CHANNEL & & m_cfg . getBool ( CHANNEL_DOMAIN , " disable " , true ) )
? CHANNEL_DOMAIN : DeviceName [ currentPartition ] ;
2012-01-21 21:57:41 +01:00
2013-01-06 22:17:30 +01:00
m_showtimer = 120 ;
m_btnMgr . setText ( m_mainLblNotice , sfmt ( " %s (%u) [%s] " , _domainFromView ( ) , m_gameList . size ( ) , upperCase ( mode ) . c_str ( ) ) ) ;
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainLblNotice ) ;
}
2012-07-05 21:57:28 +02:00
void CMenu : : exitHandler ( int ExitTo )
2012-06-21 14:25:47 +02:00
{
2012-09-09 20:35:15 +02:00
m_exit = true ;
if ( ExitTo = = EXIT_TO_BOOTMII ) //Bootmii, check that the files are there, or ios will hang.
2012-06-21 14:25:47 +02:00
{
2012-09-09 20:35:15 +02:00
struct stat dummy ;
2012-09-22 15:47:52 +02:00
if ( ! DeviceHandle . IsInserted ( SD ) | |
2012-09-09 20:35:15 +02:00
stat ( " sd:/bootmii/armboot.bin " , & dummy ) ! = 0 | |
stat ( " sd:/bootmii/ppcboot.elf " , & dummy ) ! = 0 )
ExitTo = EXIT_TO_HBC ;
2012-06-21 14:25:47 +02:00
}
2012-12-07 23:40:16 +01:00
if ( ExitTo ! = WIIFLOW_DEF )
Sys_ExitTo ( ExitTo ) ;
2012-06-21 14:25:47 +02:00
}
2012-01-21 21:57:41 +01:00
int CMenu : : main ( void )
{
wstringEx curLetter ;
string prevTheme = m_cfg . getString ( " GENERAL " , " theme " , " default " ) ;
2013-04-08 23:45:13 +02:00
parental_homebrew = m_cfg . getBool ( HOMEBREW_DOMAIN , " parental " , false ) ;
2012-11-04 20:22:02 +01:00
show_homebrew = ! m_cfg . getBool ( HOMEBREW_DOMAIN , " disable " , false ) ;
2012-02-01 23:26:51 +01:00
show_channel = ! m_cfg . getBool ( " GENERAL " , " hidechannel " , false ) ;
2012-11-04 20:22:02 +01:00
show_emu = ! m_cfg . getBool ( PLUGIN_DOMAIN , " disable " , false ) ;
2012-02-15 18:57:34 +01:00
bool dpad_mode = m_cfg . getBool ( " GENERAL " , " dpad_mode " , false ) ;
2012-03-19 14:14:49 +01:00
bool b_lr_mode = m_cfg . getBool ( " GENERAL " , " b_lr_mode " , false ) ;
2012-08-06 18:46:16 +02:00
bool use_grab = m_cfg . getBool ( " GENERAL " , " use_grab " , false ) ;
2013-07-23 15:14:51 +02:00
m_use_source = m_cfg . getBool ( " GENERAL " , " use_source " , false ) ;
2012-08-17 16:16:58 +02:00
bool bheld = false ;
2012-08-21 16:30:42 +02:00
bool bUsed = false ;
2012-04-08 17:54:34 +02:00
2012-01-21 21:57:41 +01:00
m_reload = false ;
2012-08-26 14:05:04 +02:00
u32 disc_check = 0 ;
2012-01-21 21:57:41 +01:00
int done = 0 ;
2012-05-25 21:48:35 +02:00
SetupInput ( true ) ;
2012-02-01 23:26:51 +01:00
GameTDB m_gametdb ;
2012-05-04 14:30:43 +02:00
m_gametdb . OpenFile ( fmt ( " %s/wiitdb.xml " , m_settingsDir . c_str ( ) ) ) ;
2012-09-16 11:55:32 +02:00
m_GameTDBLoaded = false ;
2012-06-21 14:25:47 +02:00
if ( m_gametdb . IsLoaded ( ) )
2012-02-01 23:26:51 +01:00
{
2012-09-16 11:55:32 +02:00
m_GameTDBLoaded = true ;
2012-02-01 23:26:51 +01:00
m_gametdb . CloseFile ( ) ;
}
2013-08-13 15:12:40 +02:00
m_last_view = max ( 0 , min ( m_cfg . getInt ( " GENERAL " , " last_view " , 6 ) , 6 ) ) ;
if ( m_last_view = = 6 | | m_last_view = = 0 )
{
m_last_view = 0 ;
_clearSources ( ) ;
m_cfg . setBool ( WII_DOMAIN , " source " , true ) ;
}
m_current_view = m_last_view ;
2013-10-30 14:07:59 +01:00
m_catStartPage = m_cfg . getInt ( " GENERAL " , " cat_startpage " , 1 ) ;
2013-10-09 18:05:29 +02:00
if ( m_current_view ! = COVERFLOW_MAX )
2013-10-28 13:02:47 +01:00
{
2013-10-30 14:07:59 +01:00
m_cfg . remove ( " GENERAL " , " last_view " ) ;
m_cfg . remove ( " GENERAL " , " cat_startpage " ) ;
2013-10-28 13:02:47 +01:00
}
2013-10-30 14:07:59 +01:00
else
m_combined_view = true ;
m_cfg . save ( ) ;
2012-09-16 11:55:32 +02:00
if ( m_cfg . getBool ( " GENERAL " , " update_cache " , false ) )
2012-01-29 05:25:45 +01:00
UpdateCache ( ) ;
2012-08-06 18:46:16 +02:00
LoadView ( ) ;
2013-08-17 15:21:43 +02:00
if ( m_cfg . getBool ( " GENERAL " , " source_on_start " , false ) )
2012-04-09 00:05:37 +02:00
{
2012-08-06 18:46:16 +02:00
_hideMain ( ) ;
2013-09-12 15:04:50 +02:00
if ( m_cfg . getBool ( " SOURCEFLOW " , " enabled " , false ) )
{
m_sourceflow = true ;
2012-08-06 18:46:16 +02:00
LoadView ( ) ;
2013-09-12 15:04:50 +02:00
}
2012-08-06 18:46:16 +02:00
else
2013-01-19 22:41:05 +01:00
{
2013-09-12 15:04:50 +02:00
if ( ! _Source ( ) )
LoadView ( ) ;
else
{
if ( BTN_B_HELD )
bUsed = true ;
_initCF ( ) ;
_showMain ( ) ;
}
2013-01-19 22:41:05 +01:00
}
2012-04-09 00:05:37 +02:00
}
2014-03-01 00:11:02 +01:00
gprintf ( " start \n " ) ;
2012-09-09 20:35:15 +02:00
while ( ! m_exit )
2012-01-21 21:57:41 +01:00
{
2012-08-26 14:05:04 +02:00
/* IMPORTANT check if a disc is inserted */
WDVD_GetCoverStatus ( & disc_check ) ;
/* Main Loop */
2012-01-21 21:57:41 +01:00
_mainLoopCommon ( true ) ;
2013-09-13 17:38:23 +02:00
if ( bheld & & ! BTN_B_HELD )
2012-08-17 16:16:58 +02:00
{
bheld = false ;
2012-08-21 16:30:42 +02:00
if ( bUsed )
bUsed = false ;
else
{
2013-09-12 15:04:50 +02:00
if ( m_sourceflow )
{
m_sourceflow = false ;
LoadView ( ) ;
continue ;
}
2013-09-13 17:38:23 +02:00
if ( m_use_source )
2013-01-19 22:41:05 +01:00
{
2013-09-13 17:38:23 +02:00
_hideMain ( ) ;
if ( m_cfg . getBool ( " SOURCEFLOW " , " enabled " , false ) )
{
m_sourceflow = true ;
2013-09-12 15:04:50 +02:00
LoadView ( ) ;
2013-09-13 17:38:23 +02:00
}
2013-09-12 15:04:50 +02:00
else
{
2013-09-13 17:38:23 +02:00
if ( ! _Source ( ) ) //Different source selected
LoadView ( ) ;
else
{
if ( BTN_B_HELD )
bUsed = true ;
_initCF ( ) ;
_showMain ( ) ;
}
2013-09-12 15:04:50 +02:00
}
2013-09-13 17:38:23 +02:00
continue ;
2013-01-19 22:41:05 +01:00
}
2012-08-21 16:30:42 +02:00
}
2012-08-17 16:16:58 +02:00
}
2012-06-21 14:25:47 +02:00
if ( dpad_mode & & ( BTN_UP_PRESSED | | BTN_DOWN_PRESSED | | BTN_LEFT_PRESSED | | BTN_RIGHT_PRESSED ) & & ( m_btnMgr . selected ( m_mainBtnChannel ) | | m_btnMgr . selected ( m_mainBtnUsb ) | | m_btnMgr . selected ( m_mainBtnDML ) | | m_btnMgr . selected ( m_mainBtnHomebrew ) | | m_btnMgr . selected ( m_mainBtnEmu ) ) )
{
2013-07-29 23:06:50 +02:00
u8 lastView = m_current_view ;
2012-06-21 14:25:47 +02:00
if ( BTN_UP_PRESSED )
m_current_view = COVERFLOW_USB ;
2014-06-24 15:33:54 +02:00
else if ( BTN_DOWN_PRESSED & & ( m_show_dml | | m_devo_installed | | m_nintendont_installed ) )
2012-06-21 14:25:47 +02:00
m_current_view = COVERFLOW_DML ;
else if ( BTN_LEFT_PRESSED & & show_emu )
2012-10-03 23:34:37 +02:00
m_current_view = COVERFLOW_PLUGIN ;
2012-06-21 14:25:47 +02:00
else if ( BTN_RIGHT_PRESSED & & show_channel )
m_current_view = COVERFLOW_CHANNEL ;
2013-09-21 18:33:16 +02:00
if ( lastView = = m_current_view & & show_homebrew & & ( parental_homebrew | | ! m_locked ) )
2012-06-21 14:25:47 +02:00
m_current_view = COVERFLOW_HOMEBREW ;
2013-08-13 15:12:40 +02:00
_clearSources ( ) ;
2013-01-15 14:54:33 +01:00
switch ( m_current_view )
{
case COVERFLOW_USB :
m_cfg . setBool ( WII_DOMAIN , " source " , true ) ;
break ;
case COVERFLOW_DML :
m_cfg . setBool ( GC_DOMAIN , " source " , true ) ;
break ;
case COVERFLOW_CHANNEL :
m_cfg . setBool ( CHANNEL_DOMAIN , " source " , true ) ;
break ;
case COVERFLOW_HOMEBREW :
m_cfg . setBool ( HOMEBREW_DOMAIN , " source " , true ) ;
break ;
default :
m_cfg . setBool ( PLUGIN_DOMAIN , " source " , true ) ;
}
2013-07-29 23:06:50 +02:00
m_catStartPage = 1 ;
2013-08-13 15:12:40 +02:00
m_combined_view = false ;
2012-06-21 14:25:47 +02:00
LoadView ( ) ;
continue ;
}
2013-09-12 15:04:50 +02:00
if ( BTN_HOME_PRESSED & & ! m_sourceflow )
2012-06-21 14:25:47 +02:00
{
2012-06-21 19:28:46 +02:00
_hideMain ( ) ;
if ( _Home ( ) ) //exit wiiflow
break ;
_showMain ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-06-21 14:25:47 +02:00
}
else if ( BTN_A_PRESSED )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
if ( m_btnMgr . selected ( m_mainBtnPrev ) )
2012-11-11 19:28:03 +01:00
CoverFlow . pageUp ( ) ;
2012-06-21 14:25:47 +02:00
else if ( m_btnMgr . selected ( m_mainBtnNext ) )
2012-11-11 19:28:03 +01:00
CoverFlow . pageDown ( ) ;
2012-06-21 14:25:47 +02:00
else if ( m_btnMgr . selected ( m_mainBtnQuit ) )
{
2012-06-21 19:28:46 +02:00
_hideMain ( ) ;
if ( _Home ( ) ) //exit wiiflow
break ;
_showMain ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-06-21 14:25:47 +02:00
}
else if ( m_btnMgr . selected ( m_mainBtnChannel ) | | m_btnMgr . selected ( m_mainBtnUsb ) | | m_btnMgr . selected ( m_mainBtnDML ) | | m_btnMgr . selected ( m_mainBtnHomebrew ) | | m_btnMgr . selected ( m_mainBtnEmu ) )
{
if ( m_current_view = = COVERFLOW_USB )
2014-06-24 15:33:54 +02:00
m_current_view = ( m_show_dml | | m_devo_installed | | m_nintendont_installed ) ? COVERFLOW_DML :
( show_channel ? COVERFLOW_CHANNEL : ( show_emu ? COVERFLOW_PLUGIN :
( ( show_homebrew & & ( parental_homebrew | | ! m_locked ) ) ? COVERFLOW_HOMEBREW : COVERFLOW_USB ) ) ) ;
2012-06-21 14:25:47 +02:00
else if ( m_current_view = = COVERFLOW_DML )
2012-10-03 23:34:37 +02:00
m_current_view = show_channel ? COVERFLOW_CHANNEL : ( ( show_emu ? COVERFLOW_PLUGIN : ( show_homebrew & & ( parental_homebrew | | ! m_locked ) ) ? COVERFLOW_HOMEBREW : COVERFLOW_USB ) ) ;
2012-06-21 14:25:47 +02:00
else if ( m_current_view = = COVERFLOW_CHANNEL )
2012-10-03 23:34:37 +02:00
m_current_view = ( show_emu ? COVERFLOW_PLUGIN : ( show_homebrew & & ( parental_homebrew | | ! m_locked ) ) ? COVERFLOW_HOMEBREW : COVERFLOW_USB ) ;
else if ( m_current_view = = COVERFLOW_PLUGIN )
2012-06-21 14:25:47 +02:00
m_current_view = ( show_homebrew & & ( parental_homebrew | | ! m_locked ) ) ? COVERFLOW_HOMEBREW : COVERFLOW_USB ;
2013-01-15 14:54:33 +01:00
else if ( m_current_view = = COVERFLOW_HOMEBREW | | m_current_view = = COVERFLOW_MAX )
2012-06-21 14:25:47 +02:00
m_current_view = COVERFLOW_USB ;
2013-08-13 15:12:40 +02:00
_clearSources ( ) ;
2013-01-15 14:54:33 +01:00
switch ( m_current_view )
{
case COVERFLOW_USB :
m_cfg . setBool ( WII_DOMAIN , " source " , true ) ;
break ;
case COVERFLOW_DML :
m_cfg . setBool ( GC_DOMAIN , " source " , true ) ;
break ;
case COVERFLOW_CHANNEL :
m_cfg . setBool ( CHANNEL_DOMAIN , " source " , true ) ;
break ;
case COVERFLOW_HOMEBREW :
m_cfg . setBool ( HOMEBREW_DOMAIN , " source " , true ) ;
break ;
default :
m_cfg . setBool ( PLUGIN_DOMAIN , " source " , true ) ;
}
2013-07-29 23:06:50 +02:00
m_catStartPage = 1 ;
2013-08-13 15:12:40 +02:00
m_combined_view = false ;
2012-06-21 14:25:47 +02:00
LoadView ( ) ;
}
else if ( m_btnMgr . selected ( m_mainBtnInit ) )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
if ( ! m_locked )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
_hideMain ( ) ;
_wbfsOp ( CMenu : : WO_ADD_GAME ) ;
if ( prevTheme ! = m_cfg . getString ( " GENERAL " , " theme " ) )
{
m_reload = true ;
break ;
}
_showMain ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-01-21 21:57:41 +01:00
}
}
2012-06-21 14:25:47 +02:00
else if ( m_btnMgr . selected ( m_mainBtnInit2 ) )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
_hideMain ( ) ;
_config ( 1 ) ;
if ( prevTheme ! = m_cfg . getString ( " GENERAL " , " theme " ) )
{
m_reload = true ;
break ;
}
_showMain ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-06-21 14:25:47 +02:00
}
else if ( m_btnMgr . selected ( m_mainBtnConfig ) )
{
_hideMain ( ) ;
_config ( 1 ) ;
2012-08-06 18:46:16 +02:00
if ( prevTheme ! = m_cfg . getString ( " GENERAL " , " theme " ) )
2012-06-21 14:25:47 +02:00
{
m_reload = true ;
break ;
}
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2013-08-13 15:12:40 +02:00
if ( m_load_view )
2013-07-10 17:08:40 +02:00
LoadView ( ) ;
2013-08-13 15:12:40 +02:00
else
_showMain ( ) ;
2012-06-21 14:25:47 +02:00
}
else if ( m_btnMgr . selected ( m_mainBtnInfo ) )
{
_hideMain ( ) ;
2012-12-21 16:11:24 +01:00
_about ( true ) ;
2012-06-21 14:25:47 +02:00
_showMain ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-06-21 14:25:47 +02:00
}
else if ( m_btnMgr . selected ( m_mainBtnDVD ) )
{
2012-08-26 17:20:51 +02:00
/* Cleanup for Disc Booter */
2012-06-21 14:25:47 +02:00
_hideMain ( true ) ;
2012-11-11 19:28:03 +01:00
CoverFlow . clear ( ) ;
2012-07-26 00:12:17 +02:00
_showWaitMessage ( ) ;
2012-08-26 17:20:51 +02:00
m_gameSound . Stop ( ) ;
CheckGameSoundThread ( ) ;
/* Create Fake Header */
2012-06-21 14:25:47 +02:00
dir_discHdr hdr ;
memset ( & hdr , 0 , sizeof ( dir_discHdr ) ) ;
memcpy ( & hdr . id , " dvddvd " , 6 ) ;
2012-08-26 17:20:51 +02:00
/* Boot the Disc */
2012-06-21 14:25:47 +02:00
_launchGame ( & hdr , true ) ;
_showMain ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-06-21 14:25:47 +02:00
}
else if ( m_btnMgr . selected ( m_mainBtnFavoritesOn ) | | m_btnMgr . selected ( m_mainBtnFavoritesOff ) )
{
m_favorites = ! m_favorites ;
2012-09-11 14:01:07 +02:00
m_cfg . setBool ( _domainFromView ( ) , " favorites " , m_favorites ) ;
2012-06-21 14:25:47 +02:00
_initCF ( ) ;
}
2012-11-11 19:28:03 +01:00
else if ( ! CoverFlow . empty ( ) & & CoverFlow . select ( ) )
2012-06-21 14:25:47 +02:00
{
_hideMain ( ) ;
2013-09-12 15:04:50 +02:00
if ( m_sourceflow )
{
_sourceFlow ( ) ;
LoadView ( ) ;
continue ;
}
else
{
_game ( BTN_B_HELD ) ;
if ( m_exit )
break ;
if ( BTN_B_HELD )
bUsed = true ;
CoverFlow . cancel ( ) ;
_showMain ( ) ;
}
2012-01-21 21:57:41 +01:00
}
}
2012-06-21 14:25:47 +02:00
else if ( BTN_B_PRESSED )
2012-02-15 18:57:34 +01:00
{
2012-06-21 14:25:47 +02:00
//Events to Show Categories
if ( m_btnMgr . selected ( m_mainBtnFavoritesOn ) | | m_btnMgr . selected ( m_mainBtnFavoritesOff ) )
2012-05-22 16:15:34 +02:00
{
2012-06-21 14:25:47 +02:00
// Event handler to show categories for selection
_hideMain ( ) ;
_CategorySettings ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-06-21 14:25:47 +02:00
_showMain ( ) ;
_initCF ( ) ;
}
//Events to Switch off/on nand emu
else if ( m_btnMgr . selected ( m_mainBtnChannel ) | | m_btnMgr . selected ( m_mainBtnUsb ) | | m_btnMgr . selected ( m_mainBtnDML ) | | m_btnMgr . selected ( m_mainBtnEmu ) | | m_btnMgr . selected ( m_mainBtnHomebrew ) )
{
2013-09-13 17:38:23 +02:00
if ( ! m_use_source ) //B on mode to source
2012-09-02 15:12:37 +02:00
{
_hideMain ( ) ;
2013-09-13 17:38:23 +02:00
if ( m_cfg . getBool ( " SOURCEFLOW " , " enabled " , false ) )
{
m_sourceflow = true ;
2012-09-02 15:12:37 +02:00
LoadView ( ) ;
2013-09-13 17:38:23 +02:00
}
2012-09-02 15:12:37 +02:00
else
2013-09-13 17:38:23 +02:00
{
if ( ! _Source ( ) ) //Different source selected
LoadView ( ) ;
else
{
if ( BTN_B_HELD )
bUsed = true ;
_initCF ( ) ;
_showMain ( ) ;
}
}
2012-09-02 15:12:37 +02:00
continue ;
}
2013-09-13 17:38:23 +02:00
2012-06-21 14:25:47 +02:00
}
else if ( m_btnMgr . selected ( m_mainBtnNext ) | | m_btnMgr . selected ( m_mainBtnPrev ) )
{
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-06-21 14:25:47 +02:00
const char * domain = _domainFromView ( ) ;
int sorting = m_cfg . getInt ( domain , " sort " , SORT_ALPHA ) ;
if ( sorting ! = SORT_ALPHA & & sorting ! = SORT_PLAYERS & & sorting ! = SORT_WIFIPLAYERS & & sorting ! = SORT_GAMEID )
{
2012-11-11 19:28:03 +01:00
CoverFlow . setSorting ( ( Sorting ) SORT_ALPHA ) ;
2012-06-21 14:25:47 +02:00
m_cfg . setInt ( domain , " sort " , SORT_ALPHA ) ;
2013-09-19 20:37:41 +02:00
sorting = SORT_ALPHA ;
2012-06-21 14:25:47 +02:00
}
wchar_t c [ 2 ] = { 0 , 0 } ;
2012-11-11 19:28:03 +01:00
m_btnMgr . selected ( m_mainBtnPrev ) ? CoverFlow . prevLetter ( c ) : CoverFlow . nextLetter ( c ) ;
2013-01-06 22:17:30 +01:00
m_showtimer = 120 ;
2012-06-21 14:25:47 +02:00
curLetter . clear ( ) ;
curLetter = wstringEx ( c ) ;
if ( sorting = = SORT_ALPHA )
{
m_btnMgr . setText ( m_mainLblLetter , curLetter ) ;
m_btnMgr . show ( m_mainLblLetter ) ;
}
else
{
curLetter = _getNoticeTranslation ( sorting , curLetter ) ;
m_btnMgr . setText ( m_mainLblNotice , curLetter ) ;
m_btnMgr . show ( m_mainLblNotice ) ;
}
}
2013-09-11 20:11:23 +02:00
else if ( m_btnMgr . selected ( m_mainBtnInfo ) & & m_allow_random & & ! CoverFlow . empty ( ) )
2013-03-31 01:57:42 +01:00
{
/* WiiFlow should boot a random game */
_hideMain ( ) ;
srand ( time ( NULL ) ) ;
u16 place = ( rand ( ) + rand ( ) + rand ( ) ) % CoverFlow . size ( ) ;
gprintf ( " Lets boot the random game number %u \n " , place ) ;
const dir_discHdr * gameHdr = CoverFlow . getSpecificHdr ( place ) ;
if ( gameHdr ! = NULL )
_launch ( gameHdr ) ;
/* Shouldnt happen */
_showMain ( ) ;
}
2012-02-15 18:57:34 +01:00
}
2012-06-21 21:06:29 +02:00
else if ( WROLL_LEFT )
2012-08-17 16:42:37 +02:00
{
2012-11-11 19:28:03 +01:00
CoverFlow . left ( ) ;
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-08-17 16:42:37 +02:00
}
2012-06-21 21:06:29 +02:00
else if ( WROLL_RIGHT )
2012-08-17 16:42:37 +02:00
{
2012-11-11 19:28:03 +01:00
CoverFlow . right ( ) ;
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-08-17 16:42:37 +02:00
}
2012-06-21 14:25:47 +02:00
if ( ! BTN_B_HELD )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
if ( BTN_UP_REPEAT | | RIGHT_STICK_UP )
2012-11-11 19:28:03 +01:00
CoverFlow . up ( ) ;
2012-08-17 16:42:37 +02:00
else if ( BTN_RIGHT_REPEAT | | RIGHT_STICK_RIGHT )
2012-11-11 19:28:03 +01:00
CoverFlow . right ( ) ;
2012-06-21 14:25:47 +02:00
else if ( BTN_DOWN_REPEAT | | RIGHT_STICK_DOWN )
2012-11-11 19:28:03 +01:00
CoverFlow . down ( ) ;
2012-08-17 16:42:37 +02:00
else if ( BTN_LEFT_REPEAT | | RIGHT_STICK_LEFT )
2012-11-11 19:28:03 +01:00
CoverFlow . left ( ) ;
2012-06-21 14:25:47 +02:00
else if ( BTN_1_PRESSED | | BTN_2_PRESSED )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
if ( ! m_btnMgr . selected ( m_mainBtnQuit ) )
{
const char * domain = _domainFromView ( ) ;
s8 direction = BTN_1_PRESSED ? 1 : - 1 ;
int cfVersion = 1 + loopNum ( ( m_cfg . getInt ( domain , " last_cf_mode " , 1 ) - 1 ) + direction , m_numCFVersions ) ;
_loadCFLayout ( cfVersion ) ;
2012-11-11 19:28:03 +01:00
CoverFlow . applySettings ( ) ;
2012-06-21 14:25:47 +02:00
m_cfg . setInt ( domain , " last_cf_mode " , cfVersion ) ;
}
}
else if ( BTN_MINUS_PRESSED )
{
if ( b_lr_mode )
2012-09-22 15:47:52 +02:00
MusicPlayer . Previous ( ) ;
2012-06-21 14:25:47 +02:00
else
2012-11-11 19:28:03 +01:00
CoverFlow . pageUp ( ) ;
2012-06-21 14:25:47 +02:00
}
else if ( BTN_PLUS_PRESSED )
{
if ( b_lr_mode )
2012-09-22 15:47:52 +02:00
MusicPlayer . Next ( ) ;
2012-06-21 14:25:47 +02:00
else
2012-11-11 19:28:03 +01:00
CoverFlow . pageDown ( ) ;
2012-01-21 21:57:41 +01:00
}
}
2012-06-21 14:25:47 +02:00
else
2012-01-21 21:57:41 +01:00
{
2012-08-21 16:30:42 +02:00
bheld = true ;
2012-01-21 21:57:41 +01:00
const char * domain = _domainFromView ( ) ;
//Search by Alphabet
2012-06-21 14:25:47 +02:00
if ( BTN_DOWN_PRESSED | | BTN_UP_PRESSED )
2012-01-21 21:57:41 +01:00
{
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-01-21 21:57:41 +01:00
int sorting = m_cfg . getInt ( domain , " sort " , SORT_ALPHA ) ;
2012-06-21 14:25:47 +02:00
if ( sorting ! = SORT_ALPHA & & sorting ! = SORT_PLAYERS & & sorting ! = SORT_WIFIPLAYERS & & sorting ! = SORT_GAMEID )
2012-01-21 21:57:41 +01:00
{
2012-11-11 19:28:03 +01:00
CoverFlow . setSorting ( ( Sorting ) SORT_ALPHA ) ;
2012-01-21 21:57:41 +01:00
m_cfg . setInt ( domain , " sort " , SORT_ALPHA ) ;
2013-09-19 20:37:41 +02:00
sorting = SORT_ALPHA ;
2012-01-21 21:57:41 +01:00
}
wchar_t c [ 2 ] = { 0 , 0 } ;
2012-11-11 19:28:03 +01:00
BTN_UP_PRESSED ? CoverFlow . prevLetter ( c ) : CoverFlow . nextLetter ( c ) ;
2012-01-21 21:57:41 +01:00
curLetter . clear ( ) ;
curLetter = wstringEx ( c ) ;
2013-01-06 22:17:30 +01:00
m_showtimer = 120 ;
2012-01-21 21:57:41 +01:00
if ( sorting = = SORT_ALPHA )
{
m_btnMgr . setText ( m_mainLblLetter , curLetter ) ;
m_btnMgr . show ( m_mainLblLetter ) ;
}
else
{
curLetter = _getNoticeTranslation ( sorting , curLetter ) ;
m_btnMgr . setText ( m_mainLblNotice , curLetter ) ;
m_btnMgr . show ( m_mainLblNotice ) ;
}
}
2012-06-21 14:25:47 +02:00
else if ( BTN_LEFT_PRESSED )
2012-01-21 21:57:41 +01:00
{
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-06-21 14:25:47 +02:00
if ( b_lr_mode )
2012-11-11 19:28:03 +01:00
CoverFlow . pageUp ( ) ;
2012-06-21 14:25:47 +02:00
else
2012-09-22 15:47:52 +02:00
MusicPlayer . Previous ( ) ;
2012-06-21 14:25:47 +02:00
}
else if ( BTN_RIGHT_PRESSED )
{
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-06-21 14:25:47 +02:00
if ( b_lr_mode )
2012-11-11 19:28:03 +01:00
CoverFlow . pageDown ( ) ;
2012-06-21 14:25:47 +02:00
else
2012-09-22 15:47:52 +02:00
MusicPlayer . Next ( ) ;
2012-06-21 14:25:47 +02:00
}
2013-09-12 15:04:50 +02:00
else if ( BTN_PLUS_PRESSED & & ! m_locked & & ! m_sourceflow )
2012-06-21 14:25:47 +02:00
{
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-01-21 21:57:41 +01:00
u32 sort = 0 ;
2013-09-19 20:37:41 +02:00
sort = loopNum ( ( m_cfg . getInt ( domain , " sort " , 0 ) ) + 1 , SORT_MAX ) ;
if ( ( m_current_view = = COVERFLOW_HOMEBREW | | m_current_view = = COVERFLOW_PLUGIN ) & & sort > SORT_LASTPLAYED )
sort = SORT_ALPHA ;
2012-01-21 21:57:41 +01:00
m_cfg . setInt ( domain , " sort " , sort ) ;
2013-09-19 20:37:41 +02:00
_initCF ( ) ;
2012-01-21 21:57:41 +01:00
wstringEx curSort ;
2012-06-21 14:25:47 +02:00
if ( sort = = SORT_ALPHA )
2012-01-21 21:57:41 +01:00
curSort = m_loc . getWString ( m_curLanguage , " alphabetically " , L " Alphabetically " ) ;
2012-06-21 14:25:47 +02:00
else if ( sort = = SORT_PLAYCOUNT )
2012-01-21 21:57:41 +01:00
curSort = m_loc . getWString ( m_curLanguage , " byplaycount " , L " By Play Count " ) ;
2012-06-21 14:25:47 +02:00
else if ( sort = = SORT_LASTPLAYED )
2012-01-21 21:57:41 +01:00
curSort = m_loc . getWString ( m_curLanguage , " bylastplayed " , L " By Last Played " ) ;
2012-06-21 14:25:47 +02:00
else if ( sort = = SORT_GAMEID )
2012-01-21 21:57:41 +01:00
curSort = m_loc . getWString ( m_curLanguage , " bygameid " , L " By Game I.D. " ) ;
2012-06-21 14:25:47 +02:00
else if ( sort = = SORT_WIFIPLAYERS )
2012-01-21 21:57:41 +01:00
curSort = m_loc . getWString ( m_curLanguage , " bywifiplayers " , L " By Wifi Players " ) ;
2012-06-21 14:25:47 +02:00
else if ( sort = = SORT_PLAYERS )
2012-01-21 21:57:41 +01:00
curSort = m_loc . getWString ( m_curLanguage , " byplayers " , L " By Players " ) ;
2013-01-06 22:17:30 +01:00
m_showtimer = 120 ;
2012-01-21 21:57:41 +01:00
m_btnMgr . setText ( m_mainLblNotice , curSort ) ;
m_btnMgr . show ( m_mainLblNotice ) ;
}
2013-09-12 15:04:50 +02:00
else if ( BTN_MINUS_PRESSED & & ! m_locked & & ! m_sourceflow )
2012-01-21 21:57:41 +01:00
{
2012-08-21 16:30:42 +02:00
bUsed = true ;
2012-11-14 17:58:14 +01:00
const char * partition = NULL ;
2013-04-08 23:45:13 +02:00
_showWaitMessage ( ) ;
_hideMain ( ) ;
_setPartition ( 1 ) ;
if ( m_current_view = = COVERFLOW_CHANNEL & & ( m_cfg . getBool ( CHANNEL_DOMAIN , " disable " , true ) | | neek2o ( ) ) )
2012-11-14 17:58:14 +01:00
partition = " NAND " ;
2013-04-08 23:45:13 +02:00
else
partition = DeviceName [ currentPartition ] ;
2012-11-03 20:16:03 +01:00
//gprintf("Next item: %s\n", partition);
2013-04-08 23:45:13 +02:00
_loadList ( ) ;
_showMain ( ) ;
_initCF ( ) ;
2013-09-11 20:11:23 +02:00
/* refresh AFTER reloading */
m_showtimer = 120 ;
m_btnMgr . setText ( m_mainLblNotice , sfmt ( " %s (%u) [%s] " , _domainFromView ( ) , m_gameList . size ( ) , upperCase ( partition ) . c_str ( ) ) ) ;
m_btnMgr . show ( m_mainLblNotice ) ;
2012-01-21 21:57:41 +01:00
}
}
2012-06-21 14:25:47 +02:00
- Categories update.
- now you can have as many categories as you want.
- copied the idea of selected, hidden, and required categories from USB Loader GX. Thanks Cyan. Checkmark = selected, X = Hidden, and + = Required.
- redid categories.ini layout and renamed it categories_v4.ini so you can copy and paste settings from the old one to the new one. Each view (USB,DML,EMU,NAND,HOMEBREW) has it's own numcategories, category names, and category settings. All games are now seperated based on the view. Don't forget to add 1 to numcategories for the show All mode.
- Replaced All checkbox with CLEAR button which clears all checkboxes so no category is selected and all games will be shown.
- Added features to the Game Selected Categories Menu. Now the title is the title of the current game. You can now press plus(+) and minus(-) on wiimote to go to the next or previous games without going back to previous screen making it easier to setup categories for your games.
- note: all changes will not be saved in categories_v4.ini unless you exit wiiflow or launch a game.
2012-08-31 19:51:49 +02:00
if ( done = = 0 & & m_cfg . getBool ( " GENERAL " , " category_on_start " , false ) )
2012-01-21 21:57:41 +01:00
{
done = 1 ; //set done so it doesnt keep doing it
// show categories menu
_hideMain ( ) ;
_CategorySettings ( ) ;
2012-08-21 16:30:42 +02:00
if ( BTN_B_HELD )
bUsed = true ;
2012-01-21 21:57:41 +01:00
_showMain ( ) ;
_initCF ( ) ;
}
2012-06-21 14:25:47 +02:00
if ( use_grab )
_getGrabStatus ( ) ;
if ( m_showtimer > 0 )
2012-01-21 21:57:41 +01:00
{
2012-06-21 14:25:47 +02:00
if ( - - m_showtimer = = 0 )
2012-01-21 21:57:41 +01:00
{
m_btnMgr . hide ( m_mainLblLetter ) ;
m_btnMgr . hide ( m_mainLblNotice ) ;
}
2012-06-21 14:25:47 +02:00
}
2012-01-21 21:57:41 +01:00
//zones, showing and hiding buttons
2012-06-21 14:25:47 +02:00
if ( ! m_gameList . empty ( ) & & m_show_zone_prev )
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainBtnPrev ) ;
else
m_btnMgr . hide ( m_mainBtnPrev ) ;
2012-06-21 14:25:47 +02:00
if ( ! m_gameList . empty ( ) & & m_show_zone_next )
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainBtnNext ) ;
else
m_btnMgr . hide ( m_mainBtnNext ) ;
2013-09-12 15:04:50 +02:00
if ( ! m_gameList . empty ( ) & & m_show_zone_main & & ! m_sourceflow )
2012-01-21 21:57:41 +01:00
{
m_btnMgr . show ( m_mainLblUser [ 0 ] ) ;
m_btnMgr . show ( m_mainLblUser [ 1 ] ) ;
m_btnMgr . show ( m_mainBtnInfo ) ;
m_btnMgr . show ( m_mainBtnConfig ) ;
m_btnMgr . show ( m_mainBtnQuit ) ;
static bool change = m_favorites ;
m_btnMgr . show ( m_favorites ? m_mainBtnFavoritesOn : m_mainBtnFavoritesOff , change ! = m_favorites ) ;
m_btnMgr . hide ( m_favorites ? m_mainBtnFavoritesOff : m_mainBtnFavoritesOn , change ! = m_favorites ) ;
change = m_favorites ;
}
else
{
m_btnMgr . hide ( m_mainLblUser [ 0 ] ) ;
m_btnMgr . hide ( m_mainLblUser [ 1 ] ) ;
2012-05-26 00:13:43 +02:00
if ( ! m_gameList . empty ( ) )
m_btnMgr . hide ( m_mainBtnConfig ) ;
2012-01-21 21:57:41 +01:00
m_btnMgr . hide ( m_mainBtnInfo ) ;
m_btnMgr . hide ( m_mainBtnQuit ) ;
m_btnMgr . hide ( m_mainBtnFavoritesOn ) ;
m_btnMgr . hide ( m_mainBtnFavoritesOff ) ;
}
2013-09-12 15:04:50 +02:00
if ( ( ! m_cfg . getBool ( " GENERAL " , " hideviews " , false ) & & ( m_gameList . empty ( ) | | m_show_zone_main2 ) ) & & ! m_sourceflow )
2012-02-13 18:09:26 +01:00
{
2012-06-21 14:25:47 +02:00
switch ( m_current_view )
{
case COVERFLOW_DML :
if ( show_channel )
m_btnMgr . show ( m_mainBtnChannel ) ;
else if ( show_emu )
m_btnMgr . show ( m_mainBtnEmu ) ;
2013-09-21 18:33:16 +02:00
else if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
2012-06-21 14:25:47 +02:00
m_btnMgr . show ( m_mainBtnHomebrew ) ;
else
m_btnMgr . show ( m_mainBtnUsb ) ;
break ;
case COVERFLOW_CHANNEL :
if ( show_emu )
m_btnMgr . show ( m_mainBtnEmu ) ;
else if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
m_btnMgr . show ( m_mainBtnHomebrew ) ;
else
m_btnMgr . show ( m_mainBtnUsb ) ;
break ;
2012-10-03 23:34:37 +02:00
case COVERFLOW_PLUGIN :
2012-06-21 14:25:47 +02:00
if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
m_btnMgr . show ( m_mainBtnHomebrew ) ;
else
m_btnMgr . show ( m_mainBtnUsb ) ;
break ;
case COVERFLOW_HOMEBREW :
2013-01-15 18:24:42 +01:00
case COVERFLOW_MAX :
2012-02-13 18:09:26 +01:00
m_btnMgr . show ( m_mainBtnUsb ) ;
2012-06-21 14:25:47 +02:00
break ;
default :
2014-06-24 15:33:54 +02:00
if ( m_show_dml | | m_devo_installed | | m_nintendont_installed )
2012-06-21 14:25:47 +02:00
m_btnMgr . show ( m_mainBtnDML ) ;
else if ( show_channel )
m_btnMgr . show ( m_mainBtnChannel ) ;
else if ( show_emu )
m_btnMgr . show ( m_mainBtnEmu ) ;
else if ( show_homebrew & & ( parental_homebrew | | ! m_locked ) )
m_btnMgr . show ( m_mainBtnHomebrew ) ;
else
m_btnMgr . show ( m_mainBtnUsb ) ;
}
2012-01-21 21:57:41 +01:00
m_btnMgr . show ( m_mainLblUser [ 2 ] ) ;
m_btnMgr . show ( m_mainLblUser [ 3 ] ) ;
}
else
{
m_btnMgr . hide ( m_mainBtnHomebrew ) ;
m_btnMgr . hide ( m_mainBtnChannel ) ;
m_btnMgr . hide ( m_mainBtnUsb ) ;
2012-01-21 22:15:45 +01:00
m_btnMgr . hide ( m_mainBtnDML ) ;
2012-04-08 17:54:34 +02:00
m_btnMgr . hide ( m_mainBtnEmu ) ;
2012-01-21 21:57:41 +01:00
m_btnMgr . hide ( m_mainLblUser [ 2 ] ) ;
m_btnMgr . hide ( m_mainLblUser [ 3 ] ) ;
}
2013-09-12 15:04:50 +02:00
if ( ( ( disc_check & 0x2 ) & & ( m_gameList . empty ( ) | | m_show_zone_main3 ) ) & & ! m_sourceflow )
2012-01-21 21:57:41 +01:00
{
m_btnMgr . show ( m_mainBtnDVD ) ;
m_btnMgr . show ( m_mainLblUser [ 4 ] ) ;
m_btnMgr . show ( m_mainLblUser [ 5 ] ) ;
}
else
{
m_btnMgr . hide ( m_mainBtnDVD ) ;
m_btnMgr . hide ( m_mainLblUser [ 4 ] ) ;
m_btnMgr . hide ( m_mainLblUser [ 5 ] ) ;
}
for ( int chan = WPAD_MAX_WIIMOTES - 1 ; chan > = 0 ; chan - - )
2012-05-13 17:13:33 +02:00
{
2012-06-21 14:25:47 +02:00
if ( WPadIR_Valid ( chan ) | | ( m_show_pointer [ chan ] & & ! WPadIR_Valid ( chan ) ) )
2012-11-11 19:28:03 +01:00
CoverFlow . mouse ( chan , m_cursor [ chan ] . x ( ) , m_cursor [ chan ] . y ( ) ) ;
2012-01-21 21:57:41 +01:00
else
2012-11-11 19:28:03 +01:00
CoverFlow . mouse ( chan , - 1 , - 1 ) ;
2012-05-13 17:13:33 +02:00
}
2012-01-21 21:57:41 +01:00
}
2012-10-21 17:28:00 +02:00
ScanInput ( ) ;
if ( m_reload | | BTN_B_HELD )
2012-08-13 18:30:34 +02:00
{
2012-11-11 19:28:03 +01:00
CoverFlow . clear ( ) ;
2012-08-06 18:46:16 +02:00
_showWaitMessage ( ) ;
2012-09-09 20:35:15 +02:00
exitHandler ( PRIILOADER_DEF ) ; //Making wiiflow ready to boot something
2012-08-13 18:30:34 +02:00
_launchHomebrew ( fmt ( " %s/boot.dol " , m_appDir . c_str ( ) ) , m_homebrewArgs ) ;
return 0 ;
}
2012-09-10 00:38:42 +02:00
else if ( Sys_GetExitTo ( ) = = EXIT_TO_SMNK2O | | Sys_GetExitTo ( ) = = EXIT_TO_WFNK2O )
2012-08-26 14:05:04 +02:00
{
2013-01-04 19:16:12 +01:00
const char * ReturnPath = NULL ;
if ( ! m_cfg . getBool ( CHANNEL_DOMAIN , " neek_return_default " , false ) )
{
string emuPath ;
m_current_view = COVERFLOW_CHANNEL ; /* So we get the path */
_FindEmuPart ( emuPath , false ) ;
ReturnPath = NandHandle . Get_NandPath ( ) ;
}
Sys_SetNeekPath ( ReturnPath ) ;
2012-08-26 14:05:04 +02:00
}
2012-11-03 20:16:03 +01:00
//gprintf("Saving configuration files\n");
2012-01-21 21:57:41 +01:00
m_cfg . save ( ) ;
2012-09-11 14:01:07 +02:00
m_cat . save ( ) ;
2012-01-21 21:57:41 +01:00
// m_loc.save();
2012-08-13 18:30:34 +02:00
return 0 ;
2012-01-21 21:57:41 +01:00
}
2012-11-03 20:16:03 +01:00
void CMenu : : _initMainMenu ( )
2012-01-21 21:57:41 +01:00
{
2012-12-28 15:19:40 +01:00
TexData texQuit ;
TexData texQuitS ;
TexData texInfo ;
TexData texInfoS ;
TexData texConfig ;
TexData texConfigS ;
TexData texDML ;
TexData texDMLs ;
TexData texEmu ;
TexData texEmus ;
TexData texDVD ;
TexData texDVDs ;
TexData texUsb ;
TexData texUsbs ;
TexData texChannel ;
TexData texChannels ;
TexData texHomebrew ;
TexData texHomebrews ;
TexData texPrev ;
TexData texPrevS ;
TexData texNext ;
TexData texNextS ;
TexData texFavOn ;
TexData texFavOnS ;
TexData texFavOff ;
TexData texFavOffS ;
TexData bgLQ ;
TexData emptyTex ;
2012-01-21 21:57:41 +01:00
2012-11-03 20:16:03 +01:00
m_mainBg = _texture ( " MAIN/BG " , " texture " , theme . bg , false ) ;
2012-12-28 15:19:40 +01:00
if ( m_theme . loaded ( ) & & TexHandle . fromImageFile ( bgLQ , fmt ( " %s/%s " , m_themeDataDir . c_str ( ) , m_theme . getString ( " MAIN/BG " , " texture " ) . c_str ( ) ) , GX_TF_CMPR , 64 , 64 ) = = TE_OK )
2012-01-21 21:57:41 +01:00
m_mainBgLQ = bgLQ ;
2013-11-19 16:27:52 +01:00
TexHandle . fromImageFile ( texQuit , fmt ( " %s/btnquit.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texQuitS , fmt ( " %s/btnquits.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texInfo , fmt ( " %s/btninfo.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texInfoS , fmt ( " %s/btninfos.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texConfig , fmt ( " %s/btnconfig.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texConfigS , fmt ( " %s/btnconfigs.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texDVD , fmt ( " %s/btndvd.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texDVDs , fmt ( " %s/btndvds.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texUsb , fmt ( " %s/btnusb.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texUsbs , fmt ( " %s/btnusbs.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texDML , fmt ( " %s/btndml.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texDMLs , fmt ( " %s/btndmls.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texEmu , fmt ( " %s/btnemu.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texEmus , fmt ( " %s/btnemus.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texChannel , fmt ( " %s/btnchannel.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texChannels , fmt ( " %s/btnchannels.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texHomebrew , fmt ( " %s/btnhomebrew.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texHomebrews , fmt ( " %s/btnhomebrews.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texPrev , fmt ( " %s/btnprev.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texPrevS , fmt ( " %s/btnprevs.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texNext , fmt ( " %s/btnnext.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texNextS , fmt ( " %s/btnnexts.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texFavOn , fmt ( " %s/favoriteson.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texFavOnS , fmt ( " %s/favoritesons.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texFavOff , fmt ( " %s/favoritesoff.png " , m_imgsDir . c_str ( ) ) ) ;
TexHandle . fromImageFile ( texFavOffS , fmt ( " %s/favoritesoffs.png " , m_imgsDir . c_str ( ) ) ) ;
2012-01-21 21:57:41 +01:00
2012-11-03 20:16:03 +01:00
_addUserLabels ( m_mainLblUser , ARRAY_SIZE ( m_mainLblUser ) , " MAIN " ) ;
m_mainBtnInfo = _addPicButton ( " MAIN/INFO_BTN " , texInfo , texInfoS , 20 , 400 , 48 , 48 ) ;
m_mainBtnConfig = _addPicButton ( " MAIN/CONFIG_BTN " , texConfig , texConfigS , 70 , 400 , 48 , 48 ) ;
m_mainBtnQuit = _addPicButton ( " MAIN/QUIT_BTN " , texQuit , texQuitS , 570 , 400 , 48 , 48 ) ;
m_mainBtnChannel = _addPicButton ( " MAIN/CHANNEL_BTN " , texChannel , texChannels , 520 , 400 , 48 , 48 ) ;
m_mainBtnHomebrew = _addPicButton ( " MAIN/HOMEBREW_BTN " , texHomebrew , texHomebrews , 520 , 400 , 48 , 48 ) ;
m_mainBtnUsb = _addPicButton ( " MAIN/USB_BTN " , texUsb , texUsbs , 520 , 400 , 48 , 48 ) ;
m_mainBtnDML = _addPicButton ( " MAIN/DML_BTN " , texDML , texDMLs , 520 , 400 , 48 , 48 ) ;
m_mainBtnEmu = _addPicButton ( " MAIN/EMU_BTN " , texEmu , texEmus , 520 , 400 , 48 , 48 ) ;
m_mainBtnDVD = _addPicButton ( " MAIN/DVD_BTN " , texDVD , texDVDs , 470 , 400 , 48 , 48 ) ;
m_mainBtnNext = _addPicButton ( " MAIN/NEXT_BTN " , texNext , texNextS , 540 , 146 , 80 , 80 ) ;
m_mainBtnPrev = _addPicButton ( " MAIN/PREV_BTN " , texPrev , texPrevS , 20 , 146 , 80 , 80 ) ;
2013-11-04 20:46:23 +01:00
m_mainBtnInit = _addButton ( " MAIN/BIG_SETTINGS_BTN " , theme . titleFont , L " " , 72 , 180 , 496 , 48 , theme . titleFontColor ) ;
m_mainBtnInit2 = _addButton ( " MAIN/BIG_SETTINGS_BTN2 " , theme . titleFont , L " " , 72 , 290 , 496 , 48 , theme . titleFontColor ) ;
2012-11-03 20:16:03 +01:00
m_mainLblInit = _addLabel ( " MAIN/MESSAGE " , theme . lblFont , L " " , 40 , 40 , 560 , 140 , theme . lblFontColor , FTGX_JUSTIFY_LEFT | FTGX_ALIGN_MIDDLE ) ;
2013-11-04 20:46:23 +01:00
m_mainBtnFavoritesOn = _addPicButton ( " MAIN/FAVORITES_ON " , texFavOn , texFavOnS , 288 , 400 , 64 , 64 ) ;
m_mainBtnFavoritesOff = _addPicButton ( " MAIN/FAVORITES_OFF " , texFavOff , texFavOffS , 288 , 400 , 64 , 64 ) ;
2012-11-03 20:16:03 +01:00
m_mainLblLetter = _addLabel ( " MAIN/LETTER " , theme . titleFont , L " " , 540 , 40 , 80 , 80 , theme . titleFontColor , FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE , emptyTex ) ;
m_mainLblNotice = _addLabel ( " MAIN/NOTICE " , theme . titleFont , L " " , 340 , 40 , 280 , 80 , theme . titleFontColor , FTGX_JUSTIFY_RIGHT | FTGX_ALIGN_MIDDLE , emptyTex ) ;
2013-11-04 20:46:23 +01:00
m_mainLblCurMusic = _addLabel ( " MAIN/MUSIC " , theme . btnFont , L " " , 0 , 20 , 640 , 48 , theme . btnFontColor , FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE , theme . btnTexC ) ;
2013-01-21 00:30:28 +01:00
# ifdef SHOWMEM
m_mem1FreeSize = _addLabel ( " MEM1 " , theme . btnFont , L " " , 0 , 300 , 480 , 56 , theme . btnFontColor , FTGX_JUSTIFY_LEFT , emptyTex ) ;
m_mem2FreeSize = _addLabel ( " MEM2 " , theme . btnFont , L " " , 0 , 356 , 480 , 56 , theme . btnFontColor , FTGX_JUSTIFY_LEFT , emptyTex ) ;
2012-01-21 21:57:41 +01:00
# endif
//
m_mainPrevZone . x = m_theme . getInt ( " MAIN/ZONES " , " prev_x " , - 32 ) ;
m_mainPrevZone . y = m_theme . getInt ( " MAIN/ZONES " , " prev_y " , - 32 ) ;
m_mainPrevZone . w = m_theme . getInt ( " MAIN/ZONES " , " prev_w " , 182 ) ;
m_mainPrevZone . h = m_theme . getInt ( " MAIN/ZONES " , " prev_h " , 382 ) ;
m_mainPrevZone . hide = m_theme . getBool ( " MAIN/ZONES " , " prev_hide " , true ) ;
m_mainNextZone . x = m_theme . getInt ( " MAIN/ZONES " , " next_x " , 490 ) ;
m_mainNextZone . y = m_theme . getInt ( " MAIN/ZONES " , " next_y " , - 32 ) ;
m_mainNextZone . w = m_theme . getInt ( " MAIN/ZONES " , " next_w " , 182 ) ;
m_mainNextZone . h = m_theme . getInt ( " MAIN/ZONES " , " next_h " , 382 ) ;
m_mainNextZone . hide = m_theme . getBool ( " MAIN/ZONES " , " next_hide " , true ) ;
m_mainButtonsZone . x = m_theme . getInt ( " MAIN/ZONES " , " buttons_x " , - 32 ) ;
m_mainButtonsZone . y = m_theme . getInt ( " MAIN/ZONES " , " buttons_y " , 350 ) ;
m_mainButtonsZone . w = m_theme . getInt ( " MAIN/ZONES " , " buttons_w " , 704 ) ;
m_mainButtonsZone . h = m_theme . getInt ( " MAIN/ZONES " , " buttons_h " , 162 ) ;
m_mainButtonsZone . hide = m_theme . getBool ( " MAIN/ZONES " , " buttons_hide " , true ) ;
m_mainButtonsZone2 . x = m_theme . getInt ( " MAIN/ZONES " , " buttons2_x " , - 32 ) ;
m_mainButtonsZone2 . y = m_theme . getInt ( " MAIN/ZONES " , " buttons2_y " , 350 ) ;
m_mainButtonsZone2 . w = m_theme . getInt ( " MAIN/ZONES " , " buttons2_w " , 704 ) ;
m_mainButtonsZone2 . h = m_theme . getInt ( " MAIN/ZONES " , " buttons2_h " , 162 ) ;
m_mainButtonsZone2 . hide = m_theme . getBool ( " MAIN/ZONES " , " buttons2_hide " , true ) ;
m_mainButtonsZone3 . x = m_theme . getInt ( " MAIN/ZONES " , " buttons3_x " , - 32 ) ;
m_mainButtonsZone3 . y = m_theme . getInt ( " MAIN/ZONES " , " buttons3_y " , 350 ) ;
m_mainButtonsZone3 . w = m_theme . getInt ( " MAIN/ZONES " , " buttons3_w " , 704 ) ;
m_mainButtonsZone3 . h = m_theme . getInt ( " MAIN/ZONES " , " buttons3_h " , 162 ) ;
m_mainButtonsZone3 . hide = m_theme . getBool ( " MAIN/ZONES " , " buttons3_hide " , true ) ;
//
_setHideAnim ( m_mainBtnNext , " MAIN/NEXT_BTN " , 0 , 0 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnPrev , " MAIN/PREV_BTN " , 0 , 0 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnConfig , " MAIN/CONFIG_BTN " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnInfo , " MAIN/INFO_BTN " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnQuit , " MAIN/QUIT_BTN " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnChannel , " MAIN/CHANNEL_BTN " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnHomebrew , " MAIN/HOMEBREW_BTN " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnUsb , " MAIN/USB_BTN " , 0 , 40 , 0.f , 0.f ) ;
2012-01-21 22:15:45 +01:00
_setHideAnim ( m_mainBtnDML , " MAIN/DML_BTN " , 0 , 40 , 0.f , 0.f ) ;
2012-04-08 17:54:34 +02:00
_setHideAnim ( m_mainBtnEmu , " MAIN/EMU_BTN " , 0 , 40 , 0.f , 0.f ) ;
2012-01-21 21:57:41 +01:00
_setHideAnim ( m_mainBtnDVD , " MAIN/DVD_BTN " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnFavoritesOn , " MAIN/FAVORITES_ON " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnFavoritesOff , " MAIN/FAVORITES_OFF " , 0 , 40 , 0.f , 0.f ) ;
_setHideAnim ( m_mainBtnInit , " MAIN/BIG_SETTINGS_BTN " , 0 , 0 , - 2.f , 0.f ) ;
_setHideAnim ( m_mainBtnInit2 , " MAIN/BIG_SETTINGS_BTN2 " , 0 , 0 , - 2.f , 0.f ) ;
_setHideAnim ( m_mainLblInit , " MAIN/MESSAGE " , 0 , 0 , 0.f , 0.f ) ;
_setHideAnim ( m_mainLblLetter , " MAIN/LETTER " , 0 , 0 , 0.f , 0.f ) ;
_setHideAnim ( m_mainLblNotice , " MAIN/NOTICE " , 0 , 0 , 0.f , 0.f ) ;
2012-09-16 15:41:31 +02:00
_setHideAnim ( m_mainLblCurMusic , " MAIN/MUSIC " , 0 , - 100 , 0.f , 0.f ) ;
2012-01-21 21:57:41 +01:00
# ifdef SHOWMEM
2013-01-21 00:30:28 +01:00
_setHideAnim ( m_mem1FreeSize , " MEM1 " , 0 , 0 , 0.f , 0.f ) ;
2012-01-21 21:57:41 +01:00
_setHideAnim ( m_mem2FreeSize , " MEM2 " , 0 , 0 , 0.f , 0.f ) ;
# endif
_hideMain ( true ) ;
_textMain ( ) ;
}
void CMenu : : _textMain ( void )
{
m_btnMgr . setText ( m_mainBtnInit , _t ( " main1 " , L " Install Game " ) ) ;
m_btnMgr . setText ( m_mainBtnInit2 , _t ( " main3 " , L " Select Partition " ) ) ;
}
wstringEx CMenu : : _getNoticeTranslation ( int sorting , wstringEx curLetter )
{
if ( sorting = = SORT_PLAYERS )
curLetter + = m_loc . getWString ( m_curLanguage , " players " , L " Players " ) ;
else if ( sorting = = SORT_WIFIPLAYERS )
curLetter + = m_loc . getWString ( m_curLanguage , " wifiplayers " , L " Wifi Players " ) ;
else if ( sorting = = SORT_GAMEID )
{
switch ( curLetter [ 0 ] )
{
case L ' C ' :
{
if ( m_current_view ! = COVERFLOW_CHANNEL )
curLetter = m_loc . getWString ( m_curLanguage , " custom " , L " Custom " ) ;
else
curLetter = m_loc . getWString ( m_curLanguage , " commodore " , L " Commodore 64 " ) ;
break ;
}
case L ' E ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " neogeo " , L " Neo-Geo " ) ;
break ;
}
case L ' F ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " nes " , L " Nintendo " ) ;
break ;
}
case L ' J ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " snes " , L " Super Nintendo " ) ;
break ;
}
case L ' L ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " mastersystem " , L " Sega Master System " ) ;
break ;
}
case L ' M ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " genesis " , L " Sega Genesis " ) ;
break ;
}
case L ' N ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " nintendo64 " , L " Nintendo64 " ) ;
break ;
}
case L ' P ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " turbografx16 " , L " TurboGrafx-16 " ) ;
break ;
}
case L ' Q ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " turbografxcd " , L " TurboGrafx-CD " ) ;
break ;
}
case L ' W ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " wiiware " , L " WiiWare " ) ;
break ;
}
case L ' H ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " wiichannels " , L " Offical Wii Channels " ) ;
break ;
}
case L ' R ' :
case L ' S ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " wii " , L " Wii " ) ;
break ;
}
case L ' D ' :
{
curLetter = m_loc . getWString ( m_curLanguage , " homebrew " , L " Homebrew " ) ;
break ;
}
default :
{
curLetter = m_loc . getWString ( m_curLanguage , " unknown " , L " Unknown " ) ;
break ;
}
}
}
return curLetter ;
}
2012-11-24 14:49:32 +01:00
void CMenu : : _setPartition ( s8 direction )
{
2013-04-08 23:45:13 +02:00
if ( m_current_view = = COVERFLOW_CHANNEL & & neek2o ( ) )
2012-11-24 14:49:32 +01:00
return ;
2012-12-22 17:47:02 +01:00
_cfNeedsUpdate ( ) ;
2013-10-04 01:26:22 +02:00
int FS_Type = 0 ;
2012-11-24 14:49:32 +01:00
if ( direction ! = 0 )
{
2013-04-08 23:45:13 +02:00
bool switch_to_real = true ;
if ( m_current_view = = COVERFLOW_CHANNEL & & ! NANDemuView )
{
NANDemuView = true ;
m_cfg . setBool ( CHANNEL_DOMAIN , " disable " , false ) ;
switch_to_real = false ;
}
2012-11-24 14:49:32 +01:00
bool NeedFAT = m_current_view = = COVERFLOW_CHANNEL | | m_current_view = = COVERFLOW_DML ;
2013-04-08 23:45:13 +02:00
u8 limiter = 0 ;
do
2012-11-24 14:49:32 +01:00
{
2013-04-08 23:45:13 +02:00
currentPartition = loopNum ( currentPartition + direction , 10 ) ;
2012-11-24 14:49:32 +01:00
FS_Type = DeviceHandle . GetFSType ( currentPartition ) ;
2013-04-08 23:45:13 +02:00
if ( m_current_view = = COVERFLOW_CHANNEL & & switch_to_real & & FS_Type = = - 1 )
2012-11-24 14:49:32 +01:00
break ;
limiter + + ;
}
2013-04-08 23:45:13 +02:00
while ( limiter < 12 & & ( ! DeviceHandle . IsInserted ( currentPartition ) | |
( m_current_view ! = COVERFLOW_USB & & FS_Type = = PART_FS_WBFS ) | |
( NeedFAT & & FS_Type ! = PART_FS_FAT ) ) ) ;
if ( m_current_view = = COVERFLOW_CHANNEL & & FS_Type = = - 1 )
{
NANDemuView = false ;
m_cfg . setBool ( CHANNEL_DOMAIN , " disable " , true ) ;
}
2012-11-24 14:49:32 +01:00
}
if ( m_tempView )
m_cfg . setInt ( WII_DOMAIN , " savepartition " , currentPartition ) ;
else
2012-12-25 20:09:41 +01:00
{
2013-10-04 01:26:22 +02:00
if ( direction = = 0 | | ( direction ! = 0 & & ( m_current_view ! = COVERFLOW_CHANNEL | |
( FS_Type ! = - 1 & & DeviceHandle . IsInserted ( currentPartition ) ) ) ) )
m_cfg . setInt ( _domainFromView ( ) , " partition " , currentPartition ) ;
2013-09-04 22:58:22 +02:00
vector < bool > plugin_list = m_plugin . GetEnabledPlugins ( m_cfg , & enabledPluginsCount ) ;
2012-12-25 20:09:41 +01:00
if ( enabledPluginsCount = = 1 )
2013-09-04 22:58:22 +02:00
{
u8 i = 0 ;
2013-09-15 16:29:14 +02:00
for ( i = 0 ; i < plugin_list . size ( ) ; + + i )
2013-09-04 22:58:22 +02:00
{
if ( plugin_list [ i ] = = true )
break ;
}
char PluginMagicWord [ 9 ] ;
memset ( PluginMagicWord , 0 , sizeof ( PluginMagicWord ) ) ;
strncpy ( PluginMagicWord , fmt ( " %08x " , m_plugin . getPluginMagic ( i ) ) , 8 ) ;
2012-12-25 20:09:41 +01:00
m_cfg . setInt ( " PLUGINS/PARTITION " , PluginMagicWord , currentPartition ) ;
2013-09-04 22:58:22 +02:00
}
2012-12-25 20:09:41 +01:00
}
2012-11-24 14:49:32 +01:00
}