Qt: Add recent games list

This commit is contained in:
wheremyfoodat
2026-02-24 19:56:51 +02:00
parent f5e5be4b6d
commit 0c1ccbd177
4 changed files with 96 additions and 5 deletions

View File

@@ -108,6 +108,9 @@ struct EmulatorConfig {
std::filesystem::path defaultRomPath = "";
std::filesystem::path filePath;
static constexpr size_t maxRecentGames = 8;
std::vector<std::filesystem::path> recentlyPlayed;
// Frontend window settings
struct WindowSettings {
static constexpr int defaultX = 200;
@@ -132,6 +135,8 @@ struct EmulatorConfig {
void load();
void save();
void addToRecentGames(const std::filesystem::path& path);
static LanguageCodes languageCodeFromString(std::string inString);
static const char* languageCodeToString(LanguageCodes code);
};

View File

@@ -103,6 +103,7 @@ class MainWindow : public QMainWindow {
std::vector<EmulatorMessage> messageQueue;
QMenuBar* menuBar = nullptr;
QMenu* recentsMenu = nullptr;
InputMappings keyboardMappings;
ScreenWidget* screen;
AboutWindow* aboutWindow;
@@ -123,6 +124,8 @@ class MainWindow : public QMainWindow {
void emuThreadMainLoop();
void selectLuaFile();
void selectROM();
void loadROMFromPath(const std::filesystem::path& path);
void updateRecentsMenu();
void dumpDspFirmware();
void dumpRomFS();
void showAboutMenu();