mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added state machine debug functionality
This commit is contained in:
parent
ebd31168f4
commit
a65f1d19fa
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user