From 755581be4084f8393b49bbf8343f09fea493afa0 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 16:23:46 +0100 Subject: [PATCH] Changed BI functions to check for settings --- .../zeus/functions/fnc_bi_moduleCurator.sqf | 55 ++++++++++--------- addons/zeus/functions/fnc_bi_moduleMine.sqf | 22 +++++--- .../functions/fnc_bi_moduleProjectile.sqf | 11 ++-- .../functions/fnc_bi_moduleRemoteControl.sqf | 9 +-- .../zeus/functions/fnc_moduleZeusSettings.sqf | 10 ++-- 5 files changed, 57 insertions(+), 50 deletions(-) diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 2203cb7f3a..333053c8eb 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -150,14 +150,15 @@ if (_activated) then { _x radiochanneladd [_player]; } foreach (_logic getvariable ["channels",[]]); - /* Removed by ACE - //--- Sent notification to all assigned players - { - if (isplayer _x) then { - [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; - }; - } foreach (curatoreditableobjects _logic); - */ + // Added by ACE_zeus to toggle ascension messages + if (GETMVAR(QGVAR(zeusAscension),true)) then { + //--- Sent notification to all assigned players + { + if (isplayer _x) then { + [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; + }; + } foreach (curatoreditableobjects _logic); + }; [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; @@ -189,14 +190,15 @@ if (_activated) then { }; }; - /* Removed by ACE - //--- Create bird - _birdType = _logic getvariable ["birdType","eagle_f"]; - if (_birdType != "") then { - _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; - _logic setvariable ["bird",_bird,true]; + // Added by ACE_zeus to toggle eagle + if (GETMVAR(QGVAR(zeusBird),true)) then { + //--- Create bird + _birdType = _logic getvariable ["birdType","eagle_f"]; + if (_birdType != "") then { + _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _logic setvariable ["bird",_bird,true]; + }; }; - */ //--- Activated all future addons _addons = []; @@ -213,17 +215,18 @@ if (_activated) then { } foreach (synchronizedobjects _logic); _addons call bis_fnc_activateaddons; - /* Removed by ACE - //--- Locality changed - _logic addeventhandler [ - "local", - { - _logic = _this select 0; - _bird = _logic getvariable ["bird",objnull]; - _bird setowner owner _logic; - } - ]; - */ + // Added by ACE_zeus to toggle eagle + if (GETMVAR(QGVAR(zeusBird),true)) then { + //--- Locality changed + _logic addeventhandler [ + "local", + { + _logic = _this select 0; + _bird = _logic getvariable ["bird",objnull]; + _bird setowner owner _logic; + } + ]; + }; }; //--- Player diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index d8142c078d..df1c55dbf1 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -22,16 +22,20 @@ if (_activated) then { _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; _explosive attachto [_logic]; - /* Removed by ACE - //--- Reveal the mine to curator's side - { - _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; - _side revealmine _explosive; - } foreach (objectcurators _logic); + // Added by ACE_zeus to control if mines are revealed + _revealMines = GETMVAR(QGVAR(revealMines),2); + if (_revealMines > 0) then { + //--- Reveal the mine to curator's side + { + _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; + _side revealmine _explosive; + } foreach (objectcurators _logic); - //--- Mark minefields in the map - [] spawn bis_fnc_drawMinefields; - */ + if (_revealMines > 1) then { + //--- Mark minefields in the map + [] spawn bis_fnc_drawMinefields; + }; + }; //--- Show hint to curator who placed the object [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index fbae16e00d..047f5ac5eb 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -91,7 +91,6 @@ if (_activated) then { }; default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; }; - /* Removed by ACE _fnc_playRadio = { if (_radio != "") then { _entities = (getposatl _logic) nearentities ["All",100]; @@ -110,7 +109,6 @@ if (_activated) then { } foreach _entities; }; }; - */ if (count _hint > 0) then { [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; }; @@ -136,10 +134,11 @@ if (_activated) then { //--- Create sound source _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; - /* Removed by ACE - //--- Play radio warning - [] call _fnc_playRadio; - */ + // Added by ACE_zeus to toggle ordnance radio message + if (GETMVAR(QGVAR(radioOrdnance),true)) then { + //--- Play radio warning + [] call _fnc_playRadio; + }; //--- Update if (_attach) then { diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index bf73a8863e..e57ee98b5c 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -45,10 +45,11 @@ if (_activated && local _logic && !isnull curatorcamera) then { bis_fnc_moduleRemoteControl_unit = _unit; _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; - /* Removed by ACE - //--- Play wind cue to all players - [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; - */ + // Added by ACE_zeus to toggle remote control wind sound + if (GETMVAR(QGVAR(remoteWind),true)) then { + //--- Play wind cue to all players + [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; + }; _blur = ppeffectcreate ["RadialBlur",144]; _blur ppeffectenable true; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 94dc0d966a..5963d7216c 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -22,8 +22,8 @@ _activated = _this select 2; if !(_activated) exitWith {}; -[_logic, QGVAR(settingAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingBird), "zeusBird"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingMines), "revealMines"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingWind), "remoteWind"] call EFUNC(common,readSettingFromModule); \ No newline at end of file +[_logic, QGVAR(zeusAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeusBird), "zeusBird"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(radioOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(revealMines), "revealMines"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(remoteWind), "remoteWind"] call EFUNC(common,readSettingFromModule); \ No newline at end of file