Skip to content

Instantly share code, notes, and snippets.

@maca134
Created March 23, 2016 15:57
Show Gist options
  • Save maca134/9c3fa1dd477f389b096f to your computer and use it in GitHub Desktop.
Save maca134/9c3fa1dd477f389b096f to your computer and use it in GitHub Desktop.
MMC_fnc_getConfig = {
params [
['_base', configfile, [configfile]]
];
private _inherts = inheritsFrom _base;
private _output = [
if (configName _inherts != '') then {
format ['class %1 : %2 {', configName _base, configName _inherts]
} else {
format ['class %1 {', configName _base]
}
];
private _classes = "true" configClasses _base;
systemChat str [_base, _classes];
{
private _child = [_x] call MMC_fnc_getConfig;
_child = _child apply {' ' + _x};
_output append _child;
} forEach _classes;
private _properties = configProperties [_base, 'true', false];
{
switch (true) do {
case (isText _x): {
_output pushBack format [' %1 = "%2";', configName _x, getText _x];
};
case (isNumber _x): {
_output pushBack format [' %1 = %2;', configName _x, getNumber _x];
};
case (isArray _x): {
private _arr = str (getArray _x);
_arr = _arr select [1];
_arr = _arr select [0, count _arr - 1];
_output pushBack format [' %1[] = {%2};', configName _x, _arr];
};
};
} forEach _properties;
_output pushBack '};';
_output
};
{_output append ([configFile >> 'RscButtonMenu'] call MMC_fnc_getConfig);} forEach _find;
copyToClipboard (_output joinString toString [10]);
/*
Outputs:
class RscButtonMenu : RscShortcutButton {
class TextPos {
left = "0.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
top = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) - ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)) / 2";
right = 0.005;
bottom = 0;
};
class Attributes {
font = "PuristaLight";
color = "#E5E5E5";
align = "left";
shadow = "false";
};
class ShortcutPos {
left = "5.25 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
top = 0;
w = "1 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
idc = -1;
type = 16;
style = "0x02 + 0xC0";
default = 0;
shadow = 0;
x = 0;
y = 0;
w = 0.095589;
h = 0.039216;
animTextureNormal = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDisabled = "#(argb,8,8,3)color(1,1,1,1)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
colorBackground[] = {0,0,0,0.8};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground2[] = {0.75,0.75,0.75,1};
color[] = {1,1,1,1};
colorFocused[] = {0,0,0,1};
color2[] = {0,0,0,1};
colorText[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.25};
textSecondary = "";
colorSecondary[] = {1,1,1,1};
colorFocusedSecondary[] = {0,0,0,1};
color2Secondary[] = {0,0,0,1};
colorDisabledSecondary[] = {1,1,1,0.25};
sizeExSecondary = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
fontSecondary = "PuristaLight";
period = 1.2;
periodFocus = 1.2;
periodOver = 1.2;
size = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
soundEnter[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEnter",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundPush",0.09,1};
soundClick[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundClick",0.09,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButtonMenu\soundEscape",0.09,1};
};
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment