Add touch input support, add fast scrolling support for coverflow display mode, fix use after free bug in banner list mode

This commit is contained in:
Gericom
2026-04-04 19:24:39 +02:00
parent 21a8790ebc
commit 97762b14d3
119 changed files with 2251 additions and 762 deletions

View File

@@ -24,7 +24,7 @@ CheatsViewModel::CheatsViewModel(const FileInfo& romFileInfo, IRomBrowserControl
});
}
void CheatsViewModel::ActivateSelectedItem()
void CheatsViewModel::ActivateItem(int index)
{
if (_state != State::DisplayCheats)
{
@@ -36,19 +36,19 @@ void CheatsViewModel::ActivateSelectedItem()
u32 numberOfSubEntries = 0;
auto subEntries = cheatCategory->GetSubEntries(numberOfSubEntries);
if (numberOfSubEntries == 0)
if (numberOfSubEntries == 0 || index < 0 || index >= (int)numberOfSubEntries)
{
// There is nothing to activate
return;
}
auto& entry = subEntries[_selectedItem];
auto& entry = subEntries[index];
if (entry.IsCheatCategory())
{
// Category activated
if (_categoryStackLevel + 1 != _categoryStack.size())
{
_categoryStack[++_categoryStackLevel] = { &entry, (u32)_selectedItem };
_categoryStack[++_categoryStackLevel] = { &entry, (u32)index };
_selectedItem = 0;
}
}