Skip to content

Commit

Permalink
Add achievement rarity to GameCenter plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ddossot committed Oct 29, 2023
1 parent fc5952a commit a5fe31a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/gamecenter/game_center.mm
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
GodotIntArray maximum_points;
Array hidden;
Array replayable;
GodotFloatArray rarity_percents;

for (NSUInteger i = 0; i < [descriptions count]; i++) {

Expand All @@ -226,6 +227,12 @@
hidden.push_back(description.hidden == YES);

replayable.push_back(description.replayable == YES);

NSNumber *number;
if (@available(iOS 17.0, *)) {
number = description.rarityPercent;
}
rarity_percents.push_back(number != NULL ? number.doubleValue : -1);
}

ret["names"] = names;
Expand All @@ -235,6 +242,7 @@
ret["maximum_points"] = maximum_points;
ret["hidden"] = hidden;
ret["replayable"] = replayable;
ret["rarity_percents"] = rarity_percents;

} else {
ret["result"] = "error";
Expand Down

0 comments on commit a5fe31a

Please sign in to comment.