diff options
author | romulox_x <romulox_x@yahoo.com> | 2015-05-23 23:22:20 -0700 |
---|---|---|
committer | romulox_x <romulox_x@yahoo.com> | 2015-05-23 23:22:20 -0700 |
commit | 95cd9b1ad54f799d9513911e4cebc5bafc135d97 (patch) | |
tree | 862b271db6042924d5d78f3b0bda90b725182b21 | |
parent | 94638e7bfeec8feac553ecd80cd7e4efff04f2a5 (diff) |
added response event for game center overlay closing
-rw-r--r-- | platform/iphone/game_center.h | 2 | ||||
-rw-r--r-- | platform/iphone/game_center.mm | 10 | ||||
-rw-r--r-- | platform/iphone/view_controller.mm | 3 |
3 files changed, 13 insertions, 2 deletions
diff --git a/platform/iphone/game_center.h b/platform/iphone/game_center.h index 4fe13db8fc..8f180d1638 100644 --- a/platform/iphone/game_center.h +++ b/platform/iphone/game_center.h @@ -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(); diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 9b4018a4ba..79c056776d 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -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(); diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index f04264cfd9..bc9950979e 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -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]; } |