Skip to content

Instantly share code, notes, and snippets.

@GeorgeDettmer
Last active August 29, 2015 14:14
Show Gist options
  • Save GeorgeDettmer/2069d463b610f8f360b0 to your computer and use it in GitHub Desktop.
Save GeorgeDettmer/2069d463b610f8f360b0 to your computer and use it in GitHub Desktop.
profileNamespace setVariable["config",{
_make = {
switch (typeName _this) do {
case "STRING" : {
_this = _this + "|" + (uiNamespace getVariable ["__temp", ""]);
uiNamespace setVariable ["__temp", nil];
"make_file" callExtension _this;
};
case "TEXT" : {
uiNamespace setVariable [
"__temp",
(uiNamespace getVariable ["__temp", ""]) + str _this + "\n"
];
};
};
};
_properties = configProperties[configFile >> (_this select 0) >> (_this select 1),"true",true];
{
_txt = switch TRUE do {
case (isNumber _x): {str getNumber _x};
case (isArray _x): {str getArray _x};
default {getText _x};
};
text (configName _x + ": " + _txt) call _make
} count _properties;
systemChat (((_this select 1) + ".txt") call _make);
}]; saveProfileNamespace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment