mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Remove Badges Enabled option from Achievements
Was informed by the RetroAchievements team that this isn't an option in most emulators, and as the next commits will be to enable default icons, there will always be something to display.
This commit is contained in:
parent
e0e09d1074
commit
75465f00cc
@ -637,7 +637,7 @@ void AchievementManager::DisplayWelcomeMessage()
|
||||
m_display_welcome_message = false;
|
||||
const u32 color =
|
||||
rc_client_get_hardcore_enabled(m_client) ? OSD::Color::YELLOW : OSD::Color::CYAN;
|
||||
if (Config::Get(Config::RA_BADGES_ENABLED) && !m_game_badge.name.empty())
|
||||
if (!m_game_badge.name.empty())
|
||||
{
|
||||
OSD::AddMessage("", OSD::Duration::VERY_LONG, OSD::Color::GREEN,
|
||||
DecodeBadgeToOSDIcon(m_game_badge.badge));
|
||||
@ -677,11 +677,9 @@ void AchievementManager::HandleAchievementTriggeredEvent(const rc_client_event_t
|
||||
(rc_client_get_hardcore_enabled(AchievementManager::GetInstance().m_client)) ?
|
||||
OSD::Color::YELLOW :
|
||||
OSD::Color::CYAN,
|
||||
(Config::Get(Config::RA_BADGES_ENABLED)) ?
|
||||
DecodeBadgeToOSDIcon(AchievementManager::GetInstance()
|
||||
.m_unlocked_badges[client_event->achievement->id]
|
||||
.badge) :
|
||||
nullptr);
|
||||
DecodeBadgeToOSDIcon(AchievementManager::GetInstance()
|
||||
.m_unlocked_badges[client_event->achievement->id]
|
||||
.badge));
|
||||
}
|
||||
|
||||
void AchievementManager::HandleLeaderboardStartedEvent(const rc_client_event_t* client_event)
|
||||
@ -738,15 +736,12 @@ void AchievementManager::HandleLeaderboardTrackerHideEvent(const rc_client_event
|
||||
void AchievementManager::HandleAchievementChallengeIndicatorShowEvent(
|
||||
const rc_client_event_t* client_event)
|
||||
{
|
||||
if (Config::Get(Config::RA_BADGES_ENABLED))
|
||||
auto& unlocked_badges = AchievementManager::GetInstance().m_unlocked_badges;
|
||||
if (const auto unlocked_iter = unlocked_badges.find(client_event->achievement->id);
|
||||
unlocked_iter != unlocked_badges.end())
|
||||
{
|
||||
auto& unlocked_badges = AchievementManager::GetInstance().m_unlocked_badges;
|
||||
if (const auto unlocked_iter = unlocked_badges.find(client_event->achievement->id);
|
||||
unlocked_iter != unlocked_badges.end())
|
||||
{
|
||||
AchievementManager::GetInstance().m_active_challenges[client_event->achievement->badge_name] =
|
||||
DecodeBadgeToOSDIcon(unlocked_iter->second.badge);
|
||||
}
|
||||
AchievementManager::GetInstance().m_active_challenges[client_event->achievement->badge_name] =
|
||||
DecodeBadgeToOSDIcon(unlocked_iter->second.badge);
|
||||
}
|
||||
}
|
||||
|
||||
@ -763,11 +758,9 @@ void AchievementManager::HandleAchievementProgressIndicatorShowEvent(
|
||||
OSD::AddMessage(fmt::format("{} {}", client_event->achievement->title,
|
||||
client_event->achievement->measured_progress),
|
||||
OSD::Duration::SHORT, OSD::Color::GREEN,
|
||||
(Config::Get(Config::RA_BADGES_ENABLED)) ?
|
||||
DecodeBadgeToOSDIcon(AchievementManager::GetInstance()
|
||||
.m_unlocked_badges[client_event->achievement->id]
|
||||
.badge) :
|
||||
nullptr);
|
||||
DecodeBadgeToOSDIcon(AchievementManager::GetInstance()
|
||||
.m_unlocked_badges[client_event->achievement->id]
|
||||
.badge));
|
||||
}
|
||||
|
||||
void AchievementManager::HandleGameCompletedEvent(const rc_client_event_t* client_event,
|
||||
@ -784,9 +777,7 @@ void AchievementManager::HandleGameCompletedEvent(const rc_client_event_t* clien
|
||||
OSD::AddMessage(fmt::format("Congratulations! {} has {} {}", user_info->display_name,
|
||||
hardcore ? "mastered" : "completed", game_info->title),
|
||||
OSD::Duration::VERY_LONG, hardcore ? OSD::Color::YELLOW : OSD::Color::CYAN,
|
||||
(Config::Get(Config::RA_BADGES_ENABLED)) ?
|
||||
DecodeBadgeToOSDIcon(AchievementManager::GetInstance().m_game_badge.badge) :
|
||||
nullptr);
|
||||
DecodeBadgeToOSDIcon(AchievementManager::GetInstance().m_game_badge.badge));
|
||||
}
|
||||
|
||||
void AchievementManager::HandleResetEvent(const rc_client_event_t* client_event)
|
||||
@ -880,7 +871,7 @@ void AchievementManager::FetchBadge(AchievementManager::BadgeStatus* badge, u32
|
||||
const AchievementManager::BadgeNameFunction function,
|
||||
const UpdatedItems callback_data)
|
||||
{
|
||||
if (!m_client || !HasAPIToken() || !Config::Get(Config::RA_BADGES_ENABLED))
|
||||
if (!m_client || !HasAPIToken())
|
||||
{
|
||||
m_update_callback(callback_data);
|
||||
if (m_display_welcome_message && badge_type == RC_IMAGE_TYPE_GAME)
|
||||
|
@ -26,7 +26,6 @@ const Info<bool> RA_DISCORD_PRESENCE_ENABLED{
|
||||
{System::Achievements, "Achievements", "DiscordPresenceEnabled"}, false};
|
||||
const Info<bool> RA_PROGRESS_ENABLED{{System::Achievements, "Achievements", "ProgressEnabled"},
|
||||
false};
|
||||
const Info<bool> RA_BADGES_ENABLED{{System::Achievements, "Achievements", "BadgesEnabled"}, false};
|
||||
} // namespace Config
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
@ -20,7 +20,6 @@ extern const Info<bool> RA_ENCORE_ENABLED;
|
||||
extern const Info<bool> RA_SPECTATOR_ENABLED;
|
||||
extern const Info<bool> RA_DISCORD_PRESENCE_ENABLED;
|
||||
extern const Info<bool> RA_PROGRESS_ENABLED;
|
||||
extern const Info<bool> RA_BADGES_ENABLED;
|
||||
} // namespace Config
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
@ -61,7 +61,7 @@ void AchievementBox::UpdateData()
|
||||
color = AchievementManager::GOLD;
|
||||
else if (m_achievement->unlocked & RC_CLIENT_ACHIEVEMENT_UNLOCKED_SOFTCORE)
|
||||
color = AchievementManager::BLUE;
|
||||
if (Config::Get(Config::RA_BADGES_ENABLED) && badge.name != "")
|
||||
if (badge.name != "")
|
||||
{
|
||||
QImage i_badge{};
|
||||
if (i_badge.loadFromData(&badge.badge.front(), static_cast<int>(badge.badge.size())))
|
||||
|
@ -74,7 +74,7 @@ void AchievementHeaderWidget::UpdateData()
|
||||
m_user_icon->setVisible(false);
|
||||
m_user_icon->clear();
|
||||
m_user_icon->setText({});
|
||||
if (Config::Get(Config::RA_BADGES_ENABLED) && !player_badge.name.empty())
|
||||
if (!player_badge.name.empty())
|
||||
{
|
||||
QImage i_user_icon{};
|
||||
if (i_user_icon.loadFromData(&player_badge.badge.front(), (int)player_badge.badge.size()))
|
||||
@ -95,7 +95,7 @@ void AchievementHeaderWidget::UpdateData()
|
||||
rc_client_user_game_summary_t game_summary;
|
||||
rc_client_get_user_game_summary(instance.GetClient(), &game_summary);
|
||||
|
||||
if (Config::Get(Config::RA_BADGES_ENABLED) && !game_badge.name.empty())
|
||||
if (!game_badge.name.empty())
|
||||
{
|
||||
QImage i_game_icon{};
|
||||
if (i_game_icon.loadFromData(&game_badge.badge.front(), (int)game_badge.badge.size()))
|
||||
|
@ -105,11 +105,6 @@ void AchievementSettingsWidget::CreateLayout()
|
||||
tr("Enable progress notifications on achievements.<br><br>Displays a brief popup message "
|
||||
"whenever the player makes progress on an achievement that tracks an accumulated value, "
|
||||
"such as 60 out of 120 stars."));
|
||||
m_common_badges_enabled_input = new ToolTipCheckBox(tr("Enable Achievement Badges"));
|
||||
m_common_badges_enabled_input->SetDescription(
|
||||
tr("Enable achievement badges.<br><br>Displays icons for the player, game, and achievements. "
|
||||
"Simple visual option, but will require a small amount of extra memory and time to "
|
||||
"download the images."));
|
||||
|
||||
m_common_layout->addWidget(m_common_integration_enabled_input);
|
||||
m_common_layout->addWidget(m_common_username_label);
|
||||
@ -129,7 +124,6 @@ void AchievementSettingsWidget::CreateLayout()
|
||||
m_common_layout->addWidget(m_common_discord_presence_enabled_input);
|
||||
#endif // USE_DISCORD_PRESENCE
|
||||
m_common_layout->addWidget(m_common_progress_enabled_input);
|
||||
m_common_layout->addWidget(m_common_badges_enabled_input);
|
||||
|
||||
m_common_layout->setAlignment(Qt::AlignTop);
|
||||
setLayout(m_common_layout);
|
||||
@ -153,8 +147,6 @@ void AchievementSettingsWidget::ConnectWidgets()
|
||||
&AchievementSettingsWidget::ToggleDiscordPresence);
|
||||
connect(m_common_progress_enabled_input, &QCheckBox::toggled, this,
|
||||
&AchievementSettingsWidget::ToggleProgress);
|
||||
connect(m_common_badges_enabled_input, &QCheckBox::toggled, this,
|
||||
&AchievementSettingsWidget::ToggleBadges);
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::OnControllerInterfaceConfigure()
|
||||
@ -214,9 +206,6 @@ void AchievementSettingsWidget::LoadSettings()
|
||||
SignalBlocking(m_common_progress_enabled_input)
|
||||
->setChecked(Config::Get(Config::RA_PROGRESS_ENABLED));
|
||||
SignalBlocking(m_common_progress_enabled_input)->setEnabled(enabled);
|
||||
|
||||
SignalBlocking(m_common_badges_enabled_input)->setChecked(Config::Get(Config::RA_BADGES_ENABLED));
|
||||
SignalBlocking(m_common_badges_enabled_input)->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::SaveSettings()
|
||||
@ -235,7 +224,6 @@ void AchievementSettingsWidget::SaveSettings()
|
||||
m_common_discord_presence_enabled_input->isChecked());
|
||||
Config::SetBaseOrCurrent(Config::RA_PROGRESS_ENABLED,
|
||||
m_common_progress_enabled_input->isChecked());
|
||||
Config::SetBaseOrCurrent(Config::RA_BADGES_ENABLED, m_common_badges_enabled_input->isChecked());
|
||||
Config::Save();
|
||||
}
|
||||
|
||||
@ -308,11 +296,4 @@ void AchievementSettingsWidget::ToggleProgress()
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
void AchievementSettingsWidget::ToggleBadges()
|
||||
{
|
||||
SaveSettings();
|
||||
AchievementManager::GetInstance().FetchPlayerBadge();
|
||||
AchievementManager::GetInstance().FetchGameBadges();
|
||||
}
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
@ -38,7 +38,6 @@ private:
|
||||
void ToggleSpectator();
|
||||
void ToggleDiscordPresence();
|
||||
void ToggleProgress();
|
||||
void ToggleBadges();
|
||||
|
||||
QGroupBox* m_common_box;
|
||||
QVBoxLayout* m_common_layout;
|
||||
@ -56,7 +55,6 @@ private:
|
||||
ToolTipCheckBox* m_common_spectator_enabled_input;
|
||||
ToolTipCheckBox* m_common_discord_presence_enabled_input;
|
||||
ToolTipCheckBox* m_common_progress_enabled_input;
|
||||
ToolTipCheckBox* m_common_badges_enabled_input;
|
||||
};
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
Loading…
Reference in New Issue
Block a user