-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: jonpas <[email protected]>
- Loading branch information
Showing
16 changed files
with
4,967 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x\tac\addons\debug_console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
class Extended_PreStart_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); | ||
}; | ||
}; | ||
class Extended_PreInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); | ||
}; | ||
}; | ||
class Extended_PostInit_EventHandlers { | ||
class ADDON { | ||
init = QUOTE(call COMPILE_SCRIPT(XEH_postInit)); | ||
}; | ||
}; | ||
|
||
class Extended_DisplayLoad_EventHandlers { | ||
class RscDisplayInterrupt { | ||
GVAR(init) = QUOTE(call (uiNamespace getVariable 'FUNC(initDebugConsole)')); | ||
}; | ||
class RscDisplayMPInterrupt { | ||
GVAR(init) = QUOTE(call (uiNamespace getVariable 'FUNC(initDebugConsole)')); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
## Debug_console | ||
|
||
Enchancements for debug console. Adds a framework to add custom functionalities to the console. | ||
|
||
### Authors | ||
|
||
- [veteran29](http://github.com/veteran29) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
PREP(addButton); | ||
PREP(addCurator); | ||
PREP(handleDisconnect); | ||
PREP(initDebugConsole); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "script_component.hpp" | ||
|
||
if (isServer) then { | ||
addMissionEventHandler ["HandleDisconnect", FUNC(handleDisconnect)]; | ||
[QGVAR(createCurator), FUNC(addCurator)] call CBA_fnc_addEventHandler; | ||
[QGVAR(stopRain), { | ||
params ["_caller"]; | ||
INFO_1("Rain was stopped by '%1'",_caller); | ||
0 setRain 0; | ||
0 setOvercast 0; | ||
forceWeatherChange; | ||
}] call CBA_fnc_addEventHandler; | ||
}; | ||
|
||
[QGVAR(massHeal), { | ||
params ["_caller"]; | ||
if (isServer) exitWith { | ||
INFO_1("Mass Heal was executed by '%1'",_caller); | ||
}; | ||
[ace_player] call ACEFUNC(medical_treatment,fullHealLocal); | ||
}] call CBA_fnc_addEventHandler; | ||
|
||
// Limited to 6 buttons. | ||
[["Curator", "Assigns as Curator"], { | ||
[QGVAR(createCurator), ace_player] call CBA_fnc_serverEvent; | ||
}] call FUNC(addButton); | ||
[["Mass Heal", "Heals all Players"], { | ||
[QGVAR(massHeal), ace_player] call CBA_fnc_globalEvent; | ||
}] call FUNC(addButton); | ||
[["Stop Rain", "Stops Rain"], { | ||
[QGVAR(stopRain), ace_player] call CBA_fnc_serverEvent; | ||
}] call FUNC(addButton); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "script_component.hpp" | ||
ADDON = false; | ||
|
||
PREP_RECOMPILE_START; | ||
#include "XEH_PREP.hpp" | ||
PREP_RECOMPILE_END; | ||
|
||
GVAR(buttons) = []; | ||
GVAR(playerCurators) = []; | ||
|
||
ADDON = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#include "script_component.hpp" | ||
#include "XEH_PREP.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "script_component.hpp" | ||
class CfgPatches { | ||
class ADDON { | ||
name = COMPONENT_NAME; | ||
units[] = {}; | ||
weapons[] = {}; | ||
requiredVersion = REQUIRED_VERSION; | ||
requiredAddons[] = {"cba_diagnostic"}; | ||
author = "ArmaForces"; | ||
VERSION_CONFIG; | ||
}; | ||
}; | ||
|
||
#include "CfgEventHandlers.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: veteran29 | ||
* Adds custom button to debug console | ||
* | ||
* Arguments: | ||
* 0: Name <STRING, ARRAY> | ||
* 0: Name <STRING> | ||
* 1: Tooltip <STRING | ||
* 1: Code to execute on button click <CODE> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Example: | ||
* [["Test", "This is a button"], {hint "Button was clicked"}] call FUNC(addButton) | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
params [["_name", "", ["", []]], ["_code", "", [{}]]]; | ||
_name params [["_displayName", "", [""]], ["_tooltip", "", [""]]]; | ||
|
||
if (count GVAR(buttons) == 6) exitWith { | ||
ERROR("Maximum amount of buttons reached."); | ||
}; | ||
|
||
GVAR(buttons) pushBack [_displayName, _tooltip, _code]; | ||
|
||
nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Mike | ||
* Creates curator module for the local player. | ||
* | ||
* Arguments: | ||
* 0: Player <OBJECT> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_player"]; | ||
|
||
private _playerName = name _player; | ||
|
||
// Early exit if Module already assigned. | ||
if (!isNull getAssignedCuratorLogic _player) exitWith { | ||
INFO_1("Player '%1' already assigned as curator.",_playerName); | ||
}; | ||
|
||
INFO_1("Player '%1' assigned as Curator",_playerName); | ||
|
||
private _curatorGroup = createGroup sideLogic; | ||
private _curatorModule = _curatorGroup createUnit ["ModuleCurator_F", _player, [], 0, "NONE"]; | ||
private _configFile = (configFile >> "CfgPatches"); | ||
private _allAddons = []; | ||
|
||
GVAR(playerCurators) pushBack [_curatorModule, getPlayerUID _player]; | ||
|
||
for "_i" from 0 to (count _configFile - 1) do { | ||
private _cfgName = configName (_configFile select _i); | ||
_allAddons pushBack _cfgName; | ||
}; | ||
|
||
_curatorModule addCuratorAddons _allAddons; | ||
_curatorModule setVariable ["showNotification", false]; | ||
_curatorModule addCuratorEditableObjects [allUnits, true]; // all Players and AI. | ||
|
||
{ | ||
_curatorModule setCuratorCoef [_x, 0]; | ||
} forEach ["Place", "Edit", "Delete", "Destroy", "Group", "Synchronize"]; | ||
|
||
_player assignCurator _curatorModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: Mike | ||
* Handles deletion of curator modules on disconnect. | ||
* | ||
* Arguments: | ||
* 0: Unit <OBJECT> (Unused) | ||
* 1: ID <NUMBER> (Unused) | ||
* 2: UID <STRING> | ||
* 3: Name <STRING> (Unused) | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
params ["_unit", "_id", "_uid", "_name"]; | ||
|
||
if (GVAR(playerCurators) isEqualTo []) exitWith {}; | ||
|
||
private _moduleData = GVAR(playerCurators) select {_uid in _x} select 0; | ||
deleteVehicle (_moduleData select 0); | ||
|
||
GVAR(playerCurators) deleteAt (GVAR(playerCurators) find _moduleData); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "..\script_component.hpp" | ||
/* | ||
* Author: veteran29 | ||
* Initialize debug console display | ||
* | ||
* Arguments: | ||
* 0: Debug console display <DISPLAY> | ||
* | ||
* Return Value: | ||
* None | ||
* | ||
* Public: No | ||
*/ | ||
|
||
#define ITEMS_PER_ROW 2 | ||
#define BUTTON_WIDTH 7.5 | ||
|
||
params ["_display"]; | ||
TRACE_1("initializing debug console",_display); | ||
|
||
private _debugConsole = _display displayCtrl IDC_RSCDEBUGCONSOLE_RSCDEBUGCONSOLE; | ||
|
||
private _basePositionRow1 = ctrlPosition (_display displayCtrl IDC_RSCDEBUGCONSOLE_BUTTONANIMATIONS); | ||
private _basePositionRow2 = ctrlPosition (_display displayCtrl IDC_RSCDEBUGCONSOLE_BUTTONGUI); | ||
|
||
// Create buttons in bottom row | ||
{ | ||
_x params ["_text", "_tooltip", "_code"]; | ||
TRACE_3("adding debug console button",_text,_tooltip,_code); | ||
|
||
private _col = floor (_forEachIndex / ITEMS_PER_ROW); | ||
private _basePos = +([_basePositionRow1, _basePositionRow2] select (_forEachIndex % 2)); | ||
|
||
_basePos set [0, (_basePos select 0) + (BUTTON_WIDTH * (1 + _col)) * GUI_GRID_W]; // adjust X | ||
|
||
private _button = _display ctrlCreate ["RscButtonMenu", -1, _debugConsole]; | ||
|
||
_button ctrlSetPosition _basePos; | ||
_button ctrlCommit 0; | ||
|
||
_button ctrlSetText _text; | ||
_button ctrlSetTooltip _tooltip; | ||
_button ctrlAddEventHandler ["ButtonClick", _code]; | ||
|
||
} forEach GVAR(buttons); | ||
|
||
nil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#define COMPONENT debug_console | ||
#define COMPONENT_BEAUTIFIED Debug Console | ||
#include "\x\tac\addons\main\script_mod.hpp" | ||
|
||
#include "\a3\ui_f\hpp\defineCommonGrids.inc" | ||
#include "\a3\ui_f\hpp\defineResincl.inc" | ||
#include "\a3\ui_f\hpp\defineResinclDesign.inc" | ||
|
||
// #define DEBUG_MODE_FULL | ||
// #define DISABLE_COMPILE_CACHE | ||
// #define ENABLE_PERFORMANCE_COUNTERS | ||
|
||
#ifdef DEBUG_ENABLED_DEBUG_CONSOLE | ||
#define DEBUG_MODE_FULL | ||
#endif | ||
|
||
#ifdef DEBUG_SETTINGS_DEBUG_CONSOLE | ||
#define DEBUG_SETTINGS DEBUG_SETTINGS_DEBUG_CONSOLE | ||
#endif | ||
|
||
#include "\x\tac\addons\main\script_macros.hpp" |
Oops, something went wrong.