-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Feature Camera Player EH * Add argument verification to registerFeatureCamera * Optimize CBA_fnc_getActiveFeatureCamera * fixes * Run feature camera player EH only every 0.5s * Don't compile final a PFH function
- Loading branch information
Showing
6 changed files
with
135 additions
and
16 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
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
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,35 @@ | ||
#include "script_component.hpp" | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_getActiveFeatureCamera | ||
Description: | ||
Returns active feature camera. | ||
Checks for the following feature cameras: | ||
- Curator | ||
- Arsenal camera (BIS_fnc_arsenal) | ||
- Nexus Spectator (BIS_fnc_EGSpectator) | ||
- Establishing shot (BIS_fnc_establishingShot) | ||
- Splendid camera (BIS_fnc_camera) | ||
- Animation viewer (BIS_fnc_animViewer) | ||
- Classic camera (BIS_fnc_cameraOld) | ||
And cameras registered via CBA_fnc_registerFeatureCamera. | ||
Parameters: | ||
None | ||
Returns: | ||
Active feature camera ("" if none) <STRING> | ||
Examples: | ||
(begin example) | ||
_result = [] call CBA_fnc_getActiveFeatureCamera | ||
(end) | ||
Author: | ||
Sniperwolf572, Jonpas | ||
---------------------------------------------------------------------------- */ | ||
SCRIPT(getActiveFeatureCamera); | ||
|
||
GVAR(featureCamerasNames) param [GVAR(featureCamerasCode) findIf {call _x}, ""] |
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,43 @@ | ||
#include "script_component.hpp" | ||
/* ---------------------------------------------------------------------------- | ||
Function: CBA_fnc_registerFeatureCamera | ||
Description: | ||
Registers a feature camera for use with CBA_fnc_getActiveFeatureCamera. | ||
Parameters: | ||
_name - Name (unique/tagged) <STRING> | ||
_callback - Activity check (should return true if active, false otherwise) <CODE> | ||
Returns: | ||
Successfully registered <BOOL> | ||
Examples: | ||
(begin example) | ||
_result = [ | ||
"ace_spectator", | ||
{!isNull (missionNamespace getVariable ["ace_spectator_isSet", objNull])} | ||
] call CBA_fnc_registerFeatureCamera | ||
(end) | ||
Author: | ||
Sniperwolf572, Jonpas | ||
---------------------------------------------------------------------------- */ | ||
SCRIPT(registerFeatureCamera); | ||
|
||
params [["_name", "", [""]], ["_callback", false, [{}]]]; | ||
|
||
if (_name isEqualTo "") exitWith { | ||
TRACE_1("Name empty",_name); | ||
false | ||
}; | ||
|
||
if (_callback isEqualTo false) exitWith { | ||
TRACE_1("Callback not code",_name); | ||
false | ||
}; | ||
|
||
if ((GVAR(featureCamerasNames) pushBackUnique _name) == -1) exitWith {false}; | ||
GVAR(featureCamerasCode) pushBack _callback; | ||
|
||
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
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