Skip to content

Commit

Permalink
Send to RPT and Clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed May 30, 2015
1 parent 2cf9519 commit b49b2fa
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
60 changes: 33 additions & 27 deletions addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,49 @@
*/
#include "script_component.hpp"

private ["_var", "_unit"];
private ["_var", "_unit", "_outputText", "_text"];

#define MIN_ARRAY_SIZE 10

"ace_clipboard" callExtension "---ACE Debug---
";
_outputText = {
diag_log text (_this select 0);
"ace_clipboard" callExtension ((_this select 0) + "
");
};

"ace_clipboard" callExtension format ["--Performance--
diag_fps = %1
count ace_common_waitAndExecArray = %2
count cba_common_perFrameHandlerArray = %3 (max %4)
count diag_activeSQFScripts = %5
count diag_activeSQSScripts = %6
count diag_activeMissionFSMs = %7
_text = format ["~~~~~~~~~ACE Debug~~~~~~~~~
time = %1
", diag_fps, count ace_common_waitAndExecArray, {!isNil "_x"} count cba_common_perFrameHandlerArray, count cba_common_perFrameHandlerArray, count diag_activeSQFScripts, count diag_activeSQSScripts,count diag_activeMissionFSMs];
------Performance------
diag_fps = %2
count ace_common_waitAndExecArray = %3
count cba_common_perFrameHandlerArray = %4 (max %5)
count diag_activeSQFScripts = %6
count diag_activeSQSScripts = %7
count diag_activeMissionFSMs = %8",
time, diag_fps, count ace_common_waitAndExecArray, {!isNil "_x"} count cba_common_perFrameHandlerArray, count cba_common_perFrameHandlerArray, count diag_activeSQFScripts, count diag_activeSQSScripts,count diag_activeMissionFSMs];
[_text] call _outputText;

"ace_clipboard" callExtension "--Player--
";
if (isNull ACE_player) then {
"ace_clipboard" callExtension "Null

";
} else {
"ace_clipboard" callExtension format ["typeOf = %1
animationState = %2
_text = format ["
------Player------
typeOf = %1
animationState = %2",
if (isNull ace_player) then {"null"} else {typeOf ace_player},
if (isNull ace_player) then {"null"} else {animationState ace_player}];
[_text] call _outputText;


_text = format ["
------Array Info (count >= %1)------", MIN_ARRAY_SIZE];
[_text] call _outputText;

", typeOf ace_player, animationState ace_player];
};

"ace_clipboard" callExtension format ["--Array Info (count >= %1)--
", MIN_ARRAY_SIZE];
{
_var = missionNamespace getVariable [_x, nil];
if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then {
"ace_clipboard" callExtension format ["%1 - ARRAY SIZE: %2
", _x, (count _var)];
_text = format ["%1 - ARRAY SIZE: %2", _x, (count _var)];
[_text] call _outputText;
};
} forEach (allVariables missionNamespace);

Expand All @@ -60,8 +66,8 @@ animationState = %2
{
_var = _unit getVariable [_x, nil];
if(!isnil "_var" && {(typeName _var) == "ARRAY"} && {(count _var) > MIN_ARRAY_SIZE}) then {
"ace_clipboard" callExtension format ["%1 on [%2] - ARRAY SIZE: %3
", _x, _unit, (count _var)];
_text = format ["%1 on [%2] - ARRAY SIZE: %3", _x, _unit, (count _var)];
[_text] call _outputText;
};
} forEach (allVariables _unit);
} forEach allUnits;
Expand Down
1 change: 1 addition & 0 deletions addons/optionsmenu/gui/settingsMenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class ACE_settingsMenu {
text = "$STR_ACE_OptionsMenu_DumpDebug";
x = X_PART(26.5);
action = QUOTE([] call FUNC(debugDumpToClipboard));
tooltip = "$STR_ACE_OptionsMenu_DumpDebugTooltip";
};
};
};
Expand Down
3 changes: 3 additions & 0 deletions addons/optionsmenu/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,8 @@
<Key ID="STR_ACE_OptionsMenu_DumpDebug">
<English>Debug To Clipboard</English>
</Key>
<Key ID="STR_ACE_OptionsMenu_DumpDebugTooltip">
<English>Sends debug information to RPT and clipboard.</English>
</Key>
</Package>
</Project>

0 comments on commit b49b2fa

Please sign in to comment.