ACE3/addons/optionsmenu/functions/fnc_exportSettings.sqf

65 lines
1.6 KiB
Plaintext
Raw Normal View History

2015-04-05 00:17:43 +00:00
/*
* Author: Glowbal
* Export all config settings with their current values.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ACE_optionsmenu_fnc_exportSettings
*
* Public: No
*/
#include "script_component.hpp"
2015-04-17 00:46:42 +00:00
private ["_compiledConfig", "_name", "_typeName", "_isClientSetable", "_localizedName", "_localizedDescription", "_possibleValues", "_defaultValue", "_value", "_compiledConfigEntry"];
2015-04-05 00:17:43 +00:00
{
2015-04-05 00:33:45 +00:00
/*_settingData = [
2015-04-05 00:17:43 +00:00
_name,
_typeName,
_isClientSetable,
_localizedName,
_localizedDescription,
_possibleValues,
_isForced,
_defaultValue
];*/
_name = _x select 0;
_typeName = _x select 1;
_isClientSetable = _x select 2;
_localizedName = _x select 3;
_localizedDescription = _x select 4;
_possibleValues = _x select 5;
_defaultValue = _x select 6;
if (GVAR(ClientSettingsExportIncluded) || !_isClientSetable) then {
_value = missionNamespace getvariable [_name, _defaultValue];
if (_typeName == "STRING") then { // I dont think we have string values, but just in case
2015-04-05 00:33:45 +00:00
_value = format['"%1"', _value];
2015-04-05 00:17:43 +00:00
};
if (_typeName == "BOOL") then {
2015-04-06 09:58:52 +00:00
_value = if (typeName _value == "BOOL" && {_value}) then {1} else {0};
};
2015-04-05 00:17:43 +00:00
_compiledConfigEntry = format ["
2015-04-05 00:33:11 +00:00
class %1 {
value = %2;
typeName = %3;
force = 1;
};", _name, _value, format['"%1"', _typeName]];
2015-04-17 00:46:42 +00:00
"ace_clipboard" callExtension _compiledConfigEntry;
2015-04-05 00:17:43 +00:00
};
} forEach EGVAR(common,settings);
"ace_clipboard" callExtension "--COMPLETE--";
2015-04-05 12:48:23 +00:00
2015-05-28 19:59:04 +00:00
[LSTRING(settingsExported)] call EFUNC(common,displayTextStructured);
2015-05-02 22:28:40 +00:00