2016-01-07 19:48:21 -05:00
|
|
|
#import "SettingsViewController.h"
|
|
|
|
#include "../AppConfig.h"
|
|
|
|
#include "PreferenceDefs.h"
|
2016-01-08 10:16:11 -05:00
|
|
|
#include "AppDef.h"
|
2016-01-07 19:48:21 -05:00
|
|
|
|
|
|
|
@implementation SettingsViewController
|
|
|
|
|
|
|
|
-(void)viewDidLoad
|
|
|
|
{
|
|
|
|
[showFpsSwitch setOn: CAppConfig::GetInstance().GetPreferenceBoolean(PREFERENCE_UI_SHOWFPS)];
|
|
|
|
[showVirtualPadSwitch setOn: CAppConfig::GetInstance().GetPreferenceBoolean(PREFERENCE_UI_SHOWVIRTUALPAD)];
|
2016-01-08 10:16:11 -05:00
|
|
|
|
|
|
|
NSString* versionString = [NSString stringWithFormat: @"0.%0.2d - %s", APP_VERSION, __DATE__];
|
|
|
|
versionInfoLabel.text = versionString;
|
2016-01-07 19:48:21 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
-(void)viewDidDisappear: (BOOL)animated
|
|
|
|
{
|
|
|
|
CAppConfig::GetInstance().SetPreferenceBoolean(PREFERENCE_UI_SHOWFPS, showFpsSwitch.isOn);
|
|
|
|
CAppConfig::GetInstance().SetPreferenceBoolean(PREFERENCE_UI_SHOWVIRTUALPAD, showVirtualPadSwitch.isOn);
|
|
|
|
|
|
|
|
CAppConfig::GetInstance().Save();
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|