mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 00:56:55 +02:00
Add cheats not found label
This commit is contained in:
@@ -16,6 +16,9 @@
|
||||
#define TITLE_LABEL_X 20
|
||||
#define TITLE_LABEL_Y 16
|
||||
|
||||
#define NO_CHEATS_FOUND_LABEL_X 20
|
||||
#define NO_CHEATS_FOUND_LABEL_Y 36
|
||||
|
||||
#define LIST_X 16
|
||||
#define LIST_Y 36
|
||||
|
||||
@@ -23,14 +26,17 @@ CheatsBottomSheetView::CheatsBottomSheetView(std::unique_ptr<CheatsViewModel> vi
|
||||
const MaterialColorScheme* materialColorScheme, const IFontRepository* fontRepository,
|
||||
FocusManager* focusManager)
|
||||
: _viewModel(std::move(viewModel))
|
||||
, _titleLabel(128, 16, 25, fontRepository->GetFont(FontType::Medium11))
|
||||
, _titleLabel(64, 16, 25, fontRepository->GetFont(FontType::Medium11))
|
||||
, _noCheatsFoundLabel(96, 16, 25, fontRepository->GetFont(FontType::Regular10))
|
||||
, _cheatListRecycler(std::make_unique<RecyclerView>(LIST_X, LIST_Y, 224, 124, RecyclerView::Mode::VerticalList))
|
||||
, _materialColorScheme(materialColorScheme)
|
||||
, _fontRepository(fontRepository)
|
||||
, _focusManager(focusManager)
|
||||
{
|
||||
_titleLabel.SetText(u"Cheats");
|
||||
_noCheatsFoundLabel.SetText(u"No cheats found.");
|
||||
AddChildTail(&_titleLabel);
|
||||
AddChildTail(&_noCheatsFoundLabel);
|
||||
AddChildTail(_cheatListRecycler.get());
|
||||
}
|
||||
|
||||
@@ -64,6 +70,7 @@ void CheatsBottomSheetView::InitVram(const VramContext& vramContext)
|
||||
void CheatsBottomSheetView::Update()
|
||||
{
|
||||
_titleLabel.SetPosition(TITLE_LABEL_X, _position.y + TITLE_LABEL_Y);
|
||||
_noCheatsFoundLabel.SetPosition(NO_CHEATS_FOUND_LABEL_X, _position.y + NO_CHEATS_FOUND_LABEL_Y);
|
||||
_cheatListRecycler->SetPosition(LIST_X, _position.y + LIST_Y);
|
||||
if (_viewModel->GetState() == CheatsViewModel::State::DisplayCheats)
|
||||
{
|
||||
@@ -119,6 +126,13 @@ void CheatsBottomSheetView::Draw(GraphicsContext& graphicsContext)
|
||||
_titleLabel.SetBackgroundColor(backColor);
|
||||
_titleLabel.SetForegroundColor(_materialColorScheme->onSurface);
|
||||
_titleLabel.Draw(graphicsContext);
|
||||
|
||||
if (_viewModel->GetState() == CheatsViewModel::State::NoCheats)
|
||||
{
|
||||
_noCheatsFoundLabel.SetBackgroundColor(backColor);
|
||||
_noCheatsFoundLabel.SetForegroundColor(_materialColorScheme->onSurface);
|
||||
_noCheatsFoundLabel.Draw(graphicsContext);
|
||||
}
|
||||
}
|
||||
graphicsContext.SetPriority(oldPrio);
|
||||
graphicsContext.ResetClipArea();
|
||||
|
||||
@@ -40,6 +40,7 @@ public:
|
||||
private:
|
||||
std::unique_ptr<CheatsViewModel> _viewModel;
|
||||
Label2DView _titleLabel;
|
||||
Label2DView _noCheatsFoundLabel;
|
||||
std::unique_ptr<RecyclerView> _cheatListRecycler;
|
||||
CheatsAdapter* _cheatsAdapter = nullptr;
|
||||
const MaterialColorScheme* _materialColorScheme;
|
||||
|
||||
Reference in New Issue
Block a user