hostile-takeover/game/sdl/mac/mac.mm
Nathan Fulton fff71efc11 SDL-OSX port improvements
- Add chatroom
- Add string input
- Update main() to support SDL2
- Change game files location to
~/Library/ApplicationSupport/HostileTakeover
- Open URLs with OS’s default browser
- Use Xcode default C/C++Objective-C compiler
- Remove game/sdl/mac/SDL.framework
- Use game/sdl/SDL2/osx/SDL2.framework
2016-08-24 16:19:45 -04:00

39 lines
919 B
Plaintext

#include "game/ht.h"
#include <sys/types.h>
#include <dirent.h>
#include <sys/stat.h>
#include "base/log.h"
#include "base/thread.h"
#import "game/sdl/mac/mac.h"
#import "game/sdl/mac/inputcontroller.h"
#import "game/sdl/mac/chatviewcontroller.h"
@implementation Mac
- (id)init {
m_pchat = NULL;
inputController = [[InputController alloc] init];
chatViewController = [[ChatViewController alloc] init];
return self;
}
- (void)initiateAsk:(NSString *)title maxCharacters:(int)max defaultString:(NSString *)def keyboard:(int)keyboard secure:(BOOL)secure {
[inputController showInputAlertWithTitle:title defaultText:def maxChars:max secure:secure];
}
- (NSString *)askString {
return [inputController askString];
}
- (wi::IChatController *)getChatController {
if (m_pchat == NULL) {
m_pchat = new wi::ChatController(chatViewController);
}
return m_pchat;
}
@end