From f5924b6c8e156aa7a09f9b696c850b109acee515 Mon Sep 17 00:00:00 2001 From: 4ian <1280130+4ian@users.noreply.github.com> Date: Tue, 14 Jul 2026 10:40:07 +0000 Subject: [PATCH] [Auto] [Improve] Documented leaderboard close action, closed-by-player condition, save error expression, and connected-player option --- automated_updates_data.json | 4 ++++ docs/gdevelop5/all-features/leaderboards/index.md | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/automated_updates_data.json b/automated_updates_data.json index 93530ac0247..d57d1f61e8f 100644 --- a/automated_updates_data.json +++ b/automated_updates_data.json @@ -104,6 +104,10 @@ { "date": "2026-07-07", "summary": "Improved keyboard docs: added 'Key just pressed' (held vs one-frame) and 'Any key released' conditions, control-remapping note, and a reference list of valid key names" + }, + { + "date": "2026-07-14", + "summary": "Improved leaderboards docs: documented Close current leaderboard action, Closed by player condition, LastSaveError expression, and the always-attach-to-connected-player option" } ] } diff --git a/docs/gdevelop5/all-features/leaderboards/index.md b/docs/gdevelop5/all-features/leaderboards/index.md index 60aa1797ac8..0ecfd4bd628 100644 --- a/docs/gdevelop5/all-features/leaderboards/index.md +++ b/docs/gdevelop5/all-features/leaderboards/index.md @@ -38,6 +38,12 @@ You have 3 conditions at your disposal to monitor how the saving is run through. For each of those conditions, you can specify the leaderboard but this is optional. This can prove useful if you try to save the player score in multiple leaderboards at once. +If the save has errored, the expression `Leaderboards::LastSaveError()` returns the error message, which can help you debug the problem or display it to the player. + +!!! note + + Even when you use the "Save player score" action (for anonymous players), the score is automatically attached to the [connected player](/gdevelop5/all-features/player-authentication) if one is logged in. You can turn this off with the action **"Always attach scores to the connected player"** if you always want to submit the anonymous nickname. + ## Display a leaderboard Use the action "**Display leaderboard**" to load and display a leaderboard on the screen. It will be displayed on top of your game, and the view will have a button to close it in order to come back to your game. @@ -54,6 +60,12 @@ While it's **loading**, to let the player know that the leaderboard will display Either case, if there's an error during the display, *it will close automatically*. You can also use the 2 conditions "Leaderboard display has errored" and "Leaderboard display has loaded" if you want to add logic around a possible error. +### Closing the leaderboard + +The displayed leaderboard has a built-in button to close it, but you can also close it from your events with the action **"Close current leaderboard"** (for example, from your own button or after a delay). + +To react when the player closes the leaderboard (with the built-in button), use the condition **"Closed by player"**. This is useful to send the player back to a menu or resume the game once the leaderboard view is dismissed. + ## Advanced: pause the scene when the leaderboard is displayed We recommend that you send back the player to a menu scene or a non gameplay scene after you open the leaderboard.