mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of https://github.com/acemod/ACE3 into codeCleanupABOnEchtFrameTest
This commit is contained in:
commit
d5f9998ad0
@ -107,3 +107,4 @@ VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
|
||||
Winter <simon@agius-muscat.net>
|
||||
zGuba
|
||||
Drill <drill87@gmail.com>
|
||||
MikeMatrix <m.braun92@gmail.com>
|
||||
|
20
README.md
20
README.md
@ -1,27 +1,21 @@
|
||||
<p align="center">
|
||||
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg"
|
||||
height="112">
|
||||
<img src="https://github.com/acemod/ACE3/blob/master/extras/assets/logo/black/ACE3-Logo.jpg" width="480">
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/acemod/ACE3/releases">
|
||||
<img src="https://img.shields.io/badge/Version-3.2.1-blue.svg"
|
||||
alt="ACE version">
|
||||
<img src="https://img.shields.io/badge/Version-3.2.1-blue.svg" alt="ACE3 version">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/releases/download/v3.2.0/ace3_3.2.1.zip">
|
||||
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg"
|
||||
alt="ACE download">
|
||||
<a href="https://github.com/acemod/ACE3/releases/download/v3.2.1/ace3_3.2.1.zip">
|
||||
<img src="http://img.shields.io/badge/Download-56.5_MB-green.svg" alt="ACE3 download">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/issues">
|
||||
<img src="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues"
|
||||
alt="ACE issues">
|
||||
<img src="http://img.shields.io/github/issues-raw/acemod/ACE3.svg?label=Issues" alt="ACE3 issues">
|
||||
</a>
|
||||
<a href="http://forums.bistudio.com/showthread.php?191716-ACE3-A-collaborative-merger-between-AGM-CSE-and-ACE&p=2935435&viewfull=1#post2935435">
|
||||
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg"
|
||||
alt="BIF thread">
|
||||
<img src="https://img.shields.io/badge/BIF-Thread-lightgrey.svg" alt="BIF thread">
|
||||
</a>
|
||||
<a href="https://github.com/acemod/ACE3/blob/master/LICENSE">
|
||||
<img src="http://img.shields.io/badge/License-GPLv2-red.svg"
|
||||
alt="ACE license">
|
||||
<img src="http://img.shields.io/badge/License-GPLv2-red.svg" alt="ACE3 license">
|
||||
</a>
|
||||
</p>
|
||||
<p align="center"><sup><strong>Requires the latest version of <a href="http://www.armaholic.com/page.php?id=18767">CBA A3</a>. Visit us on <a href="https://www.facebook.com/ACE3Mod">Facebook</a> | <a href="https://www.youtube.com/c/ACE3Mod">YouTube</a> | <a href="https://twitter.com/ACE3Mod">Twitter</a> | <a href="http://www.reddit.com/r/arma/search?q=ACE&restrict_sr=on&sort=new&t=all">Reddit</a></strong></sup></p>
|
||||
|
@ -17,10 +17,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_itemClassname", "_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
|
||||
|
||||
PARAMS_3(_attachToVehicle,_unit,_args);
|
||||
_itemClassname = [_args, 0, ""] call CBA_fnc_defaultParam;
|
||||
private ["_itemVehClass", "_onAtachText", "_selfAttachPosition", "_attachedItem", "_tempObject", "_actionID", "_model"];
|
||||
params ["_attachToVehicle","_unit","_args"];
|
||||
_args params [["_itemClassname","", [""]]];
|
||||
TRACE_3("params",_attachToVehicle,_unit,_itemClassname);
|
||||
|
||||
//Sanity Check (_unit has item in inventory, not over attach limit)
|
||||
if ((_itemClassname == "") || {!(_this call FUNC(canAttach))}) exitWith {ERROR("Tried to attach, but check failed");};
|
||||
@ -69,9 +69,8 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
||||
|
||||
[{
|
||||
private["_angle", "_dir", "_screenPos", "_realDistance", "_up", "_virtualPos", "_virtualPosASL", "_lineInterection"];
|
||||
|
||||
PARAMS_2(_args,_pfID);
|
||||
EXPLODE_6_PVT(_args,_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_actionID);
|
||||
params ["_args","_idPFH"];
|
||||
_args params ["_unit","_attachToVehicle","_itemClassname","_itemVehClass","_onAtachText","_actionID"];
|
||||
|
||||
_virtualPosASL = (eyePos _unit) vectorAdd (positionCameraToWorld [0,0,0.6]) vectorDiff (positionCameraToWorld [0,0,0]);
|
||||
if (cameraView == "EXTERNAL") then {
|
||||
@ -88,7 +87,7 @@ if (_unit == _attachToVehicle) then { //Self Attachment
|
||||
{!([_unit, _attachToVehicle, []] call EFUNC(common,canInteractWith))} ||
|
||||
{!([_attachToVehicle, _unit, _itemClassname] call FUNC(canAttach))}) then {
|
||||
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
[_unit, QGVAR(vehAttach), false] call EFUNC(common,setForceWalkStatus);
|
||||
[] call EFUNC(interaction,hideMouseHint);
|
||||
[_unit, "DefaultAction", (_unit getVariable [QGVAR(placeActionEH), -1])] call EFUNC(common,removeActionEventHandler);
|
||||
|
@ -17,14 +17,14 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_attachToVehicle,_player,_args);
|
||||
private ["_attachLimit", "_attachedObjects","_playerPos"];
|
||||
params ["_attachToVehicle","_player","_args"];
|
||||
_args params [["_itemClassname","", [""]]];
|
||||
TRACE_3("params",_attachToVehicle,_unit,_itemClassname);
|
||||
|
||||
private ["_itemName", "_attachLimit", "_attachedObjects","_playerPos"];
|
||||
|
||||
_itemName = [_args, 0, ""] call CBA_fnc_defaultParam;
|
||||
_attachLimit = [6, 1] select (_player == _attachToVehicle);
|
||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
||||
|
||||
_playerPos = (ACE_player modelToWorldVisual (ACE_player selectionPosition "pilot"));
|
||||
|
||||
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemName in ((itemsWithMagazines _player) + [""])};
|
||||
(canStand _player) && {(_attachToVehicle distance _player) < 7} && {alive _attachToVehicle} && {(count _attachedObjects) < _attachLimit} && {_itemClassname in ((itemsWithMagazines _player) + [""])};
|
||||
|
@ -16,9 +16,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_attachToVehicle,_unit);
|
||||
|
||||
private ["_attachedObjects", "_inRange"];
|
||||
params ["_attachToVehicle", "_unit"];
|
||||
TRACE_2("params",_attachToVehicle,_unit);
|
||||
|
||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
||||
|
||||
|
@ -16,15 +16,16 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_attachToVehicle,_unit);
|
||||
|
||||
private ["_attachedObjects", "_attachedItems", "_itemDisplayName"];
|
||||
private ["_attachedObjects", "_attachedItems", "_itemDisplayName",
|
||||
"_attachedObject", "_attachedIndex", "_itemName", "_minDistance",
|
||||
"_unitPos", "_objectPos"
|
||||
];
|
||||
params ["_attachToVehicle","_unit"],
|
||||
TRACE_2("params",_attachToVehicle,_unit);
|
||||
|
||||
_attachedObjects = _attachToVehicle getVariable [QGVAR(Objects), []];
|
||||
_attachedItems = _attachToVehicle getVariable [QGVAR(ItemNames), []];
|
||||
|
||||
private ["_attachedObject", "_attachedIndex", "_itemName", "_minDistance", "_unitPos", "_objectPos"];
|
||||
|
||||
_attachedObject = objNull;
|
||||
_attachedIndex = -1;
|
||||
_itemName = "";
|
||||
|
@ -18,7 +18,8 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_listed", "_actions", "_item", "_displayName", "_picture", "_action"];
|
||||
PARAMS_2(_target,_player);
|
||||
params ["_target","_player"];
|
||||
TRACE_2("params",_target,_player);
|
||||
|
||||
_listed = [];
|
||||
_actions = [];
|
||||
@ -30,7 +31,7 @@ _actions = [];
|
||||
if (getText (_item >> "ACE_Attachable") != "") then {
|
||||
_displayName = getText(_item >> "displayName");
|
||||
_picture = getText(_item >> "picture");
|
||||
_action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
||||
_action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
||||
_actions pushBack [_action, [], _target];
|
||||
};
|
||||
};
|
||||
@ -43,7 +44,7 @@ _actions = [];
|
||||
if (getText (_item >> "ACE_Attachable") != "") then {
|
||||
_displayName = getText(_item >> "displayName");
|
||||
_picture = getText(_item >> "picture");
|
||||
_action = [_x, _displayName, _picture, {_this call FUNC(attach)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
||||
_action = [_x, _displayName, _picture, {[{_this call FUNC(attach)}, _this] call EFUNC(common,execNextFrame)}, {_this call FUNC(canAttach)}, {}, [_x]] call EFUNC(interact_menu,createAction);
|
||||
_actions pushBack [_action, [], _target];
|
||||
};
|
||||
};
|
||||
|
@ -27,7 +27,8 @@
|
||||
|
||||
private ["_startingOffset", "_startDistanceFromCenter", "_closeInUnitVector", "_closeInMax", "_closeInMin", "_closeInDistance", "_endPosTestOffset", "_endPosTest", "_doesIntersect", "_startingPosShifted", "_startASL", "_endPosShifted", "_endASL", "_attachedObject", "_currentObjects", "_currentItemNames"];
|
||||
|
||||
PARAMS_6(_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
|
||||
params ["_unit", "_attachToVehicle", "_itemClassname", "_itemVehClass", "_onAtachText", "_startingPosition"];
|
||||
TRACE_6("params",_unit,_attachToVehicle,_itemClassname,_itemVehClass,_onAtachText,_startingPosition);
|
||||
|
||||
_startingOffset = _attachToVehicle worldToModel _startingPosition;
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);
|
||||
["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler);
|
||||
|
@ -2,18 +2,18 @@
|
||||
* Author: commy2
|
||||
*
|
||||
* Someone opened your backpack. Execute locally.
|
||||
*
|
||||
*
|
||||
* Argument:
|
||||
* 0: Who accessed your inventory? (Object)
|
||||
* 1: Unit that wields the backpack (Object)
|
||||
* 2: The backpack object (Object)
|
||||
*
|
||||
*
|
||||
* Return value:
|
||||
* None.
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_unit,_target,_backpack);
|
||||
private ["_sounds", "_position"];
|
||||
params ["_target", "_backpack"];
|
||||
|
||||
// do cam shake if the target is the player
|
||||
if ([_target] call EFUNC(common,isPlayer)) then {
|
||||
@ -21,7 +21,6 @@ if ([_target] call EFUNC(common,isPlayer)) then {
|
||||
};
|
||||
|
||||
// play a rustling sound
|
||||
private ["_sounds", "_position"];
|
||||
|
||||
_sounds = [
|
||||
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
|
||||
|
@ -2,21 +2,21 @@
|
||||
* Author: commy2
|
||||
*
|
||||
* Returns the unit that has the given backpack object equipped.
|
||||
*
|
||||
*
|
||||
* Argument:
|
||||
* 0: A backpack object (Object)
|
||||
*
|
||||
* 0: Executing Unit (Object)
|
||||
* 1: A backpack object (Object)
|
||||
*
|
||||
* Return value:
|
||||
* Unit that has the backpack equipped. (Object)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
scopeName "main";
|
||||
|
||||
private ["_backpack", "_unit"];
|
||||
|
||||
_backpack = _this select 0;
|
||||
|
||||
_unit = objNull;
|
||||
params ["_unit","_backpack"];
|
||||
_target = objNull;
|
||||
{
|
||||
if (backpackContainer _x == _backpack) exitWith {_unit = _x};
|
||||
} forEach (allUnits + allDeadMen);
|
||||
_unit
|
||||
if (backpackContainer _x == _backpack) then {_target = _x; breakTo "main"};
|
||||
} count nearestObjects [_unit, ["Man"], 5];
|
||||
if (isNull _target) exitWith {ACE_Player};
|
||||
_target
|
||||
|
@ -11,9 +11,8 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_backpack", "_config"];
|
||||
|
||||
_backpack = _this select 0;
|
||||
private ["_config"];
|
||||
params ["_backpack"];
|
||||
|
||||
if (typeName _backpack == "OBJECT") then {
|
||||
_backpack = typeOf _backpack;
|
||||
|
@ -2,29 +2,27 @@
|
||||
* Author: commy2
|
||||
*
|
||||
* Handle the open inventory event. Display message on traget client.
|
||||
*
|
||||
*
|
||||
* Argument:
|
||||
* Input from "InventoryOpened" eventhandler
|
||||
*
|
||||
*
|
||||
* Return value:
|
||||
* false. Always open the inventory dialog. (Bool)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_backpack"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_backpack = _this select 1;
|
||||
private "_target";
|
||||
params ["","_backpack"];
|
||||
|
||||
// exit if the target is not a backpack
|
||||
if !([_backpack] call FUNC(isBackpack)) exitWith {};
|
||||
|
||||
// get the unit that wears the backpack object
|
||||
private "_target";
|
||||
_target = [_backpack] call FUNC(getBackpackAssignedUnit);
|
||||
_target = _this call FUNC(getBackpackAssignedUnit);
|
||||
|
||||
if (isNull _target) exitWith {false};
|
||||
// raise event on target unit
|
||||
["backpackOpened", _target, [_unit, _target, _backpack]] call EFUNC(common,targetEvent);
|
||||
["backpackOpened", _target, [_target, _backpack]] call EFUNC(common,targetEvent);
|
||||
|
||||
// return false to open inventory as usual
|
||||
false
|
||||
|
@ -1,9 +1,9 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_wall", "_paper"];
|
||||
private "_paper";
|
||||
|
||||
_wall = _this select 0;
|
||||
params ["_wall"];
|
||||
|
||||
if (local _wall) then {
|
||||
_paper = "UserTexture_1x2_F" createVehicle position _wall;
|
||||
|
@ -5,6 +5,13 @@ class ACE_Settings {
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(requireSurrender) {
|
||||
displayName = CSTRING(ModuleSettings_requireSurrender_name);
|
||||
description = CSTRING(ModuleSettings_requireSurrender_description);
|
||||
typeName = "SCALAR";
|
||||
values[] = {ECSTRING(common,Disabled), CSTRING(SurrenderOnly), CSTRING(SurrenderOrNoWeapon)};
|
||||
value = 1;
|
||||
};
|
||||
class GVAR(allowSurrender) {
|
||||
displayName = CSTRING(ModuleSettings_allowSurrender_name);
|
||||
description = CSTRING(ModuleSettings_allowSurrender_description);
|
||||
|
@ -189,6 +189,26 @@ class CfgVehicles {
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
class requireSurrender {
|
||||
displayName = CSTRING(ModuleSettings_requireSurrender_name);
|
||||
description = CSTRING(ModuleSettings_requireSurrender_description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class disable {
|
||||
name = ECSTRING(common,No);
|
||||
value = 0;
|
||||
};
|
||||
class Surrender {
|
||||
name = CSTRING(SurrenderOnly);
|
||||
value = 1;
|
||||
default = 1;
|
||||
};
|
||||
class SurrenderOrNoWeapon {
|
||||
name = CSTRING(SurrenderOrNoWeapon);
|
||||
value = 2;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription: ModuleDescription {
|
||||
description = CSTRING(ModuleSettings_Description);
|
||||
|
@ -16,11 +16,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
params ["_unit", "_target"];
|
||||
//Check sides, Player has cableTie, target is alive and not already handcuffed
|
||||
|
||||
(GVAR(allowHandcuffOwnSide) || {(side _unit) != (side _target)}) &&
|
||||
("ACE_CableTie" in (items _unit)) &&
|
||||
{alive _target} &&
|
||||
{!(_target getVariable [QGVAR(isHandcuffed), false])}
|
||||
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
|
||||
(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2)))
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
params ["_unit", "_target"];
|
||||
//Alive, handcuffed, not being escored, and not unconscious
|
||||
|
||||
(_target getVariable [QGVAR(isHandcuffed), false]) &&
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
params ["_unit", "_target"];
|
||||
|
||||
_target getVariable [QGVAR(isHandcuffed), false]
|
||||
|| {_target getVariable [QGVAR(isSurrendering), false]}
|
||||
|
@ -18,8 +18,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_objects"];
|
||||
|
||||
PARAMS_3(_unit,_target,_vehicle);
|
||||
params ["_unit", "_target","_vehicle"];
|
||||
|
||||
if (isNull _target) then {
|
||||
_objects = attachedObjects _unit;
|
||||
@ -28,7 +27,7 @@ if (isNull _target) then {
|
||||
};
|
||||
|
||||
if (isNull _vehicle) then {
|
||||
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship_F"], 10];
|
||||
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10];
|
||||
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
params ["_unit", "_target"];
|
||||
|
||||
//Unit is handcuffed and not currently being escorted
|
||||
_target getVariable [QGVAR(isHandcuffed), false] &&
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
DEFAULT_PARAM(1,_target,objNull);
|
||||
params ["_unit", ["_target", objNull]];
|
||||
|
||||
if (isNull _target) then {
|
||||
_target = _unit getVariable [QGVAR(escortedUnit), objNull];
|
||||
|
@ -16,12 +16,12 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_newSurrenderState);
|
||||
|
||||
private "_returnValue";
|
||||
|
||||
params ["_unit", "_newSurrenderState"];
|
||||
|
||||
_returnValue = if (_newSurrenderState) then {
|
||||
//no weapon equiped AND not currently surrendering and
|
||||
//no weapon equiped AND not currently surrendering and
|
||||
GVAR(allowSurrender) && {(currentWeapon _unit) == ""} && {!(_unit getVariable [QGVAR(isSurrendering), false])}
|
||||
} else {
|
||||
//is Surrendering
|
||||
|
@ -18,6 +18,6 @@
|
||||
|
||||
private ["_cargo"];
|
||||
|
||||
PARAMS_2(_player,_unit);
|
||||
params ["_player", "_unit"];
|
||||
|
||||
((vehicle _unit) != _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}
|
||||
|
@ -16,10 +16,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
|
||||
_unit removeItem "ACE_CableTie";
|
||||
params ["_unit", "_target"];
|
||||
|
||||
playSound3D [QUOTE(PATHTO_R(sounds\cable_tie_zipping.ogg)), objNull, false, (getPosASL _target), 1, 1, 10];
|
||||
|
||||
["SetHandcuffed", [_target], [_target, true]] call EFUNC(common,targetEvent);
|
||||
|
||||
_unit removeItem "ACE_CableTie";
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_unit,_target,_state);
|
||||
params ["_unit", "_target","_state"];
|
||||
|
||||
if (_state) then {
|
||||
if (_unit getVariable [QGVAR(isEscorting), false]) exitWith {};
|
||||
|
@ -19,6 +19,7 @@
|
||||
private ["_weapon", "_listedItemClasses", "_actions", "_allGear"];
|
||||
|
||||
PARAMS_2(_player,_unit);
|
||||
params ["_player", "_unit"];
|
||||
|
||||
_weapon = currentWeapon _player;
|
||||
if (_weapon == primaryWeapon _player && {_weapon != ""}) then {
|
||||
|
@ -17,9 +17,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_unit,_target,_vehicle);
|
||||
private "_objects";
|
||||
|
||||
params ["_unit", "_target","_vehicle"];
|
||||
|
||||
if (isNull _target) then {
|
||||
_objects = attachedObjects _unit;
|
||||
_objects = [_objects, {_this getVariable [QGVAR(isHandcuffed), false]}] call EFUNC(common,filter);
|
||||
@ -28,7 +29,7 @@ if (isNull _target) then {
|
||||
if (isNull _target) exitWith {};
|
||||
|
||||
if (isNull _vehicle) then {
|
||||
_objects = nearestObjects [_unit, ["Car_F", "Tank_F", "Helicopter_F", "Boat_F", "Plane_F"], 10];
|
||||
_objects = nearestObjects [_unit, ["Car", "Tank", "Helicopter", "Plane", "Ship"], 10];
|
||||
if ((count _objects) > 0) then {_vehicle = _objects select 0;};
|
||||
};
|
||||
if (isNull _vehicle) exitWith {};
|
||||
|
@ -15,6 +15,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
params ["_unit", "_target"];
|
||||
|
||||
["SetHandcuffed", [_target], [_target, false]] call EFUNC(common,targetEvent);
|
||||
|
@ -16,6 +16,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_target);
|
||||
params ["_unit", "_target"];
|
||||
|
||||
["MoveOutCaptive", [_target], [_target]] call EFUNC(common,targetEvent);
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_vehicle,_dontcare,_unit);
|
||||
params ["_vehicle", "_dontcare","_unit"];
|
||||
|
||||
if (local _unit) then {
|
||||
if (_unit getVariable [QGVAR(isEscorting), false]) then {
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_vehicle,_dontcare,_unit);
|
||||
params ["_vehicle", "_dontcare","_unit"];
|
||||
|
||||
if ((local _unit) && {_unit getVariable [QGVAR(isHandcuffed), false]}) then {
|
||||
private ["_cargoIndex"];
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_oldUnit);
|
||||
params ["_oldUnit"];
|
||||
|
||||
if (!local _oldUnit) exitWith {};
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_2_PVT(_this,_unit,_isUnconc);
|
||||
params ["_unit","_isUnconc"];
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_newUnit,_oldUnit);
|
||||
params ["_newUnit","_oldUnit"];
|
||||
|
||||
//set showHUD based on new unit status:
|
||||
if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_dead);
|
||||
params ["_unit","_dead"];
|
||||
|
||||
if (!local _unit) exitWith {};
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
params ["_unit"];
|
||||
|
||||
// prevent players from throwing grenades (added to all units)
|
||||
[_unit, "Throw", {((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}}, {}] call EFUNC(common,addActionEventhandler);
|
||||
|
@ -17,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_zeusIsOpen);
|
||||
params ["_unit","_zeusIsOpen"];
|
||||
|
||||
//set showHUD based on unit status:
|
||||
if (!_zeusIsOpen) then {
|
||||
|
@ -13,7 +13,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_logic);
|
||||
params ["_logic"];
|
||||
|
||||
[_logic, QGVAR(allowHandcuffOwnSide), "allowHandcuffOwnSide"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(allowSurrender), "allowSurrender"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(requireSurrender), "requireSurrender"] call EFUNC(common,readSettingFromModule);
|
||||
|
@ -17,9 +17,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_logic,_units,_activated);
|
||||
private ["_bisMouseOver", "_mouseOverObject"];
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
if (!_activated) exitWith {};
|
||||
|
||||
if (local _logic) then {
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_state);
|
||||
|
||||
params ["_unit","_state"];
|
||||
|
||||
if (!local _unit) exitwith {
|
||||
ERROR("running setHandcuffed on remote unit");
|
||||
@ -43,7 +42,7 @@ if (_state) then {
|
||||
|
||||
// fix anim on mission start (should work on dedicated servers)
|
||||
[{
|
||||
PARAMS_1(_unit);
|
||||
params ["_unit"];
|
||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||
|
@ -16,8 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_unit,_state);
|
||||
|
||||
params ["_unit","_state"];
|
||||
|
||||
if (!local _unit) exitwith {
|
||||
ERROR("running surrender on remote unit");
|
||||
|
@ -16,10 +16,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_target,_vehicle);
|
||||
|
||||
private ["_cargoIndex"];
|
||||
|
||||
params ["_target","_vehicle"];
|
||||
|
||||
_target moveInCargo _vehicle;
|
||||
_target assignAsCargo _vehicle;
|
||||
_cargoIndex = _vehicle getCargoIndex _target;
|
||||
|
@ -15,8 +15,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_unit);
|
||||
|
||||
params ["_unit"];
|
||||
_unit setVariable [QGVAR(CargoIndex), -1, true];
|
||||
|
||||
moveOut _unit;
|
||||
|
@ -221,5 +221,21 @@
|
||||
<German>Spieler können kapitulieren, nachdem sie ihre Waffe geholstert haben</German>
|
||||
<Portuguese>Jogadores podem se render depois de guardar sua arma</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_name">
|
||||
<English>Require surrendering</English>
|
||||
<Polish>Wymagaj kapitulacji</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleSettings_requireSurrender_description">
|
||||
<English>Require Players to surrender before they can be arrested</English>
|
||||
<Polish>Wymagaj od graczy kapitulacji zanim będzie można ich zaaresztować</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_SurrenderOnly">
|
||||
<English>Surrendering only</English>
|
||||
<Polish>Tylko kapitulacja</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_SurrenderOrNoWeapon">
|
||||
<English>Surrendering or No weapon</English>
|
||||
<Polish>Kapitulacja lub brak broni</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
1
addons/cargo/$PBOPREFIX$
Normal file
1
addons/cargo/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\cargo
|
9
addons/cargo/ACE_Settings.hpp
Normal file
9
addons/cargo/ACE_Settings.hpp
Normal file
@ -0,0 +1,9 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(enable) {
|
||||
displayName = CSTRING(ModuleSettings_enable);
|
||||
description = CSTRING(ModuleSettings_enable_Description);
|
||||
typeName = "BOOL";
|
||||
value = 1;
|
||||
category = CSTRING(settingsCategory);
|
||||
};
|
||||
};
|
80
addons/cargo/CfgEventHandlers.hpp
Normal file
80
addons/cargo/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,80 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Killed_EventHandlers {
|
||||
class All {
|
||||
init = QUOTE(call FUNC(handleDestroyed));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
class StaticWeapon {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
};
|
||||
};
|
||||
|
||||
class ReammoBox_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject));
|
||||
};
|
||||
};
|
||||
|
||||
class Cargo_base_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class CargoNet_01_box_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Land_CargoBox_V1_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Land_PaperBox_closed_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Car {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Tank {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Helicopter {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Plane {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
|
||||
class Ship_F {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DFUNC(initVehicle));
|
||||
};
|
||||
};
|
||||
};
|
301
addons/cargo/CfgVehicles.hpp
Normal file
301
addons/cargo/CfgVehicles.hpp
Normal file
@ -0,0 +1,301 @@
|
||||
|
||||
class CfgVehicles {
|
||||
|
||||
class ACE_Module;
|
||||
class ACE_moduleCargoSettings: ACE_Module {
|
||||
scope = 2;
|
||||
displayName = CSTRING(SettingsModule_DisplayName);
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Cargo_ca.paa));
|
||||
category = "ACE";
|
||||
function = QUOTE(DFUNC(moduleSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class enable {
|
||||
displayName = CSTRING(ModuleSettings_enable);
|
||||
description = CSTRING(ModuleSettings_enable_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = CSTRING(SettingsModule_Description);
|
||||
sync[] = {};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class LandVehicle;
|
||||
class Car: LandVehicle {
|
||||
GVAR(space) = 4;
|
||||
GVAR(hasCargo) = 1;
|
||||
class ACE_Cargo {
|
||||
/*
|
||||
class Cargo {
|
||||
class ACE_medicalSupplyCrate {
|
||||
type = "ACE_medicalSupplyCrate";
|
||||
amount = 1;
|
||||
};
|
||||
};*/
|
||||
};
|
||||
};
|
||||
|
||||
class Tank: LandVehicle {
|
||||
GVAR(space) = 4;
|
||||
GVAR(hasCargo) = 1;
|
||||
};
|
||||
class Car_F;
|
||||
class Truck_F: Car_F {
|
||||
GVAR(space) = 8;
|
||||
GVAR(hasCargo) = 1;
|
||||
};
|
||||
|
||||
class Air;
|
||||
// Repair helicopters
|
||||
class Helicopter: Air {
|
||||
GVAR(space) = 8;
|
||||
GVAR(hasCargo) = 1;
|
||||
};
|
||||
|
||||
class Heli_Transport_02_base_F;
|
||||
class I_Heli_Transport_02_F : Heli_Transport_02_base_F {
|
||||
GVAR(space) = 20;
|
||||
GVAR(hasCargo) = 1;
|
||||
};
|
||||
|
||||
// Repair fixed wing aircraft
|
||||
class Plane: Air {
|
||||
GVAR(space) = 4;
|
||||
GVAR(hasCargo) = 1;
|
||||
};
|
||||
|
||||
// boats
|
||||
class Ship;
|
||||
class Ship_F: Ship {
|
||||
GVAR(space) = 4;
|
||||
GVAR(hasCargo) = 1;
|
||||
};
|
||||
|
||||
// Static weapons
|
||||
class StaticWeapon: LandVehicle {
|
||||
GVAR(size) = 2; // 1 = small, 2 = large
|
||||
GVAR(canLoad) = 1;
|
||||
};
|
||||
|
||||
class StaticMortar;
|
||||
class Mortar_01_base_F: StaticMortar {
|
||||
GVAR(size) = 2; // 1 = small, 2 = large
|
||||
GVAR(canLoad) = 1;
|
||||
};
|
||||
|
||||
// Ammo boxes
|
||||
class ThingX;
|
||||
class ReammoBox_F: ThingX {
|
||||
GVAR(size) = 2; // 1 = small, 2 = large
|
||||
GVAR(canLoad) = 1;
|
||||
};
|
||||
|
||||
class Scrapyard_base_F;
|
||||
class Land_PaperBox_closed_F: Scrapyard_base_F {
|
||||
GVAR(space) = 10;
|
||||
GVAR(hasCargo) = 1;
|
||||
GVAR(size) = 11;
|
||||
GVAR(canLoad) = 1;
|
||||
XEH_ENABLED;
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
displayName = ECSTRING(interaction,MainAction);
|
||||
distance = 5;
|
||||
condition = QUOTE(true);
|
||||
statement = "";
|
||||
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
|
||||
selection = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Cargo_base_F: ThingX {
|
||||
GVAR(space) = 4;
|
||||
GVAR(hasCargo) = 1;
|
||||
GVAR(size) = 4;
|
||||
GVAR(canLoad) = 1;
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
displayName = ECSTRING(interaction,MainAction);
|
||||
distance = 5;
|
||||
condition = QUOTE(true);
|
||||
statement = "";
|
||||
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
|
||||
selection = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
class Cargo10_base_F: Cargo_base_F {
|
||||
GVAR(space) = 14;
|
||||
GVAR(size) = 15;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_blue_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_brick_red_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_cyan_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_grey_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_light_blue_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_light_green_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_military_green_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Ruins_F;
|
||||
class Land_Cargo20_military_ruins_F: Ruins_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_orange_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_red_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_sand_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_vr_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_white_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo20_yellow_F: Cargo_base_F {
|
||||
GVAR(space) = 49;
|
||||
GVAR(size) = 50;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
|
||||
|
||||
class Land_Cargo40_blue_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_brick_red_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_cyan_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_grey_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_light_blue_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_light_green_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_military_green_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_military_ruins_F: Ruins_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_orange_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_red_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_sand_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_vr_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_white_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
class Land_Cargo40_yellow_F: Cargo_base_F {
|
||||
GVAR(space) = 99;
|
||||
GVAR(size) = 100;
|
||||
XEH_ENABLED;
|
||||
};
|
||||
// small
|
||||
class Land_CargoBox_V1_F: ThingX {
|
||||
GVAR(space) = 7;
|
||||
GVAR(hasCargo) = 1;
|
||||
GVAR(size) = 7;
|
||||
XEH_ENABLED;
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
displayName = ECSTRING(interaction,MainAction);
|
||||
distance = 5;
|
||||
condition = QUOTE(true);
|
||||
statement = "";
|
||||
icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa";
|
||||
selection = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
};
|
BIN
addons/cargo/UI/Icon_Module_Cargo_ca.paa
Normal file
BIN
addons/cargo/UI/Icon_Module_Cargo_ca.paa
Normal file
Binary file not shown.
BIN
addons/cargo/UI/Icon_load.paa
Normal file
BIN
addons/cargo/UI/Icon_load.paa
Normal file
Binary file not shown.
27
addons/cargo/XEH_preInit.sqf
Normal file
27
addons/cargo/XEH_preInit.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(canLoadItemIn);
|
||||
PREP(canUnloadItem);
|
||||
PREP(canLoad);
|
||||
PREP(findNearestVehicle);
|
||||
PREP(getCargoSpaceLeft);
|
||||
PREP(GetSizeItem);
|
||||
PREP(initObject);
|
||||
PREP(initVehicle);
|
||||
PREP(handleDestroyed);
|
||||
PREP(moduleSettings);
|
||||
PREP(loadItem);
|
||||
PREP(onMenuOpen);
|
||||
PREP(unloadItem);
|
||||
PREP(validateCargoSpace);
|
||||
PREP(startLoadIn);
|
||||
PREP(startUnload);
|
||||
GVAR(initializedItemClasses) = [];
|
||||
|
||||
if (isServer) then {
|
||||
["cargo_hideItem", {params ["_object", "_status"]; _object hideObjectGlobal _status;}] call EFUNC(common,addEventHandler);
|
||||
};
|
||||
|
||||
ADDON = true;
|
18
addons/cargo/config.cpp
Normal file
18
addons/cargo/config.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_interaction"};
|
||||
author[] = {"commy2", "Glowbal"};
|
||||
authorUrl = "https://ace3mod.com/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "menu.hpp"
|
||||
#include "ACE_Settings.hpp"
|
31
addons/cargo/functions/fnc_canLoad.sqf
Normal file
31
addons/cargo/functions/fnc_canLoad.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if player can load item into the nearest vehicle
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
* 1: Object to load <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Can load <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_player", "_object"];
|
||||
|
||||
private ["_nearestVehicle"];
|
||||
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
||||
|
||||
if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then {
|
||||
|
||||
{
|
||||
if ([_object, _x] call FUNC(canLoadItemIn)) exitwith {_nearestVehicle = _x};
|
||||
}foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
|
||||
};
|
||||
|
||||
if (isNull _nearestVehicle) exitwith {false};
|
||||
|
||||
[_object, _nearestVehicle] call FUNC(canLoadItemIn);
|
23
addons/cargo/functions/fnc_canLoadItemIn.sqf
Normal file
23
addons/cargo/functions/fnc_canLoadItemIn.sqf
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if item can be loaded into other Object
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Item Object <OBJECT>
|
||||
* 1: Holder Object (vehicle) <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Can load in <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_item", "_vehicle"];
|
||||
|
||||
if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitwith {false};
|
||||
|
||||
private "_itemSize";
|
||||
_itemSize = ([_item] call FUNC(getSizeItem));
|
||||
_itemSize > 0 && {alive _item && alive _vehicle} && {(_item distance _vehicle <= MAX_LOAD_DISTANCE)} && {_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))};
|
39
addons/cargo/functions/fnc_canUnloadItem.sqf
Normal file
39
addons/cargo/functions/fnc_canUnloadItem.sqf
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Author: Glowbal, ViperMaul
|
||||
* Check if item can be unloaded
|
||||
*
|
||||
* Arguments:
|
||||
* 0: loaded object <OBJECT>
|
||||
* 1: Object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Can be unloaded <BOOL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_loaded", "_validVehiclestate", "_emptyPos"];
|
||||
params ["_item", "_vehicle"];
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
||||
if !(_item in _loaded) exitwith {false};
|
||||
|
||||
_validVehiclestate = true;
|
||||
_emptyPos = [];
|
||||
if (_vehicle isKindOf "Ship" ) then {
|
||||
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
|
||||
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot.
|
||||
} else {
|
||||
if (_vehicle isKindOf "Air" ) then {
|
||||
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
|
||||
_emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition);
|
||||
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
|
||||
} else {
|
||||
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
|
||||
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]);
|
||||
};
|
||||
};
|
||||
|
||||
if (!_validVehiclestate) exitwith { false };
|
||||
(count _emptyPos != 0);
|
34
addons/cargo/functions/fnc_findNearestVehicle.sqf
Normal file
34
addons/cargo/functions/fnc_findNearestVehicle.sqf
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Get nearest vehicle, priority car, air, tank, ship
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Vehicle that is in Distance <OBJECT>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_loadCar", "_loadHelicopter", "_loadTank", "_loadShip", "_loadContainer"];
|
||||
params ["_unit"];
|
||||
|
||||
_loadCar = nearestObject [_unit, "car"];
|
||||
if (_unit distance _loadCar <= MAX_LOAD_DISTANCE) exitwith {_loadCar};
|
||||
|
||||
_loadHelicopter = nearestObject [_unit, "air"];
|
||||
if (_unit distance _loadHelicopter <= MAX_LOAD_DISTANCE) exitwith {_loadHelicopter};
|
||||
|
||||
_loadTank = nearestObject [_unit, "tank"];
|
||||
if (_unit distance _loadTank <= MAX_LOAD_DISTANCE) exitwith {_loadTank};
|
||||
|
||||
_loadShip = nearestObject [_unit, "ship"];
|
||||
if (_unit distance _loadShip <= MAX_LOAD_DISTANCE) exitwith {_loadShip};
|
||||
|
||||
_loadContainer = nearestObject [_unit,"Cargo_base_F"];
|
||||
if (_unit distance _loadContainer <= MAX_LOAD_DISTANCE) exitwith {_loadContainer};
|
||||
|
||||
objNull;
|
17
addons/cargo/functions/fnc_getCargoSpaceLeft.sqf
Normal file
17
addons/cargo/functions/fnc_getCargoSpaceLeft.sqf
Normal file
@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Get the cargo space left on object
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Cargo space left <NUMBER>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle"];
|
||||
_vehicle getvariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space))];
|
22
addons/cargo/functions/fnc_getSizeItem.sqf
Normal file
22
addons/cargo/functions/fnc_getSizeItem.sqf
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Get the cargo size of an object
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Cargo size. <NUMBER> (default: -1)
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_config";
|
||||
params ["_item"];
|
||||
_config = (configFile >> "CfgVehicles" >> typeof _item >> QGVAR(size));
|
||||
if (isNumber (_config)) exitwith {
|
||||
_item getvariable [QGVAR(size), getNumber (_config)];
|
||||
};
|
||||
-1
|
29
addons/cargo/functions/fnc_handleDestroyed.sqf
Normal file
29
addons/cargo/functions/fnc_handleDestroyed.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Handle object being destroyed
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle"];
|
||||
|
||||
private["_loaded"];
|
||||
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
||||
if (count _loaded == 0) exitwith {};
|
||||
|
||||
{
|
||||
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment?
|
||||
deleteVehicle _x;
|
||||
//_x setDamage 1;
|
||||
} count _loaded;
|
||||
|
||||
[_vehicle] call FUNC(validateCargoSpace);
|
28
addons/cargo/functions/fnc_initObject.sqf
Normal file
28
addons/cargo/functions/fnc_initObject.sqf
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Initialize variables for loadable objects. Called from init EH.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Any object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_object"];
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canLoad)) != 1) exitwith {};
|
||||
|
||||
private ["_type", "_action"];
|
||||
_type = typeOf _object;
|
||||
|
||||
// do nothing if the class is already initialized
|
||||
if (_type in GVAR(initializedItemClasses)) exitWith {};
|
||||
GVAR(initializedItemClasses) pushBack _type;
|
||||
|
||||
_action = [QGVAR(load), localize LSTRING(loadObject), QUOTE(PATHTOF(UI\Icon_load.paa)), {[_player, _target] call FUNC(startLoadIn)}, {GVAR(enable) && {[_player, _target] call FUNC(canLoad)}}] call EFUNC(interact_menu,createAction);
|
||||
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);
|
58
addons/cargo/functions/fnc_initVehicle.sqf
Normal file
58
addons/cargo/functions/fnc_initVehicle.sqf
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* initalize vehicle. Adds open caro menu action if available
|
||||
*
|
||||
* Arguments:
|
||||
* 0: vehicle <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_vehicle"];
|
||||
TRACE_1("params", _vehicle);
|
||||
|
||||
private ["_type", "_initializedClasses"];
|
||||
_type = typeOf _vehicle;
|
||||
_initializedClasses = GETMVAR(GVAR(initializedClasses),[]);
|
||||
|
||||
if (isServer) then {
|
||||
{
|
||||
if (isClass _x) then {
|
||||
private ["_className", "_amount","_position","_object"];
|
||||
_className = getText (_x >> "type");
|
||||
_amount = getNumber (_x >> "amount");
|
||||
_position = getPos _vehicle;
|
||||
_position set [1, (_position select 1) + 1];
|
||||
_position set [2, (_position select 2) + 7.5];
|
||||
for "_i" from 1 to _amount do {
|
||||
_object = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"];
|
||||
if !([_object, _vehicle] call FUNC(loadItem)) exitwith {
|
||||
deleteVehicle _object;
|
||||
};
|
||||
};
|
||||
};
|
||||
nil
|
||||
} count ("true" configClasses (configFile >> "CfgVehicles" >> _type >> "ACE_Cargo" >> "Cargo"));
|
||||
};
|
||||
|
||||
// do nothing if the class is already initialized
|
||||
if (_type in _initializedClasses) exitWith {};
|
||||
// set class as initialized
|
||||
_initializedClasses pushBack _type;
|
||||
SETMVAR(GVAR(initializedClasses),_initializedClasses);
|
||||
|
||||
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitwith {};
|
||||
|
||||
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
||||
_condition = {GVAR(enable)};
|
||||
_text = localize LSTRING(openMenu);
|
||||
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
|
||||
_icon = "";
|
||||
|
||||
_action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction);
|
||||
[_type, 0, ["ACE_MainActions"], _action] call EFUNC(interact_menu,addActionToClass);
|
34
addons/cargo/functions/fnc_loadItem.sqf
Normal file
34
addons/cargo/functions/fnc_loadItem.sqf
Normal file
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Load object into vehicle
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
* 1: Vehicle <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_loaded", "_space", "_itemSize"];
|
||||
params ["_item", "_vehicle"];
|
||||
|
||||
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitwith {false};
|
||||
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
||||
_loaded pushback _item;
|
||||
_vehicle setvariable [QGVAR(loaded), _loaded, true];
|
||||
|
||||
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
||||
_itemSize = [_item] call FUNC(getSizeItem);
|
||||
_vehicle setvariable [QGVAR(space), _space - _itemSize, true];
|
||||
|
||||
detach _item;
|
||||
_item attachTo [_vehicle,[0,0,100]];
|
||||
["cargo_hideItem", [_item, true]] call EFUNC(common,serverEvent);
|
||||
|
||||
true;
|
21
addons/cargo/functions/fnc_moduleSettings.sqf
Normal file
21
addons/cargo/functions/fnc_moduleSettings.sqf
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Module for adjusting the cargo settings
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);
|
45
addons/cargo/functions/fnc_onMenuOpen.sqf
Normal file
45
addons/cargo/functions/fnc_onMenuOpen.sqf
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Handle the UI data display
|
||||
*
|
||||
* Arguments:
|
||||
* 0: display <DISPLAY>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
params["_display"];
|
||||
|
||||
uiNamespace setvariable [QGVAR(menuDisplay), _display];
|
||||
|
||||
[{
|
||||
private ["_display","_loaded", "_ctrl", "_label"];
|
||||
disableSerialization;
|
||||
_display = uiNamespace getvariable QGVAR(menuDisplay);
|
||||
if (isnil "_display") exitwith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
if (isNull GVAR(interactionVehicle) || ACE_player distance GVAR(interactionVehicle) >= 10) exitwith {
|
||||
closeDialog 0;
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_loaded = GVAR(interactionVehicle) getvariable [QGVAR(loaded), []];
|
||||
_ctrl = _display displayCtrl 100;
|
||||
_label = _display displayCtrl 2;
|
||||
|
||||
lbClear _ctrl;
|
||||
{
|
||||
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName"));
|
||||
true
|
||||
} count _loaded;
|
||||
|
||||
_label ctrlSetText format[localize LSTRING(labelSpace), [GVAR(interactionVehicle)] call DFUNC(getCargoSpaceLeft)];
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
29
addons/cargo/functions/fnc_startLoadIn.sqf
Normal file
29
addons/cargo/functions/fnc_startLoadIn.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Start load item
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Any object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_player", "_object"];
|
||||
|
||||
private ["_nearestVehicle"];
|
||||
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
||||
|
||||
if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then {
|
||||
|
||||
{
|
||||
if ([_object, _x] call FUNC(canLoadItemIn)) exitwith {_nearestVehicle = _x};
|
||||
}foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
|
||||
};
|
||||
|
||||
if (isNull _nearestVehicle) exitwith {false};
|
||||
[_object, _nearestVehicle] call FUNC(loadItem);
|
31
addons/cargo/functions/fnc_startUnload.sqf
Normal file
31
addons/cargo/functions/fnc_startUnload.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Start unload action
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
|
||||
disableSerialization;
|
||||
_display = uiNamespace getvariable QGVAR(menuDisplay);
|
||||
if (isnil "_display") exitwith {};
|
||||
|
||||
_loaded = GVAR(interactionVehicle) getvariable [QGVAR(loaded), []];
|
||||
if (count _loaded == 0) exitwith {};
|
||||
|
||||
_ctrl = _display displayCtrl 100;
|
||||
|
||||
_selected = (lbCurSel _ctrl) max 0;
|
||||
|
||||
if (count _loaded <= _selected) exitwith {};
|
||||
_item = _loaded select _selected;
|
||||
|
||||
[_item, GVAR(interactionVehicle)] call FUNC(unloadItem);
|
62
addons/cargo/functions/fnc_unloadItem.sqf
Normal file
62
addons/cargo/functions/fnc_unloadItem.sqf
Normal file
@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Author: Glowbal, ViperMaul
|
||||
* Unload object from vehicle
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
* 1: Vehicle <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
|
||||
params ["_item", "_vehicle"];
|
||||
|
||||
if !([_item, _vehicle] call FUNC(canUnloadItem)) exitwith {
|
||||
false
|
||||
};
|
||||
|
||||
_validVehiclestate = true;
|
||||
_emptyPos = [];
|
||||
if (_vehicle isKindOf "Ship" ) then {
|
||||
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
|
||||
TRACE_1("SHIP Ground Check", getPosATL _vehicle );
|
||||
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot.
|
||||
} else {
|
||||
if (_vehicle isKindOf "Air" ) then {
|
||||
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
|
||||
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
|
||||
_emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition);
|
||||
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
|
||||
} else {
|
||||
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
|
||||
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
|
||||
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeOf _item]);
|
||||
};
|
||||
};
|
||||
|
||||
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
|
||||
if (!_validVehiclestate) exitwith { false };
|
||||
|
||||
if (count _emptyPos == 0) exitwith { false }; //consider displaying text saying there are no safe places to exit the vehicle
|
||||
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
||||
_loaded = _loaded - [_item];
|
||||
_vehicle setvariable [QGVAR(loaded), _loaded, true];
|
||||
|
||||
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
||||
_itemSize = [_item] call FUNC(getSizeItem);
|
||||
_vehicle setvariable [QGVAR(space), (_space + _itemSize), true];
|
||||
|
||||
detach _item;
|
||||
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
|
||||
["cargo_hideItem", [_item, false]] call EFUNC(common,serverEvent);
|
||||
|
||||
// TOOO maybe drag/carry the unloaded item?
|
||||
|
||||
true;
|
32
addons/cargo/functions/fnc_validateCargoSpace.sqf
Normal file
32
addons/cargo/functions/fnc_validateCargoSpace.sqf
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Validate the vehicle cargo space
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Object <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_loaded", "_newLoaded", "_totalSpaceOccupied"];
|
||||
params ["_vehicle"];
|
||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
||||
_newLoaded = [];
|
||||
_totalSpaceOccupied = 0;
|
||||
{
|
||||
if !(isNull _x) then {
|
||||
_newLoaded pushback _x;
|
||||
_totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem));
|
||||
};
|
||||
true
|
||||
} count _loaded;
|
||||
|
||||
if (count _loaded != count _newLoaded) then {
|
||||
_vehicle setvariable [QGVAR(loaded), _newLoaded, true];
|
||||
};
|
||||
_vehicle setvariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true];
|
1
addons/cargo/functions/script_component.hpp
Normal file
1
addons/cargo/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\cargo\script_component.hpp"
|
104
addons/cargo/menu.hpp
Normal file
104
addons/cargo/menu.hpp
Normal file
@ -0,0 +1,104 @@
|
||||
|
||||
#include "\z\ace\addons\common\define.hpp"
|
||||
|
||||
class GVAR(menu) {
|
||||
idd = 314614;
|
||||
movingEnable = true;
|
||||
onLoad = QUOTE([_this select 0] call FUNC(onMenuOpen));
|
||||
onUnload = QUOTE(uiNamespace setvariable [ARR_2(QUOTE(QGVAR(menuDisplay)),nil)];);
|
||||
class controlsBackground {
|
||||
class HeaderBackground: ACE_gui_backgroundBase{
|
||||
idc = -1;
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
|
||||
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
text = "#(argb,8,8,3)color(0,0,0,0)";
|
||||
};
|
||||
class CenterBackground: HeaderBackground {
|
||||
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
h = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
text = "#(argb,8,8,3)color(0,0,0,0.8)";
|
||||
colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
||||
colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
||||
};
|
||||
};
|
||||
|
||||
class controls {
|
||||
class HeaderName {
|
||||
idc = 1;
|
||||
type = CT_STATIC;
|
||||
x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
|
||||
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
style = ST_LEFT + ST_SHADOW;
|
||||
font = "PuristaMedium";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
colorText[] = {0.95, 0.95, 0.95, 0.75};
|
||||
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
||||
text = CSTRING(cargoMenu);
|
||||
};
|
||||
class SubHeader: HeaderName {
|
||||
idc = 2;
|
||||
x = "13 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
|
||||
y = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
w = "13 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
style = ST_CENTER;
|
||||
colorText[] = {1, 1, 1.0, 0.9};
|
||||
colorBackground[] = {0,0,0,0};
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)";
|
||||
text = "";
|
||||
};
|
||||
class cargoList: ACE_gui_listBoxBase {
|
||||
idc = 100;
|
||||
x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
|
||||
y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
w = "12.8 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
|
||||
rowHeight = 0.03;
|
||||
colorBackground[] = {0, 0, 0, 0.2};
|
||||
colorText[] = {1, 1, 1, 1.0};
|
||||
colorScrollbar[] = {0.95, 0.95, 0.95, 1};
|
||||
colorSelect[] = {1, 1, 1, 1.0};
|
||||
colorSelect2[] = {1, 1, 1, 1.0};
|
||||
colorSelectBackground[] = {0.3, 0.3, 0.3, 1.0};
|
||||
colorSelectBackground2[] = {0.3, 0.3, 0.3, 1.0};
|
||||
};
|
||||
class btnUnload: ACE_gui_buttonBase {
|
||||
text = "Cancel";
|
||||
idc = 11;
|
||||
x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
|
||||
y = "14.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
||||
w = "5 * (((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
size = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
|
||||
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)";
|
||||
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)";
|
||||
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
|
||||
color[] = {1, 1, 1, 1};
|
||||
color2[] = {0,0,0, 1};
|
||||
colorBackgroundFocused[] = {1,1,1,1};
|
||||
colorBackground[] = {1,1,1,1};
|
||||
colorbackground2[] = {1,1,1,1};
|
||||
colorDisabled[] = {1,1,1,1};
|
||||
colorFocused[] = {0,0,0,1};
|
||||
periodFocus = 1;
|
||||
periodOver = 1;
|
||||
action = QUOTE(closeDialog 0);
|
||||
};
|
||||
class btnCancel: btnUnload {
|
||||
text = CSTRING(unloadObject);
|
||||
idc = 12;
|
||||
x = "20.9 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
|
||||
action = QUOTE([] call FUNC(startUnload););
|
||||
};
|
||||
};
|
||||
};
|
14
addons/cargo/script_component.hpp
Normal file
14
addons/cargo/script_component.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#define COMPONENT cargo
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_CARGO
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_CARGO
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_CARGO
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define MAX_LOAD_DISTANCE 10
|
35
addons/cargo/stringtable.xml
Normal file
35
addons/cargo/stringtable.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="Cargo">
|
||||
<Key ID="STR_ACE_Cargo_loadObject">
|
||||
<English>Load</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_unloadObject">
|
||||
<English>Unload</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_openMenu">
|
||||
<English>Cargo</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_cargoMenu">
|
||||
<English>Cargo Menu</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_labelSpace">
|
||||
<English>Cargo space left: %1</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_settingsCategory">
|
||||
<English>Cargo</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_ModuleSettings_enable">
|
||||
<English>Enable Cargo</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_ModuleSettings_enable_Description">
|
||||
<English>Enable the load in cargo module</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_SettingsModule_DisplayName">
|
||||
<English>Cargo Settings</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_SettingsModule_Description">
|
||||
<English>Configure the cargo module settings</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -75,16 +75,6 @@ if (isServer) then {
|
||||
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
|
||||
};
|
||||
|
||||
// hack to get PFH to work in briefing
|
||||
[QGVAR(onBriefingPFH), "onEachFrame", {
|
||||
if (ACE_time > 0) exitWith {
|
||||
[QGVAR(onBriefingPFH), "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
};
|
||||
|
||||
call cba_common_fnc_onFrame;
|
||||
}] call BIS_fnc_addStackedEventHandler;
|
||||
/////
|
||||
|
||||
QGVAR(remoteFnc) addPublicVariableEventHandler {
|
||||
(_this select 1) call FUNC(execRemoteFnc);
|
||||
};
|
||||
@ -118,8 +108,9 @@ if(!isServer) then {
|
||||
};
|
||||
["SEH", FUNC(_handleSyncedEvent)] call FUNC(addEventHandler);
|
||||
["SEH_s", FUNC(_handleRequestSyncedEvent)] call FUNC(addEventHandler);
|
||||
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
if (isServer) then {
|
||||
[FUNC(syncedEventPFH), 0.5, []] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
call FUNC(checkFiles);
|
||||
|
||||
|
||||
@ -340,6 +331,14 @@ if(isMultiplayer && { ACE_time > 0 || isNull player } ) then {
|
||||
GVAR(deviceKeyHandlingArray) = [];
|
||||
GVAR(deviceKeyCurrentIndex) = -1;
|
||||
|
||||
// Register localizations for the Keybinding categories
|
||||
["ACE3 Equipment", localize LSTRING(ACEKeybindCategoryEquipment)] call cba_fnc_registerKeybindModPrettyName;
|
||||
["ACE3 Common", localize LSTRING(ACEKeybindCategoryCommon)] call cba_fnc_registerKeybindModPrettyName;
|
||||
["ACE3 Weapons", localize LSTRING(ACEKeybindCategoryWeapons)] call cba_fnc_registerKeybindModPrettyName;
|
||||
["ACE3 Movement", localize LSTRING(ACEKeybindCategoryMovement)] call cba_fnc_registerKeybindModPrettyName;
|
||||
["ACE3 Scope Adjustment", localize LSTRING(ACEKeybindCategoryScopeAdjustment)] call cba_fnc_registerKeybindModPrettyName;
|
||||
["ACE3 Vehicles", localize LSTRING(ACEKeybindCategoryVehicles)] call cba_fnc_registerKeybindModPrettyName;
|
||||
|
||||
["ACE3 Equipment", QGVAR(openDevice), (localize "STR_ACE_Common_toggleHandheldDevice"),
|
||||
{
|
||||
[] call FUNC(deviceKeyFindValidIndex);
|
||||
|
@ -11,6 +11,7 @@ PREP(addCanInteractWithCondition);
|
||||
PREP(addLineToDebugDraw);
|
||||
PREP(addSetting);
|
||||
PREP(addToInventory);
|
||||
PREP(assignObjectsInList);
|
||||
PREP(ambientBrightness);
|
||||
PREP(applyForceWalkStatus);
|
||||
PREP(ASLToPosition);
|
||||
|
50
addons/common/functions/fnc_assignObjectsInList.sqf
Normal file
50
addons/common/functions/fnc_assignObjectsInList.sqf
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Loops through a string and filters out object names/variables to assign a value for given variable.
|
||||
* Used by moduleAssign* within various parts of the ACE3 project.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: list <STRING>
|
||||
* 1: variableName <STRING>
|
||||
* 2: value <ANY>
|
||||
* 3: Global <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_splittedList", "_nilCheckPassedList"];
|
||||
params ["_list", "_variable", "_setting", "_global"];
|
||||
|
||||
if (typeName _list == "STRING") then {
|
||||
_splittedList = [_list, ","] call BIS_fnc_splitString;
|
||||
_nilCheckPassedList = "";
|
||||
{
|
||||
_x = [_x] call FUNC(stringRemoveWhiteSpace);
|
||||
if !(isnil _x) then {
|
||||
if (_nilCheckPassedList == "") then {
|
||||
_nilCheckPassedList = _x;
|
||||
} else {
|
||||
_nilCheckPassedList = _nilCheckPassedList + ","+ _x;
|
||||
};
|
||||
};
|
||||
}foreach _splittedList;
|
||||
|
||||
_list = [] call compile format["[%1]",_nilCheckPassedList];
|
||||
};
|
||||
|
||||
{
|
||||
if (!isnil "_x") then {
|
||||
if (typeName _x == typeName objNull) then {
|
||||
if (local _x) then {
|
||||
_x setvariable [_variable, _setting, _global];
|
||||
};
|
||||
};
|
||||
};
|
||||
}foreach _list;
|
||||
|
||||
true
|
@ -27,6 +27,8 @@ _whitelist = [_whitelist, {toLower _this}] call FUNC(map);
|
||||
ACE_Version_CheckAll = _checkAll;
|
||||
ACE_Version_Whitelist = _whitelist;
|
||||
|
||||
if (!_checkAll) exitWith {}; //ACE is checked by FUNC(checkFiles)
|
||||
|
||||
if (!isServer) then {
|
||||
[_mode, _checkAll, _whitelist] spawn {
|
||||
private ["_missingAddon", "_missingAddonServer", "_oldVersionClient", "_oldVersionServer", "_text", "_error", "_rscLayer", "_ctrlHint"];
|
||||
|
@ -18,6 +18,7 @@
|
||||
* 14-16: pistol (String, Array, Array)
|
||||
* 17: map, compass, watch, etc. (Array)
|
||||
* 18: binocluar (String)
|
||||
* 19: active weapon, active muzzle, active weaponMode (Array)
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
@ -34,7 +35,8 @@ if (isNull _unit) exitWith {[
|
||||
"", ["","","",""], [],
|
||||
"", ["","","",""], [],
|
||||
[],
|
||||
""
|
||||
"",
|
||||
["","",""]
|
||||
]};
|
||||
|
||||
[
|
||||
@ -47,5 +49,6 @@ if (isNull _unit) exitWith {[
|
||||
secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit,
|
||||
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
|
||||
assignedItems _unit,
|
||||
binocular _unit
|
||||
binocular _unit,
|
||||
[currentWeapon _unit, currentMuzzle _unit, currentWeaponMode _unit]
|
||||
]
|
||||
|
@ -41,14 +41,15 @@ _hitpointClasses = [_config >> "HitPoints"];
|
||||
while {isClass _class} do {
|
||||
|
||||
for "_i" from 0 to (count _class - 1) do {
|
||||
private ["_entry", "_selection"];
|
||||
if (isClass (_class select _i)) then {
|
||||
private ["_entry", "_selection"];
|
||||
_entry = configName (_class select _i);
|
||||
_selection = getText (_class select _i >> "name");
|
||||
|
||||
_entry = configName (_class select _i);
|
||||
_selection = getText (_class select _i >> "name");
|
||||
|
||||
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
|
||||
_hitpoints pushBack _entry;
|
||||
_selections pushBack _selection;
|
||||
if (!(_selection in _selections) && {!isNil {_vehicle getHit _selection}}) then {
|
||||
_hitpoints pushBack _entry;
|
||||
_selections pushBack _selection;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -15,16 +15,16 @@
|
||||
private ["_parseConfigForDisplayNames", "_name"];
|
||||
|
||||
_parseConfigForDisplayNames = {
|
||||
private "_optionEntry";
|
||||
private ["_optionEntry", "_values", "_text"];
|
||||
_optionEntry = _this select 0;
|
||||
if !(isClass _optionEntry) exitwith {false};
|
||||
_values = getArray (_optionEntry >> "values");
|
||||
_x set [3, getText (_optionEntry >> "displayName")];
|
||||
_x set [4, getText (_optionEntry >> "description")];
|
||||
_x set [5, _values];
|
||||
_x set [8, getText (_optionEntry >> "category")];
|
||||
|
||||
private "_values";
|
||||
_values = _x select 5;
|
||||
{
|
||||
private "_text";
|
||||
_text = _x;
|
||||
if (((typeName _text) == "STRING") && {(count _text) > 1} && {(_text select [0,1]) == "$"}) then {
|
||||
_text = localize (_text select [1, ((count _text) - 1)]); //chop off the leading $
|
||||
@ -41,7 +41,9 @@ _parseConfigForDisplayNames = {
|
||||
|
||||
if !([configFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then {
|
||||
if !([configFile >> "ACE_ServerSettings" >> _name] call _parseConfigForDisplayNames) then {
|
||||
[missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames;
|
||||
if !([missionConfigFile >> "ACE_Settings" >> _name] call _parseConfigForDisplayNames) then {
|
||||
diag_log text format ["[ACE] - Setting found, but couldn't localize [%1] (server has but we don't?)", _name];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -65,17 +65,19 @@ if (isNil _name) then {
|
||||
localizedDescription,
|
||||
possibleValues,
|
||||
isForced,
|
||||
defaultValue
|
||||
defaultValue,
|
||||
category
|
||||
];*/
|
||||
_settingData = [
|
||||
_name,
|
||||
_typeName,
|
||||
(getNumber (_optionEntry >> "isClientSettable")) > 0,
|
||||
getText (_optionEntry >> "displayName"),
|
||||
getText (_optionEntry >> "description"),
|
||||
getArray (_optionEntry >> "values"),
|
||||
"", //getText (_optionEntry >> "displayName"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText
|
||||
"", //getText (_optionEntry >> "description"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText
|
||||
[], //getArray (_optionEntry >> "values"), //No need to broadcast, handeled by fnc_loadSettingsLocalizedText
|
||||
getNumber (_optionEntry >> "force") > 0,
|
||||
_value
|
||||
_value,
|
||||
"" //getText (_optionEntry >> "category") //No need to broadcast, handeled by fnc_loadSettingsLocalizedText
|
||||
];
|
||||
|
||||
//Strings in the values array won't be localized from the config, so just do that now:
|
||||
|
@ -30,14 +30,14 @@ if (_vehicle isKindOf "Ship" ) then {
|
||||
_emptyPos = (getPosASL _vehicle) call EFUNC(common,ASLtoPosition);
|
||||
_emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ];
|
||||
} else {
|
||||
if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false};
|
||||
if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false};
|
||||
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
|
||||
_emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeof _unit]);
|
||||
};
|
||||
};
|
||||
|
||||
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
|
||||
if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid vehicle state. Either moving or Not close enough on the ground. %1", getPos _vehicle]; false };
|
||||
if (!_validVehiclestate) exitwith { diag_log format["Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4", _vehicle, getPos _vehicle, isTouchingGround _vehicle, speed _vehicle]; false };
|
||||
|
||||
diag_log str _emptyPos;
|
||||
|
||||
|
@ -479,7 +479,6 @@
|
||||
<Portuguese>Verificar PBOs</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_CheckPBO_Description">
|
||||
<English></English>
|
||||
<Polish>Sprawdzaj spójność addonów z serwerem</Polish>
|
||||
<Spanish>Este módulo verifica la integridad de los addons con los que iniciamos el simulador</Spanish>
|
||||
<German>Dieses Modul überprüft ob jeder Spieler die richtigen PBO-Dateien hat.</German>
|
||||
@ -598,5 +597,87 @@
|
||||
<Polish>Następne urządzenie podręczne</Polish>
|
||||
<Czech>Procházet ruční zařízení</Czech>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_Disabled">
|
||||
<English>Disabled</English>
|
||||
<Czech>Zakázáno</Czech>
|
||||
<French>Non</French>
|
||||
<German>Deaktiviert</German>
|
||||
<Italian>Disattivato</Italian>
|
||||
<Polish>Wyłączone</Polish>
|
||||
<Portuguese>Desativado</Portuguese>
|
||||
<Russian>Откл.</Russian>
|
||||
<Spanish>Desactivado</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_Enabled">
|
||||
<English>Enabled</English>
|
||||
<Czech>Zapnuto</Czech>
|
||||
<French>Oui</French>
|
||||
<German>Aktiviert</German>
|
||||
<Italian>Attivato</Italian>
|
||||
<Polish>Włączone</Polish>
|
||||
<Portuguese>Ativado</Portuguese>
|
||||
<Russian>Вкл.</Russian>
|
||||
<Spanish>Activado</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_Yes">
|
||||
<English>Yes</English>
|
||||
<German>Ja</German>
|
||||
<Spanish>Si</Spanish>
|
||||
<Polish>Tak</Polish>
|
||||
<Czech>Ano</Czech>
|
||||
<French>Oui</French>
|
||||
<Russian>Да</Russian>
|
||||
<Hungarian>Igen</Hungarian>
|
||||
<Portuguese>Sim</Portuguese>
|
||||
<Italian>Si</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_No">
|
||||
<English>No</English>
|
||||
<German>Nein</German>
|
||||
<Spanish>No</Spanish>
|
||||
<Polish>Nie</Polish>
|
||||
<Czech>Ne</Czech>
|
||||
<French>Non</French>
|
||||
<Russian>Нет</Russian>
|
||||
<Hungarian>Nem</Hungarian>
|
||||
<Portuguese>Não</Portuguese>
|
||||
<Italian>No</Italian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_VehiclesOnly">
|
||||
<English>Vehicles only</English>
|
||||
<Polish>Tylko pojazdy</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_DoNotForce">
|
||||
<English>Do Not Force</English>
|
||||
<Polish>Nie wymuszaj</Polish>
|
||||
<Spanish>No forzar</Spanish>
|
||||
<German>Nicht erzwingen</German>
|
||||
<Czech>Nevynucovat</Czech>
|
||||
<Portuguese>Não forçar</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_ACEKeybindCategoryEquipment">
|
||||
<English>ACE3 Equipment</English>
|
||||
<Polish>ACE3 Wyposażenie</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_ACEKeybindCategoryCommon">
|
||||
<English>ACE3 Common</English>
|
||||
<Polish>ACE3 Ogólne</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_ACEKeybindCategoryWeapons">
|
||||
<English>ACE3 Weapons</English>
|
||||
<Polish>ACE3 Broń</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_ACEKeybindCategoryMovement">
|
||||
<English>ACE3 Movement</English>
|
||||
<Polish>ACE3 Ruch</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_ACEKeybindCategoryScopeAdjustment">
|
||||
<English>ACE3 Scope Adjustment</English>
|
||||
<Polish>ACE3 Regulacja optyki</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Common_ACEKeybindCategoryVehicles">
|
||||
<English>ACE3 Vehicles</English>
|
||||
<Polish>ACE3 Pojazdy</Polish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
@ -123,7 +123,8 @@ class CfgVehicles {
|
||||
displayName = "$STR_ACE_ROLLWIRE";
|
||||
distance = 4;
|
||||
condition = "true";
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(deploy));
|
||||
//wait a frame to handle "Do When releasing action menu key" option:
|
||||
statement = QUOTE([ARR_2({_this call FUNC(deploy)}, [ARR_2(_target,_player)])] call EFUNC(common,execNextFrame));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
|
@ -37,7 +37,7 @@ deleteVehicle _wirecoil;
|
||||
_unit setVariable [QGVAR(wireDeployed), false];
|
||||
|
||||
GVAR(deployPFH) = [{
|
||||
EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action);
|
||||
EXPLODE_3_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit);
|
||||
|
||||
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
|
||||
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
|
||||
@ -73,7 +73,7 @@ GVAR(deployPFH) = [{
|
||||
{
|
||||
_wireNoGeo animate [_x, _anim];
|
||||
} foreach WIRE_FAST;
|
||||
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler;
|
||||
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<English>Concertina Wire</English>
|
||||
<German>NATO-Draht</German>
|
||||
<Russian>Проволочная спираль</Russian>
|
||||
<Polish>Drut kolczasty</Polish>
|
||||
<Polish>Koncentrina</Polish>
|
||||
<Spanish>Alambre de espino</Spanish>
|
||||
<French>Concertina wire</French>
|
||||
<Czech>Ostnatý drát</Czech>
|
||||
@ -17,7 +17,7 @@
|
||||
<English>Concertina Wire Coil</English>
|
||||
<German>NATO-Draht Rolle</German>
|
||||
<Russian>Проволочная спираль (моток)</Russian>
|
||||
<Polish>Zwój drutu kolczastego</Polish>
|
||||
<Polish>Zwój koncentriny</Polish>
|
||||
<Spanish>Bobina de alambre de espino</Spanish>
|
||||
<French>Concertina wire coil</French>
|
||||
<Czech>Smyčka ostnatého drátu</Czech>
|
||||
@ -29,7 +29,7 @@
|
||||
<English>Dismount Concertina Wire</English>
|
||||
<German>NATO-Draht abbauen</German>
|
||||
<Russian>Демонтировать проволочную спираль</Russian>
|
||||
<Polish>Zwiń drut kolczasty</Polish>
|
||||
<Polish>Zwiń koncentrinę</Polish>
|
||||
<Spanish>Desmontar alambre de espino</Spanish>
|
||||
<French>Dismount Concertina wire</French>
|
||||
<Czech>Svinout ostnatý drát</Czech>
|
||||
@ -41,7 +41,7 @@
|
||||
<English>Deploy Concertina Wire</English>
|
||||
<German>NATO-Draht verlegen</German>
|
||||
<Russian>Монтировать проволочную спираль</Russian>
|
||||
<Polish>Rozwiń drut kolczasty</Polish>
|
||||
<Polish>Rozwiń koncentrinę</Polish>
|
||||
<Spanish>Desplegar alambre de espino</Spanish>
|
||||
<French>Deploy Concertina wire</French>
|
||||
<Czech>Rozvinout ostnatý drát</Czech>
|
||||
@ -50,4 +50,4 @@
|
||||
<Portuguese>Colocar arame farpado</Portuguese>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
["DisarmDropItems", {_this call FUNC(eventTargetStart)}] call EFUNC(common,addEventHandler);
|
||||
["DisarmDebugCallback", {_this call FUNC(eventCallerFinish)}] call EFUNC(common,addEventHandler);
|
||||
["DisarmDropItems", FUNC(eventTargetStart)] call EFUNC(common,addEventHandler);
|
||||
["DisarmDebugCallback", FUNC(eventCallerFinish)] call EFUNC(common,addEventHandler);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Checks the conditions for being able to disarm a unit
|
||||
*
|
||||
* Arguments:
|
||||
@ -15,17 +16,17 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_target);
|
||||
|
||||
private ["_animationStateCfgMoves", "_putDownAnim"];
|
||||
|
||||
params ["_target"];
|
||||
|
||||
//Check animationState for putDown anim
|
||||
//This ensures the unit doesn't have to actualy do any animation to drop something
|
||||
//This should always be true for the 3 possible status effects that allow disarming
|
||||
_animationStateCfgMoves = getText (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState _target) >> "actions");
|
||||
if (_animationStateCfgMoves == "") exitWith {false};
|
||||
if (_animationStateCfgMoves == "") exitWith { false };
|
||||
_putDownAnim = getText (configFile >> "CfgMovesBasic" >> "Actions" >> _animationStateCfgMoves >> "PutDown");
|
||||
if (_putDownAnim != "") exitWith {false};
|
||||
if (_putDownAnim != "") exitWith { false };
|
||||
|
||||
|
||||
(alive _target) &&
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Checks the conditions for being able to disarm a unit
|
||||
*
|
||||
* Arguments:
|
||||
@ -16,7 +17,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_player,_target);
|
||||
params ["_player", "_target"];
|
||||
|
||||
([_target] call FUNC(canBeDisarmed)) &&
|
||||
([_target] call FUNC(canBeDisarmed)) &&
|
||||
{([_player, _target, []] call EFUNC(common,canInteractWith))}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Makes a unit drop items
|
||||
*
|
||||
* Arguments:
|
||||
@ -22,13 +23,11 @@
|
||||
|
||||
private ["_fncSumArray", "_return", "_holder", "_dropPos", "_targetMagazinesStart", "_holderMagazinesStart", "_xClassname", "_xAmmo", "_targetMagazinesEnd", "_holderMagazinesEnd", "_holderItemsStart", "_targetItemsStart", "_addToCrateClassnames", "_addToCrateCount", "_index", "_holderItemsEnd", "_targetItemsEnd", "_holderIsEmpty"];
|
||||
|
||||
|
||||
PARAMS_3(_caller,_target,_listOfItemsToRemove);
|
||||
DEFAULT_PARAM(3,_doNotDropAmmo,false); //By default units drop all weapon mags when dropping a weapon
|
||||
params ["_caller", "_target", "_listOfItemsToRemove", ["_doNotDropAmmo", false, [false]]]; //By default units drop all weapon mags when dropping a weapon
|
||||
|
||||
_fncSumArray = {
|
||||
_return = 0;
|
||||
{_return = _return + _x;} forEach (_this select 0);
|
||||
{_return = _return + _x;} count (_this select 0);
|
||||
_return
|
||||
};
|
||||
|
||||
@ -48,7 +47,7 @@ if (!_doNotDropAmmo) then {
|
||||
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
|
||||
_holder = _x;
|
||||
};
|
||||
} forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
|
||||
} count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
|
||||
};
|
||||
|
||||
//Create a new weapon holder
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Recieves a possible error code from FUNC(eventTargetFinish)
|
||||
*
|
||||
* Arguments:
|
||||
@ -17,7 +18,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_caller,_target,_errorMsg);
|
||||
params ["_caller", "_target", "_errorMsg"];
|
||||
|
||||
if (_caller != ACE_player) exitWith {};
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* After FUNC(disarmDropItems) has completed, passing a possible error code.
|
||||
* Passes that error back to orginal caller.
|
||||
*
|
||||
@ -18,7 +19,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_caller,_target,_errorMsg);
|
||||
params ["_caller", "_target", "_errorMsg"];
|
||||
|
||||
if (_errorMsg != "") then {
|
||||
diag_log text format ["[ACE_Disarming] %1 - eventTargetFinish: %2", ACE_time, _this];
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Disarm Event Handler, Starting func, called on the target.
|
||||
* If target has to remove uniform/vest, this will add all uniform/vest items to the drop list.
|
||||
*
|
||||
@ -18,7 +19,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_caller,_target,_listOfObjectsToRemove);
|
||||
params ["_caller", "_target", "_listOfObjectsToRemove"];
|
||||
|
||||
private "_itemsToAdd";
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Helper function to get all gear of a container
|
||||
*
|
||||
* Arguments:
|
||||
@ -15,15 +16,16 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_target);
|
||||
params ["_target"];
|
||||
|
||||
private ["_allGear"];
|
||||
|
||||
_allGear = [[],[]];
|
||||
private ["_items", "_counts"];
|
||||
|
||||
_items = [];
|
||||
_counts = [];
|
||||
{
|
||||
(_allGear select 0) append (_x select 0);
|
||||
(_allGear select 1) append (_x select 1);
|
||||
_x params ["_item", "_count"];
|
||||
_items append _item;
|
||||
_counts append _count;
|
||||
} forEach [(getWeaponCargo _target), (getItemCargo _target), (getMagazineCargo _target), (getBackpackCargo _target)];
|
||||
|
||||
_allGear
|
||||
[_items,_counts] // Return
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Helper function to get all gear of a unit.
|
||||
*
|
||||
* Arguments:
|
||||
@ -15,7 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_target);
|
||||
params ["_target"];
|
||||
|
||||
private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"];
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Opens the disarm dialog (allowing a person to remove items)
|
||||
*
|
||||
* Arguments:
|
||||
@ -15,21 +16,9 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define TEXTURES_RANKS [ \
|
||||
"", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\private_gs.paa", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\corporal_gs.paa", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\sergeant_gs.paa", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\lieutenant_gs.paa", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\captain_gs.paa", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\major_gs.paa", \
|
||||
"\A3\Ui_f\data\GUI\Cfg\Ranks\colonel_gs.paa" \
|
||||
]
|
||||
|
||||
PARAMS_2(_caller,_target);
|
||||
params ["_caller", "_target"];
|
||||
private "_display";
|
||||
|
||||
#define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa"
|
||||
//Sanity Checks
|
||||
if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");};
|
||||
if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");};
|
||||
@ -47,8 +36,8 @@ GVAR(disarmTarget) = _target;
|
||||
//Setup Drop Event (on right pannel)
|
||||
(_display displayCtrl 632) ctrlAddEventHandler ["LBDrop", {
|
||||
if (isNull GVAR(disarmTarget)) exitWith {};
|
||||
PARAMS_5(_ctrl,_xPos,_yPos,_idc,_itemInfo);
|
||||
EXPLODE_3_PVT((_itemInfo select 0),_displayText,_value,_data);
|
||||
params ["_ctrl", "_xPos", "_yPos", "_idc", "_itemInfo"];
|
||||
(_itemInfo select 0) params ["_displayText", "_value", "_data"];
|
||||
|
||||
if (isNull GVAR(disarmTarget)) exitWith {ERROR("disarmTarget is null");};
|
||||
|
||||
@ -60,18 +49,18 @@ GVAR(disarmTarget) = _target;
|
||||
|
||||
//Setup PFEH
|
||||
[{
|
||||
private ["_groundContainer", "_targetContainer", "_playerName", "_rankPicture", "_rankIndex", "_targetUniqueItems", "_holderUniqueItems", "_holder"];
|
||||
private ["_groundContainer", "_targetContainer", "_playerName", "_icon", "_rankPicture", "_targetUniqueItems", "_holderUniqueItems", "_holder"];
|
||||
disableSerialization;
|
||||
EXPLODE_2_PVT(_this,_args,_pfID);
|
||||
EXPLODE_3_PVT(_args,_player,_target,_display);
|
||||
params ["_args", "_idPFH"];
|
||||
_args params ["_player", "_target", "_display"];
|
||||
|
||||
if ((!([_player, _target] call FUNC(canPlayerDisarmUnit))) ||
|
||||
{isNull _display} ||
|
||||
{_player != ACE_player}) then {
|
||||
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
GVAR(disarmTarget) = objNull;
|
||||
if (!isNull _display) then {closeDialog 0;}; //close dialog if still open
|
||||
if (!isNull _display) then { closeDialog 0; }; //close dialog if still open
|
||||
} else {
|
||||
|
||||
_groundContainer = _display displayCtrl 632;
|
||||
@ -80,8 +69,9 @@ GVAR(disarmTarget) = _target;
|
||||
_rankPicture = _display displayCtrl 1203;
|
||||
|
||||
//Show rank and name (just like BIS's inventory)
|
||||
_rankIndex = ((["PRIVATE", "CORPORAL", "SERGEANT", "LIEUTENANT", "CAPTAIN", "MAJOR", "COLONEL"] find (rank _target)) + 1);
|
||||
_rankPicture ctrlSetText (TEXTURES_RANKS select _rankIndex);
|
||||
_icon = format [DEFUALTPATH, toLower (rank _target)];
|
||||
if (_icon isEqualTo DEFUALTPATH) then {_icon = ""};
|
||||
_rankPicture ctrlSetText _icon;
|
||||
_playerName ctrlSetText ([GVAR(disarmTarget)] call EFUNC(common,getName));
|
||||
|
||||
//Clear both inventory lists:
|
||||
@ -98,7 +88,7 @@ GVAR(disarmTarget) = _target;
|
||||
if ((_x getVariable [QGVAR(disarmUnit), objNull]) == _target) exitWith {
|
||||
_holder = _x;
|
||||
};
|
||||
} forEach ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
|
||||
} count ((getpos _target) nearObjects [DISARM_CONTAINER, 3]);
|
||||
|
||||
//If a holder exists, show it's inventory
|
||||
if (!isNull _holder) then {
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Shows a list of inventory items in a listBox control.
|
||||
*
|
||||
* Arguments:
|
||||
@ -17,11 +18,12 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
PARAMS_2(_listBoxCtrl,_itemsCountArray);
|
||||
|
||||
private ["_classname", "_count", "_displayName", "_picture"];
|
||||
|
||||
params ["_listBoxCtrl", "_itemsCountArray"];
|
||||
|
||||
{
|
||||
private "_configPath";
|
||||
_displayName = "";
|
||||
_picture = "";
|
||||
|
||||
@ -31,21 +33,25 @@ private ["_classname", "_count", "_displayName", "_picture"];
|
||||
if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon
|
||||
|
||||
switch (true) do {
|
||||
case (isClass (configFile >> "CfgWeapons" >> _classname)): {
|
||||
_displayName = getText (configFile >> "CfgWeapons" >> _classname >> "displayName");
|
||||
_picture = getText (configFile >> "CfgWeapons" >> _classname >> "picture");
|
||||
case (isClass (configFile >> "CfgWeapons" >> _classname)): {
|
||||
_configPath = (configFile >> "CfgWeapons");
|
||||
_displayName = getText (_configPath >> _classname >> "displayName");
|
||||
_picture = getText (_configPath >> _classname >> "picture");
|
||||
};
|
||||
case (isClass (configFile >> "CfgMagazines" >> _classname)): {
|
||||
_displayName = getText (configFile >> "CfgMagazines" >> _classname >> "displayName");
|
||||
_picture = getText (configFile >> "CfgMagazines" >> _classname >> "picture");
|
||||
case (isClass (configFile >> "CfgMagazines" >> _classname)): {
|
||||
_configPath = (configFile >> "CfgMagazines");
|
||||
_displayName = getText (_configPath >> _classname >> "displayName");
|
||||
_picture = getText (_configPath >> _classname >> "picture");
|
||||
};
|
||||
case (isClass (configFile >> "CfgVehicles" >> _classname)): {
|
||||
_displayName = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_picture = getText (configFile >> "CfgVehicles" >> _classname >> "picture");
|
||||
case (isClass (configFile >> "CfgVehicles" >> _classname)): {
|
||||
_configPath = (configFile >> "CfgVehicles");
|
||||
_displayName = getText (_configPath >> _classname >> "displayName");
|
||||
_picture = getText (_configPath >> _classname >> "picture");
|
||||
};
|
||||
case (isClass (configFile >> "CfgGlasses" >> _classname)): {
|
||||
_displayName = getText (configFile >> "CfgGlasses" >> _classname >> "displayName");
|
||||
_picture = getText (configFile >> "CfgGlasses" >> _classname >> "picture");
|
||||
case (isClass (configFile >> "CfgGlasses" >> _classname)): {
|
||||
_configPath = (configFile >> "CfgGlasses");
|
||||
_displayName = getText (_configPath >> _classname >> "displayName");
|
||||
_picture = getText (_configPath >> _classname >> "picture");
|
||||
};
|
||||
default {
|
||||
ERROR(format ["[%1] - bad classname", _classname]);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
*
|
||||
* Verifies magazines moved with exact ammo counts preserved.
|
||||
* Arrays will be in format from magazinesAmmo/magazinesAmmoCargo
|
||||
* e.g.: [["30Rnd_65x39_caseless_mag",15], ["30Rnd_65x39_caseless_mag",30]]
|
||||
|
@ -22,7 +22,7 @@ class Extended_FiredBIS_EventHandlers {
|
||||
class Extended_InitPost_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
init = QUOTE([ARR_2(_this select 0, secondaryWeapon (_this select 0))] call FUNC(takeLoadedATWeapon));
|
||||
init = QUOTE([_this select 0] call FUNC(takeLoadedATWeapon));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
class CfgMagazines {
|
||||
class NLAW_F;
|
||||
class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine
|
||||
class ACE_PreloadedMissileDummy: NLAW_F { // The dummy magazine
|
||||
author = ECSTRING(common,ACETeam);
|
||||
scope = 1;
|
||||
scopeArsenal = 1;
|
||||
@ -12,14 +12,4 @@ class CfgMagazines {
|
||||
class ACE_FiredMissileDummy: ACE_PreloadedMissileDummy {
|
||||
count = 0;
|
||||
};
|
||||
class ACE_UsedTube_F: NLAW_F {
|
||||
author = ECSTRING(common,ACETeam);
|
||||
displayName = CSTRING(UsedTube);
|
||||
descriptionShort = CSTRING(UsedTubeDescription);
|
||||
displayNameShort = "-";
|
||||
count = 0;
|
||||
weaponPoolAvailable = 0;
|
||||
modelSpecial = "";
|
||||
mass = 0;
|
||||
};
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user