mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Initial work on implementing support for cheats
This commit is contained in:
35
arm9/source/romBrowser/viewModels/CheatsViewModel.h
Normal file
35
arm9/source/romBrowser/viewModels/CheatsViewModel.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include "core/task/TaskQueue.h"
|
||||
#include "cheats/GameCheats.h"
|
||||
#include "romBrowser/FileInfo.h"
|
||||
#include "romBrowser/IRomBrowserController.h"
|
||||
|
||||
/// @brief View model for the cheats screen.
|
||||
class CheatsViewModel
|
||||
{
|
||||
public:
|
||||
enum class State
|
||||
{
|
||||
Loading,
|
||||
NoCheats,
|
||||
DisplayCheats
|
||||
};
|
||||
|
||||
CheatsViewModel(const FileInfo& romFileInfo, IRomBrowserController* romBrowserController);
|
||||
|
||||
void Close()
|
||||
{
|
||||
_romBrowserController->HideGameInfo();
|
||||
}
|
||||
|
||||
State GetState() const { return _state; }
|
||||
const GameCheats* GetCheats() const { return _cheats.get(); }
|
||||
|
||||
private:
|
||||
FileInfo _romFileInfo;
|
||||
IRomBrowserController* _romBrowserController;
|
||||
QueueTask<void> _loadCheatsTask;
|
||||
std::unique_ptr<GameCheats> _cheats;
|
||||
State _state = State::Loading;
|
||||
};
|
||||
Reference in New Issue
Block a user