Skip to content

Commit

Permalink
fix: start trackNum at 1
Browse files Browse the repository at this point in the history
  • Loading branch information
tsa96 committed Aug 31, 2024
1 parent e40c713 commit 44a6423
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/pages/leaderboards/leaderboards.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { exposeToPanelContext, PanelHandler } from 'util/module-helpers';
import { LeaderboardListType, LeaderboardStatusType, LeaderboardType } from 'common/leaderboard';
import { EndOfRunShowReason } from 'common/timer';
import { MMap } from 'common/web';
import { MMap, TrackType } from 'common/web';

exposeToPanelContext({ LeaderboardListType, LeaderboardType });

Expand Down Expand Up @@ -167,9 +167,9 @@ class LeaderboardsHandler {
if (leaderboard.trackType === 0) {
trackStr = $.Localize('#Leaderboards_Tracks_Main');
} else if (leaderboard.trackType === 1) {
trackStr = `${$.Localize('#Leaderboards_Tracks_Stage')} ${leaderboard.trackNum + 1}`;
trackStr = `${$.Localize('#Leaderboards_Tracks_Stage')} ${leaderboard.trackNum}`;
} else {
trackStr = `${$.Localize('#Leaderboards_Tracks_Bonus')} ${leaderboard.trackNum + 1}`;
trackStr = `${$.Localize('#Leaderboards_Tracks_Bonus')} ${leaderboard.trackNum}`;
}

const item = $.CreatePanel('Label', this.panels.tracksDropdown, trackStr, {
Expand All @@ -186,8 +186,8 @@ class LeaderboardsHandler {
this.panels.tracksDropdown.SetPanelEvent('onuserinputsubmit', () => {
const selected = this.panels.tracksDropdown.GetSelected();
this.panels.cp.selectTrack(
selected.GetAttributeInt('trackType', 0),
selected.GetAttributeInt('trackNum', 0)
selected.GetAttributeInt('trackType', TrackType.MAIN as number),
selected.GetAttributeInt('trackNum', 1)
);
});
}
Expand Down

0 comments on commit 44a6423

Please sign in to comment.