Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export debug report from options menu #1304

Merged
merged 6 commits into from
Jun 3, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions addons/optionsmenu/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

ADDON = false;

PREP(debugDumpToClipboard);
PREP(onListBoxSettingsChanged);
PREP(onListBoxShowSelectionChanged);
PREP(onSettingsMenuOpen);
Expand Down
75 changes: 75 additions & 0 deletions addons/optionsmenu/functions/fnc_debugDumpToClipboard.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* Author: PabstMirror
* Dumps debug info to clipboard.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ACE_optionsmenu_fnc_debugDumpToClipboard
*
* Public: No
*/
#include "script_component.hpp"

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

#define MIN_ARRAY_SIZE 10

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

_text = format ["~~~~~~~~~ACE Debug~~~~~~~~~
time = %1

------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;


_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;


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

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

"ace_clipboard" callExtension "--COMPLETE--";
7 changes: 7 additions & 0 deletions addons/optionsmenu/gui/settingsMenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ 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));
tooltip = "$STR_ACE_OptionsMenu_DumpDebugTooltip";
};
};
};
Expand Down
8 changes: 7 additions & 1 deletion addons/optionsmenu/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,11 @@
<Polish>Dół</Polish>
<Spanish>Abajo</Spanish>
</Key>
<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>
</Project>