Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions addons/interaction/functions/fnc_openDoor.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,11 @@ GVAR(doorTargetPhase) = _house animationPhase (_animations select 0);
GVAR(isOpeningDoor) = true;
GVAR(usedScrollWheel) = false;

// Raise local started opening event
[QGVAR(doorOpeningStarted), [_house, _door, _animations]] call CBA_fnc_localEvent;

[{
(_this select 0) params ["_house", "_animations", "_position", "_time", "_frame"];
(_this select 0) params ["_house", "_animations", "_position", "_time", "_frame", "_door"];

if !(GVAR(isOpeningDoor)) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
Expand All @@ -75,6 +78,9 @@ GVAR(usedScrollWheel) = false;

{_house animate [_x, _phase]; false} count _animations;
};

// Raise local stopped opening event
[QGVAR(doorOpeningStopped), [_house, _door, _animations]] call CBA_fnc_localEvent;
};

// check if player moved too far away
Expand All @@ -88,4 +94,4 @@ GVAR(usedScrollWheel) = false;
};
// do incremental door opening
{_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations;
}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler;
}, 0.1, [_house, _animations, getPosASL ACE_player, CBA_missionTime + 0.2, diag_frameno + 2, _door]] call CBA_fnc_addPerFrameHandler;
10 changes: 9 additions & 1 deletion docs/wiki/framework/events-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ MenuType: 0 = Interaction, 1 = Self Interaction
|---------- |------------|----------|------|-------------|
| `ace_medical_treatment_fullHealLocalMod` | [_patient] | Local | Listen | Called before a local unit is fully healed, mods can listen and apply their own healing logic

### 2.15 Interaction (`ace_interaction`)

| Event Key | Parameters | Locality | Type | Description |
|---------- |------------|----------|------|-------------|
|---------- |------------|----------|------|-------------|
| `ace_interaction_doorOpeningStarted` | [_house, _door, _animations] | Local | Listen | Called when local unit starts interacting with doors
| `ace_interaction_doorOpeningStopped` | [_house, _door, _animations] | Local | Listen | Called when local unit stopps interacting with doors

## 3. Usage
Also Reference [CBA Events System](https://github.com/CBATeam/CBA_A3/wiki/Custom-Events-System){:target="_blank"} documentation.

Expand Down Expand Up @@ -263,4 +271,4 @@ Calls a globally synchronized event, which will also be run on JIP players unles

// Event called on another machine (tapping above target machine)
["ace_interact_tapShoulder", [arguments], [target]] call CBA_fnc_targetEvent;
```
```