From 124140c7d2437c128df2a3f70ffc08f302cc858f Mon Sep 17 00:00:00 2001 From: commy2 Date: Fri, 22 Dec 2017 17:37:21 +0100 Subject: [PATCH] add description.ext entry to enable debug console in SP (#843) * add description.ext entry to enable debug console in SP * fix a functions header (#845) * emulate LOCAL EXEC key in MP when pressing Enter (#846) --- .../diagnostic/fnc_initExtendedDebugConsole.sqf | 16 +++++++++++++++- addons/diagnostic/fnc_isDebugConsoleAllowed.sqf | 1 + .../fnc_removeUnitTrackProjectiles.sqf | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/addons/diagnostic/fnc_initExtendedDebugConsole.sqf b/addons/diagnostic/fnc_initExtendedDebugConsole.sqf index 2fb0a3b3a..dacc872ea 100644 --- a/addons/diagnostic/fnc_initExtendedDebugConsole.sqf +++ b/addons/diagnostic/fnc_initExtendedDebugConsole.sqf @@ -44,9 +44,23 @@ _expression ctrlCommit 0; // Save expression when hitting enter key inside expression text field _expression ctrlAddEventHandler ["KeyDown", { - params ["", "_key", "_shift"]; + params ["_expression", "_key", "_shift"]; if (_key in [DIK_RETURN, DIK_NUMPADENTER] && {!_shift}) then { // shift + enter is newline + // fix for enter key not working in MP + private _buttonLocalExec = ctrlParentControlsGroup _expression controlsGroupCtrl IDC_RSCDEBUGCONSOLE_BUTTONEXECUTELOCAL; + + if (isMultiplayer && {ctrlEnabled _buttonLocalExec}) then { + [ + "executeButton", + [ctrlParent _buttonLocalExec, _buttonLocalExec], + "RscDisplayDebugPublic", + 0 + ] call compile preprocessFileLineNumbers "\A3\Ui_f\scripts\GUI\RscDebugConsole.sqf"; + + playSound "SoundClick"; + }; + _this call FUNC(logStatement); }; false diff --git a/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf b/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf index e2bcfdd46..76601b29f 100644 --- a/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf +++ b/addons/diagnostic/fnc_isDebugConsoleAllowed.sqf @@ -2,6 +2,7 @@ // enable debug console in virtual arsenal if (str missionConfigFile == "A3\Missions_F_Bootcamp\Scenarios\Arsenal.VR\description.ext") exitWith {true}; +if (!isMultiplayer && {getNumber (missionConfigFile >> "enableDebugConsoleSP") == 1}) exitWith {true}; call { #include "\a3\functions_f\Debug\fn_isDebugConsoleAllowed.sqf"; diff --git a/addons/diagnostic/fnc_removeUnitTrackProjectiles.sqf b/addons/diagnostic/fnc_removeUnitTrackProjectiles.sqf index 27aba7b4f..9c2e648a5 100644 --- a/addons/diagnostic/fnc_removeUnitTrackProjectiles.sqf +++ b/addons/diagnostic/fnc_removeUnitTrackProjectiles.sqf @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- -Function: CBA_removeUnitTrackProjectiles +Function: CBA_fnc_removeUnitTrackProjectiles Description: Removes projectile tracking from a given unit or vehicle. @@ -12,7 +12,7 @@ Returns: Examples: (begin example) - [vehicle player] call CBA_removeUnitTrackProjectiles; + [vehicle player] call CBA_fnc_removeUnitTrackProjectiles; (end) Author: