Save mouse and joystick analog scales, dead zones, and saturation values to .cfg whether they're the defaults or not

This fixes an issue where changing one of these values would result in the value being written to the .cfg, but changing the value back to the default would leave the old value in the .cfg.

git-svn-id: https://svn.eduke32.com/eduke32@7341 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-02-20 21:32:56 +00:00
parent e74cad12ad
commit eef6667fbc

View file

@ -835,13 +835,10 @@ void CONFIG_WriteSetup(uint32_t flags)
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.MouseDigitalFunctions[i][1]));
}
if (ud.config.MouseAnalogueScale[i] != DEFAULTMOUSEANALOGUESCALE)
{
Bsprintf(buf, "MouseAnalogScale%d", i);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.MouseAnalogueScale[i], FALSE, FALSE);
}
}
}
if (ud.setup.usejoystick)
{
@ -879,25 +876,16 @@ void CONFIG_WriteSetup(uint32_t flags)
SCRIPT_PutString(ud.config.scripthandle, "Controls", buf, CONFIG_FunctionNumToName(ud.config.JoystickDigitalFunctions[dummy][1]));
}
if (ud.config.JoystickAnalogueScale[dummy] != DEFAULTJOYSTICKANALOGUESCALE)
{
Bsprintf(buf, "JoystickAnalogScale%d", dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueScale[dummy], FALSE, FALSE);
}
if (ud.config.JoystickAnalogueDead[dummy] != DEFAULTJOYSTICKANALOGUEDEAD)
{
Bsprintf(buf, "JoystickAnalogDead%d", dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueDead[dummy], FALSE, FALSE);
}
if (ud.config.JoystickAnalogueSaturate[dummy] != DEFAULTJOYSTICKANALOGUESATURATE)
{
Bsprintf(buf, "JoystickAnalogSaturate%d", dummy);
SCRIPT_PutNumber(ud.config.scripthandle, "Controls", buf, ud.config.JoystickAnalogueSaturate[dummy], FALSE, FALSE);
}
}
}
SCRIPT_PutString(ud.config.scripthandle, "Comm Setup","PlayerName",&szPlayerName[0]);