Files
isaac-port/src/leaderboard.h
T
shweetandClaude Opus 5.5 233d5123e8 Curation round 5: Game construction, FXLayers, PlayerManager, the menus; the main menu renders
Eight agents took over ScoreSheet, DeathmatchManager, giantbook and boss overlays, FXLayers, PlayerManager, the menu
manager with the save and prompt flow, twelve menus (character wheel, options, challenges, daily (offline), special
seeds, leaderboard (local), collection, bestiary, stats, controller select, key config, cutscenes), console text input
and gamepad hot-plug through platform listeners. Integration moved input to device ids.
KAGE's projection matrix now reaches the 'ProjectionMatrix' uniform the basic shaders from afterbirthp.a declare, as
well as the exe's 'Transform', which takes the color-mod and HQ4X passes from black to correct output.
Under gdb with stubs skipped, the intro, title, file select, main menu and character wheel render as in the game.
1330 functions taken over, boot path 261/615. build/isaac stops at OnlineEmotes::init in Game::LoadConfigXmls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 02:59:23 -05:00

84 lines
2.4 KiB
C++

#pragma once
#include "anm2.h"
#include "score_sheet.h"
#include <array>
// What the leaderboard shows: a daily run's score breakdown, then the boards.
enum LeaderboardMode : int
{
LEADERBOARD_BREAKDOWN,
LEADERBOARD_BOARDS
};
// Where the leaderboard's sheet is: hidden, coming in, loading, shown or going out.
enum LeaderboardDisplay : int
{
LEADERBOARD_HIDDEN,
LEADERBOARD_APPEARING,
LEADERBOARD_LOADING,
LEADERBOARD_SHOWN,
LEADERBOARD_CLOSING
};
// The daily boards (REPENTOGON's RankingState), named by leaderboard_name_format.
enum LeaderboardKind : int
{
BOARD_SCORES_SOLO,
BOARD_TIMES_SOLO,
BOARD_SCORES_COOP,
BOARD_TIMES_COOP,
BOARD_KIND_COUNT
};
// Which rows of a board are listed (REPENTOGON's LiveSelectionState).
enum LeaderboardScope : int
{
SCOPE_GLOBAL,
SCOPE_FRIENDS,
SCOPE_AROUND_PLAYER
};
// The daily run leaderboard (Leaderboard), in Game after a daily run and in the daily run menu: the run's score
// breakdown with its ranks, then the day's boards a page at a time, by kind, scope and day.
// The boards are online. Offline every search for one fails at once, so none is ever found and no rows come.
// Construction and destruction (00856f70, 00857050) are the defaults.
class Leaderboard
{
public:
ScoreSheet scoreSheet;
DailyChallenge dailyChallenge{};
std::array<uint32_t, BOARD_KIND_COUNT> boards{};
ANM2 leaderboardSprite;
ANM2 scoreSprite;
LeaderboardMode mode = LEADERBOARD_BREAKDOWN;
LeaderboardDisplay displayState = LEADERBOARD_HIDDEN;
LeaderboardKind rankingState = BOARD_SCORES_SOLO;
LeaderboardScope liveSelectionState = SCOPE_GLOBAL;
uint32_t runDate = 0;
uint32_t shownDate = 0;
int entryCount = -1;
int rowOffset = -1;
int scoreRank = 0;
int timeRank = 0;
bool isClosed = false;
bool isEntriesDownloaded = false;
bool isScoreSubmitted = false;
bool isTimeSubmitted = false;
void LoadAnm2();
void Update();
void update_input();
void Render();
void Show(uint32_t date, const ScoreSheet& sheet, bool isSubmitScore, bool isCoop);
void get_leaderboard(LeaderboardKind kind, LeaderboardScope scope);
void download_entries(LeaderboardKind kind, LeaderboardScope scope);
void render_daily_score_breakdown();
void render_scores();
private:
uint32_t board_get();
int row_offset_max_get();
void close(ANM2& sprite, std::string_view animation);
};