Closed BrettMayson closed 5 years ago
Good comment about saveProfileNamespace
. Don't know why it's missing lol
About the profile namespace, I just wanted to make sure it's saved, and moreover, use the same value when the option's name is changed for some reason. Sure the current code would cause some more work, but the difference shouldn't be noticeable.
I mean, all the stuff you are doing with profileNamespace and missionNamespace is completely unnecessary. CBA handles all of it already, it saves the settings and the variables are already in missionNamespace.
private _enabled = profileNamespace getVariable ["orbis_aerodynamics_enabled", true];
missionNamespace setVariable ["orbis_aerodynamics_enabled", _enabled];
[
"orbis_aerodynamics_enabled",
"LIST",
["Advanced Aerodynamics", "Can enable or disable Advanced Aerodynamics"],
"AWESome Aerodynamics",
[[true, false], ["Enabled", "Disabled"], [1, 0] select _enabled],
nil,
{
missionNamespace setVariable ["orbis_aerodynamics_enabled", _this];
profileNamespace setVariable ["orbis_aerodynamics_enabled", _this];
saveProfileNamespace;
}
] call CBA_Settings_fnc_init;
can be simplified to
[
"orbis_aerodynamics_enabled",
"LIST",
["Advanced Aerodynamics", "Can enable or disable Advanced Aerodynamics"],
"AWESome Aerodynamics",
[[true, false], ["Enabled", "Disabled"], 0],
nil
] call CBA_Settings_fnc_init;
Yeah, that's been done with #40 #41 #42 and #43
Ah ok, I had viewed #37
Sorry for revival, but I was browsing this repository and I have to comment on this:
Since
saveProfileNamespace
is not used, this code is already not doing anything.
Actually not true, it auto-saves on various loads, shut-down etc. :) Not saying it was the case here, but likely was anyways.
Describe the bug A default value is being stored in the profileNamespace for CBA settings. This is not needed since CBA stores the user settings already. Since
saveProfileNamespace
is not used, this code is already not doing anything.For example,
should just be
CBA will automatically create the variable in the mission namespace