Merge pull request #14478 from JosJuice/wii-menu-headache
Move achievements code out of DVDInterface::SetDisc
This commit is contained in:
@@ -524,6 +524,7 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
|
|||||||
NOTICE_LOG_FMT(BOOT, "Booting from disc: {}", disc.path);
|
NOTICE_LOG_FMT(BOOT, "Booting from disc: {}", disc.path);
|
||||||
const DiscIO::VolumeDisc* volume =
|
const DiscIO::VolumeDisc* volume =
|
||||||
SetDisc(system.GetDVDInterface(), std::move(disc.volume), disc.auto_disc_change_paths);
|
SetDisc(system.GetDVDInterface(), std::move(disc.volume), disc.auto_disc_change_paths);
|
||||||
|
AchievementManager::GetInstance().LoadGame(volume);
|
||||||
|
|
||||||
if (!volume)
|
if (!volume)
|
||||||
return false;
|
return false;
|
||||||
@@ -642,16 +643,16 @@ bool CBoot::BootUp(Core::System& system, const Core::CPUThreadGuard& guard,
|
|||||||
if (!Load_BS2(system, ipl.path))
|
if (!Load_BS2(system, ipl.path))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
const DiscIO::VolumeDisc* volume = nullptr;
|
||||||
if (ipl.disc)
|
if (ipl.disc)
|
||||||
{
|
{
|
||||||
NOTICE_LOG_FMT(BOOT, "Inserting disc: {}", ipl.disc->path);
|
NOTICE_LOG_FMT(BOOT, "Inserting disc: {}", ipl.disc->path);
|
||||||
SetDisc(system.GetDVDInterface(), DiscIO::CreateDiscForCore(ipl.disc->path),
|
|
||||||
|
volume = SetDisc(system.GetDVDInterface(), DiscIO::CreateDiscForCore(ipl.disc->path),
|
||||||
ipl.disc->auto_disc_change_paths);
|
ipl.disc->auto_disc_change_paths);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
AchievementManager::GetInstance().LoadGame(volume);
|
||||||
AchievementManager::GetInstance().LoadGame(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
SConfig::OnTitleDirectlyBooted(guard);
|
SConfig::OnTitleDirectlyBooted(guard);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -420,8 +420,6 @@ void DVDInterface::SetDisc(std::unique_ptr<DiscIO::VolumeDisc> disc,
|
|||||||
m_auto_disc_change_index = 0;
|
m_auto_disc_change_index = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AchievementManager::GetInstance().LoadGame(disc.get());
|
|
||||||
|
|
||||||
// Assume that inserting a disc requires having an empty disc before
|
// Assume that inserting a disc requires having an empty disc before
|
||||||
if (had_disc != has_disc)
|
if (had_disc != has_disc)
|
||||||
ExpansionInterface::g_rtc_flags[ExpansionInterface::RTCFlag::DiscChanged] = true;
|
ExpansionInterface::g_rtc_flags[ExpansionInterface::RTCFlag::DiscChanged] = true;
|
||||||
@@ -444,6 +442,7 @@ void DVDInterface::AutoChangeDiscCallback(Core::System& system, u64 userdata, s6
|
|||||||
|
|
||||||
void DVDInterface::EjectDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate)
|
void DVDInterface::EjectDiscCallback(Core::System& system, u64 userdata, s64 cyclesLate)
|
||||||
{
|
{
|
||||||
|
AchievementManager::GetInstance().LoadGame(nullptr);
|
||||||
system.GetDVDInterface().SetDisc(nullptr, {});
|
system.GetDVDInterface().SetDisc(nullptr, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -454,9 +453,14 @@ void DVDInterface::InsertDiscCallback(Core::System& system, u64 userdata, s64 cy
|
|||||||
DiscIO::CreateDiscForCore(di.m_disc_path_to_insert);
|
DiscIO::CreateDiscForCore(di.m_disc_path_to_insert);
|
||||||
|
|
||||||
if (new_disc)
|
if (new_disc)
|
||||||
|
{
|
||||||
|
AchievementManager::GetInstance().LoadGame(new_disc.get());
|
||||||
di.SetDisc(std::move(new_disc), {});
|
di.SetDisc(std::move(new_disc), {});
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
PanicAlertFmtT("The disc that was about to be inserted couldn't be found.");
|
PanicAlertFmtT("The disc that was about to be inserted couldn't be found.");
|
||||||
|
}
|
||||||
|
|
||||||
di.m_disc_path_to_insert.clear();
|
di.m_disc_path_to_insert.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user