shadPS4/src/qt_gui/trophy_viewer.h
Dmugetsu d59536a71c
Adding Top and Bottom trophy option for pop window + Trophy improvements (#2566)
* Adding top button option for trophy pop up

* Ui fix

* Clang format

* improvements to trophy pr 

* improvements

* Note: The sound will only work in QT versions

* -.

* Update path_util.cpp

* Update path_util.cpp

* centered text when using top and bottom option

* Clang

* trophy viewer now opens in window not fullscreen

---------

Co-authored-by: DanielSvoboda <daniel.svoboda@hotmail.com>
2025-03-02 21:36:12 +02:00

65 lines
1.5 KiB
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QApplication>
#include <QCheckBox>
#include <QDir>
#include <QDockWidget>
#include <QFileInfoList>
#include <QGraphicsBlurEffect>
#include <QHeaderView>
#include <QLabel>
#include <QMainWindow>
#include <QPushButton>
#include <QTableWidget>
#include <QTableWidgetItem>
#include <QVBoxLayout>
#include <QXmlStreamReader>
#include "common/types.h"
#include "core/file_format/trp.h"
class TrophyViewer : public QMainWindow {
Q_OBJECT
public:
explicit TrophyViewer(QString trophyPath, QString gameTrpPath);
void updateTrophyInfo();
void updateTableFilters();
void onDockClosed();
void reopenLeftDock();
private:
void PopulateTrophyWidget(QString title);
void SetTableItem(QTableWidget* parent, int row, int column, QString str);
QTabWidget* tabWidget = nullptr;
QStringList headers;
QString gameTrpPath_;
TRP trp;
QLabel* trophyInfoLabel;
QCheckBox* showEarnedCheck;
QCheckBox* showNotEarnedCheck;
QCheckBox* showHiddenCheck;
QPushButton* expandButton;
QDockWidget* trophyInfoDock;
QPushButton* reopenButton;
std::string GetTrpType(const QChar trp_) {
switch (trp_.toLatin1()) {
case 'B':
return "bronze.png";
case 'S':
return "silver.png";
case 'G':
return "gold.png";
case 'P':
return "platinum.png";
}
return "Unknown";
}
};