Added state machine debug functionality

This commit is contained in:
BaerMitUmlaut 2016-11-07 22:19:55 +01:00
parent ebd31168f4
commit a65f1d19fa
2 changed files with 27 additions and 1 deletions

View File

@ -35,3 +35,29 @@ if (!hasInterface) exitWith {};
linearConversion [0, 1, _pain, 1, 5, true];
}] call EFUNC(common,arithmeticSetSource);
#ifdef DEBUG_MODE_FULL
if (hasInterface) then {
private _ctrl = findDisplay 46 ctrlCreate ["RscText", -1];
_ctrl ctrlSetPosition [
safeZoneX,
safeZoneY,
safeZoneW,
40 * pixelH
];
_ctrl ctrlSetFontHeight (40 * pixelH);
_ctrl ctrlSetTextColor [0.6, 0, 0, 1];
_ctrl ctrlCommit 0;
uiNamespace setVariable [QGVAR(debugControl), _ctrl];
[{
private _playerState = [ACE_player, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
(uiNamespace getVariable [QGVAR(debugControl), controlNull]) ctrlSetText format ["Player state: %1", _playerState];
if (!isNull cursorTarget && {cursorTarget isKindOf "CAManBase"}) then {
private _targetState = [cursorTarget, GVAR(STATE_MACHINE)] call CBA_statemachine_fnc_getCurrentState;
drawIcon3D ["", [0.6, 0, 0, 1], cursorTarget modelToWorld (cursorTarget selectionPosition "pelvis"), 0, 0, 0, format ["State: %1", _targetState], 2, 40 * pixelH, "RobotoCondensed"];
};
}] call CBA_fnc_addPerFrameHandler;
};
#endif

View File

@ -2,7 +2,7 @@
#define COMPONENT_BEAUTIFIED Medical Core
#include "\z\ace\addons\main\script_mod.hpp"
// #define DEBUG_MODE_FULL
#define DEBUG_MODE_FULL
#define DISABLE_COMPILE_CACHE
// #define ENABLE_PERFORMANCE_COUNTERS