MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DrawInputBindingWindow

Method DrawInputBindingWindow

pcsx2/ImGui/FullscreenUI_Settings.cpp:451–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449}
450
451void FullscreenUI::DrawInputBindingWindow()
452{
453 pxAssert(s_input_binding_type != InputBindingInfo::Type::Unknown);
454
455 const double time_remaining = INPUT_BINDING_TIMEOUT_SECONDS - s_input_binding_timer.GetTimeSeconds();
456 if (time_remaining <= 0.0)
457 {
458 InputManager::RemoveHook();
459 ClearInputBindingVariables();
460 return;
461 }
462
463 const char* title = FSUI_ICONSTR(ICON_FA_GAMEPAD, "Set Input Binding");
464 ImGui::SetNextWindowSize(LayoutScale(500.0f, 0.0f));
465 ImGui::SetNextWindowPos(ImGui::GetIO().DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
466 ImGui::OpenPopup(title);
467
468 ImGui::PushFont(g_large_font.first, g_large_font.second);
469 ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, LayoutScale(ImGuiFullscreen::LAYOUT_WINDOW_ROUNDING));
470 ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, LayoutScale(20.0f, 20.0f));
471 ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f);
472 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,
473 LayoutScale(ImGuiFullscreen::LAYOUT_MENU_BUTTON_X_PADDING, ImGuiFullscreen::LAYOUT_MENU_BUTTON_Y_PADDING));
474
475 if (ImGui::BeginPopupModal(title, nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoInputs))
476 {
477 ImGui::TextWrapped(FSUI_CSTR("Setting %s binding %s."), s_input_binding_section.c_str(), s_input_binding_display_name.c_str());
478 ImGui::TextUnformatted(FSUI_CSTR("Push a controller button or axis now."));
479 ImGui::NewLine();
480 ImGui::Text(FSUI_CSTR("Timing out in %.0f seconds..."), time_remaining);
481 ImGui::EndPopup();
482 }
483
484 ImGui::PopStyleVar(4);
485 ImGui::PopFont();
486}
487
488bool FullscreenUI::DrawToggleSetting(SettingsInterface* bsi, const char* title, const char* summary, const char* section, const char* key,
489 bool default_value, bool enabled, bool allow_tristate, float height, std::pair<ImFont*, float> font, std::pair<ImFont*, float> summary_font)

Callers

nothing calls this directly

Calls 5

LayoutScaleFunction · 0.85
PushFontFunction · 0.85
GetTimeSecondsMethod · 0.80
ImVec2Class · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected