FullscreenUI: Fix controller navigation in disc change

This commit is contained in:
Connor McLaughlin 2021-02-17 02:16:23 +10:00
parent 52962ce584
commit 09805c1f80
5 changed files with 19 additions and 3 deletions

View file

@ -1773,8 +1773,11 @@ bool HasMedia()
return g_cdrom.HasMedia();
}
const std::string& GetMediaFileName()
std::string GetMediaFileName()
{
if (!g_cdrom.HasMedia())
return {};
return g_cdrom.GetMediaFileName();
}

View file

@ -189,7 +189,7 @@ bool DumpVRAM(const char* filename);
bool DumpSPURAM(const char* filename);
bool HasMedia();
const std::string& GetMediaFileName();
std::string GetMediaFileName();
bool InsertMedia(const char* path);
void RemoveMedia();

View file

@ -201,7 +201,8 @@ bool Initialize(CommonHostInterface* host_interface, SettingsInterface* settings
bool HasActiveWindow()
{
return s_current_main_window != MainWindowType::None;
return s_current_main_window != MainWindowType::None || s_save_state_selector_open ||
ImGuiFullscreen::IsChoiceDialogOpen() || ImGuiFullscreen::IsFileSelectorOpen();
}
void SystemCreated()

View file

@ -902,6 +902,11 @@ static void SetFileSelectorDirectory(std::string dir)
PopulateFileSelectorItems();
}
bool IsFileSelectorOpen()
{
return s_file_selector_open;
}
void OpenFileSelector(const char* title, bool select_directory, FileSelectorCallback callback,
FileSelectorFilters filters, std::string initial_directory)
{
@ -1017,6 +1022,11 @@ static std::string s_choice_dialog_title;
static ChoiceDialogOptions s_choice_dialog_options;
static ChoiceDialogCallback s_choice_dialog_callback;
bool IsChoiceDialogOpen()
{
return s_choice_dialog_open;
}
void OpenChoiceDialog(const char* title, bool checkable, ChoiceDialogOptions options, ChoiceDialogCallback callback)
{
if (s_choice_dialog_open)

View file

@ -210,6 +210,7 @@ static ALWAYS_INLINE bool EnumChoiceButton(const char* title, const char* summar
using FileSelectorCallback = std::function<void(const std::string& path)>;
using FileSelectorFilters = std::vector<std::string>;
bool IsFileSelectorOpen();
void OpenFileSelector(const char* title, bool select_directory, FileSelectorCallback callback,
FileSelectorFilters filters = FileSelectorFilters(),
std::string initial_directory = std::string());
@ -217,6 +218,7 @@ void CloseFileSelector();
using ChoiceDialogCallback = std::function<void(s32 index, const std::string& title, bool checked)>;
using ChoiceDialogOptions = std::vector<std::pair<std::string, bool>>;
bool IsChoiceDialogOpen();
void OpenChoiceDialog(const char* title, bool checkable, ChoiceDialogOptions options, ChoiceDialogCallback callback);
void CloseChoiceDialog();