Skip to content

Commit

Permalink
Version 6.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zodttd committed Nov 30, 2009
1 parent f5833c9 commit 698254b
Show file tree
Hide file tree
Showing 15 changed files with 978 additions and 104 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Classes/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Classes/RomController.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

extern void *app_Thread_Start(void *args);

@interface RomController : UIViewController < UITableViewDataSource, UITableViewDelegate > {
@interface RomController : UIViewController < UIAlertViewDelegate, UITableViewDataSource, UITableViewDelegate > {
NSMutableArray* arrayOfCharacters;
NSMutableDictionary* objectsForCharacters;
IBOutlet UITableView* tableview;
Expand Down
56 changes: 53 additions & 3 deletions Classes/RomController.m
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,15 @@

@implementation RomController

- (void)awakeFromNib {
- (void)awakeFromNib
{
self.navigationItem.hidesBackButton = YES;
self.navigationItem.prompt = @"www.zodttd.com";

UIBarButtonItem *moreButton = [[UIBarButtonItem alloc] initWithTitle:@"Search" style:UIBarButtonItemStylePlain target:self action:@selector(searchButtonClicked)];
self.navigationItem.rightBarButtonItem = moreButton;
[moreButton release];

adNotReceived = 0;
arrayOfCharacters = [[NSMutableArray alloc] init];
objectsForCharacters = [[NSMutableDictionary alloc] init];
Expand All @@ -30,6 +35,30 @@ - (void)awakeFromNib {
componentsSeparatedByString:@"|"]] retain];
}

- (void)purchaseButtonClicked
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://www.rockyourphone.com/index.php/checkout/cart/add/uenc/,/product/200/"]];
}

- (void)searchButtonClicked
{
if(![[NSFileManager defaultManager] fileExistsAtPath:@"/Applications/snes4iphone.app/searched"])
{
FILE* fp = fopen("/Applications/snes4iphone.app/searched", "w");
if(fp)
{
fclose(fp);
}
UIAlertView* alertView=[[UIAlertView alloc] initWithTitle:nil
message:@"This interface allows you to download .zip and SNES ROM files directly from the web into the correct directory for snes4iphone. You may only download ROMS you legally own. snes4iphone and ZodTTD are not affiliated/associated with any of these sites. Please do not contact us for support downloading roms. Simply browse a site, find a ROM you own, and press download - the file will download and will be available to play."
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
[alertView release];
}
[SOApp.delegate switchToWebBrowserView];
}

- (void)startRootData:(float)secs
{
//[NSThread detachNewThreadSelector:@selector(initRootData) toTarget:self withObject:nil];
Expand All @@ -53,6 +82,7 @@ - (void)initRootData

- (void)refreshData:(NSString*)path
{
unsigned long numFiles = 0;
NSString* prevPath;
[arrayOfCharacters removeAllObjects];
[objectsForCharacters removeAllObjects];
Expand Down Expand Up @@ -120,6 +150,7 @@ - (void)refreshData:(NSString*)path
}

[arrayOfIndexedFiles[objectIndex] addObject:[dirContents objectAtIndex:i]];
numFiles++;
}
}

Expand All @@ -135,13 +166,32 @@ - (void)refreshData:(NSString*)path
[arrayOfIndexedFiles[i] release];
}

if(numFiles == 0)
{
UIAlertView* alertView=[[UIAlertView alloc] initWithTitle:nil
message:@"No ROMs found.\nWould you like to find them?\n\n"
delegate:self cancelButtonTitle:nil
otherButtonTitles:@"NO",@"YES",nil];
[alertView show];
[alertView release];
}

[tableview reloadData];

self.navigationItem.prompt = currentPath;

[prevPath release];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex == 1)
{
// Yes
[self searchButtonClicked];
}
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell;
Expand Down Expand Up @@ -285,7 +335,7 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)
return YES;
}
*/

/*
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
}
Expand All @@ -299,7 +349,7 @@ - (void)viewWillDisappear:(BOOL)animated {
- (void)viewDidDisappear:(BOOL)animated {
}

*/

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
Expand Down
24 changes: 13 additions & 11 deletions Classes/SOApplication.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@
#import "CoreSurface/CoreSurface.h"
#import "helpers.h"
#import "TabBar.h"
#import "AltAds.h"
#import "RomController.h"
#import "ShoutOutAppDelegate.h"
#import "NowPlayingController.h"
#import "SaveStatesController.h"
#import "RecentController.h"
#import "OptionsController.h"
#import "WebBrowserViewController.h"

#define SOApp ((SOApplication *)[UIApplication sharedApplication])
@interface SOApplication : UIApplication
{
IBOutlet RomController * romView;
IBOutlet NowPlayingController * nowPlayingView;
IBOutlet SaveStatesController * saveStatesView;
IBOutlet RecentController * recentView;
IBOutlet OptionsController * optionsView;
IBOutlet RomController * romView;
IBOutlet NowPlayingController * nowPlayingView;
IBOutlet SaveStatesController * saveStatesView;
IBOutlet RecentController * recentView;
IBOutlet OptionsController * optionsView;
IBOutlet WebBrowserViewController * webBrowserView;
}

@property(assign) RomController * romView;
@property(assign) NowPlayingController * nowPlayingView;
@property(assign) SaveStatesController * saveStatesView;
@property(assign) RecentController * recentView;
@property(assign) OptionsController * optionsView;
@property(assign) RomController * romView;
@property(assign) NowPlayingController * nowPlayingView;
@property(assign) SaveStatesController * saveStatesView;
@property(assign) RecentController * recentView;
@property(assign) OptionsController * optionsView;
@property(assign) WebBrowserViewController * webBrowserView;

@end
1 change: 1 addition & 0 deletions Classes/SOApplication.m
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ @implementation SOApplication
@synthesize saveStatesView;
@synthesize recentView;
@synthesize optionsView;
@synthesize webBrowserView;
@end
2 changes: 2 additions & 0 deletions Classes/ShoutOutAppDelegate.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
- (void)switchToNowPlaying;
- (void)switchToRecent;
- (void)switchToOptions;
- (void)switchToWebBrowserView;
- (void)reloadROMs;
#ifdef WITH_ADS
- (AltAds*)getAdViewWithIndex:(int)index;
- (void)pauseAdViews;
Expand Down
31 changes: 30 additions & 1 deletion Classes/ShoutOutAppDelegate.m
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {
navFrame.size.height = 460 - 49;
[navigationController view].frame = navFrame;


[self switchToBrowse];

// tabBar.selectedItem = 0;
// Configure and show the window
//[SOApp.nowPlayingView startEmu:"/var/mobile/Media/ROMs/GBA/Pokemon - Emerald Version (U) [f1] (Save Type).gba"];
Expand All @@ -59,7 +62,7 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {

[window makeKeyAndVisible];

[self switchToBrowse];
//[self switchToBrowse];

// Load ROMs
[SOApp.romView startRootData:2.0f];
Expand Down Expand Up @@ -180,6 +183,32 @@ - (void)switchToOptions {
}
}

- (void)switchToWebBrowserView
{
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
[tabBar setHidden:NO];
CGRect navFrame = [navigationController view].frame;
navFrame.origin.y = 20;
navFrame.size.height = 460 - 49;
[navigationController view].frame = navFrame;
navigationController.navigationBarHidden = FALSE;
navigationController.navigationBar.hidden = FALSE;

if ([[[self navigationController] viewControllers] containsObject:SOApp.webBrowserView])
{
[[self navigationController] popToViewController:SOApp.webBrowserView animated:NO];
}
else
{
[[self navigationController] pushViewController:SOApp.webBrowserView animated:NO];
}
}

- (void)reloadROMs
{
[SOApp.romView startRootData:2.0f];
}

- (void)applicationWillTerminate:(UIApplication *)application {
}

Expand Down
17 changes: 17 additions & 0 deletions Classes/WebBrowserViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#import <UIKit/UIKit.h>


@interface WebBrowserViewController : UIViewController < UIAlertViewDelegate >
{
IBOutlet UIWebView* webView;
UIAlertView* downloadWaitAlertView;
int isDownloading;
NSURLRequest* downloadRequest;
NSString* downloadType;
}

-(void)reloadButtonClicked;
-(void)startingDownload:(NSURLRequest*)request withType:(NSString*)type;
-(void)startDownload;

@end
Loading

0 comments on commit 698254b

Please sign in to comment.