-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Feature Camera Player EH #982
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5ca1a28
Add Feature Camera Player EH
jonpas 99f32e7
Add argument verification to registerFeatureCamera
jonpas 9e07b1c
Optimize CBA_fnc_getActiveFeatureCamera
PabstMirror 2289585
fixes
PabstMirror 8696687
Run feature camera player EH only every 0.5s
jonpas 55f5e2e
Don't compile final a PFH function
jonpas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no reason to compileFinal this. It is only done for Map, because it is a mission event handler and therefore affected by the recompiled-every-execution-bug. That however does not apply to CBA PFH.