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

Method DoLoadInputProfile

pcsx2/ImGui/FullscreenUI_Settings.cpp:4862–4896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4860}
4861
4862void FullscreenUI::DoLoadInputProfile()
4863{
4864 std::vector<std::string> profiles = Pad::GetInputProfileNames();
4865 if (profiles.empty())
4866 {
4867 ShowToast(std::string(), FSUI_STR("No input profiles available."));
4868 return;
4869 }
4870
4871 ImGuiFullscreen::ChoiceDialogOptions coptions;
4872 coptions.reserve(profiles.size());
4873 for (std::string& name : profiles)
4874 coptions.emplace_back(std::move(name), false);
4875 OpenChoiceDialog(FSUI_ICONSTR(ICON_FA_FOLDER_OPEN, "Load Profile"), false, std::move(coptions),
4876 [](s32 index, const std::string& title, bool checked) {
4877 if (index < 0)
4878 return;
4879
4880 INISettingsInterface ssi(VMManager::GetInputProfilePath(title));
4881 if (!ssi.Load())
4882 {
4883 ShowToast(std::string(), fmt::format(FSUI_FSTR("Failed to load '{}'."), title));
4884 CloseChoiceDialog();
4885 return;
4886 }
4887
4888 auto lock = Host::GetSettingsLock();
4889 SettingsInterface* dsi = GetEditingSettingsInterface();
4890 Pad::CopyConfiguration(dsi, ssi, true, true, IsEditingGameSettings(dsi));
4891 USB::CopyConfiguration(dsi, ssi, true, true);
4892 SetSettingsChanged(dsi);
4893 ShowToast(std::string(), fmt::format(FSUI_FSTR("Input profile '{}' loaded."), title));
4894 CloseChoiceDialog();
4895 });
4896}
4897
4898void FullscreenUI::DoSaveInputProfile(const std::string& name)
4899{

Callers

nothing calls this directly

Calls 6

stringClass · 0.50
formatFunction · 0.50
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected