Skip to content
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

Dragging - Add hookable events #10304

Merged
merged 8 commits into from
Sep 11, 2024
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
3 changes: 3 additions & 0 deletions addons/dragging/functions/fnc_carryObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,6 @@ if (_UAVCrew isNotEqualTo []) then {

// Check everything
[LINKFUNC(carryObjectPFH), 0.5, [_unit, _target, CBA_missionTime]] call CBA_fnc_addPerFrameHandler;

// API
[QGVAR(startedCarry), [_unit, _target]] call CBA_fnc_localEvent;
3 changes: 3 additions & 0 deletions addons/dragging/functions/fnc_dragObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ if (_UAVCrew isNotEqualTo []) then {

// Fixes not being able to move when in combat pace
[_unit, "forceWalk", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set);

// API
[QGVAR(startedDrag), [_unit, _target]] call CBA_fnc_localEvent;
3 changes: 3 additions & 0 deletions addons/dragging/functions/fnc_dropObject.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ private _mass = _target getVariable [QGVAR(originalMass), 0];
if (_mass != 0) then {
[QEGVAR(common,setMass), [_target, _mass]] call CBA_fnc_globalEvent; // Force global sync
};

// API
[QGVAR(stoppedDrag), [_unit, _target]] call CBA_fnc_localEvent;
6 changes: 6 additions & 0 deletions addons/dragging/functions/fnc_dropObject_carry.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ if (_loadCargo) then {
} else {
[_unit, _target, _cursorObject] call EFUNC(common,loadPerson);
};

// Repurpose variable for flag used in event below
_loadCargo = true;
};
};
};

// API
[QGVAR(stoppedCarry), [_unit, _target, _loadCargo]] call CBA_fnc_localEvent;
3 changes: 3 additions & 0 deletions addons/dragging/functions/fnc_startCarryLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ if (_mass > 1) then {
_target setVariable [QGVAR(originalMass), _mass, true];
[QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync
};

// API
[QGVAR(setupCarry), [_unit, _target]] call CBA_fnc_localEvent;
3 changes: 3 additions & 0 deletions addons/dragging/functions/fnc_startDragLocal.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,6 @@ if (_mass > 1) then {
_target setVariable [QGVAR(originalMass), _mass, true];
[QEGVAR(common,setMass), [_target, 1e-12]] call CBA_fnc_globalEvent; // Force global sync
};

// API
[QGVAR(setupDrag), [_unit, _target]] call CBA_fnc_localEvent;
6 changes: 6 additions & 0 deletions docs/wiki/framework/events-framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ MenuType: 0 = Interaction, 1 = Self Interaction
|---------- |------------|----------|------|-------------|
| `ace_dragging_cloneCreated` | [_clone, _corpse] | Local | Listen | Called when a clone used for dragging/carrying corpses is created
| `ace_dragging_cloneDeleted` | [_clone, _corpse] | Local | Listen | Called when a clone used for dragging/carrying corpses is deleted
| `ace_dragging_setupCarry` | [_unit, _target] | Local | Listen | Called when the unit starts the carrying animation for the target
| `ace_dragging_startedCarry` | [_unit, _target] | Local | Listen | Called when the unit starts successfully carrying the target. This event is called after `ace_dragging_setupCarry`.
| `ace_dragging_stoppedCarry` | [_unit, _target, _loadCargo] | Local | Listen | Called when the unit stops carrying the target. `_loadCargo` says if the target is being loaded as cargo/person or not.
| `ace_dragging_setupDrag` | [_unit, _target] | Local | Listen | Called when the unit starts the dragging animation for the target
| `ace_dragging_startedDrag` | [_unit, _target] | Local | Listen | Called when the unit starts successfully dragging the target. This event is called after `ace_dragging_setupDrag`.
| `ace_dragging_stoppedDrag` | [_unit, _target] | Local | Listen | Called when the unit stops dragging the target

### 2.19 HuntIR (`ace_huntir`)

Expand Down