mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 15:45:42 +00:00
Frontend: Hook up change disc menu item
This commit is contained in:
parent
3128d0ebcb
commit
9bda6c5ef7
|
@ -752,7 +752,8 @@ void SDLInterface::DrawMainMenuBar()
|
|||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::MenuItem("Change Disc", nullptr, false, system_enabled);
|
||||
if (ImGui::MenuItem("Change Disc", nullptr, false, system_enabled))
|
||||
DoChangeDisc();
|
||||
|
||||
if (ImGui::MenuItem("Frame Step", nullptr, false, system_enabled))
|
||||
DoFrameStep();
|
||||
|
@ -1166,6 +1167,20 @@ void SDLInterface::DoStartBIOS()
|
|||
ClearImGuiFocus();
|
||||
}
|
||||
|
||||
void SDLInterface::DoChangeDisc()
|
||||
{
|
||||
Assert(m_system);
|
||||
|
||||
nfdchar_t* path = nullptr;
|
||||
if (!NFD_OpenDialog("bin,img,cue,exe,psexe", nullptr, &path) || !path || std::strlen(path) == 0)
|
||||
return;
|
||||
|
||||
if (m_system->InsertMedia(path))
|
||||
AddOSDMessage(SmallString::FromFormat("Switched CD to '%s'", path));
|
||||
else
|
||||
AddOSDMessage("Failed to switch CD. The log may contain further information.");
|
||||
}
|
||||
|
||||
void SDLInterface::DoLoadState(u32 index)
|
||||
{
|
||||
if (!HasSystem() && !InitializeSystem(nullptr, nullptr))
|
||||
|
|
|
@ -70,6 +70,7 @@ private:
|
|||
void DoResume();
|
||||
void DoStartDisc();
|
||||
void DoStartBIOS();
|
||||
void DoChangeDisc();
|
||||
void DoLoadState(u32 index);
|
||||
void DoSaveState(u32 index);
|
||||
void DoTogglePause();
|
||||
|
|
Loading…
Reference in a new issue