added response event for game center overlay closing

This commit is contained in:
romulox_x 2015-05-23 23:22:20 -07:00
parent 94638e7bfe
commit 95cd9b1ad5
3 changed files with 13 additions and 2 deletions

View File

@ -56,6 +56,8 @@ public:
void request_achievement_descriptions();
Error show_game_center(Variant p_params);
void game_center_closed();
int get_pending_event_count();
Variant pop_pending_event();

View File

@ -314,10 +314,18 @@ Error GameCenter::show_game_center(Variant p_params) {
}
[root_controller presentViewController: controller animated: YES completion:nil];
return OK;
};
void GameCenter::game_center_closed() {
Dictionary ret;
ret["type"] = "show_game_center";
ret["result"] = "ok";
pending_events.push_back(ret);
}
int GameCenter::get_pending_event_count() {
return pending_events.size();

View File

@ -130,7 +130,8 @@ int add_cmdline(int p_argc, char** p_args) {
}
- (void) gameCenterViewControllerDidFinish:(GKGameCenterViewController*) gameCenterViewController {
printf("in finish");
//[gameCenterViewController dismissViewControllerAnimated:YES completion:^{GameCenter::get_singleton()->game_center_closed();}];//version for signaling when overlay is completely gone
GameCenter::get_singleton()->game_center_closed();
[gameCenterViewController dismissViewControllerAnimated:YES completion:nil];
}