mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add an unjam action to the interact menu when the weapon is jammed
This commit is contained in:
parent
2dbf979ec6
commit
11f3189306
@ -4,6 +4,15 @@ class CfgVehicles {
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Equipment {
|
||||
class ACE_UnJam {
|
||||
displayName = CSTRING(UnjamWeapon);
|
||||
condition = QUOTE( [_player] call FUNC(canUnjam) );
|
||||
exceptions[] = {"isNotInside", "isNotSitting"};
|
||||
statement = QUOTE( [ARR_2(_player, currentMuzzle _player)] call FUNC(clearJam); );
|
||||
showDisabled = 0;
|
||||
priority = 4;
|
||||
icon = QUOTE(PATHTOF(UI\unjam_ca.paa));
|
||||
};
|
||||
class ACE_SwapBarrel {
|
||||
displayName = CSTRING(SwapBarrel);
|
||||
condition = QUOTE( 'ACE_SpareBarrel' in items _player && {getNumber (configFile >> 'CfgWeapons' >> currentWeapon _player >> 'ACE_Overheating_allowSwapBarrel') == 1} );
|
||||
|
BIN
addons/overheating/UI/unjam_ca.paa
Normal file
BIN
addons/overheating/UI/unjam_ca.paa
Normal file
Binary file not shown.
@ -22,9 +22,8 @@ GVAR(cacheWeaponData) setText QGVAR(cacheWeaponData);
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, ["isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !([ACE_player] call EFUNC(common,canUseWeapon) &&
|
||||
{currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])}
|
||||
) exitWith {false};
|
||||
|
||||
if !([ACE_player] call FUNC(canUnjam)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[ACE_player, currentMuzzle ACE_player, false] call FUNC(clearJam);
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(canUnjam);
|
||||
PREP(checkTemperature);
|
||||
PREP(clearJam);
|
||||
PREP(displayTemperature);
|
||||
|
25
addons/overheating/functions/fnc_canUnjam.sqf
Normal file
25
addons/overheating/functions/fnc_canUnjam.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Author: Commy2 and esteldunedain
|
||||
* Return true if the unit can unjam it's current weapon
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Bool
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
TRACE_1("_unit",_unit);
|
||||
|
||||
private _jammedWeapons = _unit getVariable [QGVAR(jammedWeapons), []];
|
||||
if !(currentWeapon _unit in _jammedWeapons) exitWith {
|
||||
false
|
||||
};
|
||||
if !([_unit] call EFUNC(common,canUseWeapon)) exitWith {
|
||||
false
|
||||
};
|
||||
true
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit", "_weapon", "_skipAnim"];
|
||||
params ["_unit", "_weapon", ["_skipAnim", false]];
|
||||
TRACE_3("params",_unit,_weapon,_skipAnim);
|
||||
|
||||
private _jammedWeapons = _unit getVariable [QGVAR(jammedWeapons), []];
|
||||
|
Loading…
Reference in New Issue
Block a user