Skip to content

Commit bd8380c

Browse files
feat(momentum): Display sync track button on official map leaderboards
1 parent 6acb512 commit bd8380c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scripts/pages/leaderboards/leaderboards.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class LeaderboardsHandler {
6363

6464
this.panels.tracksDropdown.RemoveAllOptions();
6565
this.panels.tracksDropdown.visible = false;
66+
67+
this.panels.endOfRunButton.visible = false;
68+
this.panels.syncTrackButton.visible = false;
6669
}
6770

6871
onTimesUpdated(count: number) {
@@ -201,18 +204,13 @@ class LeaderboardsHandler {
201204
* Hide the button to go to the end of run page.
202205
*/
203206
onMapLoad(isOfficial: boolean) {
204-
this.panels.endOfRunButton.visible = false;
205-
this.panels.syncTrackButton.visible = false;
206-
207207
if (isOfficial) {
208208
return; // Load official leaderboard tracks instead
209209
}
210210

211211
// Try to load tracks from local zones
212212
const mapZoneData = MomentumTimerAPI.GetActiveZoneDefs();
213213
if (mapZoneData) {
214-
this.panels.syncTrackButton.visible = true;
215-
216214
// Main track
217215
{
218216
const trackStr = $.Localize('#Leaderboards_Tracks_Main');
@@ -299,6 +297,11 @@ class LeaderboardsHandler {
299297
return;
300298
}
301299

300+
// Allow player to sync their current track to the value selected in the dropdown
301+
if (this.panels.cp.id === 'TabMenuLeaderboards') {
302+
this.panels.syncTrackButton.visible = true;
303+
}
304+
302305
this.panels.tracksDropdown.visible = true;
303306
this.panels.tracksDropdown.SetSelectedIndex(0);
304307
this.panels.tracksDropdown.SetPanelEvent('onuserinputsubmit', () => {

0 commit comments

Comments
 (0)