mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add Check ammo self interaction setting (#7306)
This commit is contained in:
parent
7f62067a7b
commit
ead5105070
@ -1,6 +1,17 @@
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Equipment {
|
||||
class GVAR(checkAmmo) {
|
||||
displayName = CSTRING(checkAmmo);
|
||||
condition = QUOTE(GVAR(showCheckAmmoSelf) && {_player call FUNC(canCheckAmmoSelf)});
|
||||
statement = QUOTE(call FUNC(checkAmmo));
|
||||
exceptions[] = {"isNotInside", "isNotSwimming", "isNotSitting"};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Actions {
|
||||
class ACE_Weapon {
|
||||
class GVAR(LinkBelt) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
PREP(canCheckAmmo);
|
||||
PREP(canCheckAmmoSelf);
|
||||
PREP(getAmmoToLinkBelt);
|
||||
PREP(checkAmmo);
|
||||
PREP(displayAmmo);
|
||||
|
@ -8,7 +8,7 @@ if (!hasInterface) exitWith {};
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, vehicle ACE_player, ["isNotInside", "isNotSwimming", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
// Conditions: specific
|
||||
if !(ACE_player call CBA_fnc_canUseWeapon || {(vehicle ACE_player) isKindOf "StaticWeapon"}) exitWith {false};
|
||||
if !(ACE_player call FUNC(canCheckAmmoSelf)) exitWith {false};
|
||||
// Ignore if controlling UAV (blocks radar keybind)
|
||||
if (!isNull (ACE_controlledUAV param [0, objNull])) exitWith {false};
|
||||
|
||||
|
@ -6,4 +6,6 @@ PREP_RECOMPILE_START;
|
||||
#include "XEH_PREP.hpp"
|
||||
PREP_RECOMPILE_END;
|
||||
|
||||
#include "initSettings.sqf"
|
||||
|
||||
ADDON = true;
|
||||
|
20
addons/reload/functions/fnc_canCheckAmmoSelf.sqf
Normal file
20
addons/reload/functions/fnc_canCheckAmmoSelf.sqf
Normal file
@ -0,0 +1,20 @@
|
||||
#include "script_component.hpp"
|
||||
/*
|
||||
* Author: veteran29
|
||||
* Check if the player can check his own ammo.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Can check ammo <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [cursorObject] call ace_reload_fnc_canCheckAmmoSelf
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_player"];
|
||||
|
||||
_player call CBA_fnc_canUseWeapon && {!((vehicle _player) isKindOf "StaticWeapon")}
|
9
addons/reload/initSettings.sqf
Normal file
9
addons/reload/initSettings.sqf
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
[
|
||||
QGVAR(showCheckAmmoSelf),
|
||||
"CHECKBOX",
|
||||
[LSTRING(SettingShowCheckAmmoSelf), LSTRING(SettingShowCheckAmmoSelfDesc)],
|
||||
localize ELSTRING(common,ACEKeybindCategoryWeapons),
|
||||
false, // default value
|
||||
0 // isGlobal
|
||||
] call CBA_fnc_addSetting;
|
@ -33,6 +33,14 @@
|
||||
<Chinesesimp>在重新装填时检查新弹匣上的弹药.</Chinesesimp>
|
||||
<Chinese>在重新裝填時檢查新彈匣上的彈藥.</Chinese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Reload_SettingShowCheckAmmoSelf">
|
||||
<English>Always show check ammo self interaction</English>
|
||||
<Polish>Zawsze pokazuj interakcję od sprawdzania amunicji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Reload_SettingShowCheckAmmoSelfDesc">
|
||||
<English>Shows check ammo self interaction even when not in static weapons.</English>
|
||||
<Polish>Pokazuje interakcję od sprawdzania amunicji poza bronią statyczną.</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Reload_checkAmmo">
|
||||
<English>Check Ammo</English>
|
||||
<German>Munition prüfen</German>
|
||||
|
Loading…
Reference in New Issue
Block a user