Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move bool param conversion to initServer to fix autoload #3042

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions A3A/addons/core/functions/init/fn_initServer.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ private _savedParamsHM = createHashMapFromArray (A3A_saveData get "params");
{
if (getArray (_x/"texts") isEqualTo [""]) then { continue }; // spacer/title
private _val = _savedParamsHM getOrDefault [configName _x, getNumber (_x/"default")];
if (getArray (_x/"values") isEqualTo [0,1]) then {
if (_val isEqualType 0) then { _val = _val != 0 }; // number -> bool
} else {
if (_val isEqualType false) then { _val = [0, 1] select _val }; // bool -> number
};
missionNamespace setVariable [configName _x, _val, true]; // just publish them all, doesn't really hurt
} forEach ("true" configClasses (configFile/"A3A"/"Params"));

Expand Down
1 change: 0 additions & 1 deletion A3A/addons/gui/functions/SetupGUI/fn_setupParamsTab.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ switch (_mode) do
private _params = (_paramsTable getVariable "allCtrls") apply {
private _cfg = _x getVariable "config";
private _val = _x lbValue lbCurSel _x;
if (getArray (_cfg/"values") isEqualTo [0,1]) then { _val = _val != 0 }; // number -> bool
[configName _cfg, _val];
};
_params;
Expand Down