Skip to content

Commit

Permalink
Qt: make trophy type translateable
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Apr 6, 2020
1 parent 5a45707 commit fdb40ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
22 changes: 11 additions & 11 deletions rpcs3/rpcs3qt/trophy_manager_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,8 @@ void trophy_manager_dialog::ApplyFilter()
continue;
}

const int trophy_id = item->text().toInt();
const QString trophy_type = type_item->text();
const int trophy_id = item->text().toInt();
const int trophy_type = type_item->data(Qt::UserRole).toInt();

// I could use boolean logic and reduce this to something much shorter and also much more confusing...
const bool hidden = icon_item->data(Qt::UserRole).toBool();
Expand All @@ -637,10 +637,10 @@ void trophy_manager_dialog::ApplyFilter()
{
hide = true;
}
else if ((trophy_type == Bronze && !m_show_bronze_trophies)
|| (trophy_type == Silver && !m_show_silver_trophies)
|| (trophy_type == Gold && !m_show_gold_trophies)
|| (trophy_type == Platinum && !m_show_platinum_trophies))
else if ((trophy_type == SCE_NP_TROPHY_GRADE_BRONZE && !m_show_bronze_trophies)
|| (trophy_type == SCE_NP_TROPHY_GRADE_SILVER && !m_show_silver_trophies)
|| (trophy_type == SCE_NP_TROPHY_GRADE_GOLD && !m_show_gold_trophies)
|| (trophy_type == SCE_NP_TROPHY_GRADE_PLATINUM && !m_show_platinum_trophies))
{
hide = true;
}
Expand Down Expand Up @@ -827,14 +827,14 @@ void trophy_manager_dialog::PopulateTrophyTable()
const QString platinum_relevant = platinum_link_id < 0 ? tr("No") : tr("Yes");

// Get trophy type
QString trophy_type = "";
QString trophy_type;

switch (n->GetAttribute("ttype")[0])
{
case 'B': details.trophyGrade = SCE_NP_TROPHY_GRADE_BRONZE; trophy_type = Bronze; break;
case 'S': details.trophyGrade = SCE_NP_TROPHY_GRADE_SILVER; trophy_type = Silver; break;
case 'G': details.trophyGrade = SCE_NP_TROPHY_GRADE_GOLD; trophy_type = Gold; break;
case 'P': details.trophyGrade = SCE_NP_TROPHY_GRADE_PLATINUM; trophy_type = Platinum; break;
case 'B': details.trophyGrade = SCE_NP_TROPHY_GRADE_BRONZE; trophy_type = tr("Bronze", "Trophy type"); break;
case 'S': details.trophyGrade = SCE_NP_TROPHY_GRADE_SILVER; trophy_type = tr("Silver", "Trophy type"); break;
case 'G': details.trophyGrade = SCE_NP_TROPHY_GRADE_GOLD; trophy_type = tr("Gold", "Trophy type"); break;
case 'P': details.trophyGrade = SCE_NP_TROPHY_GRADE_PLATINUM; trophy_type = tr("Platinum", "Trophy type"); break;
}

// Get hidden state
Expand Down
5 changes: 0 additions & 5 deletions rpcs3/rpcs3qt/trophy_manager_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ class trophy_manager_dialog : public QWidget
{
Q_OBJECT

const QString Bronze = "Bronze";
const QString Silver = "Silver";
const QString Gold = "Gold";
const QString Platinum = "Platinum";

public:
explicit trophy_manager_dialog(std::shared_ptr<gui_settings> gui_settings);
~trophy_manager_dialog() override;
Expand Down

0 comments on commit fdb40ee

Please sign in to comment.