mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-05 08:52:36 +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
@ -42,9 +42,11 @@ void GameGridFrame::onCurrentCellChanged(int currentRow, int currentColumn, int
|
|||||||
|
|
||||||
auto itemID = (crtRow * columnCnt) + currentColumn;
|
auto itemID = (crtRow * columnCnt) + currentColumn;
|
||||||
if (itemID > m_game_info->m_games.count() - 1) {
|
if (itemID > m_game_info->m_games.count() - 1) {
|
||||||
|
validCellSelected = false;
|
||||||
BackgroundMusicPlayer::getInstance().stopMusic();
|
BackgroundMusicPlayer::getInstance().stopMusic();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
validCellSelected = true;
|
||||||
SetGridBackgroundImage(crtRow, crtColumn);
|
SetGridBackgroundImage(crtRow, crtColumn);
|
||||||
auto snd0Path = QString::fromStdString(m_game_info->m_games[itemID].snd0_path.string());
|
auto snd0Path = QString::fromStdString(m_game_info->m_games[itemID].snd0_path.string());
|
||||||
PlayBackgroundMusic(snd0Path);
|
PlayBackgroundMusic(snd0Path);
|
||||||
@ -166,3 +168,7 @@ void GameGridFrame::RefreshGridBackgroundImage() {
|
|||||||
this->setPalette(palette);
|
this->setPalette(palette);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GameGridFrame::IsValidCellSelected() {
|
||||||
|
return validCellSelected;
|
||||||
|
}
|
||||||
|
@ -30,10 +30,12 @@ private:
|
|||||||
GuiContextMenus m_gui_context_menus;
|
GuiContextMenus m_gui_context_menus;
|
||||||
std::shared_ptr<GameInfoClass> m_game_info;
|
std::shared_ptr<GameInfoClass> m_game_info;
|
||||||
std::shared_ptr<QVector<GameInfo>> m_games_shared;
|
std::shared_ptr<QVector<GameInfo>> m_games_shared;
|
||||||
|
bool validCellSelected = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent = nullptr);
|
explicit GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get, QWidget* parent = nullptr);
|
||||||
void PopulateGameGrid(QVector<GameInfo> m_games, bool fromSearch);
|
void PopulateGameGrid(QVector<GameInfo> m_games, bool fromSearch);
|
||||||
|
bool IsValidCellSelected();
|
||||||
|
|
||||||
bool cellClicked = false;
|
bool cellClicked = false;
|
||||||
int icon_size;
|
int icon_size;
|
||||||
|
@ -1034,9 +1034,12 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) {
|
|||||||
if (event->type() == QEvent::KeyPress) {
|
if (event->type() == QEvent::KeyPress) {
|
||||||
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
|
||||||
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
|
if (keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return) {
|
||||||
MainWindow::StartGame();
|
auto tblMode = Config::getTableMode();
|
||||||
|
if (tblMode != 2 && (tblMode != 1 || m_game_grid_frame->IsValidCellSelected())) {
|
||||||
|
StartGame();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return QMainWindow::eventFilter(obj, event);
|
return QMainWindow::eventFilter(obj, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user