mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-22 04:24:44 +00:00
don't start game in elf viewer mode or gridview mode with empty item selected
This commit is contained in:
parent
ce3b499031
commit
13e23ef1dd
3 changed files with 13 additions and 2 deletions
|
@ -42,9 +42,11 @@ void GameGridFrame::onCurrentCellChanged(int currentRow, int currentColumn, int
|
|||
|
||||
auto itemID = (crtRow * columnCnt) + currentColumn;
|
||||
if (itemID > m_game_info->m_games.count() - 1) {
|
||||
validCellSelected = false;
|
||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||
return;
|
||||
}
|
||||
validCellSelected = true;
|
||||
SetGridBackgroundImage(crtRow, crtColumn);
|
||||
auto snd0Path = QString::fromStdString(m_game_info->m_games[itemID].snd0_path.string());
|
||||
PlayBackgroundMusic(snd0Path);
|
||||
|
@ -166,3 +168,7 @@ void GameGridFrame::RefreshGridBackgroundImage() {
|
|||
this->setPalette(palette);
|
||||
}
|
||||
}
|
||||
|
||||
bool GameGridFrame::IsValidCellSelected() {
|
||||
return validCellSelected;
|
||||
}
|
||||
|
|
|
@ -30,10 +30,12 @@ private:
|
|||
GuiContextMenus m_gui_context_menus;
|
||||
std::shared_ptr<GameInfoClass> m_game_info;
|
||||
std::shared_ptr<QVector<GameInfo>> m_games_shared;
|
||||
bool validCellSelected = false;
|
||||
|
||||
public:
|
||||
explicit GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent = nullptr);
|
||||
void PopulateGameGrid(QVector<GameInfo> m_games, bool fromSearch);
|
||||
bool IsValidCellSelected();
|
||||
|
||||
bool cellClicked = false;
|
||||
int icon_size;
|
||||
|
|
|
@ -1034,8 +1034,11 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) {
|
|||
if (event->type() == QEvent::KeyPress) {
|
||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
|
||||
MainWindow::StartGame();
|
||||
return true;
|
||||
auto tblMode = Config::getTableMode();
|
||||
if (tblMode != 2 && (tblMode != 1 || m_game_grid_frame->IsValidCellSelected())) {
|
||||
StartGame();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return QMainWindow::eventFilter(obj, event);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue