mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Safety - Add optional flag to hide hint (#9086)
* Add optional flag to hide hint * Update addons/safemode/functions/fnc_setWeaponSafety.sqf * Update addons/safemode/functions/fnc_unlockSafety.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> * Update addons/safemode/functions/fnc_lockSafety.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> Co-authored-by: jonpas <jonpas33@gmail.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
This commit is contained in:
parent
5693edc96d
commit
7f5a8e4099
@ -7,6 +7,7 @@
|
|||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Weapon <STRING>
|
* 1: Weapon <STRING>
|
||||||
* 2: Muzzle <STRING>
|
* 2: Muzzle <STRING>
|
||||||
|
* 3: Show hint <BOOL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -17,7 +18,7 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_unit", "_weapon", "_muzzle"];
|
params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]];
|
||||||
|
|
||||||
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||||
|
|
||||||
@ -75,6 +76,9 @@ if (_muzzle isEqualType "") then {
|
|||||||
// play fire mode selector sound
|
// play fire mode selector sound
|
||||||
[_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound);
|
[_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound);
|
||||||
|
|
||||||
// show info box
|
// show info box unless disabled
|
||||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
if (_hint) then {
|
||||||
[localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture);
|
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||||
|
[localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||||
|
};
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Weapon <STRING>
|
* 1: Weapon <STRING>
|
||||||
* 2: State <BOOL>
|
* 2: State <BOOL>
|
||||||
|
* 3: Show hint <BOOL> (default: true)
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -20,7 +21,8 @@
|
|||||||
params [
|
params [
|
||||||
["_unit", objNull, [objNull]],
|
["_unit", objNull, [objNull]],
|
||||||
["_weapon", "", [""]],
|
["_weapon", "", [""]],
|
||||||
["_state", true, [true]]
|
["_state", true, [true]],
|
||||||
|
["_hint", true, [true]]
|
||||||
];
|
];
|
||||||
|
|
||||||
if (_weapon == "") exitWith {};
|
if (_weapon == "") exitWith {};
|
||||||
@ -32,5 +34,5 @@ _weapon = configName (configFile >> "CfgWeapons" >> _weapon);
|
|||||||
private _muzzle = currentMuzzle _unit;
|
private _muzzle = currentMuzzle _unit;
|
||||||
|
|
||||||
if (_state isNotEqualTo (_weapon in _safedWeapons)) then {
|
if (_state isNotEqualTo (_weapon in _safedWeapons)) then {
|
||||||
[_unit, _weapon, _muzzle] call FUNC(lockSafety);
|
[_unit, _weapon, _muzzle, _hint] call FUNC(lockSafety);
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
* 0: Unit <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
* 1: Weapon <STRING>
|
* 1: Weapon <STRING>
|
||||||
* 2: Muzzle <STRING>
|
* 2: Muzzle <STRING>
|
||||||
|
* 3: Show hint <BOOL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
@ -17,7 +18,7 @@
|
|||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
params ["_unit", "_weapon", "_muzzle"];
|
params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]];
|
||||||
|
|
||||||
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||||
_safedWeapons deleteAt (_safedWeapons find _weapon);
|
_safedWeapons deleteAt (_safedWeapons find _weapon);
|
||||||
@ -77,6 +78,8 @@ if (inputAction "nextWeapon" > 0) then {
|
|||||||
// player hud
|
// player hud
|
||||||
[true] call FUNC(setSafeModeVisual);
|
[true] call FUNC(setSafeModeVisual);
|
||||||
|
|
||||||
// show info box
|
// show info box unless disabled
|
||||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
if (_hint) then {
|
||||||
[localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture);
|
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||||
|
[localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||||
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user