loicteixeira / gj-unity-api

[MOVED] Game Jolt API wrapper for Unity.
https://github.com/InfectedBytes/gj-unity-api/
MIT License
16 stars 13 forks source link

ShowLeaderboards callback don't work #51

Closed michidk closed 9 years ago

michidk commented 9 years ago

If i execute the following code: GameJolt.UI.Manager.Instance.ShowLeaderboards((bool test) => { Debug.Log("A very sad callback :c");}); And i close the Leaderboard by pressing the given close button (from the GameJoltAPI-Prefab), nothing happens.

WizzardMaker commented 9 years ago

You have to go to Plugins/GameJolt/Scripts/UI/Controllers and in LeaderboardsWindow.cs:20 you have to modify this piece of Code:

override public void Show(Action<bool> callback)
{
    animator.SetTrigger("Leaderboards");
    animator.SetTrigger("ShowLoadingIndicator");
    this.callback = callback; // <- Add this
    //...
}

Hope it helps

michidk commented 9 years ago

Okay, i implmented the callback myself, but your fix is better. Just, tested, works fine. Should i open a PR or do you want to do it?

WizzardMaker commented 9 years ago

You can do it, I am just a stranger who saw your issue and wanted to help

michidk commented 9 years ago

Haha, awesome :D Thank you!

loicteixeira commented 9 years ago

Good job guys :+1: Thanks @michidk for the issue and pull request and thanks @WizzardMaker for helping him!