mirror of
https://github.com/spiffcode/hostile-takeover.git
synced 2026-04-25 20:35:16 -06:00
- 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
39 lines
919 B
Plaintext
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
|