diff --git a/ios/RetroArch/RADirectoryGrid.m b/ios/RetroArch/RADirectoryGrid.m index b97ec9ea0c..0e0e87f4cc 100644 --- a/ios/RetroArch/RADirectoryGrid.m +++ b/ios/RetroArch/RADirectoryGrid.m @@ -29,7 +29,6 @@ _config = config; _list = ra_ios_list_directory(_path); - self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button; [self setTitle: [_path lastPathComponent]]; // Init collection view @@ -61,7 +60,7 @@ if(path.isDirectory) [[RetroArch_iOS get] pushViewController:[RADirectoryList directoryListOrGridWithPath:path.path] isGame:NO]; else - [[RetroArch_iOS get] runGame:path.path]; + [[RetroArch_iOS get] pushViewController:[[RAModuleList alloc] initWithGame:path.path] isGame:NO]; } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath diff --git a/ios/RetroArch/RADirectoryList.m b/ios/RetroArch/RADirectoryList.m index f7f2f97b1e..3b2376902c 100644 --- a/ios/RetroArch/RADirectoryList.m +++ b/ios/RetroArch/RADirectoryList.m @@ -45,7 +45,6 @@ _config = config; _list = ra_ios_list_directory(_path); - self.navigationItem.rightBarButtonItem = [RetroArch_iOS get].settings_button; [self setTitle: [_path lastPathComponent]]; return self; @@ -58,7 +57,7 @@ if(path.isDirectory) [[RetroArch_iOS get] pushViewController:[RADirectoryList directoryListOrGridWithPath:path.path] isGame:NO]; else - [[RetroArch_iOS get] runGame:path.path]; + [[RetroArch_iOS get] pushViewController:[[RAModuleList alloc] initWithGame:path.path] isGame:NO]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section diff --git a/ios/RetroArch/RAModuleList.m b/ios/RetroArch/RAModuleList.m index 63d265934a..e54ae1010f 100644 --- a/ios/RetroArch/RAModuleList.m +++ b/ios/RetroArch/RAModuleList.m @@ -18,11 +18,13 @@ @implementation RAModuleList { NSMutableArray* _modules; + NSString* _game; } -- (id)init +- (id)initWithGame:(NSString*)path { - self = [super initWithStyle:UITableViewStylePlain]; + self = [super initWithStyle:UITableViewStyleGrouped]; + _game = path; // Get the contents of the modules directory of the bundle. NSString* module_dir = [NSString stringWithFormat:@"%@/modules", [[NSBundle mainBundle] bundlePath]]; @@ -58,16 +60,14 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - RAModuleInfo* info = (RAModuleInfo*)[_modules objectAtIndex:indexPath.row]; - [RetroArch_iOS get].moduleInfo = info; - - [[RetroArch_iOS get] pushViewController:[RADirectoryList directoryListOrGridWithPath:nil] isGame:NO]; + [RetroArch_iOS get].moduleInfo = (RAModuleInfo*)[_modules objectAtIndex:indexPath.row];; + [[RetroArch_iOS get] runGame:_game]; } - (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath { - RAModuleInfo* info = (RAModuleInfo*)[_modules objectAtIndex:indexPath.row]; - [[RetroArch_iOS get] pushViewController:[[RAModuleInfoList alloc] initWithModuleInfo:info] isGame:NO]; + [RetroArch_iOS get].moduleInfo = (RAModuleInfo*)[_modules objectAtIndex:indexPath.row]; + [[RetroArch_iOS get] showSettings]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section @@ -84,7 +84,6 @@ cell.textLabel.text = [[info.path lastPathComponent] stringByDeletingPathExtension]; cell.accessoryType = (info.data) ? UITableViewCellAccessoryDetailDisclosureButton : UITableViewCellAccessoryNone; - return cell; } diff --git a/ios/RetroArch/RetroArch_iOS.h b/ios/RetroArch/RetroArch_iOS.h index 233cb78500..1cc9b380c0 100644 --- a/ios/RetroArch/RetroArch_iOS.h +++ b/ios/RetroArch/RetroArch_iOS.h @@ -25,11 +25,13 @@ - (void)pushViewController:(UIViewController*)theView isGame:(BOOL)game; - (UIViewController*)popViewController; +- (IBAction)showSettings; +- (IBAction)showWiiRemoteConfig; + @property (strong, nonatomic) RAModuleInfo* moduleInfo; @property (strong, nonatomic) NSString* system_directory; @property (strong, nonatomic) UIImage* file_icon; @property (strong, nonatomic) UIImage* folder_icon; -@property (strong, nonatomic) UIBarButtonItem* settings_button; @end diff --git a/ios/RetroArch/RetroArch_iOS.m b/ios/RetroArch/RetroArch_iOS.m index 5730a38ef7..7d65312d86 100644 --- a/ios/RetroArch/RetroArch_iOS.m +++ b/ios/RetroArch/RetroArch_iOS.m @@ -16,6 +16,13 @@ #include #include "rarch_wrapper.h" #include "general.h" +#import "browser.h" + +#ifdef WIIMOTE +#include "BTStack/wiimote.h" +#import "BTStack/WiiMoteHelper.h" +#endif + #define ALMOST_INVISIBLE .021f @@ -99,14 +106,6 @@ self.file_icon = [UIImage imageNamed:@"ic_file"]; self.folder_icon = [UIImage imageNamed:@"ic_dir"]; - // Load buttons - self.settings_button = [[UIBarButtonItem alloc] - initWithTitle:@"Module Settings" - style:UIBarButtonItemStyleBordered - target:nil action:nil]; - self.settings_button.target = self; - self.settings_button.action = @selector(showSettings); - // Load pause menu UINib* xib = [UINib nibWithNibName:@"PauseView" bundle:nil]; _pauseView = [[xib instantiateWithOwner:self options:nil] lastObject]; @@ -119,7 +118,7 @@ // Setup window _navigator = [[RANavigator alloc] initWithAppDelegate:self]; - [_navigator pushViewController: [RAModuleList new] animated:YES]; + [_navigator pushViewController: [RADirectoryList directoryListOrGridWithPath:nil] animated:YES]; _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; _window.rootViewController = _navigator; @@ -351,6 +350,12 @@ [self pushViewController:[RASettingsList new] isGame:NO]; } +- (IBAction)showWiiRemoteConfig +{ +#ifdef WIIMOTE + [WiiMoteHelper startwiimote:_navigator]; +#endif +} @end diff --git a/ios/RetroArch/settings/RASettingsList.m b/ios/RetroArch/settings/RASettingsList.m index 8b93ad7164..282f2cba98 100644 --- a/ios/RetroArch/settings/RASettingsList.m +++ b/ios/RetroArch/settings/RASettingsList.m @@ -16,11 +16,6 @@ #import #import "settings.h" -#ifdef WIIMOTE -#include "BTStack/wiimote.h" -#import "BTStack/WiiMoteHelper.h" -#endif - @implementation RASettingData @end @@ -190,10 +185,8 @@ static RASettingData* subpath_setting(RAConfig* config, NSString* name, NSString { if (indexPath.row == 0) [[RetroArch_iOS get] pushViewController:[[RAModuleInfoList alloc] initWithModuleInfo:[RetroArch_iOS get].moduleInfo] isGame:NO]; -#ifdef WIIMOTE else if(indexPath.row == 1) - [WiiMoteHelper startwiimote:_navigator]; -#endif + [[RetroArch_iOS get] showWiiRemoteConfig]; } else [super tableView:tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:indexPath.row inSection:indexPath.section - 1]]; diff --git a/ios/RetroArch/views.h b/ios/RetroArch/views.h index 119213864f..19b4cfb0ed 100644 --- a/ios/RetroArch/views.h +++ b/ios/RetroArch/views.h @@ -34,6 +34,7 @@ @end @interface RAModuleList : UITableViewController +- (id)initWithGame:(NSString*)path; @end @interface RASettingsSubList : UITableViewController