GameSettings: Disable analog mode forcing instead of forcing digital controller

This commit is contained in:
Albert Liu
2020-12-11 00:59:40 -08:00
parent 8716c33f41
commit def9a98cb9
8 changed files with 102 additions and 102 deletions

View File

@ -3,6 +3,7 @@
#include "common/state_wrapper.h"
#include "common/string_util.h"
#include "host_interface.h"
#include "settings.h"
#include "system.h"
#include <cmath>
Log_SetChannel(AnalogController);
@ -31,7 +32,17 @@ void AnalogController::Reset()
ResetRumbleConfig();
if (m_force_analog_on_reset)
SetAnalogMode(true);
{
if (g_settings.controller_disable_analog_mode_forcing)
{
g_host_interface->AddOSDMessage(
g_host_interface->TranslateStdString(
"OSDMessage", "Analog mode forcing is disabled by game settings. Controller will start in digital mode."),
10.0f);
}
else
SetAnalogMode(true);
}
}
bool AnalogController::DoState(StateWrapper& sw)

View File

@ -218,6 +218,7 @@ void Settings::Load(SettingsInterface& si)
ParseControllerTypeName(
si.GetStringValue("Controller2", "Type", GetControllerTypeName(DEFAULT_CONTROLLER_2_TYPE)).c_str())
.value_or(DEFAULT_CONTROLLER_2_TYPE);
controller_disable_analog_mode_forcing = false;
memory_card_types[0] =
ParseMemoryCardTypeName(

View File

@ -175,6 +175,8 @@ struct Settings
bool bios_patch_fast_boot = false;
std::array<ControllerType, NUM_CONTROLLER_AND_CARD_PORTS> controller_types{};
bool controller_disable_analog_mode_forcing = false;
std::array<MemoryCardType, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_types{};
std::array<std::string, NUM_CONTROLLER_AND_CARD_PORTS> memory_card_paths{};
bool memory_card_use_playlist_title = true;