-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Goggles - Add API to crack glasses (#10648)
Co-authored-by: johnb432 <[email protected]>
- Loading branch information
1 parent
a17d6fe
commit a54c4da
Showing
3 changed files
with
50 additions
and
23 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
// effects | ||
PREP(applyCrackEffect); | ||
PREP(applyDirtEffect); | ||
PREP(applyDustEffect); | ||
PREP(applyGlassesEffect); | ||
|
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" | ||
/* | ||
* Authors: DartRuffian | ||
* Adds cracked glass effect to glasses. | ||
* | ||
* Arguments: | ||
* None | ||
* | ||
* Return Value: | ||
* Succeeded <BOOL> | ||
* | ||
* Example: | ||
* _applied = [] call ace_goggles_fnc_applyCrackEffect | ||
* | ||
* Public: Yes | ||
*/ | ||
|
||
if (GETBROKEN) exitWith { true }; | ||
|
||
private _unit = ACE_player; | ||
private _config = configFile >> "CfgGlasses" >> goggles _unit; | ||
|
||
if !(_unit call FUNC(isGogglesVisible)) exitWith { | ||
["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent; | ||
true | ||
}; | ||
|
||
scopeName "main"; | ||
|
||
private _effects = GETGLASSES(_unit); | ||
_effects set [BROKEN, true]; | ||
|
||
SETGLASSES(_unit,_effects); | ||
|
||
if (getText (_config >> "ACE_OverlayCracked") != "") then { | ||
if ([] call FUNC(externalCamera)) exitWith { | ||
false breakOut "main"; | ||
}; | ||
if (isNull (GLASSDISPLAY)) then { | ||
GVAR(GogglesLayer) cutRsc ["RscACE_Goggles", "PLAIN", 1, false, false]; | ||
}; | ||
|
||
(GLASSDISPLAY displayCtrl IDC_GOGGLES_OVERLAY) ctrlSetText getText (_config >> "ACE_OverlayCracked"); | ||
}; | ||
|
||
["ace_glassesCracked", [_unit]] call CBA_fnc_localEvent; | ||
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