mirror of
https://github.com/godotengine/godot.git
synced 2024-11-29 23:53:08 +00:00
added response event for game center overlay closing
This commit is contained in:
parent
94638e7bfe
commit
95cd9b1ad5
@ -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();
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user