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>
|
||||
* 1: Weapon <STRING>
|
||||
* 2: Muzzle <STRING>
|
||||
* 3: Show hint <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -17,7 +18,7 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit", "_weapon", "_muzzle"];
|
||||
params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]];
|
||||
|
||||
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||
|
||||
@ -75,6 +76,9 @@ if (_muzzle isEqualType "") then {
|
||||
// play fire mode selector sound
|
||||
[_unit, _weapon, _muzzle] call FUNC(playChangeFiremodeSound);
|
||||
|
||||
// show info box
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||
// show info box unless disabled
|
||||
if (_hint) then {
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize LSTRING(PutOnSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Weapon <STRING>
|
||||
* 2: State <BOOL>
|
||||
* 3: Show hint <BOOL> (default: true)
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -20,7 +21,8 @@
|
||||
params [
|
||||
["_unit", objNull, [objNull]],
|
||||
["_weapon", "", [""]],
|
||||
["_state", true, [true]]
|
||||
["_state", true, [true]],
|
||||
["_hint", true, [true]]
|
||||
];
|
||||
|
||||
if (_weapon == "") exitWith {};
|
||||
@ -32,5 +34,5 @@ _weapon = configName (configFile >> "CfgWeapons" >> _weapon);
|
||||
private _muzzle = currentMuzzle _unit;
|
||||
|
||||
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>
|
||||
* 1: Weapon <STRING>
|
||||
* 2: Muzzle <STRING>
|
||||
* 3: Show hint <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -17,7 +18,7 @@
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
params ["_unit", "_weapon", "_muzzle"];
|
||||
params ["_unit", "_weapon", "_muzzle", ["_hint", true, [true]]];
|
||||
|
||||
private _safedWeapons = _unit getVariable [QGVAR(safedWeapons), []];
|
||||
_safedWeapons deleteAt (_safedWeapons find _weapon);
|
||||
@ -77,6 +78,8 @@ if (inputAction "nextWeapon" > 0) then {
|
||||
// player hud
|
||||
[true] call FUNC(setSafeModeVisual);
|
||||
|
||||
// show info box
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||
// show info box unless disabled
|
||||
if (_hint) then {
|
||||
private _picture = getText (configFile >> "CfgWeapons" >> _weapon >> "picture");
|
||||
[localize LSTRING(TookOffSafety), _picture] call EFUNC(common,displayTextPicture);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user