Skip to content

Commit

Permalink
Merge develop branch (v0.2.5.9)
Browse files Browse the repository at this point in the history
  • Loading branch information
SceptreOfficial committed Oct 8, 2019
2 parents 21ccf96 + 9b425dd commit d4dacf3
Show file tree
Hide file tree
Showing 16 changed files with 227 additions and 92 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<p align="center">
<a href="https://github.com/SceptreOfficial/Simplex-Support-Services/releases/latest">
<img src="https://img.shields.io/badge/Version-0.2.5.3-blue?style=flat-square" alt="Version">
<img src="https://img.shields.io/badge/Version-0.2.5.9-blue?style=flat-square" alt="Version">
</a>
<a href="https://github.com/SceptreOfficial/Simplex-Support-Services/issues">
<img src="https://img.shields.io/github/issues-raw/SceptreOfficial/Simplex-Support-Services?style=flat-square&label=Issues" alt="Issues">
Expand Down
7 changes: 5 additions & 2 deletions addons/CDS/functions/fnc_cancel.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ private _returnValues = (uiNamespace getVariable QGVAR(controls)) apply {
};
};

[_returnValues,uiNamespace getVariable QGVAR(customArguments)] call (uiNamespace getVariable QGVAR(onCancel));

closeDialog 0;

[{isNull (findDisplay DISPLAY_IDD)},{
params ["_returnValues","_customArguments","_code"];
[_returnValues,_customArguments] call _code;
},[_returnValues,uiNamespace getVariable QGVAR(customArguments),uiNamespace getVariable QGVAR(onCancel)]] call CBA_fnc_waitUntilAndExecute;
7 changes: 5 additions & 2 deletions addons/CDS/functions/fnc_confirm.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ private _returnValues = (uiNamespace getVariable QGVAR(controls)) apply {
};
};

[_returnValues,uiNamespace getVariable QGVAR(customArguments)] call (uiNamespace getVariable QGVAR(onOK));

closeDialog 0;

[{isNull (findDisplay DISPLAY_IDD)},{
params ["_returnValues","_customArguments","_code"];
[_returnValues,_customArguments] call _code;
},[_returnValues,uiNamespace getVariable QGVAR(customArguments),uiNamespace getVariable QGVAR(onOK)]] call CBA_fnc_waitUntilAndExecute;
6 changes: 2 additions & 4 deletions addons/common/functions/fnc_commission.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ private _group = group _vehicle;

