mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Cleaned function headers
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Check if player can load item into the nearest vehicle
|
* Check if player can load an item into the nearest vehicle.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Player <OBJECT>
|
* 0: Player <OBJECT>
|
||||||
@ -9,9 +9,11 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* Can load <BOOL>
|
* Can load <BOOL>
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [player, object] call ace_cargo_fnc_canLoad
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_player", "_object"];
|
params ["_player", "_object"];
|
||||||
@ -20,12 +22,11 @@ private ["_nearestVehicle"];
|
|||||||
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
||||||
|
|
||||||
if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then {
|
if (_nearestVehicle isKindOf "Cargo_Base_F" || isNull _nearestVehicle) then {
|
||||||
|
|
||||||
{
|
{
|
||||||
if ([_object, _x] call FUNC(canLoadItemIn)) exitwith {_nearestVehicle = _x};
|
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x};
|
||||||
}foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
|
} forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNull _nearestVehicle) exitwith {false};
|
if (isNull _nearestVehicle) exitWith {false};
|
||||||
|
|
||||||
[_object, _nearestVehicle] call FUNC(canLoadItemIn);
|
[_object, _nearestVehicle] call FUNC(canLoadItemIn);
|
||||||
|
@ -1,22 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Check if item can be loaded into other Object
|
* Check if item can be loaded into other Object.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Item Object <OBJECT>
|
* 0: Item Object <OBJECT>
|
||||||
* 1: Holder Object (vehicle) <OBJECT>
|
* 1: Holder Object (Vehicle) <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Can load in <BOOL>
|
* Can load in <BOOL>
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [item, holder] call ace_cargo_fnc_canLoadItemIn
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_item", "_vehicle"];
|
params ["_item", "_vehicle"];
|
||||||
|
|
||||||
if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitwith {false};
|
if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false};
|
||||||
|
|
||||||
private "_itemSize";
|
private "_itemSize";
|
||||||
_itemSize = ([_item] call FUNC(getSizeItem));
|
_itemSize = ([_item] call FUNC(getSizeItem));
|
||||||
|
@ -1,23 +1,27 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal, ViperMaul
|
* Author: Glowbal, ViperMaul
|
||||||
* Check if item can be unloaded
|
* Check if item can be unloaded.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: loaded object <OBJECT>
|
* 0: loaded Object <OBJECT>
|
||||||
* 1: Object <OBJECT>
|
* 1: Object <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Can be unloaded <BOOL>
|
* Can be unloaded <BOOL>
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [item, holder] call ace_cargo_fnc_canUnloadItem
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_loaded", "_validVehiclestate", "_emptyPos"];
|
private ["_loaded", "_validVehiclestate", "_emptyPos"];
|
||||||
|
|
||||||
params ["_item", "_vehicle"];
|
params ["_item", "_vehicle"];
|
||||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
|
||||||
if !(_item in _loaded) exitwith {false};
|
_loaded = _vehicle getVariable [QGVAR(loaded), []];
|
||||||
|
if !(_item in _loaded) exitWith {false};
|
||||||
|
|
||||||
_validVehiclestate = true;
|
_validVehiclestate = true;
|
||||||
_emptyPos = [];
|
_emptyPos = [];
|
||||||
@ -35,5 +39,5 @@ if (_vehicle isKindOf "Ship" ) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!_validVehiclestate) exitwith { false };
|
if (!_validVehiclestate) exitWith {false};
|
||||||
(count _emptyPos != 0);
|
(count _emptyPos != 0);
|
||||||
|
@ -1,34 +1,37 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Get nearest vehicle, priority car, air, tank, ship
|
* Get nearest vehicle from unit, priority: Car-Air-Tank-Ship.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Unit <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Vehicle that is in Distance <OBJECT>
|
* Vehicle in Distance <OBJECT>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [unit] call ace_cargo_fnc_findNearestVehicle
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_loadCar", "_loadHelicopter", "_loadTank", "_loadShip", "_loadContainer"];
|
private ["_loadCar", "_loadHelicopter", "_loadTank", "_loadShip", "_loadContainer"];
|
||||||
|
|
||||||
params ["_unit"];
|
params ["_unit"];
|
||||||
|
|
||||||
_loadCar = nearestObject [_unit, "car"];
|
_loadCar = nearestObject [_unit, "car"];
|
||||||
if (_unit distance _loadCar <= MAX_LOAD_DISTANCE) exitwith {_loadCar};
|
if (_unit distance _loadCar <= MAX_LOAD_DISTANCE) exitWith {_loadCar};
|
||||||
|
|
||||||
_loadHelicopter = nearestObject [_unit, "air"];
|
_loadHelicopter = nearestObject [_unit, "air"];
|
||||||
if (_unit distance _loadHelicopter <= MAX_LOAD_DISTANCE) exitwith {_loadHelicopter};
|
if (_unit distance _loadHelicopter <= MAX_LOAD_DISTANCE) exitWith {_loadHelicopter};
|
||||||
|
|
||||||
_loadTank = nearestObject [_unit, "tank"];
|
_loadTank = nearestObject [_unit, "tank"];
|
||||||
if (_unit distance _loadTank <= MAX_LOAD_DISTANCE) exitwith {_loadTank};
|
if (_unit distance _loadTank <= MAX_LOAD_DISTANCE) exitWith {_loadTank};
|
||||||
|
|
||||||
_loadShip = nearestObject [_unit, "ship"];
|
_loadShip = nearestObject [_unit, "ship"];
|
||||||
if (_unit distance _loadShip <= MAX_LOAD_DISTANCE) exitwith {_loadShip};
|
if (_unit distance _loadShip <= MAX_LOAD_DISTANCE) exitWith {_loadShip};
|
||||||
|
|
||||||
_loadContainer = nearestObject [_unit,"Cargo_base_F"];
|
_loadContainer = nearestObject [_unit,"Cargo_base_F"];
|
||||||
if (_unit distance _loadContainer <= MAX_LOAD_DISTANCE) exitwith {_loadContainer};
|
if (_unit distance _loadContainer <= MAX_LOAD_DISTANCE) exitWith {_loadContainer};
|
||||||
|
|
||||||
objNull;
|
objNull;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Get the cargo space left on object
|
* Get the cargo space left on object.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
@ -8,10 +8,13 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* Cargo space left <NUMBER>
|
* Cargo space left <NUMBER>
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object] call ace_cargo_fnc_getCargoSpaceLeft
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_vehicle"];
|
params ["_object"];
|
||||||
_vehicle getvariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space))];
|
|
||||||
|
_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _object >> QGVAR(space))];
|
||||||
|
@ -1,22 +1,28 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Get the cargo size of an object
|
* Get the cargo size of an object.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* Cargo size. <NUMBER> (default: -1)
|
* Cargo size <NUMBER> (default: -1)
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [object] call ace_cargo_fnc_getSizeItem
|
||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private "_config";
|
private "_config";
|
||||||
|
|
||||||
params ["_item"];
|
params ["_item"];
|
||||||
|
|
||||||
_config = (configFile >> "CfgVehicles" >> typeof _item >> QGVAR(size));
|
_config = (configFile >> "CfgVehicles" >> typeof _item >> QGVAR(size));
|
||||||
if (isNumber (_config)) exitwith {
|
|
||||||
_item getvariable [QGVAR(size), getNumber (_config)];
|
if (isNumber (_config)) exitWith {
|
||||||
|
_item getVariable [QGVAR(size), getNumber (_config)];
|
||||||
};
|
};
|
||||||
|
|
||||||
-1
|
-1
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Handle object being destroyed
|
* Handle object being destroyed.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
@ -8,17 +8,19 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object] call ace_cargo_fnc_handleDestroyed
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
|
|
||||||
private["_loaded"];
|
private["_loaded"];
|
||||||
|
|
||||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
_loaded = _vehicle getVariable [QGVAR(loaded), []];
|
||||||
if (count _loaded == 0) exitwith {};
|
if (count _loaded == 0) exitWith {};
|
||||||
|
|
||||||
{
|
{
|
||||||
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment?
|
// TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment?
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Initialize variables for loadable objects. Called from init EH.
|
* Initializes variables for loadable objects. Called from init EH.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Any object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object] call ace_cargo_fnc_initObject
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_object"];
|
params ["_object"];
|
||||||
|
|
||||||
if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canLoad)) != 1) exitwith {};
|
if (getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(canLoad)) != 1) exitWith {};
|
||||||
|
|
||||||
private ["_type", "_action"];
|
private ["_type", "_action"];
|
||||||
_type = typeOf _object;
|
_type = typeOf _object;
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* initalize vehicle. Adds open caro menu action if available
|
* Initializes vehicle, adds open caro menu action if available.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: vehicle <OBJECT>
|
* 0: Vehicle <OBJECT>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [vehicle] call ace_cargo_fnc_initVehicle
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
@ -31,7 +33,7 @@ if (isServer) then {
|
|||||||
_position set [2, (_position select 2) + 7.5];
|
_position set [2, (_position select 2) + 7.5];
|
||||||
for "_i" from 1 to _amount do {
|
for "_i" from 1 to _amount do {
|
||||||
_object = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"];
|
_object = createVehicle [_className, _position, [], 0, "CAN_COLLIDE"];
|
||||||
if !([_object, _vehicle] call FUNC(loadItem)) exitwith {
|
if !([_object, _vehicle] call FUNC(loadItem)) exitWith {
|
||||||
deleteVehicle _object;
|
deleteVehicle _object;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -46,7 +48,7 @@ if (_type in _initializedClasses) exitWith {};
|
|||||||
_initializedClasses pushBack _type;
|
_initializedClasses pushBack _type;
|
||||||
SETMVAR(GVAR(initializedClasses),_initializedClasses);
|
SETMVAR(GVAR(initializedClasses),_initializedClasses);
|
||||||
|
|
||||||
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitwith {};
|
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
|
||||||
|
|
||||||
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
||||||
_condition = {GVAR(enable)};
|
_condition = {GVAR(enable)};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Load object into vehicle
|
* Load object into vehicle.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
@ -9,23 +9,26 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object, vehicle] call ace_cargo_fnc_loadItem
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_loaded", "_space", "_itemSize"];
|
private ["_loaded", "_space", "_itemSize"];
|
||||||
|
|
||||||
params ["_item", "_vehicle"];
|
params ["_item", "_vehicle"];
|
||||||
|
|
||||||
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitwith {false};
|
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false};
|
||||||
|
|
||||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
_loaded = _vehicle getVariable [QGVAR(loaded), []];
|
||||||
_loaded pushback _item;
|
_loaded pushback _item;
|
||||||
_vehicle setvariable [QGVAR(loaded), _loaded, true];
|
_vehicle setVariable [QGVAR(loaded), _loaded, true];
|
||||||
|
|
||||||
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
||||||
_itemSize = [_item] call FUNC(getSizeItem);
|
_itemSize = [_item] call FUNC(getSizeItem);
|
||||||
_vehicle setvariable [QGVAR(space), _space - _itemSize, true];
|
_vehicle setVariable [QGVAR(space), _space - _itemSize, true];
|
||||||
|
|
||||||
detach _item;
|
detach _item;
|
||||||
_item attachTo [_vehicle,[0,0,100]];
|
_item attachTo [_vehicle,[0,0,100]];
|
||||||
|
@ -3,19 +3,26 @@
|
|||||||
* Module for adjusting the cargo settings
|
* Module for adjusting the cargo settings
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: The module logic <LOGIC>
|
* 0: The module logic <OBJECT>
|
||||||
* 1: units <ARRAY>
|
* 1: Synchronized units <ARRAY>
|
||||||
* 2: activated <BOOL>
|
* 2: Activated <BOOL>
|
||||||
*
|
*
|
||||||
* Return Value:
|
* Return Value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* function = "ace_cargo_fnc_loadItem"
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if (!isServer) exitWith {};
|
||||||
|
|
||||||
params ["_logic", "_units", "_activated"];
|
params ["_logic", "_units", "_activated"];
|
||||||
if !(_activated) exitWith {};
|
|
||||||
|
if (!_activated) exitWith {};
|
||||||
|
|
||||||
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);
|
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);
|
||||||
|
|
||||||
|
diag_log text "[ACE]: Cargo Module Initialized.";
|
||||||
|
@ -1,37 +1,40 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Handle the UI data display
|
* Handle the UI data display.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: display <DISPLAY>
|
* 0: Display <DISPLAY>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [display] call ace_cargo_fnc_onMenuOpen
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
|
|
||||||
params ["_display"];
|
params ["_display"];
|
||||||
|
|
||||||
uiNamespace setvariable [QGVAR(menuDisplay), _display];
|
uiNamespace setVariable [QGVAR(menuDisplay), _display];
|
||||||
|
|
||||||
[{
|
[{
|
||||||
private ["_display","_loaded", "_ctrl", "_label"];
|
private ["_display","_loaded", "_ctrl", "_label"];
|
||||||
disableSerialization;
|
disableSerialization;
|
||||||
_display = uiNamespace getvariable QGVAR(menuDisplay);
|
_display = uiNamespace getVariable QGVAR(menuDisplay);
|
||||||
if (isnil "_display") exitwith {
|
if (isnil "_display") exitWith {
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNull GVAR(interactionVehicle) || ACE_player distance GVAR(interactionVehicle) >= 10) exitwith {
|
if (isNull GVAR(interactionVehicle) || ACE_player distance GVAR(interactionVehicle) >= 10) exitWith {
|
||||||
closeDialog 0;
|
closeDialog 0;
|
||||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||||
};
|
};
|
||||||
|
|
||||||
_loaded = GVAR(interactionVehicle) getvariable [QGVAR(loaded), []];
|
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
|
||||||
_ctrl = _display displayCtrl 100;
|
_ctrl = _display displayCtrl 100;
|
||||||
_label = _display displayCtrl 2;
|
_label = _display displayCtrl 2;
|
||||||
|
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Start load item
|
* Start load item.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Any object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
*
|
*
|
||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object] call ace_cargo_fnc_starLoadIn
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_player", "_object"];
|
params ["_player", "_object"];
|
||||||
@ -19,11 +21,10 @@ private ["_nearestVehicle"];
|
|||||||
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
||||||
|
|
||||||
if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then {
|
if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then {
|
||||||
|
|
||||||
{
|
{
|
||||||
if ([_object, _x] call FUNC(canLoadItemIn)) exitwith {_nearestVehicle = _x};
|
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x};
|
||||||
} foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
|
} foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNull _nearestVehicle) exitwith {false};
|
if (isNull _nearestVehicle) exitWith {false};
|
||||||
[_object, _nearestVehicle] call FUNC(loadItem);
|
[_object, _nearestVehicle] call FUNC(loadItem);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Start unload action
|
* Start unload action.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* None
|
* None
|
||||||
@ -8,24 +8,28 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [] call ace_cargo_fnc_startUnload
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
|
private ["_display", "_loaded", "_ctrl", "_selected", "_item"];
|
||||||
disableSerialization;
|
|
||||||
_display = uiNamespace getvariable QGVAR(menuDisplay);
|
|
||||||
if (isnil "_display") exitwith {};
|
|
||||||
|
|
||||||
_loaded = GVAR(interactionVehicle) getvariable [QGVAR(loaded), []];
|
disableSerialization;
|
||||||
if (count _loaded == 0) exitwith {};
|
|
||||||
|
_display = uiNamespace getVariable QGVAR(menuDisplay);
|
||||||
|
if (isnil "_display") exitWith {};
|
||||||
|
|
||||||
|
_loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []];
|
||||||
|
if (count _loaded == 0) exitWith {};
|
||||||
|
|
||||||
_ctrl = _display displayCtrl 100;
|
_ctrl = _display displayCtrl 100;
|
||||||
|
|
||||||
_selected = (lbCurSel _ctrl) max 0;
|
_selected = (lbCurSel _ctrl) max 0;
|
||||||
|
|
||||||
if (count _loaded <= _selected) exitwith {};
|
if (count _loaded <= _selected) exitWith {};
|
||||||
_item = _loaded select _selected;
|
_item = _loaded select _selected;
|
||||||
|
|
||||||
[_item, GVAR(interactionVehicle)] call FUNC(unloadItem);
|
[_item, GVAR(interactionVehicle)] call FUNC(unloadItem);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal, ViperMaul
|
* Author: Glowbal, ViperMaul
|
||||||
* Unload object from vehicle
|
* Unload object from vehicle.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
@ -9,15 +9,18 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object, vehicle] call ace_cargo_fnc_unloadItem
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
|
private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"];
|
||||||
|
|
||||||
params ["_item", "_vehicle"];
|
params ["_item", "_vehicle"];
|
||||||
|
|
||||||
if !([_item, _vehicle] call FUNC(canUnloadItem)) exitwith {
|
if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith {
|
||||||
false
|
false
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,17 +44,17 @@ if (_vehicle isKindOf "Ship" ) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
|
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
|
||||||
if (!_validVehiclestate) exitwith { false };
|
if (!_validVehiclestate) exitWith { false };
|
||||||
|
|
||||||
if (count _emptyPos == 0) exitwith { false }; //consider displaying text saying there are no safe places to exit the vehicle
|
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 = _vehicle getVariable [QGVAR(loaded), []];
|
||||||
_loaded = _loaded - [_item];
|
_loaded = _loaded - [_item];
|
||||||
_vehicle setvariable [QGVAR(loaded), _loaded, true];
|
_vehicle setVariable [QGVAR(loaded), _loaded, true];
|
||||||
|
|
||||||
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
_space = [_vehicle] call FUNC(getCargoSpaceLeft);
|
||||||
_itemSize = [_item] call FUNC(getSizeItem);
|
_itemSize = [_item] call FUNC(getSizeItem);
|
||||||
_vehicle setvariable [QGVAR(space), (_space + _itemSize), true];
|
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
|
||||||
|
|
||||||
detach _item;
|
detach _item;
|
||||||
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
|
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Author: Glowbal
|
* Author: Glowbal
|
||||||
* Validate the vehicle cargo space
|
* Validate the vehicle cargo space.
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* 0: Object <OBJECT>
|
* 0: Object <OBJECT>
|
||||||
@ -8,14 +8,19 @@
|
|||||||
* Return value:
|
* Return value:
|
||||||
* None
|
* None
|
||||||
*
|
*
|
||||||
|
* Example:
|
||||||
|
* [object] call ace_cargo_fnc_validateCargoSpace
|
||||||
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_loaded", "_newLoaded", "_totalSpaceOccupied"];
|
private ["_loaded", "_newLoaded", "_totalSpaceOccupied"];
|
||||||
|
|
||||||
params ["_vehicle"];
|
params ["_vehicle"];
|
||||||
_loaded = _vehicle getvariable [QGVAR(loaded), []];
|
|
||||||
|
_loaded = _vehicle getVariable [QGVAR(loaded), []];
|
||||||
|
|
||||||
_newLoaded = [];
|
_newLoaded = [];
|
||||||
_totalSpaceOccupied = 0;
|
_totalSpaceOccupied = 0;
|
||||||
{
|
{
|
||||||
@ -27,6 +32,7 @@ _totalSpaceOccupied = 0;
|
|||||||
} count _loaded;
|
} count _loaded;
|
||||||
|
|
||||||
if (count _loaded != count _newLoaded) then {
|
if (count _loaded != count _newLoaded) then {
|
||||||
_vehicle setvariable [QGVAR(loaded), _newLoaded, true];
|
_vehicle setVariable [QGVAR(loaded), _newLoaded, true];
|
||||||
};
|
};
|
||||||
_vehicle setvariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true];
|
|
||||||
|
_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true];
|
||||||
|
@ -4,7 +4,7 @@ class GVAR(menu) {
|
|||||||
idd = 314614;
|
idd = 314614;
|
||||||
movingEnable = true;
|
movingEnable = true;
|
||||||
onLoad = QUOTE([_this select 0] call FUNC(onMenuOpen));
|
onLoad = QUOTE([_this select 0] call FUNC(onMenuOpen));
|
||||||
onUnload = QUOTE(uiNamespace setvariable [ARR_2(QUOTE(QGVAR(menuDisplay)),nil)];);
|
onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuDisplay)),nil)];);
|
||||||
class controlsBackground {
|
class controlsBackground {
|
||||||
class HeaderBackground: ACE_gui_backgroundBase{
|
class HeaderBackground: ACE_gui_backgroundBase{
|
||||||
idc = -1;
|
idc = -1;
|
||||||
@ -19,8 +19,8 @@ class GVAR(menu) {
|
|||||||
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
|
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)";
|
h = "14 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||||
text = "#(argb,8,8,3)color(0,0,0,0.8)";
|
text = "#(argb,8,8,3)color(0,0,0,0.8)";
|
||||||
colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
colorText[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
|
||||||
colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
|
colorBackground[] = {0,0,0,"(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ class GVAR(menu) {
|
|||||||
font = "PuristaMedium";
|
font = "PuristaMedium";
|
||||||
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||||
colorText[] = {0.95, 0.95, 0.95, 0.75};
|
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])"};
|
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);
|
text = CSTRING(cargoMenu);
|
||||||
};
|
};
|
||||||
class SubHeader: HeaderName {
|
class SubHeader: HeaderName {
|
||||||
|
Reference in New Issue
Block a user