Skip to content

Commit

Permalink
fix debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed May 2, 2017
1 parent ccfd899 commit ac76832
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
14 changes: 9 additions & 5 deletions functions/debug/fn_showWhatTheyThink.sqf
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#include "..\..\component.hpp"

["GRAD_civs_thoughtDebugger", "onEachFrame", {
_color = [1,1,1,0.9];
params [["_onOff",GRAD_CIVS_DEBUGMODE]];

GRAD_CIVS_DEBUGMODE = _onOff;

[{
if (!GRAD_CIVS_DEBUGMODE) exitWith {[_this select 1] call CBA_fnc_removePerFrameHandler};

_color = [1,1,1,0.9];
{

_text = _x getVariable ["GRAD_civs_currentlyThinking", "no special purpose"];
Expand All @@ -15,6 +20,5 @@
1, 1, 0, _text + " | code | " + str _number, 1, 0.02, "EtelkaNarrowMediumPro", "center", true
];

}forEach allUnits - allPlayers;

},[]] call BIS_fnc_addStackedEventHandler;
} forEach allUnits - allPlayers;
} , 0, []] call CBA_fnc_addPerFrameHandler;
2 changes: 1 addition & 1 deletion functions/init/fn_initModule.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (isServer) then {
};

if (hasInterface) then {
missionNamespace setVariable ["GRAD_CIVS_DEBUGMODE",([missionConfigFile >> "cfgGradCivs","debugMode",0] call BIS_fnc_returnConfigEntry) == 1,false];
if (isNil "GRAD_CIVS_DEBUGMODE") then {missionNamespace setVariable ["GRAD_CIVS_DEBUGMODE",([missionConfigFile >> "cfgGradCivs","debugMode",0] call BIS_fnc_returnConfigEntry) == 1,false]};

[] call GRAD_civs_fnc_playerLoop;
if (GRAD_CIVS_DEBUGMODE) then {[] call GRAD_civs_fnc_showWhatTheyThink};
Expand Down
1 change: 1 addition & 0 deletions functions/init/fn_setDebugMode.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
params [["_value",false]];

missionNamespace setVariable ["GRAD_CIVS_DEBUGMODE",_value,true];
[_value] remoteExec ["GRAD_civs_fnc_showWhatTheyThink",0,false];
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grad-civs",
"description": "ambient civilians",
"version": "0.0.4",
"version": "0.0.5",
"contributors": [
{
"name": "nomisum"
Expand Down

0 comments on commit ac76832

Please sign in to comment.