switch (_entity getVariable "SSS_supportType") do {
case "artillery" : {
{
_x disableAI "MOVE";
_x disableAI "AUTOCOMBAT";
} forEach PRIMARY_CREW(_vehicle);
{_x disableAI "PATH"} forEach PRIMARY_CREW(_vehicle);
_vehicle lockTurret [[0],true];
_vehicle lockCargo true;

_group enableAttack true;
_group setBehaviour "COMBAT";
};

case "CASHelicopter" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ params ["_target","_player","_entity"];
private _entity = _this # 2;

["Change Behavior",[
["SLIDER","Flying height",[[40,1000,0],_entity getVariable "SSS_flyingHeight"]],
["SLIDER","Flying height",[[50,2000,0],_entity getVariable "SSS_flyingHeight"]],
["COMBOBOX","Speed Mode",[["LIMITED","NORMAL","FULL"],_entity getVariable "SSS_speedMode"]],
["COMBOBOX","Combat Mode",[["Fire At will","Hold Fire"],_entity getVariable "SSS_combatMode"]],
["CHECKBOX","Headlight",_entity getVariable "SSS_lightsOn"],
Expand Down
9 changes: 5 additions & 4 deletions addons/interaction/functions/fnc_onMapClick.sqf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "script_component.hpp"

params ["_units","_position","_alt","_shift","_target","_player","_args"];
_args params ["_entity","_request"];
params ["_target","_entity","_request","_position"];

if (isNull _entity) exitWith {};

switch (_entity getVariable "SSS_supportType") do {
case "artillery" : {
Expand Down Expand Up @@ -42,7 +43,7 @@ switch (_entity getVariable "SSS_supportType") do {
false
};
};

["Fire Mission Parameters - " + mapGridPosition _position,[
["SLIDER","Rounds",[[1,_entity getVariable "SSS_maxRounds",0],1]],
["SLIDER","Random Dispersion Radius",[[0,250,0],0]],
Expand Down Expand Up @@ -303,7 +304,7 @@ switch (_entity getVariable "SSS_supportType") do {
case 5 : {
["Paradrop parameters",[
["SLIDER",["Jump delay","Seconds between each unit jumping out"],[[0,5,1],1]],
["SLIDER","A.I. opening height",[[100,2000,0],200]]
["SLIDER","AI opening height",[[100,2000,0],200]]
],{
params ["_values","_args"];
_args params ["_entity","_request","_position"];
Expand Down
61 changes: 43 additions & 18 deletions addons/interaction/functions/fnc_selectPosition.sqf
Original file line number Diff line number Diff line change
@@ -1,27 +1,52 @@
#include "script_component.hpp"

SSS_mapWasOpened = visibleMap;
SSS_mapClicked = false;
openMap [true,false];
titleText ["Select Position","PLAIN",0.5];
params ["_target","_player","_args"];
_args params ["_entity","_request"];

["SSS_selectPosition","onMapSingleClick",{
["SSS_selectPosition","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;
if (missionNamespace getVariable format ["SSS_setting_milsimMode%1",_entity getVariable "SSS_service"]) then {
["Map grid position",[
["EDITBOX",["Grid","Supports up to a 10 digit grid reference"],""]
],{
params ["_values","_args"];
_values params ["_grid"];
_args params ["_target","_entity","_request"];

SSS_mapClicked = true;
titleFadeOut 0.5;
if (!SSS_mapWasOpened) then {
openMap [false,false];
};
if (_grid isEqualTo "") exitWith {
titleText ["Request Cancelled - No grid input","PLAIN",0.5];
[{titleFadeOut 0.5;},[],1] call CBA_fnc_waitAndExecute;
};

private _position = _grid call CBA_fnc_mapGridToPos;

[_target,_entity,_request,_position] call FUNC(onMapClick);
},{REQUEST_CANCELLED;},[_target,_entity,_request]] call EFUNC(CDS,dialog);
} else {
SSS_mapWasOpened = visibleMap;
SSS_mapClicked = false;

_this call FUNC(onMapClick);
},_this] call BIS_fnc_addStackedEventHandler;
openMap [true,false];
titleText ["Select Position","PLAIN",0.5];

["SSS_selectPosition","onMapSingleClick",{
params ["_units","_position","_alt","_shift","_target","_entity","_request"];

[{!visibleMap || SSS_mapClicked},{
if (!SSS_mapClicked) then {
["SSS_selectPosition","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;

SSS_mapClicked = true;
titleFadeOut 0.5;
REQUEST_CANCELLED;
};
}] call CBA_fnc_waitUntilAndExecute;
if (!SSS_mapWasOpened) then {
openMap [false,false];
};

[_target,_entity,_request,_position] call FUNC(onMapClick);
},[_target,_entity,_request]] call BIS_fnc_addStackedEventHandler;

[{!visibleMap || SSS_mapClicked},{
if (!SSS_mapClicked) then {
["SSS_selectPosition","onMapSingleClick"] call BIS_fnc_removeStackedEventHandler;

titleFadeOut 0.5;
REQUEST_CANCELLED;
};
}] call CBA_fnc_waitUntilAndExecute;
};
75 changes: 53 additions & 22 deletions addons/main/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,26 @@
ADDON = false;
#include "XEH_PREP.hpp"

// Addon Options
["SSS_setting_useChatNotifications","CHECKBOX",
["Use chat notifications","Disables custom notification system"],
["Simplex Support Services","Personal"],
// Admin
["SSS_setting_adminFullAccess","CHECKBOX",
["Give admins access to all supports","Admins will be able to use every support available, even if services aren't shown/enabled"],
["Simplex Support Services","Admin"],
false, // _valueInfo
false, // _isGlobal
{}, //_script
false // _needRestart
] call CBA_fnc_addSetting;

["SSS_setting_adminLimitSide","CHECKBOX",
["Limit admin access to side","Limit the admin access to the current side of the admin"],
["Simplex Support Services","Admin"],
false,
false,
{},
false
] call CBA_fnc_addSetting;

// Core
["SSS_setting_GiveUAVTerminal","CHECKBOX",
["Give UAV Terminal on drone request","Gives CAS Drone requesters a UAV terminal if they don't have one"],
["Simplex Support Services","Core"],
Expand Down Expand Up @@ -66,6 +76,45 @@ ADDON = false;
false
] call CBA_fnc_addSetting;

// Milsim mode
["SSS_setting_milsimModeArtillery","CHECKBOX",
["Enable milsim mode - Artillery","Require map grid coordinates on requests"],
["Simplex Support Services","Milsim Mode"],
false,
true,
{},
false
] call CBA_fnc_addSetting;

["SSS_setting_milsimModeCAS","CHECKBOX",
["Enable milsim mode - CAS","Require map grid coordinates on requests"],
["Simplex Support Services","Milsim Mode"],
false,
true,
{},
false
] call CBA_fnc_addSetting;

["SSS_setting_milsimModeTransport","CHECKBOX",
["Enable milsim mode - Transport","Require map grid coordinates on requests"],
["Simplex Support Services","Milsim Mode"],
false,
true,
{},
false
] call CBA_fnc_addSetting;

// Personal
["SSS_setting_useChatNotifications","CHECKBOX",
["Use chat notifications","Disables custom notification system"],
["Simplex Support Services","Personal"],
false,
false,
{},
false
] call CBA_fnc_addSetting;

// Special Items
["SSS_setting_specialItems","EDITBOX",
["Special items - classnames","Items used to permit access to supports. Leave empty to ignore. Separate with commas (eg. itemRadio,itemMap)"],
["Simplex Support Services","Special Items"],
Expand Down Expand Up @@ -93,24 +142,6 @@ ADDON = false;
false
] call CBA_fnc_addSetting;

["SSS_setting_adminFullAccess","CHECKBOX",
["Give admins access to all supports","Admins will be able to use every support available, even if services aren't shown/enabled"],
["Simplex Support Services","Admin"],
false,
false,
{},
false
] call CBA_fnc_addSetting;

["SSS_setting_adminLimitSide","CHECKBOX",
["Limit admin access to side","Limit the admin access to the current side of the admin"],
["Simplex Support Services","Admin"],
false,
false,
{},
false
] call CBA_fnc_addSetting;

// Master array
SSS_entities = [];

Expand Down
2 changes: 1 addition & 1 deletion addons/main/script_version.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define MAJOR 0
#define MINOR 2
#define PATCH 5
#define BUILD 3
#define BUILD 9
84 changes: 59 additions & 25 deletions addons/support/functions/fnc_requestArtillery.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,50 @@ if (_vehicle isKindOf "B_Ship_MRLS_01_base_F") then {

_vehicle setFuel 1;
_vehicle setVehicleAmmo 1;
(gunner _vehicle) setAmmo [currentWeapon _vehicle,20];
(gunner _vehicle) doWatch _position;
_vehicle setVariable ["SSS_roundsLeft",_rounds];
_vehicle setVariable ["SSS_doneFiring",false];

if (_dispersion isEqualTo 0) then {
[_vehicle,"Fired",{
params ["_vehicle","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_gunner"];
_thisArgs params ["_magType"];

if (_vehicle getVariable ["SSS_doneFiring",false]) exitWith {
_vehicle removeEventHandler [_thisType,_thisID];
};

if (_magazine != _magType) exitWith {};

private _roundsLeft = (_vehicle getVariable "SSS_roundsLeft") - 1;
_vehicle setVariable ["SSS_roundsLeft",_roundsLeft];
_vehicle setVariable ["SSS_doneFiring",true];

if (_roundsLeft <= 0) then {
_vehicle removeEventHandler [_thisType,_thisID];
};
},[_magType]] call CBA_fnc_addBISEventHandler;

[{
params ["_vehicle","_position","_magType","_rounds"];
params ["_args","_PFHID"];
_args params ["_vehicle","_position","_magType","_rounds"];

if (!alive _vehicle || !alive gunner _vehicle || {_vehicle getVariable ["SSS_doneFiring",false]}) exitWith {
[_PFHID] call CBA_fnc_removePerFrameHandler;
};

_vehicle doArtilleryFire [_position,_magType,_rounds];
},[_vehicle,_position,_magType,_rounds]] call CBA_fnc_execNextFrame;
if (unitReady _vehicle) then {
_vehicle doArtilleryFire [_position,_magType,_rounds];
};
},5,[_vehicle,_position,_magType,_rounds]] call CBA_fnc_addPerFrameHandler;
} else {
[_vehicle,"Fired",{
params ["_vehicle","_weapon","_muzzle","_mode","_ammo","_magazine","_projectile","_gunner"];
_thisArgs params ["_position","_magType","_dispersion"];
_thisArgs params ["_magType","_position","_dispersion"];

if (_vehicle getVariable ["SSS_doneFiring",false]) exitWith {
_vehicle removeEventHandler [_thisType,_thisID];
};

if (_magazine != _magType) exitWith {};

Expand All @@ -128,37 +160,39 @@ if (_vehicle isKindOf "B_Ship_MRLS_01_base_F") then {
if (_roundsLeft <= 0) then {
_vehicle removeEventHandler [_thisType,_thisID];
_vehicle setVariable ["SSS_doneFiring",true];
} else {
_vehicle doArtilleryFire [_position getPos [_dispersion * sqrt random 1,random 360],_magType,1];
};
},[_position,_magType,_dispersion]] call CBA_fnc_addBISEventHandler;
},[_magType,_position,_dispersion]] call CBA_fnc_addBISEventHandler;

_vehicle setVariable ["SSS_roundsLeft",_rounds];

[{
params ["_vehicle","_position","_magType","_dispersion"];
params ["_args","_PFHID"];
_args params ["_vehicle","_position","_magType","_dispersion"];

if (unitReady _vehicle && isNil {_vehicle getVariable "SSS_doneFiring"}) then {
_vehicle doArtilleryFire [_position getPos [_dispersion * sqrt random 1,random 360],_magType,1];
systemChat str CBA_missionTime;
if (!alive _vehicle || !alive gunner _vehicle || {_vehicle getVariable ["SSS_doneFiring",false]}) exitWith {
[_PFHID] call CBA_fnc_removePerFrameHandler;
};

(_vehicle getVariable "SSS_roundsLeft") <= 0 || {!alive _vehicle || !alive gunner _vehicle}
},{},[_vehicle,_position,_magType,_dispersion]] call CBA_fnc_waitUntilAndExecute;
if (unitReady _vehicle) then {
_vehicle doArtilleryFire [_position getPos [_dispersion * sqrt random 1,random 360],_magType,1];
};
},5,[_vehicle,_position,_magType,_dispersion]] call CBA_fnc_addPerFrameHandler;
};
};

// Make sure we have ammo while firing
[{
params ["_entity","_vehicle"];

if (!isNull _entity && {(_entity getVariable "SSS_cooldown") > 0 && alive _vehicle && alive gunner _vehicle && isNil {_vehicle getVariable "SSS_doneFiring"}}) then {
(gunner _vehicle) setAmmo [currentWeapon _vehicle,20];
false
} else {
if (!isNull _entity) then {
["SSS_requestCompleted",[_entity]] call CBA_fnc_globalEvent;
};
(gunner _vehicle) setAmmo [currentWeapon _vehicle,999];

_vehicle setVariable ["SSS_doneFiring",nil];
true
isNull _entity || {(_entity getVariable "SSS_cooldown") <= 0 || !alive _vehicle || !alive gunner _vehicle || {(_vehicle getVariable "SSS_roundsLeft") <= 0}}
},{
params ["_entity","_vehicle"];

if (!isNull _entity) then {
["SSS_requestCompleted",[_entity]] call CBA_fnc_globalEvent;
};
},{},[_entity,_vehicle]] call CBA_fnc_waitUntilAndExecute;

_vehicle setVariable ["SSS_doneFiring",true];
_vehicle setVehicleAmmo 1;
},[_entity,_vehicle]] call CBA_fnc_waitUntilAndExecute;
Loading

0 comments on commit d4dacf3

Please sign in to comment.