2024-03-29 05:51:38 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
2024-03-29 05:43:46 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QScrollBar>
|
2024-08-04 13:07:10 +00:00
|
|
|
|
2024-09-26 06:12:41 +00:00
|
|
|
#include "background_music_player.h"
|
2024-06-11 02:42:21 +00:00
|
|
|
#include "common/config.h"
|
2024-03-29 05:43:46 +00:00
|
|
|
#include "game_info.h"
|
|
|
|
#include "game_list_utils.h"
|
|
|
|
#include "gui_context_menus.h"
|
2024-12-25 07:30:09 +00:00
|
|
|
#include "qt_gui/compatibility_info.h"
|
2024-03-29 05:43:46 +00:00
|
|
|
|
|
|
|
class GameGridFrame : public QTableWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void GameGridFrameClosed();
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void SetGridBackgroundImage(int row, int column);
|
|
|
|
void RefreshGridBackgroundImage();
|
2024-09-28 18:04:47 +00:00
|
|
|
void PlayBackgroundMusic(QString path);
|
|
|
|
void onCurrentCellChanged(int currentRow, int currentColumn, int previousRow,
|
|
|
|
int previousColumn);
|
2024-03-29 05:43:46 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QImage backgroundImage;
|
|
|
|
GameListUtils m_game_list_utils;
|
|
|
|
GuiContextMenus m_gui_context_menus;
|
|
|
|
std::shared_ptr<GameInfoClass> m_game_info;
|
2024-12-25 07:30:09 +00:00
|
|
|
std::shared_ptr<CompatibilityInfoClass> m_compat_info;
|
2024-03-29 05:43:46 +00:00
|
|
|
std::shared_ptr<QVector<GameInfo>> m_games_shared;
|
2024-09-28 18:04:47 +00:00
|
|
|
bool validCellSelected = false;
|
2024-03-29 05:43:46 +00:00
|
|
|
|
|
|
|
public:
|
2024-12-25 07:30:09 +00:00
|
|
|
explicit GameGridFrame(std::shared_ptr<GameInfoClass> game_info_get,
|
|
|
|
std::shared_ptr<CompatibilityInfoClass> compat_info_get,
|
|
|
|
QWidget* parent = nullptr);
|
2024-03-29 05:43:46 +00:00
|
|
|
void PopulateGameGrid(QVector<GameInfo> m_games, bool fromSearch);
|
2024-09-28 18:04:47 +00:00
|
|
|
bool IsValidCellSelected();
|
2024-03-29 05:43:46 +00:00
|
|
|
|
2024-06-11 02:42:21 +00:00
|
|
|
bool cellClicked = false;
|
2024-03-29 05:43:46 +00:00
|
|
|
int icon_size;
|
|
|
|
int windowWidth;
|
2024-06-11 02:42:21 +00:00
|
|
|
int crtRow;
|
|
|
|
int crtColumn;
|
|
|
|
int columnCnt;
|
2024-03-29 05:43:46 +00:00
|
|
|
};
|