mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 03:24:49 +00:00
qt: Prevent interacting with empty grid cells. (#2243)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
This commit is contained in:
parent
3960283a67
commit
461148c227
2 changed files with 4 additions and 3 deletions
|
@ -38,17 +38,18 @@ GameGridFrame::GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get,
|
|||
|
||||
void GameGridFrame::onCurrentCellChanged(int currentRow, int currentColumn, int previousRow,
|
||||
int previousColumn) {
|
||||
cellClicked = true;
|
||||
crtRow = currentRow;
|
||||
crtColumn = currentColumn;
|
||||
columnCnt = this->columnCount();
|
||||
|
||||
auto itemID = (crtRow * columnCnt) + currentColumn;
|
||||
if (itemID > m_game_info->m_games.count() - 1) {
|
||||
cellClicked = false;
|
||||
validCellSelected = false;
|
||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||
return;
|
||||
}
|
||||
cellClicked = true;
|
||||
validCellSelected = true;
|
||||
SetGridBackgroundImage(crtRow, crtColumn);
|
||||
auto snd0Path = QString::fromStdString(m_game_info->m_games[itemID].snd0_path.string());
|
||||
|
|
|
@ -41,8 +41,8 @@ public:
|
|||
itemID = widget->currentRow() * widget->columnCount() + widget->currentColumn();
|
||||
}
|
||||
|
||||
// Do not show the menu if an item is selected
|
||||
if (itemID == -1) {
|
||||
// Do not show the menu if no item is selected
|
||||
if (itemID < 0 || itemID >= m_games.size()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue