|
|
|
@ -5345,10 +5345,10 @@ void FullscreenUI::DrawPauseMenu()
|
|
|
|
3, // Achievements
|
|
|
|
3, // Achievements
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ResetFocusHere();
|
|
|
|
BeginMenuButtons(submenu_item_count[static_cast<u32>(s_current_pause_submenu)], 1.0f,
|
|
|
|
BeginMenuButtons(submenu_item_count[static_cast<u32>(s_current_pause_submenu)], 1.0f,
|
|
|
|
ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING,
|
|
|
|
ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING,
|
|
|
|
ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY);
|
|
|
|
ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY);
|
|
|
|
ResetFocusHere();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (s_current_pause_submenu)
|
|
|
|
switch (s_current_pause_submenu)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -5617,6 +5617,7 @@ bool FullscreenUI::OpenSaveStateSelector(bool is_loading)
|
|
|
|
if (PopulateSaveStateListEntries(System::GetGameTitle(), System::GetGameSerial()) > 0)
|
|
|
|
if (PopulateSaveStateListEntries(System::GetGameTitle(), System::GetGameSerial()) > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
s_save_state_selector_open = true;
|
|
|
|
s_save_state_selector_open = true;
|
|
|
|
|
|
|
|
QueueResetFocus(FocusResetType::PopupOpened);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -5626,6 +5627,9 @@ bool FullscreenUI::OpenSaveStateSelector(bool is_loading)
|
|
|
|
|
|
|
|
|
|
|
|
void FullscreenUI::CloseSaveStateSelector()
|
|
|
|
void FullscreenUI::CloseSaveStateSelector()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (s_save_state_selector_open)
|
|
|
|
|
|
|
|
QueueResetFocus(FocusResetType::PopupClosed);
|
|
|
|
|
|
|
|
|
|
|
|
ClearSaveStateEntryList();
|
|
|
|
ClearSaveStateEntryList();
|
|
|
|
s_save_state_selector_open = false;
|
|
|
|
s_save_state_selector_open = false;
|
|
|
|
s_save_state_selector_loading = false;
|
|
|
|
s_save_state_selector_loading = false;
|
|
|
|
@ -5674,14 +5678,13 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::PushStyleColor(ImGuiCol_ChildBg, ModAlpha(UIPrimaryColor, 0.9f));
|
|
|
|
ImGui::PushStyleColor(ImGuiCol_ChildBg, ModAlpha(UIPrimaryColor, 0.9f));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool closed = false;
|
|
|
|
|
|
|
|
bool was_close_not_back = false;
|
|
|
|
if (ImGui::BeginChild("state_titlebar", heading_size, false, ImGuiWindowFlags_NavFlattened))
|
|
|
|
if (ImGui::BeginChild("state_titlebar", heading_size, false, ImGuiWindowFlags_NavFlattened))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BeginNavBar();
|
|
|
|
BeginNavBar();
|
|
|
|
if (NavButton(ICON_FA_BACKWARD, true, true))
|
|
|
|
if (NavButton(ICON_FA_BACKWARD, true, true))
|
|
|
|
{
|
|
|
|
closed = true;
|
|
|
|
CloseSaveStateSelector();
|
|
|
|
|
|
|
|
ReturnToPreviousWindow();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NavTitle(is_loading ? FSUI_CSTR("Load State") : FSUI_CSTR("Save State"));
|
|
|
|
NavTitle(is_loading ? FSUI_CSTR("Load State") : FSUI_CSTR("Save State"));
|
|
|
|
EndNavBar();
|
|
|
|
EndNavBar();
|
|
|
|
@ -5692,13 +5695,15 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
ImGui::PushStyleColor(ImGuiCol_ChildBg, ModAlpha(UIBackgroundColor, 0.9f));
|
|
|
|
ImGui::PushStyleColor(ImGuiCol_ChildBg, ModAlpha(UIBackgroundColor, 0.9f));
|
|
|
|
ImGui::SetCursorPos(ImVec2(0.0f, heading_size.y));
|
|
|
|
ImGui::SetCursorPos(ImVec2(0.0f, heading_size.y));
|
|
|
|
|
|
|
|
|
|
|
|
bool closed = false;
|
|
|
|
if (IsFocusResetFromWindowChange())
|
|
|
|
bool close_handled = false;
|
|
|
|
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
|
|
|
if (s_save_state_selector_open &&
|
|
|
|
|
|
|
|
ImGui::BeginChild("state_list",
|
|
|
|
|
|
|
|
|
|
|
|
if (ImGui::BeginChild("state_list",
|
|
|
|
ImVec2(io.DisplaySize.x, io.DisplaySize.y - LayoutScale(LAYOUT_FOOTER_HEIGHT) - heading_size.y),
|
|
|
|
ImVec2(io.DisplaySize.x, io.DisplaySize.y - LayoutScale(LAYOUT_FOOTER_HEIGHT) - heading_size.y),
|
|
|
|
false, ImGuiWindowFlags_NavFlattened))
|
|
|
|
false, ImGuiWindowFlags_NavFlattened))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
ResetFocusHere();
|
|
|
|
BeginMenuButtons();
|
|
|
|
BeginMenuButtons();
|
|
|
|
|
|
|
|
|
|
|
|
const ImGuiStyle& style = ImGui::GetStyle();
|
|
|
|
const ImGuiStyle& style = ImGui::GetStyle();
|
|
|
|
@ -5723,9 +5728,6 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
|
|
|
|
ImGui::SetCursorPos(ImVec2(start_x, 0.0f));
|
|
|
|
for (u32 i = 0; i < s_save_state_selector_slots.size();)
|
|
|
|
for (u32 i = 0; i < s_save_state_selector_slots.size();)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (i == 0)
|
|
|
|
|
|
|
|
ResetFocusHere();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SaveStateListEntry& entry = s_save_state_selector_slots[i];
|
|
|
|
SaveStateListEntry& entry = s_save_state_selector_slots[i];
|
|
|
|
if (static_cast<s32>(i) == s_save_state_selector_submenu_index)
|
|
|
|
if (static_cast<s32>(i) == s_save_state_selector_submenu_index)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -5768,6 +5770,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
DoSaveState(entry.slot, entry.global);
|
|
|
|
DoSaveState(entry.slot, entry.global);
|
|
|
|
|
|
|
|
|
|
|
|
closed = true;
|
|
|
|
closed = true;
|
|
|
|
|
|
|
|
was_close_not_back = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!entry.path.empty() && ActiveButton(FSUI_ICONSTR(ICON_FA_FOLDER_MINUS, "Delete Save"), false, true,
|
|
|
|
if (!entry.path.empty() && ActiveButton(FSUI_ICONSTR(ICON_FA_FOLDER_MINUS, "Delete Save"), false, true,
|
|
|
|
@ -5785,9 +5788,14 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
removed = true;
|
|
|
|
removed = true;
|
|
|
|
|
|
|
|
|
|
|
|
if (s_save_state_selector_slots.empty())
|
|
|
|
if (s_save_state_selector_slots.empty())
|
|
|
|
|
|
|
|
{
|
|
|
|
closed = true;
|
|
|
|
closed = true;
|
|
|
|
|
|
|
|
was_close_not_back = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
is_open = false;
|
|
|
|
is_open = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -5808,19 +5816,8 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
ImGui::EndPopup();
|
|
|
|
ImGui::EndPopup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// don't let the back button flow through to the main window
|
|
|
|
if (!is_open)
|
|
|
|
if (WantsToCloseMenu())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
close_handled = true;
|
|
|
|
|
|
|
|
is_open = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_open || closed)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
s_save_state_selector_submenu_index = -1;
|
|
|
|
s_save_state_selector_submenu_index = -1;
|
|
|
|
if (!closed)
|
|
|
|
|
|
|
|
QueueResetFocus(FocusResetType::ViewChanged);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::PopStyleColor(3);
|
|
|
|
ImGui::PopStyleColor(3);
|
|
|
|
ImGui::PopStyleVar(3);
|
|
|
|
ImGui::PopStyleVar(3);
|
|
|
|
@ -5896,6 +5893,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
DoSaveState(entry.slot, entry.global);
|
|
|
|
DoSaveState(entry.slot, entry.global);
|
|
|
|
|
|
|
|
|
|
|
|
closed = true;
|
|
|
|
closed = true;
|
|
|
|
|
|
|
|
was_close_not_back = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (hovered &&
|
|
|
|
else if (hovered &&
|
|
|
|
(ImGui::IsItemClicked(ImGuiMouseButton_Right) || ImGui::IsKeyPressed(ImGuiKey_NavGamepadMenu, false) ||
|
|
|
|
(ImGui::IsItemClicked(ImGuiMouseButton_Right) || ImGui::IsKeyPressed(ImGuiKey_NavGamepadMenu, false) ||
|
|
|
|
@ -5929,33 +5927,29 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
|
|
|
|
ImGui::EndPopup();
|
|
|
|
ImGui::EndPopup();
|
|
|
|
ImGui::PopStyleVar(5);
|
|
|
|
ImGui::PopStyleVar(5);
|
|
|
|
|
|
|
|
|
|
|
|
if (closed)
|
|
|
|
if (IsGamepadInputSource())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CloseSaveStateSelector();
|
|
|
|
SetFullscreenFooterText(std::array{std::make_pair(ICON_PF_XBOX_DPAD, FSUI_VSTR("Select State")),
|
|
|
|
ReturnToMainWindow();
|
|
|
|
std::make_pair(ICON_PF_BUTTON_Y, FSUI_VSTR("Delete State")),
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_BUTTON_A, FSUI_VSTR("Load State")),
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_BUTTON_B, FSUI_VSTR("Cancel"))});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!close_handled && WantsToCloseMenu())
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CloseSaveStateSelector();
|
|
|
|
SetFullscreenFooterText(std::array{
|
|
|
|
ReturnToPreviousWindow();
|
|
|
|
std::make_pair(ICON_PF_ARROW_UP ICON_PF_ARROW_DOWN ICON_PF_ARROW_LEFT ICON_PF_ARROW_RIGHT,
|
|
|
|
|
|
|
|
FSUI_VSTR("Select State")),
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_F1, FSUI_VSTR("Delete State")), std::make_pair(ICON_PF_ENTER, FSUI_VSTR("Load State")),
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_ESC, FSUI_VSTR("Cancel"))});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
if (WantsToCloseMenu() || closed)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (IsGamepadInputSource())
|
|
|
|
CloseSaveStateSelector();
|
|
|
|
{
|
|
|
|
if (was_close_not_back)
|
|
|
|
SetFullscreenFooterText(std::array{std::make_pair(ICON_PF_XBOX_DPAD, FSUI_VSTR("Select State")),
|
|
|
|
ReturnToMainWindow();
|
|
|
|
std::make_pair(ICON_PF_BUTTON_Y, FSUI_VSTR("Delete State")),
|
|
|
|
else if (s_current_main_window != MainWindowType::GameList)
|
|
|
|
std::make_pair(ICON_PF_BUTTON_A, FSUI_VSTR("Load State")),
|
|
|
|
ReturnToPreviousWindow();
|
|
|
|
std::make_pair(ICON_PF_BUTTON_B, FSUI_VSTR("Cancel"))});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
SetFullscreenFooterText(std::array{
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_ARROW_UP ICON_PF_ARROW_DOWN ICON_PF_ARROW_LEFT ICON_PF_ARROW_RIGHT,
|
|
|
|
|
|
|
|
FSUI_VSTR("Select State")),
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_F1, FSUI_VSTR("Delete State")), std::make_pair(ICON_PF_ENTER, FSUI_VSTR("Load State")),
|
|
|
|
|
|
|
|
std::make_pair(ICON_PF_ESC, FSUI_VSTR("Cancel"))});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -5971,6 +5965,7 @@ bool FullscreenUI::OpenLoadStateSelectorForGameResume(const GameList::Entry* ent
|
|
|
|
s_save_state_selector_loading = true;
|
|
|
|
s_save_state_selector_loading = true;
|
|
|
|
s_save_state_selector_open = true;
|
|
|
|
s_save_state_selector_open = true;
|
|
|
|
s_save_state_selector_resuming = true;
|
|
|
|
s_save_state_selector_resuming = true;
|
|
|
|
|
|
|
|
QueueResetFocus(FocusResetType::PopupOpened);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -6313,6 +6308,9 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
|
|
|
|
const GameList::Entry* selected_entry = nullptr;
|
|
|
|
const GameList::Entry* selected_entry = nullptr;
|
|
|
|
PopulateGameListEntryList();
|
|
|
|
PopulateGameListEntryList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsFocusResetFromWindowChange())
|
|
|
|
|
|
|
|
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
|
|
|
|
|
|
|
|
|
|
|
if (BeginFullscreenColumnWindow(0.0f, -530.0f, "game_list_entries"))
|
|
|
|
if (BeginFullscreenColumnWindow(0.0f, -530.0f, "game_list_entries"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const ImVec2 image_size(LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT, LAYOUT_MENU_BUTTON_HEIGHT));
|
|
|
|
const ImVec2 image_size(LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT, LAYOUT_MENU_BUTTON_HEIGHT));
|
|
|
|
@ -6509,6 +6507,9 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
|
|
|
|
|
|
|
|
|
|
|
|
void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
|
|
|
|
void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (IsFocusResetFromWindowChange())
|
|
|
|
|
|
|
|
ImGui::SetNextWindowScroll(ImVec2(0.0f, 0.0f));
|
|
|
|
|
|
|
|
|
|
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
|
|
if (!BeginFullscreenWindow(
|
|
|
|
if (!BeginFullscreenWindow(
|
|
|
|
ImVec2(0.0f, heading_size.y),
|
|
|
|
ImVec2(0.0f, heading_size.y),
|
|
|
|
|