mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix settings localization is done by the server instead of client #744
This commit is contained in:
parent
d80d340eaf
commit
85e5293c37
@ -13,6 +13,29 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_parseConfigForDisplayNames", "_name", "_isClientSetable", "_isForced", "_profileValue"];
|
||||||
|
|
||||||
|
_parseConfigForDisplayNames = {
|
||||||
|
private "_optionEntry";
|
||||||
|
_optionEntry = _this select 0;
|
||||||
|
if !(isClass _optionEntry) exitwith {false};
|
||||||
|
_x set [3, getText (_optionEntry >> "displayName")];
|
||||||
|
_x set [4, getText (_optionEntry >> "description")];
|
||||||
|
|
||||||
|
private "_values";
|
||||||
|
_values = _x select 5;
|
||||||
|
{
|
||||||
|
private "_text";
|
||||||
|
_text = _x;
|
||||||
|
if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then {
|
||||||
|
_text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $
|
||||||
|
_values set [_forEachIndex, _text];
|
||||||
|
};
|
||||||
|
} forEach _values;
|
||||||
|
true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Iterate through settings
|
// Iterate through settings
|
||||||
{
|
{
|
||||||
_name = _x select 0;
|
_name = _x select 0;
|
||||||
@ -34,4 +57,11 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then {
|
||||||
|
if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then {
|
||||||
|
[missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
} forEach GVAR(settings);
|
} forEach GVAR(settings);
|
||||||
|
@ -75,9 +75,9 @@ if (isNil _name) then {
|
|||||||
getNumber (_optionEntry >> "force") > 0,
|
getNumber (_optionEntry >> "force") > 0,
|
||||||
_value
|
_value
|
||||||
];
|
];
|
||||||
|
|
||||||
//Strings in the values array won't be localized from the config, so just do that now:
|
//Strings in the values array won't be localized from the config, so just do that now:
|
||||||
private "_values";
|
/*private "_values";
|
||||||
_values = _settingData select 5;
|
_values = _settingData select 5;
|
||||||
{
|
{
|
||||||
_text = _x;
|
_text = _x;
|
||||||
@ -85,8 +85,8 @@ if (isNil _name) then {
|
|||||||
_text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $
|
_text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $
|
||||||
_values set [_forEachIndex, _text];
|
_values set [_forEachIndex, _text];
|
||||||
};
|
};
|
||||||
} forEach _values;
|
} forEach _values;*/
|
||||||
|
|
||||||
|
|
||||||
GVAR(settings) pushBack _settingData;
|
GVAR(settings) pushBack _settingData;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user