mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Rename Advanced Throwing component to be in-line with other advanced_ components (#4318)
* Rename Advanced Throwing component to be in-line with other advanced_ components * Rename wiki page as well * Add redirect from old wiki page
This commit is contained in:
48
addons/advanced_throwing/functions/fnc_onMouseScroll.sqf
Normal file
48
addons/advanced_throwing/functions/fnc_onMouseScroll.sqf
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Author: Dslyecxi, Jonpas
|
||||
* Mouse scroll wheel changed event.
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_advanced_throwing_fnc_onMouseScroll
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(ACE_player getVariable [QGVAR(inHand), false]) exitWith {};
|
||||
|
||||
params ["", "_amount"];
|
||||
|
||||
if (ACE_player getVariable [QGVAR(dropMode), false]) then {
|
||||
private _dropDistance = ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT];
|
||||
if (_amount < 0) then {
|
||||
// Move closer
|
||||
ACE_player setVariable [QGVAR(dropDistance), (_dropDistance - 0.1) max DROP_DISTANCE_DEFAULT];
|
||||
} else {
|
||||
// Move further
|
||||
ACE_player setVariable [QGVAR(dropDistance), (_dropDistance + 0.1) min 1];
|
||||
};
|
||||
|
||||
// Limit distance in vehicle
|
||||
if (vehicle ACE_player != ACE_player) then {
|
||||
ACE_player setVariable [QGVAR(dropDistance), (ACE_player getVariable [QGVAR(dropDistance), DROP_DISTANCE_DEFAULT]) min 0.5];
|
||||
};
|
||||
} else {
|
||||
private _throwType = ACE_player getVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
if (_amount < 0) then {
|
||||
if (_throwType == "high") then {
|
||||
ACE_player setVariable [QGVAR(throwType), THROW_TYPE_DEFAULT];
|
||||
};
|
||||
} else {
|
||||
if (_throwType == "normal") then {
|
||||
ACE_player setVariable [QGVAR(throwType), "high"];
|
||||
};
|
||||
};
|
||||
TRACE_2("Change Throw Type",_amount,ACE_player getVariable QGVAR(throwType));
|
||||
};
|
Reference in New Issue
Block a user