Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trophy notification improvements #10482

Merged
merged 4 commits into from Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 16 additions & 12 deletions rpcs3/Emu/RSX/Overlays/overlay_trophy_notification.cpp
Expand Up @@ -34,17 +34,21 @@ namespace rsx

trophy_notification::trophy_notification()
{
frame.set_pos(0, 0);
frame.set_size(300, 80);
frame.back_color.a = 0.85f;

image.set_pos(8, 8);
image.set_size(64, 64);
frame.set_pos(68, 55);
frame.set_size(300, 72);
frame.back_color.r = 0.247059f;
frame.back_color.g = 0.250980f;
frame.back_color.b = 0.247059f;
frame.back_color.a = 0.88f;


image.set_pos(78, 64);
image.set_size(53, 53);
image.back_color.a = 0.f;

text_view.set_pos(85, 0);
text_view.set_padding(0, 0, 24, 0);
text_view.set_font("Arial", 9);
text_view.set_pos(139, 69);
text_view.set_padding(0, 0, 0, 0);
text_view.set_font("Arial", 14);
text_view.align_text(overlay_element::text_align::center);
text_view.back_color.a = 0.f;

Expand All @@ -71,7 +75,7 @@ namespace rsx
return;
}

if (((t - creation_time) / 1000) > 7500)
if (((t - creation_time) / 1000) > 5000)
{
if (!sliding_animation.active)
{
Expand Down Expand Up @@ -133,8 +137,8 @@ namespace rsx
text_view.auto_resize();

// Resize background to cover the text
u16 margin_sz = text_view.x - image.w - image.x;
frame.w = text_view.x + text_view.w + margin_sz;
u16 margin_sz = 9;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using this margin is fine. But it should probably be used to calculate the image position etc as well for consistency

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Removal of auto resize means lots of testing specifically with different languages that dont use latin fonts. This will be needed with and without fw and also on linux and BSD. This hardcoded stuff to me just seems to be whats appealing in specific conditions. We had ugly overflowing text when using some system languages before.

Copy link
Contributor Author

@Kilowog01 Kilowog01 Jun 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested Portuguese, English US, Japanese, Traditional Chinese, Korean, Russian and Danish. 18 different trophies each test. The only problem I noticed is that the first line remains in English, but this already happens in the current build so it isn't my fault. I can't test on linux and BSD.

frame.w = margin_sz * 3 + image.w + text_view.w;

visible = true;
return CELL_OK;
Expand Down
8 changes: 4 additions & 4 deletions rpcs3/rpcs3qt/localized_emu.h
Expand Up @@ -34,10 +34,10 @@ class localized_emu : public QObject
{
switch (id)
{
case localized_string_id::RSX_OVERLAYS_TROPHY_BRONZE: return tr("You have earned the bronze trophy\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_SILVER: return tr("You have earned the silver trophy\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_GOLD: return tr("You have earned the gold trophy\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_PLATINUM: return tr("You have earned the platinum trophy\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_BRONZE: return tr("You have earned a bronze trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_SILVER: return tr("You have earned a silver trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_GOLD: return tr("You have earned a gold trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_TROPHY_PLATINUM: return tr("You have earned a platinum trophy.\n%0", "Trophy text").arg(std::forward<Args>(args)...);
case localized_string_id::RSX_OVERLAYS_COMPILING_SHADERS: return tr("Compiling shaders");
case localized_string_id::RSX_OVERLAYS_MSG_DIALOG_YES: return tr("Yes", "Message Dialog");
case localized_string_id::RSX_OVERLAYS_MSG_DIALOG_NO: return tr("No", "Message Dialog");
Expand Down