Button to dump array info to clipboard

This commit is contained in:
PabstMirror 2015-05-18 18:44:52 -05:00
parent 3c5eac96ea
commit bace23c331
4 changed files with 70 additions and 0 deletions

View File

@ -2,6 +2,7 @@
ADDON = false;
PREP(debugDumpToClipboard);
PREP(onListBoxSettingsChanged);
PREP(onListBoxShowSelectionChanged);
PREP(onSettingsMenuOpen);

View File

@ -0,0 +1,60 @@
/*
* Author: PabstMirror
* Dumps debug info to clipboard.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ACE_optionsmenu_fnc_debugDumpToClipboard
*
* Public: No
*/
#include "script_component.hpp"
_outputString = "Array Variable Count':
";
{
private["_var"];
_var = missionNamespace getVariable [_x, nil];
if(!isnil "_var" && {(typeName _var) == "ARRAY"} ) then {
_outputString = _outputString + format["%1 - ARRAY SIZE: %2
", _x, (count _var)];
};
} forEach (allVariables missionNamespace);
{
_unit = _x;
{
private["_var"];
_var = missionNamespace getVariable [_x, nil];
if(!isnil "_var" && {(typeName _var) == "ARRAY"} ) then {
_outputString = _outputString + text format["%1 - ARRAY SIZE: %2 for %3
", _x, (count _var), _unit];
};
} forEach (allVariables _unit);
} forEach allUnits;
FUNC(clipboardExport) = {
private["_chunks"];
_chunks = [];
_chunks = [_this select 0, "-"] call CBA_fnc_split;
{
private["_chunk"];
_chunk = _x + ";";
"ace_clipboard" callExtension format["%1", _chunk];
} forEach _chunks;
"ace_clipboard" callExtension "--COMPLETE--";
};
[_outputString] call FUNC(clipboardExport);

View File

@ -247,6 +247,12 @@ class ACE_settingsMenu {
text = "$STR_ACE_OptionsMenu_OpenExport";
x = X_PART(18);
action = QUOTE(if (GVAR(serverConfigGeneration) > 0) then {createDialog 'ACE_serverSettingsMenu'; });
};
class action_debug: actionClose {
idc = 1102;
text = "$STR_ACE_OptionsMenu_DumpDebug";
x = X_PART(26.5);
action = QUOTE([] call FUNC(debugDumpToClipboard));
};
};
};

View File

@ -285,5 +285,8 @@
<English>Bottom</English>
<Polish>Dół</Polish>
</Key>
<Key ID="STR_ACE_OptionsMenu_DumpDebug">
<English>Debug To Clipboard</English>
</Key>
</Package>
</Project>