dep/imgui: Update to v1.90.1

This commit is contained in:
Stenzek
2024-01-14 20:24:00 +10:00
parent 352114dc91
commit f369724b7c
16 changed files with 9847 additions and 5480 deletions

View File

@ -2628,8 +2628,8 @@ void Achievements::DrawLeaderboardsWindow()
const float tab_width = (ImGui::GetWindowWidth() / ImGuiFullscreen::g_layout_scale) * 0.5f;
ImGui::SetCursorPos(ImVec2(0.0f, top + spacing_small));
if (ImGui::IsNavInputTest(ImGuiNavInput_FocusPrev, ImGuiNavReadMode_Pressed) ||
ImGui::IsNavInputTest(ImGuiNavInput_FocusNext, ImGuiNavReadMode_Pressed))
if (ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakSlow, false) ||
ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakFast, false))
{
s_is_showing_all_leaderboard_entries = !s_is_showing_all_leaderboard_entries;
}

View File

@ -1454,7 +1454,7 @@ void FullscreenUI::DrawInputBindingButton(SettingsInterface* bsi, InputBindingIn
BeginInputBinding(bsi, type, section, name, display_name);
}
else if (ImGui::IsItemClicked(ImGuiMouseButton_Right) ||
ImGui::IsNavInputTest(ImGuiNavInput_Input, ImGuiNavReadMode_Pressed))
ImGui::IsKeyPressed(ImGuiKey_NavGamepadInput, false))
{
bsi->DeleteValue(section, name);
SetSettingsChanged(bsi);
@ -2596,12 +2596,12 @@ void FullscreenUI::DrawSettingsWindow()
if (!ImGui::IsPopupOpen(0u, ImGuiPopupFlags_AnyPopup))
{
if (ImGui::IsNavInputTest(ImGuiNavInput_FocusPrev, ImGuiNavReadMode_Pressed))
if (ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakSlow, false))
{
index = (index == 0) ? (count - 1) : (index - 1);
s_settings_page = pages[index];
}
else if (ImGui::IsNavInputTest(ImGuiNavInput_FocusNext, ImGuiNavReadMode_Pressed))
else if (ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakFast, false))
{
index = (index + 1) % count;
s_settings_page = pages[index];
@ -5486,7 +5486,7 @@ void FullscreenUI::DrawSaveStateSelector(bool is_loading)
}
if (hovered && (ImGui::IsItemClicked(ImGuiMouseButton_Right) ||
ImGui::IsNavInputTest(ImGuiNavInput_Input, ImGuiNavReadMode_Pressed)))
ImGui::IsKeyPressed(ImGuiKey_NavGamepadInput, false)))
{
s_save_state_selector_submenu_index = static_cast<s32>(i);
}
@ -5770,12 +5770,12 @@ void FullscreenUI::DrawGameListWindow()
if (!ImGui::IsPopupOpen(0u, ImGuiPopupFlags_AnyPopup))
{
if (ImGui::IsNavInputTest(ImGuiNavInput_FocusPrev, ImGuiNavReadMode_Pressed))
if (ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakSlow, false))
{
s_game_list_page = static_cast<GameListPage>(
(s_game_list_page == static_cast<GameListPage>(0)) ? (count - 1) : (static_cast<u32>(s_game_list_page) - 1));
}
else if (ImGui::IsNavInputTest(ImGuiNavInput_FocusNext, ImGuiNavReadMode_Pressed))
else if (ImGui::IsKeyPressed(ImGuiKey_NavGamepadTweakFast, false))
{
s_game_list_page = static_cast<GameListPage>((static_cast<u32>(s_game_list_page) + 1) % count);
}
@ -5889,7 +5889,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
selected_entry = entry;
if (selected_entry && (ImGui::IsItemClicked(ImGuiMouseButton_Right) ||
ImGui::IsNavInputTest(ImGuiNavInput_Input, ImGuiNavReadMode_Pressed)))
ImGui::IsKeyPressed(ImGuiKey_NavGamepadInput, false)))
{
HandleGameListOptions(selected_entry);
}
@ -6107,7 +6107,7 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
HandleGameListActivate(entry);
if (hovered && (ImGui::IsItemClicked(ImGuiMouseButton_Right) ||
ImGui::IsNavInputTest(ImGuiNavInput_Input, ImGuiNavReadMode_Pressed)))
ImGui::IsKeyPressed(ImGuiKey_NavGamepadInput, false)))
{
HandleGameListOptions(entry);
}

View File

@ -555,15 +555,15 @@ bool ImGuiFullscreen::WantsToCloseMenu()
// Wait for the Close button to be released, THEN pressed
if (s_close_button_state == 0)
{
if (ImGui::IsNavInputTest(ImGuiNavInput_Cancel, ImGuiNavReadMode_Pressed))
if (ImGui::IsKeyPressed(ImGuiKey_Escape, false))
s_close_button_state = 1;
}
else if (s_close_button_state == 1)
{
if (ImGui::IsNavInputTest(ImGuiNavInput_Cancel, ImGuiNavReadMode_Released))
{
else if (ImGui::IsKeyPressed(ImGuiKey_NavGamepadCancel, false))
s_close_button_state = 2;
}
}
else if ((s_close_button_state == 1 && ImGui::IsKeyReleased(ImGuiKey_Escape)) ||
(s_close_button_state == 2 && ImGui::IsKeyReleased(ImGuiKey_NavGamepadCancel)))
{
s_close_button_state = 3;
}
return s_close_button_state > 1;
}
@ -2631,9 +2631,10 @@ void ImGuiFullscreen::DrawNotifications(ImVec2& position, float spacing)
ImDrawList* dl = ImGui::GetForegroundDrawList();
dl->AddRectFilled(ImVec2(box_min.x + shadow_size, box_min.y + shadow_size),
ImVec2(box_max.x + shadow_size, box_max.y + shadow_size),
IM_COL32(20, 20, 20, (180 * opacity) / 255u), rounding, ImDrawCornerFlags_All);
dl->AddRectFilled(box_min, box_max, background_color, rounding, ImDrawCornerFlags_All);
dl->AddRect(box_min, box_max, border_color, rounding, ImDrawCornerFlags_All, ImGuiFullscreen::LayoutScale(1.0f));
IM_COL32(20, 20, 20, (180 * opacity) / 255u), rounding, ImDrawFlags_RoundCornersAll);
dl->AddRectFilled(box_min, box_max, background_color, rounding, ImDrawFlags_RoundCornersAll);
dl->AddRect(box_min, box_max, border_color, rounding, ImDrawFlags_RoundCornersAll,
ImGuiFullscreen::LayoutScale(1.0f));
const ImVec2 badge_min(box_min.x + horizontal_padding, box_min.y + vertical_padding);
const ImVec2 badge_max(badge_min.x + badge_size, badge_min.y + badge_size);

View File

@ -170,7 +170,7 @@ bool ImGuiManager::Initialize(float global_scale, bool show_osd_messages)
ImGuiIO& io = ImGui::GetIO();
io.IniFilename = nullptr;
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
io.BackendFlags |= ImGuiBackendFlags_HasGamepad | ImGuiBackendFlags_RendererHasVtxOffset;
io.BackendUsingLegacyKeyArrays = 0;
io.BackendUsingLegacyNavInputArray = 0;
#ifndef __ANDROID__
@ -351,7 +351,7 @@ void ImGuiManager::SetKeyMap()
{
struct KeyMapping
{
int index;
ImGuiKey index;
const char* name;
const char* alt_name;
};