mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 00:56:55 +02:00
Add ability to move to and from the up button in the cheats panel with the dpad, fix oopsie with cheat category name text, update Usage.md
This commit is contained in:
@@ -256,14 +256,20 @@ SharedPtr<View> RecyclerView::MoveFocusVertical(const SharedPtr<View>& currentFo
|
|||||||
if (!_selectedItem || currentFocus.GetPointer() != _selectedItem->view.GetPointer())
|
if (!_selectedItem || currentFocus.GetPointer() != _selectedItem->view.GetPointer())
|
||||||
{
|
{
|
||||||
// incoming focus
|
// incoming focus
|
||||||
if (direction != FocusMoveDirection::Right)
|
if (direction == FocusMoveDirection::Right)
|
||||||
{
|
{
|
||||||
return nullptr;
|
int idx = (-_yOffset + currentFocus->GetPosition().y - _yPadding + ((_ySpacing + _itemHeight) >> 1)) / (_ySpacing + _itemHeight) * _columns;
|
||||||
|
SetSelectedItem(std::clamp(idx, 0, ((int)_itemCount - 1) / _columns * _columns));
|
||||||
|
return _selectedItem != nullptr ? _selectedItem->view : SharedFromThis();
|
||||||
|
}
|
||||||
|
else if (direction == FocusMoveDirection::Down)
|
||||||
|
{
|
||||||
|
int idx = (-_xOffset + currentFocus->GetPosition().x - _xPadding + ((_xSpacing + _itemWidth) >> 1)) / (_xSpacing + _itemWidth);
|
||||||
|
SetSelectedItem(std::clamp(idx, 0, _columns - 1));
|
||||||
|
return _selectedItem != nullptr ? _selectedItem->view : SharedFromThis();
|
||||||
}
|
}
|
||||||
|
|
||||||
int idx = (-_yOffset + currentFocus->GetPosition().y - _yPadding + ((_ySpacing + _itemHeight) >> 1)) / (_ySpacing + _itemHeight) * _columns;
|
return nullptr;
|
||||||
SetSelectedItem(std::clamp(idx, 0, ((int)_itemCount - 1) / _columns * _columns));
|
|
||||||
return _selectedItem != nullptr ? _selectedItem->view : SharedFromThis();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int column = _selectedItem->itemIdx % _columns;
|
int column = _selectedItem->itemIdx % _columns;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void CheatsBottomSheetView::Update()
|
|||||||
else if (_currentCheatCategory != _viewModel->GetCurrentCheatCategory()
|
else if (_currentCheatCategory != _viewModel->GetCurrentCheatCategory()
|
||||||
&& _viewModel->GetCurrentCheatCategory() != nullptr)
|
&& _viewModel->GetCurrentCheatCategory() != nullptr)
|
||||||
{
|
{
|
||||||
// _secondaryLabel->SetText(_viewModel->GetCurrentCheatCategory()->GetName());
|
_secondaryLabel->SetText(_viewModel->GetCurrentCheatCategory()->GetName());
|
||||||
UpdateCheatList();
|
UpdateCheatList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -223,6 +223,25 @@ void CheatsBottomSheetView::Draw(GraphicsContext& graphicsContext)
|
|||||||
graphicsContext.ResetClipArea();
|
graphicsContext.ResetClipArea();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SharedPtr<View> CheatsBottomSheetView::MoveFocus(const SharedPtr<View>& currentFocus, FocusMoveDirection direction, View* source)
|
||||||
|
{
|
||||||
|
if (!currentFocus)
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (source == _cheatListRecycler.GetPointer() && direction == FocusMoveDirection::Up && _viewModel->IsInSubCategory())
|
||||||
|
{
|
||||||
|
return _upButton;
|
||||||
|
}
|
||||||
|
else if (source == _upButton.GetPointer() && direction == FocusMoveDirection::Down)
|
||||||
|
{
|
||||||
|
return _cheatListRecycler->MoveFocus(currentFocus, direction, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
bool CheatsBottomSheetView::HandleInput(const InputProvider& inputProvider, FocusManager& focusManager)
|
bool CheatsBottomSheetView::HandleInput(const InputProvider& inputProvider, FocusManager& focusManager)
|
||||||
{
|
{
|
||||||
if (inputProvider.Triggered(InputKey::B))
|
if (inputProvider.Triggered(InputKey::B))
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public:
|
|||||||
void InitVram(const VramContext& vramContext) override;
|
void InitVram(const VramContext& vramContext) override;
|
||||||
void Update() override;
|
void Update() override;
|
||||||
void Draw(GraphicsContext& graphicsContext) override;
|
void Draw(GraphicsContext& graphicsContext) override;
|
||||||
|
SharedPtr<View> MoveFocus(const SharedPtr<View>& currentFocus, FocusMoveDirection direction, View* source) override;
|
||||||
bool HandleInput(const InputProvider& inputProvider, FocusManager& focusManager) override;
|
bool HandleInput(const InputProvider& inputProvider, FocusManager& focusManager) override;
|
||||||
|
|
||||||
void Focus(FocusManager& focusManager) override
|
void Focus(FocusManager& focusManager) override
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ From here you can browse your SD card to launch homebrew and games.
|
|||||||
|
|
||||||
The back arrow on the top left of the bottom screen can also be used to go up to the parent folder.
|
The back arrow on the top left of the bottom screen can also be used to go up to the parent folder.
|
||||||
|
|
||||||
Please note that touch functionality is not supported yet.
|
Touch input is also supported.
|
||||||
|
|
||||||
## Settings menu
|
## Settings menu
|
||||||
The settings menu can be accessed by using the DPAD to move the selector to the cogwheel icon and pressing A. When in the settings menu, press the B button will to return to the file browser.
|
The settings menu can be accessed by using the DPAD to move the selector to the cogwheel icon and pressing A. When in the settings menu, press the B button will to return to the file browser.
|
||||||
|
|||||||
Reference in New Issue
Block a user