Merge pull request #13287 from JoshuaVandaele/legacyconfig
Remove legacy configuration support
This commit is contained in:
@@ -254,43 +254,6 @@ bool IsPressed(int id, bool held)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function exists to load the old "Keys" group so pre-existing configs don't break.
|
|
||||||
// TODO: Remove this at a future date when we're confident most configs are migrated.
|
|
||||||
static void LoadLegacyConfig(ControllerEmu::EmulatedController* controller)
|
|
||||||
{
|
|
||||||
Common::IniFile inifile;
|
|
||||||
if (inifile.Load(File::GetUserPath(D_CONFIG_IDX) + "Hotkeys.ini"))
|
|
||||||
{
|
|
||||||
if (!inifile.Exists("Hotkeys") && inifile.Exists("Hotkeys1"))
|
|
||||||
{
|
|
||||||
auto sec = inifile.GetOrCreateSection("Hotkeys1");
|
|
||||||
|
|
||||||
{
|
|
||||||
std::string defdev;
|
|
||||||
sec->Get("Device", &defdev, "");
|
|
||||||
controller->SetDefaultDevice(defdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto& group : controller->groups)
|
|
||||||
{
|
|
||||||
for (auto& control : group->controls)
|
|
||||||
{
|
|
||||||
std::string key("Keys/" + control->name);
|
|
||||||
|
|
||||||
if (sec->Exists(key))
|
|
||||||
{
|
|
||||||
std::string expression;
|
|
||||||
sec->Get(key, &expression, "");
|
|
||||||
control->control_ref->SetExpression(std::move(expression));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
controller->UpdateReferences(g_controller_interface);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Initialize()
|
void Initialize()
|
||||||
{
|
{
|
||||||
if (s_config.ControllersNeedToBeCreated())
|
if (s_config.ControllersNeedToBeCreated())
|
||||||
@@ -309,7 +272,6 @@ void Initialize()
|
|||||||
void LoadConfig()
|
void LoadConfig()
|
||||||
{
|
{
|
||||||
s_config.LoadConfig();
|
s_config.LoadConfig();
|
||||||
LoadLegacyConfig(s_config.GetController(0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ControllerEmu::ControlGroup* GetHotkeyGroup(HotkeyGroup group)
|
ControllerEmu::ControlGroup* GetHotkeyGroup(HotkeyGroup group)
|
||||||
|
|||||||
Reference in New Issue
Block a user