project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
changeset 6000 dbcebcd3d79f
parent 5709 36cf87a4f6ae
child 6018 3b86826f6665
equal deleted inserted replaced
5998:e8f44e9433f0 6000:dbcebcd3d79f
    22 #import "GameInterfaceBridge.h"
    22 #import "GameInterfaceBridge.h"
    23 #import "PascalImports.h"
    23 #import "PascalImports.h"
    24 #import "EngineProtocolNetwork.h"
    24 #import "EngineProtocolNetwork.h"
    25 #import "OverlayViewController.h"
    25 #import "OverlayViewController.h"
    26 #import "StatsPageViewController.h"
    26 #import "StatsPageViewController.h"
       
    27 #import "AudioManagerController.h"
    27 #import "ObjcExports.h"
    28 #import "ObjcExports.h"
    28 
    29 
    29 @implementation GameInterfaceBridge
    30 @implementation GameInterfaceBridge
    30 @synthesize parentController, savePath, overlayController, engineProtocol, ipcPort, gameType;
    31 @synthesize parentController, savePath, overlayController, engineProtocol, ipcPort, gameType;
    31 
    32 
   152     // keep track of uncompleted games
   153     // keep track of uncompleted games
   153     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   154     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   154     [userDefaults setObject:self.savePath forKey:@"savedGamePath"];
   155     [userDefaults setObject:self.savePath forKey:@"savedGamePath"];
   155     [userDefaults synchronize];
   156     [userDefaults synchronize];
   156 
   157 
   157     [HedgewarsAppDelegate pauseBackgroundMusic];
   158     [AudioManagerController pauseBackgroundMusic];
   158 
   159 
   159     // SYSTEMS ARE GO!!
   160     // SYSTEMS ARE GO!!
   160     [self startGameEngine];
   161     [self startGameEngine];
   161     
   162     
   162     // remove completed games notification
   163     // remove completed games notification
   175     [self.overlayController removeOverlay];
   176     [self.overlayController removeOverlay];
   176 
   177 
   177     // warn our host that it's going to be visible again
   178     // warn our host that it's going to be visible again
   178     [self.parentController viewWillAppear:YES];
   179     [self.parentController viewWillAppear:YES];
   179 
   180 
   180     if ([[userDefaults objectForKey:@"music"] boolValue])
   181     [AudioManagerController playBackgroundMusic];
   181         [HedgewarsAppDelegate playBackgroundMusic];
       
   182 }
   182 }
   183 
   183 
   184 // set up variables for a local game
   184 // set up variables for a local game
   185 -(void) startLocalGame:(NSDictionary *)withDictionary {
   185 -(void) startLocalGame:(NSDictionary *)withDictionary {
   186     self.gameType = gtLocal;
   186     self.gameType = gtLocal;