shadPS4/src/qt_gui/trophy_viewer.h
rainmakerv2 47ac8b6c03
Fix and add back Trophy type icons for both the trophy pop-up and viewer (#2522)
* Add back fixed trophy type icons to trophy viewer

* Remove unused declaration until it is needed again

* Fix trophy pop-up icons

* Adjust size and alignment based on trophy name length

---------

Co-authored-by: rainmakerv2 <30595646+jpau02@users.noreply.github.com>
2025-02-24 12:41:57 +02:00

49 lines
1.1 KiB
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <QApplication>
#include <QDir>
#include <QFileInfoList>
#include <QGraphicsBlurEffect>
#include <QHeaderView>
#include <QLabel>
#include <QMainWindow>
#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);
private:
void PopulateTrophyWidget(QString title);
void SetTableItem(QTableWidget* parent, int row, int column, QString str);
QTabWidget* tabWidget = nullptr;
QStringList headers;
QString gameTrpPath_;
TRP trp;
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";
}
};