From 715ebf2a913c326cc770f3605a6e780a31b538b3 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Tue, 3 Oct 2023 08:35:37 +0200 Subject: [PATCH 01/13] Update CfgVehicles.hpp --- addons/cargo/CfgVehicles.hpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/cargo/CfgVehicles.hpp b/addons/cargo/CfgVehicles.hpp index f3b6f2af5b5..485a53d8f58 100644 --- a/addons/cargo/CfgVehicles.hpp +++ b/addons/cargo/CfgVehicles.hpp @@ -173,7 +173,7 @@ class CfgVehicles { }; - // misc. vehicles + // Misc. vehicles class Quadbike_01_base_F: Car_F { GVAR(space) = 0; GVAR(hasCargo) = 0; @@ -184,7 +184,7 @@ class CfgVehicles { GVAR(hasCargo) = 0; }; - // helicopters + // Helicopters class Air; class Helicopter: Air { GVAR(space) = 8; @@ -224,7 +224,7 @@ class CfgVehicles { }; class Heli_Transport_04_base_F: Helicopter_Base_H { - // note the double brackets are because loadmasterTurrets is an array of arrays / turret paths + // Note the double brackets are because loadmasterTurrets is an array of arrays / turret paths GVAR(loadmasterTurrets)[] = {{1}}; GVAR(space) = 0; GVAR(hasCargo) = 0; @@ -363,8 +363,9 @@ class CfgVehicles { GVAR(size) = 6; }; + // Slingload pallets class Slingload_base_F: ReammoBox_F {}; - class CargoNet_01_base_F: Slingload_base_F { //Slingload pallets + class CargoNet_01_base_F: Slingload_base_F { GVAR(size) = 6; }; From be0035cc6cffac839ee4ecda728c82660a1ff44d Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 3 Nov 2023 20:57:45 +0100 Subject: [PATCH 02/13] Cargo cleanup --- addons/cargo/CfgEden.hpp | 2 +- addons/cargo/CfgEventHandlers.hpp | 1 - addons/cargo/XEH_PREP.hpp | 2 - addons/cargo/XEH_postInit.sqf | 93 +- addons/cargo/XEH_preInit.sqf | 6 +- addons/cargo/XEH_preStart.sqf | 27 +- addons/cargo/functions/fnc_addCargoItem.sqf | 20 +- .../functions/fnc_addCargoVehiclesActions.sqf | 26 +- addons/cargo/functions/fnc_canLoadItemIn.sqf | 59 +- addons/cargo/functions/fnc_canUnloadItem.sqf | 36 +- .../cargo/functions/fnc_getCargoSpaceLeft.sqf | 11 +- addons/cargo/functions/fnc_getNameItem.sqf | 24 +- addons/cargo/functions/fnc_getSizeItem.sqf | 16 +- addons/cargo/functions/fnc_handleDeleted.sqf | 25 - .../cargo/functions/fnc_handleDestroyed.sqf | 43 +- addons/cargo/functions/fnc_initObject.sqf | 44 +- addons/cargo/functions/fnc_initVehicle.sqf | 61 +- addons/cargo/functions/fnc_loadItem.sqf | 42 +- addons/cargo/functions/fnc_onMenuOpen.sqf | 63 +- addons/cargo/functions/fnc_paradropItem.sqf | 73 +- .../cargo/functions/fnc_removeCargoItem.sqf | 35 +- addons/cargo/functions/fnc_renameObject.sqf | 14 +- addons/cargo/functions/fnc_setSize.sqf | 52 +- addons/cargo/functions/fnc_setSpace.sqf | 47 +- addons/cargo/functions/fnc_startLoadIn.sqf | 67 +- addons/cargo/functions/fnc_startUnload.sqf | 87 +- .../cargo/functions/fnc_unloadCarryItem.sqf | 15 +- addons/cargo/functions/fnc_unloadItem.sqf | 66 +- .../functions/fnc_validateCargoSpace.sqf | 37 - addons/cargo/initSettings.sqf | 30 +- addons/cargo/menu.hpp | 22 +- addons/cargo/script_component.hpp | 4 - addons/cargo/stringtable.xml | 14 +- addons/common/define.hpp | 1223 ++++++++--------- .../functions/fnc_findUnloadPosition.sqf | 108 +- .../functions/fnc_dropObject_carry.sqf | 30 +- addons/rearm/initSettings.sqf | 2 +- addons/refuel/initSettings.sqf | 10 +- addons/towing/initSettings.sqf | 2 +- .../functions/fnc_moduleAddSpareTrack.sqf | 4 +- .../functions/fnc_moduleAddSpareWheel.sqf | 4 +- docs/wiki/framework/cargo-framework.md | 37 +- 42 files changed, 1354 insertions(+), 1230 deletions(-) delete mode 100644 addons/cargo/functions/fnc_handleDeleted.sqf delete mode 100644 addons/cargo/functions/fnc_validateCargoSpace.sqf diff --git a/addons/cargo/CfgEden.hpp b/addons/cargo/CfgEden.hpp index 8b67757af40..0a4cc7ba1bb 100644 --- a/addons/cargo/CfgEden.hpp +++ b/addons/cargo/CfgEden.hpp @@ -9,7 +9,7 @@ class Cfg3DEN { property = QGVAR(customName); control = "Edit"; - expression = QUOTE(_this setVariable [ARR_3(QQGVAR(customName), _value, true)];); + expression = QUOTE(_this setVariable [ARR_3(QQGVAR(customName),_value,true)]); defaultValue = "''"; condition = "objectHasInventoryCargo - objectVehicle"; diff --git a/addons/cargo/CfgEventHandlers.hpp b/addons/cargo/CfgEventHandlers.hpp index 6c29240403a..f6503c2479b 100644 --- a/addons/cargo/CfgEventHandlers.hpp +++ b/addons/cargo/CfgEventHandlers.hpp @@ -1,4 +1,3 @@ - class Extended_PreStart_EventHandlers { class ADDON { init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); diff --git a/addons/cargo/XEH_PREP.hpp b/addons/cargo/XEH_PREP.hpp index 95fefb4ba02..2d77fc90de4 100644 --- a/addons/cargo/XEH_PREP.hpp +++ b/addons/cargo/XEH_PREP.hpp @@ -5,7 +5,6 @@ PREP(canUnloadItem); PREP(getCargoSpaceLeft); PREP(getNameItem); PREP(getSizeItem); -PREP(handleDeleted); PREP(handleDestroyed); PREP(initObject); PREP(initVehicle); @@ -21,4 +20,3 @@ PREP(startLoadIn); PREP(startUnload); PREP(unloadCarryItem); PREP(unloadItem); -PREP(validateCargoSpace); diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 6146f2c862c..ee0617df278 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -1,49 +1,33 @@ #include "script_component.hpp" -["ace_addCargo", {_this call FUNC(addCargoItem)}] call CBA_fnc_addEventHandler; -[QGVAR(paradropItem), { - params ["_item", "_vehicle", ["_showHint", true]]; - - private _unloaded = [_item, _vehicle, _showHint] call FUNC(paradropItem); - - if (_unloaded && {GVAR(openAfterUnload) in [2, 3]}) then { - GVAR(interactionVehicle) = _vehicle; - GVAR(interactionParadrop) = true; - createDialog QGVAR(menu); - }; -}] call CBA_fnc_addEventHandler; +["ace_addCargo", LINKFUNC(addCargoItem)] call CBA_fnc_addEventHandler; ["ace_loadCargo", { params ["_item", "_vehicle"]; TRACE_2("LoadCargo EH",_item,_vehicle); - private _loaded = [_item, _vehicle] call FUNC(loadItem); + private _loaded = [_item, _vehicle] call FUNC(loadItem); // returns true if successful // Show hint as feedback - private _hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded; + private _hint = [LSTRING(loadingFailed), LSTRING(loadedItem)] select _loaded; private _itemName = [_item, true] call FUNC(getNameItem); private _vehicleName = getText (configOf _vehicle >> "displayName"); - [[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured); - - if (_loaded) then { - // Invoke listenable event - ["ace_cargoLoaded", [_item, _vehicle]] call CBA_fnc_globalEvent; - }; + [[_hint, _itemName, _vehicleName], 3] call EFUNC(common,displayTextStructured); }] call CBA_fnc_addEventHandler; ["ace_unloadCargo", { params ["_item", "_vehicle", ["_unloader", objNull]]; TRACE_3("UnloadCargo EH",_item,_vehicle,_unloader); - private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); //returns true if sucessful + private _unloaded = [_item, _vehicle, _unloader] call FUNC(unloadItem); // returns true if successful // Show hint as feedback - private _hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded; + private _hint = [LSTRING(unloadingFailed), LSTRING(unloadedItem)] select _unloaded; private _itemName = [_item, true] call FUNC(getNameItem); private _vehicleName = getText (configOf _vehicle >> "displayName"); - [[_hint, _itemName, _vehicleName], 3.0] call EFUNC(common,displayTextStructured); + [[_hint, _itemName, _vehicleName], 3] call EFUNC(common,displayTextStructured); if (_unloaded && {GVAR(openAfterUnload) in [1, 3]}) then { GVAR(interactionVehicle) = _vehicle; @@ -61,13 +45,24 @@ [_item, "blockDamage", "ACE_cargo", false] call EFUNC(common,statusEffect_set); }] call CBA_fnc_addEventHandler; -// Private events to handle adding actions globally via public functions -[QGVAR(initObject), DFUNC(initObject)] call CBA_fnc_addEventHandler; -[QGVAR(initVehicle), DFUNC(initVehicle)] call CBA_fnc_addEventHandler; +[QGVAR(paradropItem), { + params ["_item", "_vehicle", ["_showHint", true]]; + + private _unloaded = [_item, _vehicle, _showHint] call FUNC(paradropItem); + + if (_unloaded && {GVAR(openAfterUnload) in [2, 3]}) then { + GVAR(interactionVehicle) = _vehicle; + GVAR(interactionParadrop) = true; + createDialog QGVAR(menu); + }; +}] call CBA_fnc_addEventHandler; +// Private events to handle adding actions globally via public functions +[QGVAR(initObject), LINKFUNC(initObject)] call CBA_fnc_addEventHandler; +[QGVAR(initVehicle), LINKFUNC(initVehicle)] call CBA_fnc_addEventHandler; GVAR(vehicleAction) = [ - QGVAR(openMenu), localize LSTRING(openMenu), "", + QGVAR(openMenu), LLSTRING(openMenu), "", { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; @@ -77,16 +72,16 @@ GVAR(vehicleAction) = [ { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && - {(_target getVariable [QGVAR(hasCargo), getNumber (configOf _target >> QGVAR(hasCargo)) == 1])} && - {locked _target < 2} && - {([_player, _target] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} && {alive _target} && - {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} + {locked _target < 2} && + {(_target getVariable [QGVAR(hasCargo), getNumber (configOf _target >> QGVAR(hasCargo)) == 1])} && + {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && + {([_player, _target] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} } ] call EFUNC(interact_menu,createAction); GVAR(objectActions) = [ - [QGVAR(renameObject), LELSTRING(common,rename), "", //TODO: add icon, maybe a pencil couldn't find it before. + [QGVAR(renameObject), LELSTRING(common,rename), "\a3\Modules_F_Curator\Data\iconMissionName_ca.paa", { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; @@ -96,57 +91,65 @@ GVAR(objectActions) = [ //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && {GVAR(enableRename)} && - {(_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad))]) in [true, 1]} && {alive _target} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && - {(_target getVariable [QGVAR(noRename), getNumber (configOf _target >> QGVAR(noRename))]) in [false, 0]} + {_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad)) == 1]} && + {!(_target getVariable [QGVAR(noRename), getNumber (configOf _target >> QGVAR(noRename)) == 1])} } ] call EFUNC(interact_menu,createAction), - [QGVAR(load), localize LSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", + [QGVAR(load), LLSTRING(loadObject), "a3\ui_f\data\IGUI\Cfg\Actions\loadVehicle_ca.paa", { - params ["_target", "_player"]; + //IGNORE_PRIVATE_WARNING ["_target", "_player"]; [_player, _target] call FUNC(startLoadIn); }, { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(enable) && - {(_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad))]) in [true, 1]} && - {locked _target < 2} && {alive _target} && + {locked _target < 2} && {[_player, _target, ["isNotSwimming"]] call EFUNC(common,canInteractWith)} && - {((nearestObjects [_target, GVAR(cargoHolderTypes), (MAX_LOAD_DISTANCE + 10)]) findIf { - private _hasCargoConfig = 1 == getNumber (configOf _x >> QGVAR(hasCargo)); - private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; - (_hasCargoConfig || {_hasCargoPublic}) && {_x != _target} && {alive _x} && {locked _x < 2} && + {_target getVariable [QGVAR(canLoad), getNumber (configOf _target >> QGVAR(canLoad)) == 1]} && + {((nearestObjects [_target, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE + 10]) findIf { + _x != _target && + {alive _x} && + {locked _x < 2} && + {_x getVariable [QGVAR(hasCargo), getNumber (configOf _x >> QGVAR(hasCargo)) == 1]} && {([_target, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} - }) > -1} + }) != -1} }, LINKFUNC(addCargoVehiclesActions) ] call EFUNC(interact_menu,createAction) ]; -// find all remaining configured classes and init them, see XEH_preStart.sqf +// Find all remaining configured classes and init them, see XEH_preStart.sqf private _vehicleClassesAddAction = call (uiNamespace getVariable [QGVAR(initializedVehicleClasses), {[]}]); + { [_x, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass); } forEach _vehicleClassesAddAction; + GVAR(initializedVehicleClasses) append _vehicleClassesAddAction; private _objectClassesAddAction = call (uiNamespace getVariable [QGVAR(initializedItemClasses), {[]}]); + { private _objectClass = _x; + { [_objectClass, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToClass); } forEach GVAR(objectActions); } forEach _objectClassesAddAction; + GVAR(initializedItemClasses) append _objectClassesAddAction; private _vehicleClassesAddClassEH = call (uiNamespace getVariable [QGVAR(vehicleClasses_classEH), {[]}]); + { [_x, "initPost", DFUNC(initVehicle), nil, nil, true] call CBA_fnc_addClassEventHandler; } forEach _vehicleClassesAddClassEH; private _objectClassesAddClassEH = call (uiNamespace getVariable [QGVAR(objectClasses_classEH), {[]}]); + { [_x, "initPost", DFUNC(initObject), nil, nil, true] call CBA_fnc_addClassEventHandler; } forEach _objectClassesAddClassEH; @@ -154,7 +157,9 @@ private _objectClassesAddClassEH = call (uiNamespace getVariable [QGVAR(objectCl if (isServer) then { ["ace_placedInBodyBag", { params ["_target", "_bodyBag", "_isGrave"]; + if (_isGrave) exitWith {}; // assume graves aren't cargo + _bodyBag setVariable [QGVAR(customName), [_target, false, true] call EFUNC(common,getName), true]; }] call CBA_fnc_addEventHandler; }; diff --git a/addons/cargo/XEH_preInit.sqf b/addons/cargo/XEH_preInit.sqf index f14ccc5958e..ce29dc8a6e8 100644 --- a/addons/cargo/XEH_preInit.sqf +++ b/addons/cargo/XEH_preInit.sqf @@ -10,11 +10,11 @@ PREP_RECOMPILE_END; GVAR(initializedItemClasses) = []; GVAR(initializedVehicleClasses) = []; -GVAR(cargoHolderTypes) = ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"]; -GVAR(disableParadropEffectsClasstypes) = ["Car_F"]; +GVAR(cargoHolderTypes) = ["Car", "Air", "Tank", "Ship", "Cargo_base_F", "Land_PaperBox_closed_F"] apply {_x call EFUNC(common,getConfigName)}; // make sure they are config case +GVAR(disableParadropEffectsClasstypes) = ["Car_F"] apply {_x call EFUNC(common,getConfigName)}; if (isServer) then { - ["All", "Deleted", LINKFUNC(handleDeleted)] call CBA_fnc_addClassEventHandler; + ["All", "Deleted", LINKFUNC(handleDestroyed)] call CBA_fnc_addClassEventHandler; }; ["All", "Killed", LINKFUNC(handleDestroyed)] call CBA_fnc_addClassEventHandler; diff --git a/addons/cargo/XEH_preStart.sqf b/addons/cargo/XEH_preStart.sqf index e7b3f5c59b2..e5ef5075565 100644 --- a/addons/cargo/XEH_preStart.sqf +++ b/addons/cargo/XEH_preStart.sqf @@ -2,36 +2,38 @@ #include "XEH_PREP.hpp" - -//See XEH_postInit.sqf +// See XEH_postInit.sqf private _vehicleClasses_addClassEH = ["ThingX", "LandVehicle", "Air", "Ship_F"]; private _objectClasses_addClassEH = ["ThingX", "StaticWeapon"]; private _vehicleClasses_addAction = []; private _itemClasses_addAction = []; +private _class = ""; -// find all remaining configured classes and init them +// Find all remaining configured classes and init them { - private _class = configName _x; - // init vehicle + _class = configName _x; + + // Init vehicle if ( - 1 == getNumber (_x >> QGVAR(hasCargo)) - && {-1 == _vehicleClasses_addClassEH findIf {_class isKindOf _x}} + getNumber (_x >> QGVAR(hasCargo)) == 1 && + {_vehicleClasses_addClassEH findIf {_class isKindOf _x} == -1} ) then { if (_class isKindOf "Static") then { - if (2 == getNumber (_x >> "scope")) then { + if (getNumber (_x >> "scope") == 2) then { _vehicleClasses_addAction pushBackUnique _class; }; } else { _vehicleClasses_addClassEH pushBackUnique _class; }; }; - // init object + + // Init object if ( - 1 == getNumber (_x >> QGVAR(canLoad)) - && {-1 == _objectClasses_addClassEH findIf {_class isKindOf _x}} + getNumber (_x >> QGVAR(canLoad)) == 1 && + {_objectClasses_addClassEH findIf {_class isKindOf _x} == -1} ) then { if (_class isKindOf "Static") then { - if (2 == getNumber (_x >> "scope")) then { + if (getNumber (_x >> "scope") == 2) then { _itemClasses_addAction pushBackUnique _class; }; } else { @@ -40,7 +42,6 @@ private _itemClasses_addAction = []; }; } forEach ("true" configClasses (configFile >> "CfgVehicles")); - uiNamespace setVariable [QGVAR(vehicleClasses_classEH), compileFinal str _vehicleClasses_addClassEH]; uiNamespace setVariable [QGVAR(objectClasses_classEH), compileFinal str _objectClasses_addClassEH]; uiNamespace setVariable [QGVAR(initializedVehicleClasses), compileFinal str _vehicleClasses_addAction]; diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index ecaa4e316f5..5bddf7a5931 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -4,26 +4,30 @@ * Adds a cargo item to the vehicle. * * Arguments: - * 0: Item Classname - * 1: Vehicle + * 0: Item to be loaded or + * 1: Holder object (vehicle) * 2: Amount (default: 1) - * 3: Show Hint (default: false) * * Return Value: * None * * Example: - * ["item", vehicle] call ace_cargo_fnc_addCargoItem + * ["ACE_Wheel", cursorObject] call ace_cargo_fnc_addCargoItem * * Public: No */ -params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]]]; -TRACE_3("params",_itemClass,_vehicle,_amount); +params ["_item", "_vehicle", ["_amount", 1]]; +TRACE_3("params",_item,_vehicle,_amount); + +// Get config sensitive case name +if (_item isEqualType "") then { + _item = _item call EFUNC(common,getConfigName); +}; for "_i" from 1 to _amount do { - [_itemClass, _vehicle] call FUNC(loadItem); + [_item, _vehicle] call FUNC(loadItem); }; // Invoke listenable event -["ace_cargoAdded", [_itemClass, _vehicle, _amount]] call CBA_fnc_globalEvent; +["ace_cargoAdded", [_item, _vehicle, _amount]] call CBA_fnc_globalEvent; diff --git a/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf index 811ccd2b367..4aa18867d6a 100644 --- a/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf +++ b/addons/cargo/functions/fnc_addCargoVehiclesActions.sqf @@ -1,32 +1,34 @@ #include "..\script_component.hpp" /* * Author: Dystopian - * Create actions for nearest vehicles with cargo. + * Creates actions for nearest vehicles with cargo. * * Arguments: - * 0: Target + * 0: Holder object (vehicle) * * Return Value: * Child actions * * Example: - * [cursorObject] call ace_cargo_fnc_addCargoVehiclesActions + * cursorObject call ace_cargo_fnc_addCargoVehiclesActions * * Public: No */ -params ["_target"]; +params ["_vehicle"]; private _statement = { - params ["_target", "_player", "_vehicle"]; - [_player, _target, _vehicle] call FUNC(startLoadIn); + params ["_item", "_loader", "_vehicle"]; + + [_loader, _item, _vehicle] call FUNC(startLoadIn); }; -private _vehicles = (nearestObjects [_target, GVAR(cargoHolderTypes), (MAX_LOAD_DISTANCE + 10)]) select { - private _hasCargoConfig = 1 == getNumber (configOf _x >> QGVAR(hasCargo)); - private _hasCargoPublic = _x getVariable [QGVAR(hasCargo), false]; - (_hasCargoConfig || {_hasCargoPublic}) && {_x != _target} && {alive _x} && {locked _x < 2} && - {([_target, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} +private _vehicles = (nearestObjects [_vehicle, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE + 10]) select { + _x != _vehicle && + {alive _x} && + {locked _x < 2} && + {_x getVariable [QGVAR(hasCargo), getNumber (configOf _x >> QGVAR(hasCargo)) == 1]} && + {([_vehicle, _x] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} }; -[_vehicles, _statement, _target] call EFUNC(interact_menu,createVehiclesActions) +[_vehicles, _statement, _vehicle] call EFUNC(interact_menu,createVehiclesActions) diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index 0851c07fac0..6a455932971 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -1,48 +1,57 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Check if item can be loaded into other Object. + * Checks if the item can be loaded into another object. * * Arguments: - * 0: Item - * 1: Holder Object (Vehicle) - * 2: Ignore interaction distance and stability checks + * 0: Item to be loaded or + * 1: Holder object (vehicle) + * 2: Ignore interaction distance and stability checks (default: false) * * Return Value: - * Can load in + * Can be loaded * * Example: - * [item, holder] call ace_cargo_fnc_canLoadItemIn + * ["ACE_Wheel", cursorObject] call ace_cargo_fnc_canLoadItemIn * * Public: No */ -params [["_item", "", [objNull,""]], "_vehicle", ["_ignoreInteraction", false]]; +params ["_item", "_vehicle", ["_ignoreInteraction", false]]; -if ((!_ignoreInteraction) && {speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}}) exitWith {TRACE_1("vehicle not stable",_vehicle); false}; +// Check if vehicle is stable +if (!_ignoreInteraction && {speed _vehicle > 1 || {((getPos _vehicle) select 2) > 3}}) exitWith { + TRACE_1("vehicle not stable",_vehicle); -if (_item isEqualType objNull && {{alive _x && {getText (configOf _x >> "simulation") != "UAVPilot"}} count crew _item > 0}) exitWith { + false // return +}; + +// If there is crew that isn't UAV crew, exit +if (_item isEqualType objNull && {(crew _item) findIf {alive _x && {!unitIsUAV _x}} != -1}) exitWith { TRACE_1("item is occupied",_item); - false + + false // return }; -private _itemSize = [_item] call FUNC(getSizeItem); -private _validItem = false; -if (_item isEqualType "") then { - _validItem = - isClass (configFile >> "CfgVehicles" >> _item) && - {getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1}; +private _itemSize = _item call FUNC(getSizeItem); + +private _validItem = if (_item isEqualType "") then { + private _config = configFile >> "CfgVehicles" >> _item; + + isClass _config && + {getNumber (_config >> QGVAR(canLoad)) == 1} } else { - _validItem = - (alive _item) && - {_ignoreInteraction || {([_item, _vehicle] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}} && - {!(_item getVariable [QEGVAR(cookoff,isCookingOff), false])} && - {isNull(_item getVariable [QEGVAR(refuel,nozzle), objNull])} && // Objects which have a refueling nozzle connected to them cannot be loaded - {isNull(_item getVariable [QEGVAR(refuel,ownedNozzle), objNull])}; // Fuel sources which have their nozzle out cannot be loaded + alive _item && + {_item getVariable [QGVAR(canLoad), getNumber (configOf _item >> QGVAR(canLoad)) == 1]} && + {_ignoreInteraction || {([_item, _vehicle] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}} && + {!(_item getVariable [QEGVAR(cookoff,isCookingOff), false])} && // do not load items that are cooking off + {isNull (_item getVariable [QEGVAR(refuel,nozzle), objNull])} && // objects which have a refueling nozzle connected to them cannot be loaded + {isNull (_item getVariable [QEGVAR(refuel,ownedNozzle), objNull])} // fuel sources which have their nozzle out cannot be loaded }; _validItem && -{_itemSize > 0} && {alive _vehicle} && -{_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} && -{locked _vehicle < 2} +{locked _vehicle < 2} && +{_vehicle getVariable [QGVAR(hasCargo), getNumber (configOf _vehicle >> QGVAR(hasCargo)) == 1]} && +{_itemSize >= 0} && +{_itemSize <= (_vehicle call FUNC(getCargoSpaceLeft)) max 0} diff --git a/addons/cargo/functions/fnc_canUnloadItem.sqf b/addons/cargo/functions/fnc_canUnloadItem.sqf index fd69d5f9bdc..357ba78f21c 100644 --- a/addons/cargo/functions/fnc_canUnloadItem.sqf +++ b/addons/cargo/functions/fnc_canUnloadItem.sqf @@ -1,30 +1,44 @@ #include "..\script_component.hpp" /* * Author: Glowbal, ViperMaul - * Check if item can be unloaded. + * Checks if the item can be unloaded from another object. * * Arguments: - * 0: loaded Object - * 1: Object - * 2: Unloader (player) (default: objNull) + * 0: Item to be unloaded or + * 1: Holder object (vehicle) + * 2: Unit doing the unloading (default: objNull) + * 3: Ignore interaction distance and stability checks (default: false) + * 4: Ignore finding a suitable position (default: false) * * Return Value: * Can be unloaded * * Example: - * [item, holder] call ace_cargo_fnc_canUnloadItem + * ["ACE_Wheel", cursorObject] call ace_cargo_fnc_canUnloadItem * * Public: No */ -params ["_item", "_vehicle", ["_unloader", objNull]]; +params ["_item", "_vehicle", ["_unloader", objNull], ["_ignoreInteraction", false], ["_ignoreFindPosition", false]]; TRACE_2("params",_item,_vehicle); -private _loaded = _vehicle getVariable [QGVAR(loaded), []]; -if !(_item in _loaded) exitWith {false}; +// Get config sensitive case name +if (_item isEqualType "") then { + _item = _item call EFUNC(common,getConfigName); +}; -private _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item}; +if !(_item in (_vehicle getVariable [QGVAR(loaded), []])) exitWith {false}; -private _emptyPos = [_vehicle, _itemClass, _unloader] call EFUNC(common,findUnloadPosition); +private _validItem = if (_item isEqualType objNull) then { + alive _item +} else { + true +}; -(count _emptyPos) == 3 +_validItem && +{alive _vehicle} && +{locked _vehicle < 2} && +{_vehicle getVariable [QGVAR(hasCargo), getNumber (configOf _vehicle >> QGVAR(hasCargo)) == 1]} && +{_item call FUNC(getSizeItem) >= 0} && +{_ignoreInteraction || {([_unloader, _vehicle] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE}} && +{_ignoreFindPosition || {([_vehicle, _item, _unloader, MAX_LOAD_DISTANCE, !_ignoreInteraction] call EFUNC(common,findUnloadPosition)) isNotEqualTo []}} diff --git a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf index a0e8d2993d9..e797b0820d8 100644 --- a/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf +++ b/addons/cargo/functions/fnc_getCargoSpaceLeft.sqf @@ -1,21 +1,20 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Get the cargo space left on object. + * Gets the object's remaining cargo space. * * Arguments: - * 0: Object + * 0: Holder object (vehicle) * * Return Value: * Cargo space left * * Example: - * [object] call ace_cargo_fnc_getCargoSpaceLeft + * cursorObject call ace_cargo_fnc_getCargoSpaceLeft * * Public: No */ -params ["_object"]; -// TRACE_1("params",_object); +params ["_vehicle"]; -(_object getVariable [QGVAR(space), getNumber (configOf _object >> QGVAR(space))]) max 0 +_vehicle getVariable [QGVAR(space), getNumber (configOf _vehicle >> QGVAR(space))] diff --git a/addons/cargo/functions/fnc_getNameItem.sqf b/addons/cargo/functions/fnc_getNameItem.sqf index a28d128c63e..b71ae073cb1 100644 --- a/addons/cargo/functions/fnc_getNameItem.sqf +++ b/addons/cargo/functions/fnc_getNameItem.sqf @@ -4,31 +4,31 @@ * Gets the name of the item, and alternatively the custom name if requested and available. * * Arguments: - * 0: Target - * 1: Add custom name part (default: false) + * 0: Item or (default: "") + * 1: Add custom name (default: false) * * Return Value: - * Item Name + * Item name * * Example: - * [crate_7] call ace_cargo_fnc_getNameItem + * cursorObject call ace_cargo_fnc_getNameItem * * Public: Yes */ -params ["_object", ["_addCustomPart", false]]; +params [["_item", "", [objNull, ""]], ["_addCustomName", false, [false]]]; -private _displayName = if (_object isEqualType "") then { - getText (configFile >> "CfgVehicles" >> _object >> "displayName") +private _displayName = if (_item isEqualType "") then { + getText (configFile >> "CfgVehicles" >> _item >> "displayName") } else { - getText ((configOf _object) >> "displayName") + getText (configOf _item >> "displayName") }; -if (_addCustomPart && {!(_object isEqualType "")}) then { - private _customPart = _object getVariable [QGVAR(customName), ""]; +if (_addCustomName && {_item isEqualType objNull}) then { + private _customName = _item getVariable [QGVAR(customName), ""]; - if (_customPart isNotEqualTo "") then { - _displayName = _displayName + " [" + _customPart + "]"; + if (_customName isNotEqualTo "") then { + _displayName = _displayName + " [" + _customName + "]"; }; }; diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index 24b47f70b2a..bf049b71b3e 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -1,29 +1,25 @@ #include "..\script_component.hpp" /* * Author: Glowbal, kymckay - * Get the cargo size of an object. + * Gets the cargo size of an object. * * Arguments: - * 0: Item + * 0: Item or * * Return Value: * Cargo size (default: -1) * * Example: - * [object] call ace_cargo_fnc_getSizeItem + * cursorObject call ace_cargo_fnc_getSizeItem * * Public: No */ params ["_item"]; -// Virtual items are much easier to deal with +// Default cargo size is -1 as 0 is a valid size if (_item isEqualType "") then { - CARGO_SIZE(_item) + GET_NUMBER(configFile >> "CfgVehicles" >> _item >> QGVAR(size),-1) } else { - if (isNil {_item getVariable QGVAR(size)}) then { - CARGO_SIZE(typeOf _item) - } else { - _item getVariable QGVAR(size) - }; + _item getVariable [QGVAR(size), GET_NUMBER(configOf _item >> QGVAR(size),-1)] }; diff --git a/addons/cargo/functions/fnc_handleDeleted.sqf b/addons/cargo/functions/fnc_handleDeleted.sqf deleted file mode 100644 index a4300aea257..00000000000 --- a/addons/cargo/functions/fnc_handleDeleted.sqf +++ /dev/null @@ -1,25 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: mharis001 - * Handles an object being deleted by deleting all loaded cargo. - * - * Arguments: - * 0: Object - * - * Return Value: - * None - * - * Example: - * [_object] call ace_cargo_fnc_handleDeleted - * - * Public: No - */ - -params ["_object"]; - -{ - if (_x isEqualType objNull) then { - detach _x; - deleteVehicle _x; - }; -} forEach (_object getVariable [QGVAR(loaded), []]); diff --git a/addons/cargo/functions/fnc_handleDestroyed.sqf b/addons/cargo/functions/fnc_handleDestroyed.sqf index 016917f5f7e..cc5777723dc 100644 --- a/addons/cargo/functions/fnc_handleDestroyed.sqf +++ b/addons/cargo/functions/fnc_handleDestroyed.sqf @@ -1,7 +1,9 @@ #include "..\script_component.hpp" /* - * Author: Glowbal - * Handle object being destroyed. + * Author: mharis001, Glowbal + * Handles an object being destroyed/deleted. + * If object contained loaded cargo, the cargo is deleted. + * If object was loaded cargo, it's removed from loaded cargo list. * * Arguments: * 0: Object @@ -10,23 +12,34 @@ * None * * Example: - * [_object] call ace_cargo_fnc_handleDestroyed + * cursorObject call ace_cargo_fnc_handleDestroyed * * Public: No */ -params ["_vehicle"]; -TRACE_1("params",_vehicle); +params ["_object"]; -private _loaded = _vehicle getVariable [QGVAR(loaded), []]; -if (_loaded isEqualTo []) exitWith {}; +private _loaded = _object getVariable [QGVAR(loaded), []]; -{ - // TODO Do we want to be able to recover destroyed equipment? - if (_x isEqualType objNull) then { - detach _x; - deleteVehicle _x; - }; -} forEach _loaded; +if (_loaded isNotEqualTo []) then { + // Delete all cargo + { + if (_x isEqualType objNull) then { + detach _x; + deleteVehicle _x; + }; + } forEach _loaded; -[_vehicle] call FUNC(validateCargoSpace); + // In case vehicle is killed, but not deleted, reset loaded list + _object setVariable [QGVAR(loaded), [], true]; +}; + +// Update remaining cargo space, if loaded as cargo in a vehicle +private _vehicle = attachedTo _object; + +if (!isNull _vehicle && {_object in (_vehicle getVariable [QGVAR(loaded), []])}) then { + private _cargoSpace = _vehicle call FUNC(getCargoSpaceLeft); + private _itemSize = (_object call FUNC(getSizeItem)) max 0; // don't let negative size items increase space + + _vehicle setVariable [QGVAR(space), _cargoSpace + _itemSize, true]; +}; diff --git a/addons/cargo/functions/fnc_initObject.sqf b/addons/cargo/functions/fnc_initObject.sqf index 0842d51faad..a8522ad2830 100644 --- a/addons/cargo/functions/fnc_initObject.sqf +++ b/addons/cargo/functions/fnc_initObject.sqf @@ -4,51 +4,57 @@ * Initializes variables for loadable objects. Called from init EH. * * Arguments: - * 0: Object + * 0: Item * * Return Value: * None * * Example: - * [object] call ace_cargo_fnc_initObject + * cursorObject call ace_cargo_fnc_initObject * * Public: No */ -params ["_object"]; -private _type = typeOf _object; -private _config = configOf _object; -TRACE_2("params",_object,_type); +// Dedicated servers and HCs do not require action menus +if (!hasInterface) exitWith {}; -// If object had size given to it via eden/public then override config canLoad setting -private _canLoadPublic = _object getVariable [QGVAR(canLoad), false]; -if (!(_canLoadPublic isEqualType false)) then { - WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_object,_type,QGVAR(canLoad),_canLoadPublic); +params ["_item"]; +private _type = typeOf _item; +TRACE_2("params",_item,_type); + +// If object had size given to it via eden/public, then override config canLoad setting +private _canLoadPublic = _item getVariable QGVAR(canLoad); +private _canLoadPublicDefined = !isNil "_canLoadPublic"; + +if (_canLoadPublicDefined && {!(_canLoadPublic isEqualType false)}) then { + WARNING_4("%1[%2] - Variable %3 is %4 - Should be bool",_item,_type,QGVAR(canLoad),_canLoadPublic); }; -private _canLoadConfig = getNumber (_config >> QGVAR(canLoad)) == 1; -// Nothing to do here if object can't be loaded -if !(_canLoadConfig || {_canLoadPublic in [true, 1]}) exitWith {}; +private _canLoadConfig = getNumber (configOf _item >> QGVAR(canLoad)) == 1; -// Servers and HCs do not require action menus (beyond this point) -if !(hasInterface) exitWith {}; +// Nothing to do here if object can't be loaded +if !((_canLoadPublicDefined && {_canLoadPublic in [true, 1]}) || {!_canLoadPublicDefined && {_canLoadConfig}}) exitWith {}; // Unnecessary to add actions to an object class that's already got them if (_type in GVAR(initializedItemClasses)) exitWith {}; -if (_object getVariable [QGVAR(initObject),false]) exitWith {}; +if (_item getVariable [QGVAR(initObject),false]) exitWith {}; // Objects given size via eden have their actions added to the object // So this function may run for multiple of the same class in that case if (_canLoadConfig) then { GVAR(initializedItemClasses) pushBack _type; + TRACE_1("Adding load cargo action to class", _type); + { [_type, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToClass); } forEach GVAR(objectActions); } else { - _object setVariable [QGVAR(initObject),true]; - TRACE_1("Adding load cargo action to object", _object); + _item setVariable [QGVAR(initObject), true]; + + TRACE_1("Adding load cargo action to object", _item); + { - [_object, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToObject); + [_item, 0, ["ACE_MainActions"], _x] call EFUNC(interact_menu,addActionToObject); } forEach GVAR(objectActions); }; diff --git a/addons/cargo/functions/fnc_initVehicle.sqf b/addons/cargo/functions/fnc_initVehicle.sqf index 948fdf525e4..ed0a02cba9d 100644 --- a/addons/cargo/functions/fnc_initVehicle.sqf +++ b/addons/cargo/functions/fnc_initVehicle.sqf @@ -10,7 +10,7 @@ * None * * Example: - * [vehicle] call ace_cargo_fnc_initVehicle + * cursorObject call ace_cargo_fnc_initVehicle * * Public: No */ @@ -21,7 +21,7 @@ TRACE_1("params", _vehicle); private _type = typeOf _vehicle; private _config = configOf _vehicle; -// If vehicle had space given to it via eden/public then override config hasCargo setting +// If vehicle had space given to it via eden/public, then override config hasCargo setting private _hasCargoPublic = _vehicle getVariable [QGVAR(hasCargo), false]; private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1; @@ -29,41 +29,53 @@ private _hasCargoConfig = getNumber (_config >> QGVAR(hasCargo)) == 1; if !(_hasCargoConfig || _hasCargoPublic) exitWith {}; // Check if cargo is in cargo holder types (checked when trying to search for loadable objects) -private _addCargoType = true; -{ - if (_type isKindOf _x) exitWith {_addCargoType = false}; -} forEach GVAR(cargoHolderTypes); +private _addCargoType = GVAR(cargoHolderTypes) findIf {_type isKindOf _x} == -1; + TRACE_2("",_addCargoType,_type); + if (_addCargoType) then { GVAR(cargoHolderTypes) pushBack _type; }; -// Vehicle can have default ace cargo in its config +// If already initialised (both actions and cargo), then skip +if (_vehicle getVariable [QGVAR(initVehicle), false]) exitWith {}; + +// Vehicles can have default ace cargo in their config if (isServer) then { + _vehicle setVariable [QGVAR(initVehicle), true]; + + private _cargoClassname = ""; + private _cargoCount = 0; + { - private _cargoClassname = getText (_x >> "type"); - private _cargoCount = getNumber (_x >> "amount"); - TRACE_3("adding ACE_Cargo", (configName _x), _cargoClassname, _cargoCount); + _cargoClassname = getText (_x >> "type"); + _cargoCount = getNumber (_x >> "amount"); + + TRACE_3("adding ACE_Cargo",configName _x,_cargoClassname,_cargoCount); + ["ace_addCargo", [_cargoClassname, _vehicle, _cargoCount]] call CBA_fnc_localEvent; - } forEach ("true" configClasses (_config >> QUOTE(ADDON) >> "Cargo")); + } forEach ("true" configClasses (_config >> QUOTE(ADDON) >> "cargo")); }; // Servers and HCs do not require action menus (beyond this point) -if !(hasInterface) exitWith {}; +if (!hasInterface) exitWith {}; // Unnecessary to add actions to a vehicle class that's already got them if (_type in GVAR(initializedVehicleClasses)) exitWith {}; -if (_vehicle getVariable [QGVAR(initVehicle),false]) exitWith {}; // Vehicles given cargo via eden have their actions added to the object // So this function may run for multiple of the same class in that case if (_hasCargoConfig) then { GVAR(initializedVehicleClasses) pushBack _type; + TRACE_1("Adding unload cargo action to class", _type); + [_type, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToClass); } else { - _vehicle setVariable [QGVAR(initVehicle),true]; + _vehicle setVariable [QGVAR(initVehicle), true]; + TRACE_1("Adding unload cargo action to object", _vehicle); + [_vehicle, 0, ["ACE_MainActions"], GVAR(vehicleAction)] call EFUNC(interact_menu,addActionToObject); }; @@ -71,24 +83,31 @@ if (_hasCargoConfig) then { if (_vehicle isKindOf "Air") then { private _condition = { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; - GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)} && { - private _turretPath = _player call CBA_fnc_turretPath; - (_player == (driver _target)) || // pilot - {(getNumber (([_target, _turretPath] call CBA_fnc_getTurret) >> "isCopilot")) == 1} || // coPilot - {_turretPath in (getArray (configOf _target >> QGVAR(loadmasterTurrets)))}} // loadMaster turret from config + GVAR(enable) && + {[_player, _target, []] call EFUNC(common,canInteractWith)} && { + private _turretPath = _target unitTurret _player; + + (_player == currentPilot _target) || // Pilot/Co-pilot + {(getNumber ([_target, _turretPath] call CBA_fnc_getTurret >> "isCopilot")) == 1} || // Co-pilot + {_turretPath in (getArray (configOf _target >> QGVAR(loadmasterTurrets)))} + } }; + private _statement = { //IGNORE_PRIVATE_WARNING ["_target", "_player"]; GVAR(interactionVehicle) = _target; GVAR(interactionParadrop) = true; createDialog QGVAR(menu); }; - private _text = localize LSTRING(openMenu); + + private _text = LLSTRING(openMenu); private _icon = ""; private _action = [QGVAR(openMenu), _text, _icon, _statement, _condition] call EFUNC(interact_menu,createAction); + + // Self action on the vehicle if (_hasCargoConfig) then { - [_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); // self action on the vehicle + [_type, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToClass); } else { [_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject); }; diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index ae2d845d38f..db21c542ae6 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -1,27 +1,36 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Load object into vehicle. + * Loads an object into a vehicle. * Objects loaded via classname remain virtual until unloaded. * * Arguments: - * 0: Item - * 1: Vehicle - * 2: Ignore interaction distance and stability checks + * 0: Item to be loaded or (default: "") + * 1: Holder object (vehicle) (default: objNull) + * 2: Ignore interaction distance and stability checks (default: false) * * Return Value: * Object loaded * * Example: - * [object, vehicle] call ace_cargo_fnc_loadItem + * ["ACE_Wheel", cursorObject] call ace_cargo_fnc_loadItem * * Public: Yes */ -params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]], ["_ignoreInteraction", false]]; -TRACE_2("params",_item,_vehicle); +params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_ignoreInteraction", false, [false]]]; +TRACE_3("params",_item,_vehicle,_ignoreInteraction); -if !([_item, _vehicle, _ignoreInteraction] call FUNC(canLoadItemIn)) exitWith {TRACE_2("cannot load",_item,_vehicle); false}; +// Get config sensitive case name +if (_item isEqualType "") then { + _item = _item call EFUNC(common,getConfigName); +}; + +if !([_item, _vehicle, _ignoreInteraction] call FUNC(canLoadItemIn)) exitWith { + TRACE_3("cannot load",_item,_vehicle,_ignoreInteraction); + + false // return +}; private _loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded pushBack _item; @@ -29,17 +38,22 @@ _vehicle setVariable [QGVAR(loaded), _loaded, true]; TRACE_1("added to loaded array",_loaded); -private _space = [_vehicle] call FUNC(getCargoSpaceLeft); -private _itemSize = [_item] call FUNC(getSizeItem); -_vehicle setVariable [QGVAR(space), _space - _itemSize, true]; +// Update cargo space remaining +private _cargoSpace = _vehicle call FUNC(getCargoSpaceLeft); +private _itemSize = (_item call FUNC(getSizeItem)) max 0; // don't let negative size items increase space +_vehicle setVariable [QGVAR(space), _cargoSpace - _itemSize, true]; +// Attach object 100m below vehicle if (_item isEqualType objNull) then { detach _item; - _item attachTo [_vehicle,[0,0,-100]]; + _item attachTo [_vehicle, [0, 0, -100]]; [QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent; - // Some objects below water will take damage over time and eventualy become "water logged" and unfixable (because of negative z attach) + // Some objects below water will take damage over time, eventually becoming "water logged" and unfixable (because of negative z attach) [_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set); }; -true +// Invoke listenable event +["ace_cargoLoaded", [_item, _vehicle]] call CBA_fnc_globalEvent; + +true // return diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 16e66a6ed12..f61d724c608 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Handle the UI data display. + * Handles the UI data display. * * Arguments: * 0: Display @@ -10,7 +10,7 @@ * None * * Example: - * [display] call ace_cargo_fnc_onMenuOpen + * display call ace_cargo_fnc_onMenuOpen * * Public: No */ @@ -22,37 +22,64 @@ params ["_display"]; uiNamespace setVariable [QGVAR(menuDisplay), _display]; if (GVAR(interactionParadrop)) then { - (_display displayCtrl 12) ctrlSetText (localize LSTRING(paradropButton)); + (_display displayCtrl 12) ctrlSetText LLSTRING(paradropButton); }; [{ + params ["_vehicle", "_pfhID"]; + disableSerialization; + private _display = uiNamespace getVariable QGVAR(menuDisplay); - if (isnil "_display") exitWith { - [_this select 1] call CBA_fnc_removePerFrameHandler; + + if (isNil "_display") exitWith { + _pfhID call CBA_fnc_removePerFrameHandler; }; - if (isNull GVAR(interactionVehicle) || {(([ACE_player, GVAR(interactionVehicle)] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != GVAR(interactionVehicle)}}) exitWith { + // Close menu if in invalid state + if ( + !alive _vehicle || + {locked _vehicle >= 2} || + {!(_vehicle getVariable [QGVAR(hasCargo), getNumber (configOf _vehicle >> QGVAR(hasCargo)) == 1])} || + {(([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != _vehicle}} + ) exitWith { closeDialog 0; - [_this select 1] call CBA_fnc_removePerFrameHandler; + + _pfhID call CBA_fnc_removePerFrameHandler; }; - private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; private _ctrl = _display displayCtrl 100; private _label = _display displayCtrl 2; + // Remove previous entries lbClear _ctrl; + + // Display item names + private _displayName = ""; + private _itemSize = 0; + private _index = -1; + { - private _class = if (_x isEqualType "") then {_x} else {typeOf _x}; - private _displayName = [_x, true] call FUNC(getNameItem); - if (GVAR(interactionParadrop)) then { - _ctrl lbAdd format ["%1 (%2s)", _displayName, GVAR(paradropTimeCoefficent) * ([_class] call FUNC(getSizeItem))]; + _displayName = [_x, true] call FUNC(getNameItem); + _itemSize = _x call FUNC(getSizeItem); + + if (_itemSize >= 0) then { + _index = if (GVAR(interactionParadrop)) then { + _ctrl lbAdd format ["%1 (%2s)", _displayName, GVAR(paradropTimeCoefficent) * _itemSize] + } else { + _ctrl lbAdd _displayName + }; + + _ctrl lbSetTooltip [_index, format [LLSTRING(sizeMenu), _itemSize]]; } else { - _ctrl lbAdd _displayName; - }; + // If item has a size < 0, it means it's not loadable + _index = _ctrl lbAdd _displayName; - true - } count _loaded; + _ctrl lbSetTooltip [_index, LLSTRING(unloadingImpossible)]; + _ctrl lbSetColor [_index, [1, 0, 0, 1]]; // set text to red + _ctrl lbSetSelectColor [_index, [1, 0, 0, 1]]; + }; + } forEach (_vehicle getVariable [QGVAR(loaded), []]); - _label ctrlSetText format[localize LSTRING(labelSpace), [GVAR(interactionVehicle)] call DFUNC(getCargoSpaceLeft)]; -}, 0, []] call CBA_fnc_addPerFrameHandler; + _label ctrlSetText format [LLSTRING(labelSpace), (_vehicle call FUNC(getCargoSpaceLeft)) max 0]; +}, 0.25, GVAR(interactionVehicle)] call CBA_fnc_addPerFrameHandler; diff --git a/addons/cargo/functions/fnc_paradropItem.sqf b/addons/cargo/functions/fnc_paradropItem.sqf index d1f61fb6a24..8bd1554cf2f 100644 --- a/addons/cargo/functions/fnc_paradropItem.sqf +++ b/addons/cargo/functions/fnc_paradropItem.sqf @@ -1,18 +1,18 @@ #include "..\script_component.hpp" /* * Author: marc_book, commy2, CAA-Picard - * Unload and paradrop object from plane or helicopter. + * Unloads and paradrops an object from a plane or helicopter. * * Arguments: - * 0: Object - * 1: Vehicle + * 0: Item or + * 1: Holder object (vehicle) * 2: Show Hint (default: true) * * Return Value: * Object unloaded * * Example: - * [object, vehicle] call ace_cargo_fnc_paradropItem + * ["ACE_Wheel", vehicle player] call ace_cargo_fnc_paradropItem * * Public: No */ @@ -20,51 +20,68 @@ params ["_item", "_vehicle", ["_showHint", true]]; TRACE_2("params",_item,_vehicle); +// Get config sensitive case name +if (_item isEqualType "") then { + _item = _item call EFUNC(common,getConfigName); +}; + +// Check if item is actually part of cargo private _loaded = _vehicle getVariable [QGVAR(loaded), []]; -if !(_item in _loaded) exitWith {false}; +if !(_item in _loaded) exitWith { + false // return +}; + +// Check if item can be unloaded +private _itemSize = _item call FUNC(getSizeItem); -// unload item from cargo +if (_itemSize < 0) exitWith { + false // return +}; + +// Unload item from cargo _loaded deleteAt (_loaded find _item); _vehicle setVariable [QGVAR(loaded), _loaded, true]; -private _cargoSpace = [_vehicle] call FUNC(getCargoSpaceLeft); -private _itemSize = [_item] call FUNC(getSizeItem); -_vehicle setVariable [QGVAR(space), (_cargoSpace + _itemSize), true]; +// Update cargo space remaining +private _cargoSpace = _vehicle call FUNC(getCargoSpaceLeft); +_vehicle setVariable [QGVAR(space), _cargoSpace + _itemSize, true]; (boundingBoxReal _vehicle) params ["_bb1", "_bb2"]; private _distBehind = ((_bb1 select 1) min (_bb2 select 1)) - 4; // 4 meters behind max bounding box -TRACE_1("",_distBehind); private _posBehindVehicleAGL = _vehicle modelToWorld [0, _distBehind, -2]; +TRACE_1("",_distBehind); private _object = _item; + if (_item isEqualType objNull) then { detach _object; + // hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly - // do both on server to ensure they are executed in the correct order + // Do both on server to ensure they are executed in the correct order [QGVAR(serverUnload), [_object, _posBehindVehicleAGL]] call CBA_fnc_serverEvent; } else { _object = createVehicle [_item, _posBehindVehicleAGL, [], 0, "NONE"]; _object setPosASL (AGLtoASL _posBehindVehicleAGL); }; -[QEGVAR(common,setVelocity), [_object, ((velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5))], _object] call CBA_fnc_targetEvent; +[QEGVAR(common,setVelocity), [_object, (velocity _vehicle) vectorAdd ((vectorNormalized (vectorDir _vehicle)) vectorMultiply -5)], _object] call CBA_fnc_targetEvent; -// open parachute and ir light effect +// Open parachute and IR light effect [{ params ["_object"]; if (isNull _object || {getPos _object select 2 < 1}) exitWith {}; - private _parachute = createVehicle ["B_Parachute_02_F", [0,0,0], [], 0, "CAN_COLLIDE"]; + private _parachute = createVehicle ["B_Parachute_02_F", [0, 0, 0], [], 0, "CAN_COLLIDE"]; // Prevent collision damage [QEGVAR(common,fixCollision), _parachute] call CBA_fnc_localEvent; [QEGVAR(common,fixCollision), _object, _object] call CBA_fnc_targetEvent; - // cannot use setPos on parachutes without them closing down - _parachute attachTo [_object, [0,0,0]]; + // Cannot use setPos on parachutes without them closing down + _parachute attachTo [_object, [0, 0, 0]]; detach _parachute; private _velocity = velocity _object; @@ -76,13 +93,12 @@ if (_item isEqualType objNull) then { _parachute setVelocity _velocity; if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then { - private _light = "Chemlight_yellow" createVehicle [0,0,0]; - _light attachTo [_object, [0,0,0]]; + private _light = "Chemlight_yellow" createVehicle [0, 0, 0]; + _light attachTo [_object, [0, 0, 0]]; }; +}, _object, 0.7] call CBA_fnc_waitAndExecute; -}, [_object], 0.7] call CBA_fnc_waitAndExecute; - -// smoke effect when crate landed +// Create smoke effect when crate landed [{ (_this select 0) params ["_object"]; @@ -90,21 +106,20 @@ if (_item isEqualType objNull) then { [_this select 1] call CBA_fnc_removePerFrameHandler; }; - if (getPos _object select 2 < 1) then { + if (getPos _object select 2 < 1) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; + if ((GVAR(disableParadropEffectsClasstypes) findIf {_object isKindOf _x}) == -1) then { - private _smoke = "SmokeshellYellow" createVehicle [0,0,0]; + private _smoke = "SmokeshellYellow" createVehicle [0, 0, 0]; _smoke attachTo [_object, [0,0,0]]; }; - - [_this select 1] call CBA_fnc_removePerFrameHandler; }; - -}, 1, [_object]] call CBA_fnc_addPerFrameHandler; +}, 1, _object] call CBA_fnc_addPerFrameHandler; if (_showHint) then { [ [ - LSTRING(UnloadedItem), + LSTRING(unloadedItem), [_object, true] call FUNC(getNameItem), getText (configOf _vehicle >> "displayName") ], @@ -115,4 +130,4 @@ if (_showHint) then { // Invoke listenable event ["ace_cargoUnloaded", [_object, _vehicle, "paradrop"]] call CBA_fnc_globalEvent; -true +true // return diff --git a/addons/cargo/functions/fnc_removeCargoItem.sqf b/addons/cargo/functions/fnc_removeCargoItem.sqf index b15a5a74349..6e958939926 100644 --- a/addons/cargo/functions/fnc_removeCargoItem.sqf +++ b/addons/cargo/functions/fnc_removeCargoItem.sqf @@ -4,23 +4,28 @@ * Removes a cargo item from the vehicle. * * Arguments: - * 0: Item or - * 1: Vehicle + * 0: Item to be removed or (default: "") + * 1: Holder object (vehicle) (default: objNull) * 2: Amount (default: 1) * * Return Value: * Number of items removed * * Example: - * ["ACE_Wheel", vehicle, 2] call ace_cargo_fnc_removeCargoItem + * ["ACE_Wheel", cursorObject, 2] call ace_cargo_fnc_removeCargoItem * [crate_7, truck] call ace_cargo_fnc_removeCargoItem * * Public: Yes */ -params ["_item", "_vehicle", ["_amount", 1]]; +params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_amount", 1, [0]]]; TRACE_3("params",_item,_vehicle,_amount); +// Get config sensitive case name +if (_item isEqualType "") then { + _item = _item call EFUNC(common,getConfigName); +}; + private _loaded = _vehicle getVariable [QGVAR(loaded), []]; private _addedSpace = 0; @@ -29,31 +34,40 @@ private _itemsRemoved = 0; private _continue = if (_item isEqualType objNull) then { if !(_item in _loaded) exitWith {false}; - _addedSpace = [_item] call FUNC(getSizeItem); + + _addedSpace = (_item call FUNC(getSizeItem)) max 0; // don't let negative size items increase space _loaded deleteAt (_loaded find _item); + _itemClass = typeOf _item; + + // Delete item deleteVehicle _item; + _itemsRemoved = 1; + true } else { { if (_itemsRemoved == _amount) exitWith {}; if ( - (_x isEqualType "" && {_x == _item}) || // Check for classname, case-insensitive - {_x isEqualType objNull && {typeOf _x isEqualTo _item}} + (_x isEqualType "" && {_x == _item}) || + {_x isEqualType objNull && {typeOf _x == _item}} ) then { INC(_itemsRemoved); - ADD(_addedSpace,[_x] call FUNC(getSizeItem)); + _addedSpace = _addedSpace + ((_x call FUNC(getSizeItem)) max 0); // don't let negative size items increase space + // Delete item if (_x isEqualType objNull) then { deleteVehicle _x; }; + _loaded set [_forEachIndex, nil]; }; } forEach _loaded; FILTER(_loaded,!isNil "_x"); + true }; @@ -61,8 +75,9 @@ if (!_continue) exitWith {0}; _vehicle setVariable [QGVAR(loaded), _loaded, true]; -private _space = [_vehicle] call FUNC(getCargoSpaceLeft); -_vehicle setVariable [QGVAR(space), _space + _addedSpace, true]; +// Update remaining cargo space +private _cargoSpace = _vehicle call FUNC(getCargoSpaceLeft); +_vehicle setVariable [QGVAR(space), _cargoSpace + _addedSpace, true]; // Invoke listenable event ["ace_cargoRemoved", [_itemClass, _vehicle, _amount, _itemsRemoved]] call CBA_fnc_globalEvent; diff --git a/addons/cargo/functions/fnc_renameObject.sqf b/addons/cargo/functions/fnc_renameObject.sqf index c088dcf62a4..a10d54df7ec 100644 --- a/addons/cargo/functions/fnc_renameObject.sqf +++ b/addons/cargo/functions/fnc_renameObject.sqf @@ -1,7 +1,7 @@ #include "..\script_component.hpp" /* * Author: JasperRab - * Renames object. + * Renames an object. * * Arguments: * None @@ -10,19 +10,23 @@ * None * * Example: - * [] call ace_cargo_fnc_renameObject + * call ace_cargo_fnc_renameObject * - * Public: Yes + * Public: No */ private _display = uiNamespace getVariable QGVAR(menuDisplay); + if (isNil "_display") exitWith {}; private _ctrlEditText = ctrlText 100; -_ctrlEditText = _ctrlEditText select [0,32]; -if (_ctrlEditText isEqualTo "") then { // custom name has been removed +_ctrlEditText = _ctrlEditText select [0, 32]; + +// Check if custom name has been removed +if (_ctrlEditText isEqualTo "") then { [LSTRING(clearedCustomName), 3] call EFUNC(common,displayTextStructured); } else { [[LSTRING(renamedObject), _ctrlEditText], 3] call EFUNC(common,displayTextStructured); }; + GVAR(interactionVehicle) setVariable [QGVAR(customName), _ctrlEditText, true]; diff --git a/addons/cargo/functions/fnc_setSize.sqf b/addons/cargo/functions/fnc_setSize.sqf index 523bbdbb61e..8804c81266b 100644 --- a/addons/cargo/functions/fnc_setSize.sqf +++ b/addons/cargo/functions/fnc_setSize.sqf @@ -1,57 +1,55 @@ #include "..\script_component.hpp" /* * Author: kymckay - * Set the cargo size of any object. Has global effect. + * Sets the cargo size of any object. Has global effect. * Adds the load action menu if necessary. - * Negative size makes unloadable. + * A negative size disables the object's cargo interactions. * * Arguments: - * 0: Object - * 1: Cargo size + * 0: Object (default: objNull) + * 1: Cargo size (default: nil) * * Return Value: * None * * Example: - * [cursorTarget, 3] call ace_cargo_fnc_setSize + * [cursorObject, 3] call ace_cargo_fnc_setSize * * Public: Yes */ -// Only run this after the settings are initialized -if !(EGVAR(common,settingsInitFinished)) exitWith { - EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSize), _this]; -}; - params [ - ["_object",objNull,[objNull]], - ["_size",nil,[0]] // Default can't be a number since all are valid + ["_object", objNull, [objNull]], + ["_size", nil, [0]] // default can't be a number since all are valid ]; TRACE_2("setSize",_object,_size); +private _oldSize = _object call FUNC(getSizeItem); + // Nothing to do here -if ( - (isNil "_size") || - {isNull _object} || - {_size == _object getVariable [QGVAR(size), CARGO_SIZE(typeOf _object)]} -) exitWith {}; +if (isNil "_size" || {isNull _object} || {_size == _oldSize}) exitWith {}; // Apply new size globally -// Necessary to update value, even if unloadable, as API could be used again +// Necessary to update value, even if disabled, as API could be used again _object setVariable [QGVAR(canLoad), _size >= 0, true]; _object setVariable [QGVAR(size), _size, true]; -// If no size no need for load action -if (_size < 0) exitWith {}; +// Update remaining cargo space, if loaded as cargo in a vehicle +private _vehicle = attachedTo _object; + +if (!isNull _vehicle && {_object in (_vehicle getVariable [QGVAR(loaded), []])}) then { + private _cargoSpace = _vehicle call FUNC(getCargoSpaceLeft); + + _vehicle setVariable [QGVAR(space), _cargoSpace + (_oldSize max 0) - (_size max 0), true]; // don't let negative size items increase space +}; -// If an existing ID is present, load action has already been added globally -private _jipID = _object getVariable QGVAR(setSize_jipID); +// Actions should be added for all future JIP players too, regardless of size +private _jipID = format [QGVAR(sizeJipID_%1), hashValue _object]; +[QGVAR(initObject), _object, _jipID] call CBA_fnc_globalEventJIP; -// Actions should be added to all future JIP players too -if (isNil "_jipID") then { - _jipID = [QGVAR(initObject), [_object]] call CBA_fnc_globalEventJIP; +// Remove from JIP queue if object is deleted +if !(_object getVariable [QGVAR(setSizeRemoveJip), false]) then { [_jipID, _object] call CBA_fnc_removeGlobalEventJIP; - // Store the ID for any future calls to this function - _object setVariable [QGVAR(setSize_jipID), _jipID, true]; + _object setVariable [QGVAR(setSizeRemoveJip), true, true]; }; diff --git a/addons/cargo/functions/fnc_setSpace.sqf b/addons/cargo/functions/fnc_setSpace.sqf index f573019a11a..01c078496c2 100644 --- a/addons/cargo/functions/fnc_setSpace.sqf +++ b/addons/cargo/functions/fnc_setSpace.sqf @@ -1,12 +1,12 @@ #include "..\script_component.hpp" /* * Author: kymckay - * Set the cargo space of any object. Has global effect. + * Sets the cargo space of any object. Has global effect. * Adds the cargo action menu if necessary. * * Arguments: - * 0: Object - * 1: Cargo space + * 0: Vehicle (default: objNull) + * 1: Cargo space (default: nil) * * Return Value: * None @@ -17,49 +17,38 @@ * Public: Yes */ -// Only run this after the settings are initialized -if !(EGVAR(common,settingsInitFinished)) exitWith { - EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(setSpace), _this]; -}; - params [ - ["_vehicle",objNull,[objNull]], - ["_space",nil,[0]] // Default can't be a number since all are valid + ["_vehicle", objNull, [objNull]], + ["_space", nil, [0]] // default can't be a number since all are valid ]; -TRACE_2("setSpace",_vehicle,_size); +TRACE_2("setSpace",_vehicle,_space); // Nothing to do here -if ( - (isNil "_space") || - {isNull _vehicle} -) exitWith {}; +if (isNil "_space" || {isNull _vehicle}) exitWith {}; // Account for cargo already in the vehicle private _loaded = _vehicle getVariable [QGVAR(loaded), []]; -private _newSpace = _space; +private _cargoSpace = _space; + { - _newSpace = _newSpace - ([_x] call FUNC(getSizeItem)); + _cargoSpace = _cargoSpace - ((_x call FUNC(getSizeItem)) max 0); } forEach _loaded; // If the new value is the same as the old, do nothing -if (_newSpace == (_vehicle getVariable [QGVAR(space), CARGO_SPACE(typeOf _vehicle)])) exitwith {}; +if (_cargoSpace == (_vehicle call FUNC(getCargoSpaceLeft))) exitwith {}; // Apply new space globally -_vehicle setVariable [QGVAR(space), _newSpace, true]; // Necessary to update value, even if no space, as API could be used again _vehicle setVariable [QGVAR(hasCargo), _space > 0, true]; +_vehicle setVariable [QGVAR(space), _cargoSpace, true]; -// If no cargo space no need for cargo menu -if (_space <= 0) exitWith {}; - -// If an existing ID is present, cargo menu has already been added globally -private _jipID = _vehicle getVariable QGVAR(setSpace_jipID); +// Space should be added for all future JIP players too, regardless of space +private _jipID = format [QGVAR(spaceJipID_%1), hashValue _vehicle]; +[QGVAR(initVehicle), _vehicle, _jipID] call CBA_fnc_globalEventJIP; -// Cargo menu should be added to all future JIP players too -if (isNil "_jipID") then { - _jipID = [QGVAR(initVehicle), [_vehicle]] call CBA_fnc_globalEventJIP; +// Remove from JIP queue if vehicle is deleted +if !(_vehicle getVariable [QGVAR(setSpaceRemoveJip), false]) then { [_jipID, _vehicle] call CBA_fnc_removeGlobalEventJIP; - // Store the ID for any future calls to this function - _vehicle setVariable [QGVAR(setSpace_jipID), _jipID, true]; + _vehicle setVariable [QGVAR(setSpaceRemoveJip), true, true]; }; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 5add1386edc..5f5cb0780bc 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -1,67 +1,80 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Start load item. + * Starts loading item. * * Arguments: - * 0: Player - * 1: Object - * 2: Vehicle (Optional) + * 0: Unit doing the loading + * 1: Item to be loaded + * 2: Holder object (vehicle) (default: objNull) * * Return Value: * Load ProgressBar Started * * Example: - * [player, cursorTarget] call ace_cargo_fnc_startLoadIn + * [player, cursorObject] call ace_cargo_fnc_startLoadIn * * Public: No */ -params ["_player", "_object", ["_cargoVehicle", objNull]]; -TRACE_3("params",_player,_object,_cargoVehicle); +params ["_loader", "_item", ["_vehicle", objNull]]; +TRACE_3("params",_loader,_item,_vehicle); -private _vehicle = _cargoVehicle; if (isNull _vehicle) then { { - if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; - } forEach (nearestObjects [_player, GVAR(cargoHolderTypes), (MAX_LOAD_DISTANCE + 10)]); + if ([_item, _x] call FUNC(canLoadItemIn)) exitWith { + _vehicle = _x; + }; + } forEach (nearestObjects [_loader, GVAR(cargoHolderTypes), MAX_LOAD_DISTANCE + 10]); }; if (isNull _vehicle) exitWith { - TRACE_3("Could not find vehicle",_player,_object,_vehicle); - false + TRACE_3("Could not find vehicle",_loader,_item,_vehicle); + + false // return }; -private _return = false; // Start progress bar -if ([_object, _vehicle] call FUNC(canLoadItemIn)) then { - [_player, _object, true] call EFUNC(common,claim); - private _size = [_object] call FUNC(getSizeItem); +if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { + private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); + + // If load time is 0, don't show a progress bar + if (_duration <= 0) exitWith { + closeDialog 0; + + ["ace_loadCargo", [_item, _vehicle]] call CBA_fnc_localEvent; + + true // return + }; + + // Claim so nobody else can interact with it + [_loader, _item, true] call EFUNC(common,claim); [ - GVAR(loadTimeCoefficient) * _size, - [_object, _vehicle], + _duration, + [_item, _vehicle], { TRACE_1("load finish",_this); + [objNull, _this select 0 select 0, true] call EFUNC(common,claim); + ["ace_loadCargo", _this select 0] call CBA_fnc_localEvent; }, { TRACE_1("load fail",_this); + [objNull, _this select 0 select 0, true] call EFUNC(common,claim); }, - localize LSTRING(LoadingItem), + LLSTRING(loadingItem), { - (_this select 0) params ["_item", "_target"]; - (alive _target) && {locked _target < 2} && {alive _item} - && {([_item, _target] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} + (_this select 0) call FUNC(canLoadItemIn) }, ["isNotSwimming"] ] call EFUNC(common,progressBar); - _return = true; + + true // return } else { - private _displayName = [_object, true] call FUNC(getNameItem); - [[LSTRING(LoadingFailed), _displayName], 3] call EFUNC(common,displayTextStructured); -}; + [[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); -_return + false // return +}; diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index cf00327dcc9..82de13338ab 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -1,16 +1,16 @@ #include "..\script_component.hpp" /* * Author: Glowbal - * Start unload action. + * Starts unloading item selected in the cargo menu. * * Arguments: - * None + * 0: Unit doing the unloading * * Return Value: * None * * Example: - * [] call ace_cargo_fnc_startUnload + * player call ace_cargo_fnc_startUnload * * Public: No */ @@ -18,75 +18,90 @@ disableSerialization; private _display = uiNamespace getVariable QGVAR(menuDisplay); + if (isNil "_display") exitWith {}; private _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; + if (_loaded isEqualTo []) exitWith {}; -private _ctrl = _display displayCtrl 100; +// This can be an object or a classname string +private _item = _loaded param [lbCurSel (_display displayCtrl 100), nil]; -private _selected = (lbCurSel _ctrl) max 0; +if (isNil "_item") exitWith {}; -if (count _loaded <= _selected) exitWith {}; -private _item = _loaded select _selected; // This can be an object or a classname string +params ["_unit"]; if (GVAR(interactionParadrop)) exitWith { - // If drop time is 0 don't show a progress bar - if (GVAR(paradropTimeCoefficent) == 0) exitWith { + private _duration = GVAR(paradropTimeCoefficent) * (_item call FUNC(getSizeItem)); + + // If drop time is 0, don't show a progress bar + if (_duration <= 0) exitWith { + // Close cargo menu + closeDialog 0; + [QGVAR(paradropItem), [_item, GVAR(interactionVehicle)]] call CBA_fnc_localEvent; }; // Start progress bar - paradrop - private _size = [_item] call FUNC(getSizeItem); [ - GVAR(paradropTimeCoefficent) * _size, - [_item, GVAR(interactionVehicle), ACE_player], + _duration, + [_item, GVAR(interactionVehicle)], { - (_this select 0) params ["_item", "_target", "_player"]; - [QGVAR(paradropItem), [_item, _target]] call CBA_fnc_localEvent; + [QGVAR(paradropItem), _this select 0] call CBA_fnc_localEvent; }, { - params ["_args", "", "", "_errorCode"]; // show warning if we failed because of flight conditions - if (_errorCode == 3) then { - _args params ["_item", "_target", "_player"]; - [localize LSTRING(unlevelFlightWarning)] call EFUNC(common,displayTextStructured); + params ["", "", "", "_errorCode"]; + + if (_errorCode == 3) then { // show warning if we failed because of flight conditions + [LSTRING(unlevelFlightWarning)] call EFUNC(common,displayTextStructured); }; }, - localize LSTRING(UnloadingItem), + LLSTRING(unloadingItem), { - (_this select 0) params ["_item", "_target", "_player"]; + (_this select 0) params ["", "_target"]; + if ((acos ((vectorUp _target) select 2)) > 30) exitWith {false}; // check flight level if (((getPos _target) select 2) < 25) exitWith {false}; // check height if ((speed _target) < -5) exitWith {false}; // check reverse + true }, ["isNotSwimming", "isNotInside"] ] call EFUNC(common,progressBar); }; - // Start progress bar - normal ground unload -if ([_item, GVAR(interactionVehicle), ACE_player] call FUNC(canUnloadItem)) then { - private _size = [_item] call FUNC(getSizeItem); +if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { + private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); + + // If unload time is 0, don't show a progress bar + if (_duration <= 0) exitWith { + // Close cargo menu + closeDialog 0; + + ["ace_unloadCargo", [_item, GVAR(interactionVehicle), _unit]] call CBA_fnc_localEvent + }; [ - GVAR(loadTimeCoefficient) * _size, - [_item, GVAR(interactionVehicle), ACE_player], - {TRACE_1("unload finish",_this); ["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent}, - {TRACE_1("unload fail",_this);}, - localize LSTRING(UnloadingItem), + _duration, + [_item, GVAR(interactionVehicle), _unit], { - (_this select 0) params ["_item", "_target", "_player"]; + TRACE_1("unload finish",_this); - (alive _target) - && {locked _target < 2} - && {([_player, _target] call EFUNC(interaction,getInteractionDistance)) < MAX_LOAD_DISTANCE} - && {_item in (_target getVariable [QGVAR(loaded), []])} + ["ace_unloadCargo", _this select 0] call CBA_fnc_localEvent; + }, + { + TRACE_1("unload fail",_this); + }, + LLSTRING(unloadingItem), + { + (_this select 0) params ["_item", "_vehicle", "_unit"]; + + [_item, _vehicle, _unit, false, true] call FUNC(canUnloadItem) // don't check for a suitable unloading position every frame }, ["isNotSwimming"] ] call EFUNC(common,progressBar); } else { - private _displayName = [_item, true] call FUNC(getNameItem); - - [[LSTRING(UnloadingFailed), _displayName], 3] call EFUNC(common,displayTextStructured); + [[LSTRING(unloadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); }; diff --git a/addons/cargo/functions/fnc_unloadCarryItem.sqf b/addons/cargo/functions/fnc_unloadCarryItem.sqf index 3b97cf1599d..7baac21b735 100644 --- a/addons/cargo/functions/fnc_unloadCarryItem.sqf +++ b/addons/cargo/functions/fnc_unloadCarryItem.sqf @@ -4,17 +4,18 @@ * Dragging integration. Unloader starts carrying unloaded object. * * Arguments: - * 0: Unloader - * 1: Item + * 0: Unit doing the unloading + * 1: Unloaded item * * Return Value: * None * * Example: - * [player, object] call ace_cargo_fnc_unloadCarryItem + * [player, cursorObject] call ace_cargo_fnc_unloadCarryItem * * Public: No */ + params ["_unloader", "_object"]; TRACE_2("unloadCarryItem-start",_unloader,_object); @@ -24,17 +25,21 @@ if (!GVAR(carryAfterUnload) || {getNumber (configOf _object >> QGVAR(blockUnload // When unloading attached objects, this code will run before server has finished moving object to the safe position [{ params ["_unloader", "_object"]; + (_unloader distance _object) < 10 }, { params ["_unloader", "_object"]; + TRACE_2("unloadCarryItem-unloaded",_unloader,_object); + if ([_unloader, _object] call EFUNC(dragging,canCarry)) exitWith { [_unloader, _object] call EFUNC(dragging,startCarry); }; + if ([_unloader, _object] call EFUNC(dragging,canDrag)) exitWith { [_unloader, _object] call EFUNC(dragging,startDrag); }; -}, _this, 1.0, { // delay is based on how long it will take server event to trigger and take effect - // not a hard error if this fails, could have just unloaded to other side of vehicle because of findSafePos +}, _this, 1, { // Delay is based on how long it will take server event to trigger and take effect + // Not a hard error if this fails, could have just unloaded to other side of vehicle because of findSafePos TRACE_1("unloadCarryItem-failed to unload nearby player",_this); }] call CBA_fnc_waitUntilAndExecute; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 83b0b2ff0ea..5cf2ce372f3 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -1,57 +1,74 @@ #include "..\script_component.hpp" /* * Author: Glowbal, ViperMaul - * Unload object from vehicle. + * Unloads an object from a vehicle. * * Arguments: - * 0: Item - * 1: Vehicle + * 0: Item to be unloaded or (default: "") + * 1: Holder object (vehicle) (default: objNull) * 2: Unloader (default: objNull) * * Return Value: - * Object was unloaded + * Object unloaded * * Example: - * [object, vehicle] call ace_cargo_fnc_unloadItem + * ["ACE_Wheel", cursorObject] call ace_cargo_fnc_unloadItem * * Public: Yes */ -params ["_item", "_vehicle", ["_unloader", objNull]]; +params [["_item", "", [objNull, ""]], ["_vehicle", objNull, [objNull]], ["_unloader", objNull, [objNull]]]; TRACE_3("params",_item,_vehicle,_unloader); -//This covers testing vehicle stability and finding a safe position -private _emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition); -TRACE_1("findUnloadPosition",_emptyPosAGL); - -if ((count _emptyPosAGL) != 3) exitWith { - TRACE_4("Could not find unload pos",_vehicle,getPosASL _vehicle,isTouchingGround _vehicle,speed _vehicle); - if ((!isNull _unloader) && {_unloader == ACE_player}) then { - //display text saying there are no safe places to exit the vehicle - [localize ELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured); - }; - false +// Get config sensitive case name +if (_item isEqualType "") then { + _item = _item call EFUNC(common,getConfigName); }; +// Check if item is actually part of cargo private _loaded = _vehicle getVariable [QGVAR(loaded), []]; if !(_item in _loaded) exitWith { - ERROR_3("Tried to unload item [%1] not in vehicle[%2] cargo[%3]", _item, _vehicle, _loaded); - false + ERROR_3("Tried to unload item [%1] not in vehicle[%2] cargo[%3]",_item,_vehicle,_loaded); + + false // return +}; + +// Check if item can be unloaded +private _itemSize = _item call FUNC(getSizeItem); + +if (_itemSize < 0) exitWith { + false // return +}; + +// This covers testing vehicle stability and finding a safe position +private _emptyPosAGL = [_vehicle, _item, _unloader] call EFUNC(common,findUnloadPosition); +TRACE_1("findUnloadPosition",_emptyPosAGL); + +if (_emptyPosAGL isEqualTo []) exitWith { + // Display text saying there are no safe places to exit the vehicle + if (!isNull _unloader && {_unloader == ACE_player}) then { + [ELSTRING(common,NoRoomToUnload)] call EFUNC(common,displayTextStructured); + }; + + false // return }; +// Unload item from cargo _loaded deleteAt (_loaded find _item); _vehicle setVariable [QGVAR(loaded), _loaded, true]; -private _space = [_vehicle] call FUNC(getCargoSpaceLeft); -private _itemSize = [_item] call FUNC(getSizeItem); -_vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; +// Update cargo space remaining +private _cargoSpace = _vehicle call FUNC(getCargoSpaceLeft); +_vehicle setVariable [QGVAR(space), _cargoSpace + _itemSize, true]; private _object = _item; + if (_object isEqualType objNull) then { detach _object; + // hideObjectGlobal must be executed before setPos to ensure light objects are rendered correctly - // do both on server to ensure they are executed in the correct order + // Do both on server to ensure they are executed in the correct order [QGVAR(serverUnload), [_object, _emptyPosAGL]] call CBA_fnc_serverEvent; } else { _object = createVehicle [_item, _emptyPosAGL, [], 0, "NONE"]; @@ -66,4 +83,5 @@ if (_object isEqualType objNull) then { // Invoke listenable event ["ace_cargoUnloaded", [_object, _vehicle, "unload"]] call CBA_fnc_globalEvent; -true + +true // return diff --git a/addons/cargo/functions/fnc_validateCargoSpace.sqf b/addons/cargo/functions/fnc_validateCargoSpace.sqf deleted file mode 100644 index f5b976c3957..00000000000 --- a/addons/cargo/functions/fnc_validateCargoSpace.sqf +++ /dev/null @@ -1,37 +0,0 @@ -#include "..\script_component.hpp" -/* - * Author: Glowbal - * Validate the vehicle cargo space. - * - * Arguments: - * 0: Object - * - * Return Value: - * None - * - * Example: - * [object] call ace_cargo_fnc_validateCargoSpace - * - * Public: No - */ - -params ["_vehicle"]; -TRACE_1("params",_vehicle); - -private _loaded = _vehicle getVariable [QGVAR(loaded), []]; - -private _newLoaded = []; -private _totalSpaceOccupied = 0; -{ - if ((_x isEqualType "") || {!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 (configOf _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; diff --git a/addons/cargo/initSettings.sqf b/addons/cargo/initSettings.sqf index e971d2d9c7d..495d11db35d 100644 --- a/addons/cargo/initSettings.sqf +++ b/addons/cargo/initSettings.sqf @@ -1,52 +1,58 @@ [ - QGVAR(enable), "CHECKBOX", + QGVAR(enable), + "CHECKBOX", [LSTRING(ModuleSettings_enable), LSTRING(ModuleSettings_enable_Description)], - [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + [ELSTRING(OptionsMenu,CategoryLogistics), LSTRING(openMenu)], true, true, {[QGVAR(enable), _this] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ - QGVAR(loadTimeCoefficient), "SLIDER", + QGVAR(loadTimeCoefficient), + "SLIDER", [LSTRING(loadTimeCoefficient), LSTRING(loadTimeCoefficient_description)], - [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + [ELSTRING(OptionsMenu,CategoryLogistics), LSTRING(openMenu)], [0, 10, 5, 1], true, {[QGVAR(loadTimeCoefficient), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ - QGVAR(paradropTimeCoefficent), "SLIDER", + QGVAR(paradropTimeCoefficent), + "SLIDER", [LSTRING(paradropTimeCoefficent), LSTRING(paradropTimeCoefficent_description)], - [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + [ELSTRING(OptionsMenu,CategoryLogistics), LSTRING(openMenu)], [0, 10, 2.5, 1], true, {[QGVAR(paradropTimeCoefficent), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ - QGVAR(openAfterUnload), "LIST", + QGVAR(openAfterUnload), + "LIST", [LSTRING(openAfterUnload), LSTRING(openAfterUnload_description)], - [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + [ELSTRING(OptionsMenu,CategoryLogistics), LSTRING(openMenu)], [[0, 1, 2, 3], [ELSTRING(common,never), LSTRING(unloadObject), LSTRING(paradropButton), ELSTRING(common,both)], 0], false, {[QGVAR(openAfterUnload), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ - QGVAR(enableRename), "CHECKBOX", + QGVAR(enableRename), + "CHECKBOX", [LSTRING(ModuleSettings_enableRename), LSTRING(ModuleSettings_enableRename_Description)], - [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + [ELSTRING(OptionsMenu,CategoryLogistics), LSTRING(openMenu)], true, false, {[QGVAR(enableRename), _this, true] call EFUNC(common,cbaSettings_settingChanged)} ] call CBA_fnc_addSetting; [ - QGVAR(carryAfterUnload), "CHECKBOX", + QGVAR(carryAfterUnload), + "CHECKBOX", [LSTRING(carryAfterUnload), LSTRING(carryAfterUnload_description)], - [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(openMenu)], + [ELSTRING(OptionsMenu,CategoryLogistics), LSTRING(openMenu)], true, false, {[QGVAR(carryAfterUnload), _this] call EFUNC(common,cbaSettings_settingChanged)} diff --git a/addons/cargo/menu.hpp b/addons/cargo/menu.hpp index 03761eb73da..ac05c9824f8 100644 --- a/addons/cargo/menu.hpp +++ b/addons/cargo/menu.hpp @@ -4,7 +4,7 @@ class GVAR(menu) { idd = 314614; movingEnable = 1; onLoad = QUOTE([_this select 0] call FUNC(onMenuOpen)); - onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuDisplay)),nil)];); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(menuDisplay),nil)];); class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; @@ -20,7 +20,7 @@ class GVAR(menu) { h = "13.1 * ((((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])"}; + colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; }; }; @@ -46,8 +46,8 @@ class GVAR(menu) { 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}; + colorText[] = {1, 1, 1, 0.9}; + colorBackground[] = {0, 0, 0, 0}; SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1.2)"; text = ""; }; @@ -83,12 +83,12 @@ class GVAR(menu) { 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}; + 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); @@ -97,7 +97,7 @@ class GVAR(menu) { 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)); + action = QUOTE(ACE_player call FUNC(startUnload)); }; }; }; diff --git a/addons/cargo/script_component.hpp b/addons/cargo/script_component.hpp index d5cee60c390..00629c73d27 100644 --- a/addons/cargo/script_component.hpp +++ b/addons/cargo/script_component.hpp @@ -19,7 +19,3 @@ #define MAX_LOAD_DISTANCE 5 #define GET_NUMBER(config,default) (if (isNumber (config)) then {getNumber (config)} else {default}) - -// Default cargo size is -1 as 0 is a valid size -#define CARGO_SIZE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(size),-1) -#define CARGO_SPACE(classname) GET_NUMBER(configFile >> "CfgVehicles" >> (classname) >> QGVAR(space),0) diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 62f2603791a..f238f8127b9 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -38,7 +38,7 @@ 名前を次に変更:<br/>%1 Renommé en :<br/>%1 Переименовано в:<br/>%1 - Neu Bewaffnet: <br/>%1 + Neu umbenannt zu: <br/>%1 Nazwa zmieniona na:<br/>%1 重命名为:<br/>%1 %1(으)로 명칭을 바꿈 @@ -294,6 +294,16 @@ %1<br/>无法被卸载 %1<br/> kargo boşaltılamadı + + Can't be unloaded + Kann nicht entladen werden + Ne peut pas être déchargé + + + Cargo Size: %1 + Frachtgröße: %1 + Encombrement fret: %1 + Custom Name カスタム名 @@ -364,7 +374,7 @@ Kargo Boyutu - The cargo space required to hold this object (-1 for unloadable) + The cargo space required to hold this object (-1 for not loadable) Frachtraumgröße, welche zum Einladen dieses Objektes benötigt wird (-1 nicht einladbar) Lo spazio del cargo necessita di mantenere questo oggetto (-1 per scaricabile) オブジェクトを積載するのに必要なカーゴ スペース (-1 で積載不可) diff --git a/addons/common/define.hpp b/addons/common/define.hpp index 9e9e92ecb54..485f423cd1d 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -83,42 +83,25 @@ #define FONT_ACE "RobotoCondensed" class ACE_gui_backgroundBase { - type = CT_STATIC; - idc = -1; - style = ST_PICTURE; - colorBackground[] = {0,0,0,0}; - colorText[] = {1, 1, 1, 1}; - font = FONT_ACE; - text = ""; - sizeEx = 0.032; + type = CT_STATIC; + idc = -1; + style = ST_PICTURE; + colorBackground[] = {0, 0, 0, 0}; + colorText[] = {1, 1, 1, 1}; + font = FONT_ACE; + text = ""; + sizeEx = 0.032; }; + class ACE_gui_editBase { type = 2; x = 0; y = 0; h = 0.04; w = 0.2; - colorBackground[] = - { - 0, - 0, - 0, - 1 - }; - colorText[] = - { - 0.95, - 0.95, - 0.95, - 1 - }; - colorSelection[] = - { - "(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", - "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", - "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", - 1 - }; + colorBackground[] = {0, 0, 0, 1}; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorSelection[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", 1}; autocomplete = ""; text = ""; size = 0.2; @@ -126,629 +109,621 @@ class ACE_gui_editBase { font = "RobotoCondensed"; shadow = 2; sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorDisabled[] = - { - 1, - 1, - 1, - 0.25 - }; + colorDisabled[] = {1, 1, 1, 0.25}; }; - - class ACE_gui_buttonBase { - idc = -1; - type = 16; - style = ST_LEFT; - text = ""; - action = ""; - x = 0.0; - y = 0.0; - w = 0.25; - h = 0.04; - size = 0.03921; - sizeEx = 0.03921; - color[] = {1.0, 1.0, 1.0, 1}; - color2[] = {1.0, 1.0, 1.0, 1}; - colorBackground[] = {1,1,1,0.95}; - colorbackground2[] = {1,1,1,0.95}; - colorDisabled[] = {1,1,1,0.6}; - colorFocused[] = {1,1,1,1}; - colorBackgroundFocused[] = {1,1,1,1}; - periodFocus = 1.2; - periodOver = 0.8; - default = 0; - class HitZone { - left = 0.00; - top = 0.00; - right = 0.00; - bottom = 0.00; - }; - - class ShortcutPos { - left = 0.00; - top = 0.00; - w = 0.00; - h = 0.00; - }; - - class TextPos { - left = 0.002; - top = 0.0004; - right = 0.0; - bottom = 0.00; - }; - textureNoShortcut = ""; - 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)"; - period = 0.5; - font = FONT_ACE; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.0,0}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.07,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; - class Attributes { - font = FONT_ACE; - color = "#E5E5E5"; - align = "center"; - shadow = "true"; - }; - class AttributesImage { + idc = -1; + type = 16; + style = ST_LEFT; + text = ""; + action = ""; + x = 0; + y = 0; + w = 0.25; + h = 0.04; + size = 0.03921; + sizeEx = 0.03921; + color[] = {1, 1, 1, 1}; + color2[] = {1, 1, 1, 1}; + colorBackground[] = {1, 1, 1, 0.95}; + colorbackground2[] = {1, 1, 1, 0.95}; + colorDisabled[] = {1, 1, 1, 0.6}; + colorFocused[] = {1, 1, 1, 1}; + colorBackgroundFocused[] = {1, 1, 1, 1}; + periodFocus = 1.2; + periodOver = 0.8; + default = 0; + + class HitZone { + left = 0; + top = 0; + right = 0; + bottom = 0; + }; + class ShortcutPos { + left = 0; + top = 0; + w = 0; + h = 0; + }; + class TextPos { + left = 0.002; + top = 0.0004; + right = 0; + bottom = 0; + }; + + textureNoShortcut = ""; + 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)"; + period = 0.5; font = FONT_ACE; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick", 0.09, 1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush", 0, 0}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter", 0.07, 1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape", 0.09, 1}; + + class Attributes { + font = FONT_ACE; + color = "#E5E5E5"; + align = "center"; + shadow = "true"; + }; + class AttributesImage { + font = FONT_ACE; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; + }; }; class ACE_gui_RscProgress { - type = 8; - style = 0; - colorFrame[] = {1,1,1,0.7}; - colorBar[] = {1,1,1,0.7}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 8; + style = 0; + colorFrame[] = {1, 1, 1, 0.7}; + colorBar[] = {1, 1, 1, 0.7}; + texture = "#(argb,8,8,3)color(1,1,1,0.7)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; - class ACE_gui_staticBase { - idc = -1; - type = CT_STATIC; - x = 0.0; - y = 0.0; - w = 0.183825; - h = 0.104575; - style = ST_LEFT; - font = FONT_ACE; - sizeEx = 0.03921; - colorText[] = {0.95, 0.95, 0.95, 1.0}; - colorBackground[] = {0, 0, 0, 0}; - text = ""; + idc = -1; + type = CT_STATIC; + x = 0; + y = 0; + w = 0.183825; + h = 0.104575; + style = ST_LEFT; + font = FONT_ACE; + sizeEx = 0.03921; + colorText[] = {0.95, 0.95, 0.95, 1}; + colorBackground[] = {0, 0, 0, 0}; + text = ""; }; class RscListBox; class ACE_gui_listBoxBase: RscListBox { - type = CT_LISTBOX; - style = ST_MULTI; - font = FONT_ACE; - sizeEx = 0.03921; - color[] = {1, 1, 1, 1}; - colorText[] = {0.543, 0.5742, 0.4102, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 1}; - colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; - colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - period = 1.2; - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 1}; - maxHistoryDelay = 1.0; - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - soundSelect[] = {"",0.1,1}; - soundExpand[] = {"",0.1,1}; - soundCollapse[] = {"",0.1,1}; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + type = CT_LISTBOX; + style = ST_MULTI; + font = FONT_ACE; + sizeEx = 0.03921; + color[] = {1, 1, 1, 1}; + colorText[] = {0.543, 0.5742, 0.4102, 1}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 1}; + colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1}; + colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; + period = 1.2; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 1}; + maxHistoryDelay = 1; + autoScrollSpeed = -1; autoScrollDelay = 5; - autoScrollEnabled = 0; autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; - class ScrollBar { - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = ""; - arrowFull = ""; - arrowEmpty = ""; - border = ""; - }; + soundSelect[] = {"", 0.1, 1}; + soundExpand[] = {"", 0.1, 1}; + soundCollapse[] = {"", 0.1, 1}; + + class ListScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; + class ScrollBar { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = ""; + arrowFull = ""; + arrowEmpty = ""; + border = ""; + }; }; - class ACE_gui_listNBox { - type = CT_LISTNBOX;// 102; - style =ST_MULTI; - w = 0.4; - h = 0.4; - font = FONT_ACE; - sizeEx = 0.031; - - autoScrollSpeed = -1; - autoScrollDelay = 5; - autoScrollRewind = 0; - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - columns[] = {0.0}; - color[] = {1, 1, 1, 1}; - - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 0.2}; - colorText[] = {1,1, 1, 1.0}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 0.0}; - colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; - colorActive[] = {0,0,0,1}; - colorDisabled[] = {0,0,0,0.3}; - rows = 1; - - drawSideArrows = 0; - idcLeft = -1; - idcRight = -1; - maxHistoryDelay = 1; - soundSelect[] = {"", 0.1, 1}; - period = 1; - shadow = 2; - class ScrollBar { - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - border = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - thumb = "#(argb,8,8,3)color(1,1,1,1)"; - }; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + type = CT_LISTNBOX; // 102; + style = ST_MULTI; + w = 0.4; + h = 0.4; + font = FONT_ACE; + sizeEx = 0.031; + + autoScrollSpeed = -1; autoScrollDelay = 5; - autoScrollEnabled = 0; autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1,1,1,0.6}; - colorActive[] = {1,1,1,1}; - colorDisabled[] = {1,1,1,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + columns[] = {0}; + color[] = {1, 1, 1, 1}; + + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1, 1, 1, 1}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0}; + colorSelectBackground2[] = {0, 0, 0, 0.5}; + colorActive[] = {0, 0, 0, 1}; + colorDisabled[] = {0, 0, 0, 0.3}; + rows = 1; + + drawSideArrows = 0; + idcLeft = -1; + idcRight = -1; + maxHistoryDelay = 1; + soundSelect[] = {"", 0.1, 1}; + period = 1; + shadow = 2; + class ScrollBar { + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + border = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = "#(argb,8,8,3)color(1,1,1,1)"; + }; + class ListScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; +}; class RscCombo; class ACE_gui_comboBoxBase: RscCombo { - idc = -1; - type = 4; - style = "0x10 + 0x200"; - x = 0; - y = 0; - w = 0.3; - h = 0.035; - color[] = {0,0,0,0.6}; - colorActive[] = {1,0,0,1}; - colorBackground[] = {0,0,0,1}; - colorDisabled[] = {1,1,1,0.25}; - colorScrollbar[] = {1,0,0,1}; - colorSelect[] = {0,0,0,1}; - colorSelectBackground[] = {1,1,1,0.7}; - colorText[] = {1,1,1,1}; - - arrowEmpty = ""; - arrowFull = ""; - wholeHeight = 0.45; - font = FONT_ACE; - sizeEx = 0.031; - soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; - soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; - soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; - maxHistoryDelay = 1.0; - class ScrollBar { - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - border = ""; - }; - class ComboScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {0.3,0.3,0.3,0.6}; - colorActive[] = {0.3,0.3,0.3,1}; - colorDisabled[] = {0.3,0.3,0.3,0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; -}; - + idc = -1; + type = 4; + style = "0x10 + 0x200"; + x = 0; + y = 0; + w = 0.3; + h = 0.035; + color[] = {0, 0, 0, 0.6}; + colorActive[] = {1, 0, 0, 1}; + colorBackground[] = {0, 0, 0, 1}; + colorDisabled[] = {1, 1, 1, 0.25}; + colorScrollbar[] = {1, 0, 0, 1}; + colorSelect[] = {0, 0, 0, 1}; + colorSelectBackground[] = {1, 1, 1, 0.7}; + colorText[] = {1, 1, 1, 1}; + arrowEmpty = ""; + arrowFull = ""; + wholeHeight = 0.45; + font = FONT_ACE; + sizeEx = 0.031; + soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect", 0.1, 1}; + soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand", 0.1, 1}; + soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse", 0.1, 1}; + maxHistoryDelay = 1; + + class ScrollBar { + color[] = {0.3, 0.3, 0.3, 0.6}; + colorActive[] = {0.3, 0.3, 0.3, 1}; + colorDisabled[] = {0.3, 0.3, 0.3, 0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = ""; + }; + class ComboScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {0.3, 0.3, 0.3, 0.6}; + colorActive[] = {0.3, 0.3, 0.3, 1}; + colorDisabled[] = {0.3, 0.3, 0.3, 0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; +}; class ACE_gui_mapBase { - moveOnEdges = 1; - x = "SafeZoneXAbs"; - y = "SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "SafeZoneWAbs"; - h = "SafeZoneH - 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - type = 100; // Use 100 to hide markers - style = 48; - shadow = 0; - - ptsPerSquareSea = 5; - ptsPerSquareTxt = 3; - ptsPerSquareCLn = 10; - ptsPerSquareExp = 10; - ptsPerSquareCost = 10; - ptsPerSquareFor = 9; - ptsPerSquareForEdge = 9; - ptsPerSquareRoad = 6; - ptsPerSquareObj = 9; - showCountourInterval = 0; - scaleMin = 0.001; - scaleMax = 1.0; - scaleDefault = 0.16; - maxSatelliteAlpha = 0.85; - alphaFadeStartScale = 0.35; - alphaFadeEndScale = 0.4; - colorBackground[] = {0.969,0.957,0.949,1.0}; - colorSea[] = {0.467,0.631,0.851,0.5}; - colorForest[] = {0.624,0.78,0.388,0.5}; - colorForestBorder[] = {0.0,0.0,0.0,0.0}; - colorRocks[] = {0.0,0.0,0.0,0.3}; - colorRocksBorder[] = {0.0,0.0,0.0,0.0}; - colorLevels[] = {0.286,0.177,0.094,0.5}; - colorMainCountlines[] = {0.572,0.354,0.188,0.5}; - colorCountlines[] = {0.572,0.354,0.188,0.25}; - colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6}; - colorCountlinesWater[] = {0.491,0.577,0.702,0.3}; - colorPowerLines[] = {0.1,0.1,0.1,1.0}; - colorRailWay[] = {0.8,0.2,0.0,1.0}; - colorNames[] = {0.1,0.1,0.1,0.9}; - colorInactive[] = {1.0,1.0,1.0,0.5}; - colorOutside[] = {0.0,0.0,0.0,1.0}; - colorTracks[] = {0.84,0.76,0.65,0.15}; - colorTracksFill[] = {0.84,0.76,0.65,1.0}; - colorRoads[] = {0.7,0.7,0.7,1.0}; - colorRoadsFill[] = {1.0,1.0,1.0,1.0}; - colorMainRoads[] = {0.9,0.5,0.3,1.0}; - colorMainRoadsFill[] = {1.0,0.6,0.4,1.0}; - colorGrid[] = {0.1,0.1,0.1,0.6}; - colorGridMap[] = {0.1,0.1,0.1,0.6}; - colorText[] = {1, 1, 1, 0.85}; -font = "RobotoCondensed"; -sizeEx = 0.0270000; -stickX[] = {0.20, {"Gamma", 1.00, 1.50} }; -stickY[] = {0.20, {"Gamma", 1.00, 1.50} }; -onMouseButtonClick = ""; -onMouseButtonDblClick = ""; - - fontLabel = "RobotoCondensed"; - sizeExLabel = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontGrid = "TahomaB"; - sizeExGrid = 0.02; - fontUnits = "TahomaB"; - sizeExUnits = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontNames = "RobotoCondensed"; - sizeExNames = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; - fontInfo = "RobotoCondensed"; - sizeExInfo = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontLevel = "TahomaB"; - sizeExLevel = 0.02; - text = "#(argb,8,8,3)color(1,1,1,1)"; - class ActiveMarker { - color[] = {0.30, 0.10, 0.90, 1.00}; - size = 50; - }; - class Legend { - x = "SafeZoneX + ( ((safezoneW / safezoneH) min 1.2) / 40)"; - y = "SafeZoneY + safezoneH - 4.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "RobotoCondensed"; - sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - colorBackground[] = {1,1,1,0.5}; - color[] = {0,0,0,1}; - }; - class Task { - icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; - iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; - iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; - iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; - iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; - color[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_A',0.8])"}; - colorCreated[] = {1,1,1,1}; - colorCanceled[] = {0.7,0.7,0.7,1}; - colorDone[] = {0.7,1,0.3,1}; - colorFailed[] = {1,0.3,0.2,1}; - size = 27; - importance = 1; - coefMin = 1; - coefMax = 1; - }; - class Waypoint { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class WaypointCompleted { - icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; - color[] = {0,0,0,1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.900000; - coefMax = 4; - }; - class CustomMark { - icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; - size = 24; - importance = 1; - coefMin = 1; - coefMax = 1; - color[] = {0,0,0,1}; - }; - class Command { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - size = 18; - importance = 1; - coefMin = 1; - coefMax = 1; - color[] = {1,1,1,1}; - }; - class Bush { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = "14/2"; - importance = "0.2 * 14 * 0.05 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Rock { - icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; - color[] = {0.1,0.1,0.1,0.8}; - size = 12; - importance = "0.5 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class SmallTree { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = 12; - importance = "0.6 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Tree { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45,0.64,0.33,0.4}; - size = 12; - importance = "0.9 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class busstop { - icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class fuelstation { - icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class hospital { - icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class church { - icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class lighthouse { - icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class power { - icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powersolar { - icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwave { - icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class powerwind { - icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class quay { - icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class shipwreck { - icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class transmitter { - icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class watertower { - icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {1,1,1,1}; - }; - class Cross { - icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Chapel { - icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1.0; - color[] = {0,0,0,1}; - }; - class Bunker { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - size = 14; - importance = "1.5 * 14 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Fortress { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - size = 16; - importance = "2 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Fountain { - icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; - size = 11; - importance = "1 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Ruin { - icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; - size = 16; - importance = "1.2 * 16 * 0.05"; - coefMin = 1; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Stack { - icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; - size = 20; - importance = "2 * 16 * 0.05"; - coefMin = 0.9; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class Tourism { - icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; - size = 16; - importance = "1 * 16 * 0.05"; - coefMin = 0.7; - coefMax = 4; - color[] = {0,0,0,1}; - }; - class ViewTower { - icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; - size = 16; - importance = "2.5 * 16 * 0.05"; - coefMin = 0.5; - coefMax = 4; - color[] = {0,0,0,1}; - }; + moveOnEdges = 1; + x = "SafeZoneXAbs"; + y = "SafeZoneY + 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "SafeZoneWAbs"; + h = "SafeZoneH - 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 100; // Use 100 to hide markers + style = 48; + shadow = 0; + + ptsPerSquareSea = 5; + ptsPerSquareTxt = 3; + ptsPerSquareCLn = 10; + ptsPerSquareExp = 10; + ptsPerSquareCost = 10; + ptsPerSquareFor = 9; + ptsPerSquareForEdge = 9; + ptsPerSquareRoad = 6; + ptsPerSquareObj = 9; + showCountourInterval = 0; + scaleMin = 0.001; + scaleMax = 1; + scaleDefault = 0.16; + maxSatelliteAlpha = 0.85; + alphaFadeStartScale = 0.35; + alphaFadeEndScale = 0.4; + colorBackground[] = {0.969, 0.957, 0.949, 1}; + colorSea[] = {0.467, 0.631, 0.851, 0.5}; + colorForest[] = {0.624, 0.78, 0.388, 0.5}; + colorForestBorder[] = {0, 0, 0, 0}; + colorRocks[] = {0, 0, 0, 0.3}; + colorRocksBorder[] = {0, 0, 0, 0}; + colorLevels[] = {0.286, 0.177, 0.094, 0.5}; + colorMainCountlines[] = {0.572, 0.354, 0.188, 0.5}; + colorCountlines[] = {0.572, 0.354, 0.188, 0.25}; + colorMainCountlinesWater[] = {0.491, 0.577, 0.702, 0.6}; + colorCountlinesWater[] = {0.491, 0.577, 0.702, 0.3}; + colorPowerLines[] = {0.1, 0.1, 0.1, 1}; + colorRailWay[] = {0.8, 0.2, 0, 1}; + colorNames[] = {0.1, 0.1, 0.1, 0.9}; + colorInactive[] = {1, 1, 1, 0.5}; + colorOutside[] = {0, 0, 0, 1}; + colorTracks[] = {0.84, 0.76, 0.65, 0.15}; + colorTracksFill[] = {0.84, 0.76, 0.65, 1}; + colorRoads[] = {0.7, 0.7, 0.7, 1}; + colorRoadsFill[] = {1, 1, 1, 1}; + colorMainRoads[] = {0.9, 0.5, 0.3, 1}; + colorMainRoadsFill[] = {1, 0.6, 0.4, 1}; + colorGrid[] = {0.1, 0.1, 0.1, 0.6}; + colorGridMap[] = {0.1, 0.1, 0.1, 0.6}; + colorText[] = {1, 1, 1, 0.85}; + font = "RobotoCondensed"; + sizeEx = 0.027; + stickX[] = {0.2, {"Gamma", 1, 1.5}}; + stickY[] = {0.2, {"Gamma", 1, 1.5}}; + onMouseButtonClick = ""; + onMouseButtonDblClick = ""; + + fontLabel = "RobotoCondensed"; + sizeExLabel = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontGrid = "TahomaB"; + sizeExGrid = 0.02; + fontUnits = "TahomaB"; + sizeExUnits = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontNames = "RobotoCondensed"; + sizeExNames = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + fontInfo = "RobotoCondensed"; + sizeExInfo = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontLevel = "TahomaB"; + sizeExLevel = 0.02; + text = "#(argb,8,8,3)color(1,1,1,1)"; + + class ActiveMarker { + color[] = {0.3, 0.1, 0.9, 1}; + size = 50; + }; + class Legend { + x = "SafeZoneX + (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "SafeZoneY + safezoneH - 4.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + font = "RobotoCondensed"; + sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + colorBackground[] = {1, 1, 1, 0.5}; + color[] = {0, 0, 0, 1}; + }; + class Task { + icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; + iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; + iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; + iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; + iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; + color[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])", "(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])", "(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])", "(profilenamespace getVariable ['IGUI_TEXT_RGB_A',0.8])"}; + colorCreated[] = {1, 1, 1, 1}; + colorCanceled[] = {0.7, 0.7, 0.7, 1}; + colorDone[] = {0.7, 1, 0.3, 1}; + colorFailed[] = {1, 0.3, 0.2, 1}; + size = 27; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class Waypoint { + icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 20; + importance = "1.2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + }; + class WaypointCompleted { + icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 20; + importance = "1.2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + }; + class CustomMark { + icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 24; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class Command { + icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + color[] = {1, 1, 1, 1}; + size = 18; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class Bush { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45, 0.64, 0.33, 0.4}; + size = "14/2"; + importance = "0.2 * 14 * 0.05 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Rock { + icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; + color[] = {0.1, 0.1, 0.1, 0.8}; + size = 12; + importance = "0.5 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class SmallTree { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45, 0.64, 0.33, 0.4}; + size = 12; + importance = "0.6 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Tree { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45, 0.64, 0.33, 0.4}; + size = 12; + importance = "0.9 * 16 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class busstop { + icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class fuelstation { + icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class hospital { + icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class church { + icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class lighthouse { + icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class power { + icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class powersolar { + icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class powerwave { + icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class powerwind { + icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class quay { + icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class shipwreck { + icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class transmitter { + icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class watertower { + icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; + color[] = {1, 1, 1, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class Cross { + icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; + color[] = {0, 0, 0, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class Chapel { + icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; + color[] = {0, 0, 0, 1}; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1; + }; + class Bunker { + icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 14; + importance = "1.5 * 14 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Fortress { + icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "2 * 16 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Fountain { + icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 11; + importance = "1 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Ruin { + icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "1.2 * 16 * 0.05"; + coefMin = 1; + coefMax = 4; + }; + class Stack { + icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 20; + importance = "2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + }; + class Tourism { + icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "1 * 16 * 0.05"; + coefMin = 0.7; + coefMax = 4; + }; + class ViewTower { + icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; + color[] = {0, 0, 0, 1}; + size = 16; + importance = "2.5 * 16 * 0.05"; + coefMin = 0.5; + coefMax = 4; + }; }; #endif diff --git a/addons/common/functions/fnc_findUnloadPosition.sqf b/addons/common/functions/fnc_findUnloadPosition.sqf index 3e961b50d16..2479ad4f94d 100644 --- a/addons/common/functions/fnc_findUnloadPosition.sqf +++ b/addons/common/functions/fnc_findUnloadPosition.sqf @@ -2,138 +2,150 @@ /* * Author: PabstMirror, ViperMaul * Find a safe place near a vehicle to unload something. - * Handles Normal Terrain, In Water or On Buildings (Pier, StaticShip). + * Handles normal terrain, water or on buildings (Pier, StaticShip). * * Arguments: - * 0: Source Vehicle - * 1: Cargo or - * 2: Unloader (player) (default: objNull) - * 3: Max Distance (meters) (default: 10) - * 4: Check Vehicle is Stable (default: true) + * 0: Holder object (vehicle) + * 1: Item to be unloaded or + * 2: Unit doing the unloading (default: objNull) + * 3: Max distance (meters) (default: 10) + * 4: Check if holder object is stable (default: true) * * Return Value: - * Unload PositionAGL (can Be [] if no valid pos found) + * Unload PositionAGL ([] if no valid pos found) * * Example: - * [theCar, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition + * [cursorObject, "CAManBase", player, 10, true] call ace_common_fnc_findUnloadPosition * * Public: No */ -//Number of tests run (effects performance in worst case scenarior where nothing is found VERSUES reliably finding a pos): +// Number of tests run (effects performance in worst case scenario where nothing is found VERSUS reliably finding a pos) #define MAX_TESTS 75 -//Manual collision tests (count and radius): +// Manual collision tests (count and radius) #define COL_TEST_COUNT 12 -params ["_vehicle", "_cargo", ["_theUnloader", objNull], ["_maxDistance", 10], ["_checkVehicleIsStable", true]]; -TRACE_5("params",_vehicle,_cargo,_theUnloader,_maxDistance,_checkVehicleIsStable); +params ["_vehicle", "_item", ["_unloader", objNull], ["_maxDistance", 10], ["_checkVehicleIsStable", true]]; +TRACE_5("params",_vehicle,_item,_unloader,_maxDistance,_checkVehicleIsStable); scopeName "main"; if (_checkVehicleIsStable) then { if (((vectorMagnitude (velocity _vehicle)) > 1.5) || {(!(_vehicle isKindOf "Ship")) && {(!isTouchingGround _vehicle) && {((getPos _vehicle) select 2) > 1.5}}}) then { TRACE_4("bad vehicle state",_vehicle,velocity _vehicle,isTouchingGround _vehicle,getPos _vehicle); - [] breakOut "main"; + + [] breakOut "main" }; }; private _radiusOfItem = 1; -if (_cargo isKindOf "CAManBase") then { + +if (_item isKindOf "CAManBase") then { _radiusOfItem = 1.1; } else { - //`sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size - private _configOfCargo = if (_cargo isEqualType objNull) then { - configOf _cargo - } else { - configFile >> "CfgVehicles" >> _cargo - }; - private _itemSize = if (isNumber (_configOfCargo >> QEGVAR(cargo,size)) && {getNumber (_configOfCargo >> QEGVAR(cargo,size)) != -1}) then { - getNumber (_configOfCargo >> QEGVAR(cargo,size)); - } else { - if (["ace_cargo"] call FUNC(isModLoaded)) then { - [_cargo] call EFUNC(cargo,getSizeItem); - } else { - _radiusOfItem; + // `sizeOf` is unreliable, and does not work with object types that don't exist on map, so estimate size based on cargo size + if (["ace_cargo"] call FUNC(isModLoaded)) then { + private _itemSize = _item call EFUNC(cargo,getSizeItem); + + if (_itemSize > 0) then { + _radiusOfItem = (_itemSize ^ 0.35) max 0.75; }; }; - if (_itemSize != -1) then { - _radiusOfItem = (_itemSize ^ 0.35) max 0.75; - }; }; -if (isNull _theUnloader) then {_theUnloader = _vehicle;}; +if (isNull _unloader) then { + _unloader = _vehicle; +}; -//Ideal unload pos is halfway between unloader and vehicle (at the unloader's height) -private _originASL = ((getPosASL _theUnloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5; -_originASL set [2, (getPosASL _theUnloader) select 2]; +// Ideal unload pos is halfway between unloader and vehicle (at the unloader's height) +private _originASL = ((getPosASL _unloader) vectorAdd (getPosASL _vehicle)) vectorMultiply 0.5; +_originASL set [2, (getPosASL _unloader) select 2]; private _originAGL = ASLtoAGL _originASL; -//Do a manual search for empty pos (handles underwater, buildings or piers) +// Do a manual search for empty pos (handles underwater, buildings or piers) TRACE_2("Checking for unload",_originAGL,_radiusOfItem); private _rangeToCheck = 0; + while {_rangeToCheck < _maxDistance} do { private _roundDistance = random _rangeToCheck; private _roundAngle = random 360; private _roundAGL = _originAGL vectorAdd [(cos _roundAngle) * _roundDistance, (sin _roundAngle) * _roundDistance, 0]; private _roundPointIsValid = false; + if (((AGLtoASL _roundAGL) select 2) > 0) then { - //Shoot a ray down, and make sure we hit something solid like a building or the ground: - private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0,0,0.5], (AGLtoASL _roundAGL) vectorAdd [0,0,-1]]; + // Shoot a ray down, and make sure we hit something solid like a building or the ground + private _belowRoundArray = lineIntersectsSurfaces [(AGLtoASL _roundAGL) vectorAdd [0, 0, 0.5], (AGLtoASL _roundAGL) vectorAdd [0, 0, -1]]; TRACE_4("Testing for solid",_roundDistance,_roundAngle,_roundAGL,_belowRoundArray); + if (_belowRoundArray isNotEqualTo []) then { private _aboveBuilding = (_belowRoundArray select 0) select 2; - //Point is above something: Terrain(null) or Building + + // Point is above something: Terrain (null) or Building if ((isNull _aboveBuilding) || {_aboveBuilding isKindOf "Building"}) then { - //Get the real intersection point: + // Get the real intersection point _roundAGL = ASLtoAGL ((_belowRoundArray select 0) select 0); + _roundPointIsValid = true; }; }; } else { - //Underwater, just unload anywhere + // Underwater, just unload anywhere TRACE_3("Under the sea",_roundDistance,_roundAngle,_roundAGL); + _roundPointIsValid = true; }; - //Make sure point is valid and do a fast check for people in the way (which sometimes aren't caught by line scaning) + // Make sure point is valid and do a fast check for people in the way (which sometimes aren't caught by line scanning) if (_roundPointIsValid && {(_roundAGL nearEntities ["Man", _radiusOfItem]) isEqualTo []}) then { for "_index" from 0 to (COL_TEST_COUNT -1) do { - //Scan for colisions with objects with lineIntersectsSurfaces + // Scan for collisions with objects with lineIntersectsSurfaces private _angle = _index * (360 / COL_TEST_COUNT); private _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.1]; - private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, (_radiusOfItem + 0.5)]; + private _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, _radiusOfItem + 0.5]; private _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; + if (((count _testIntersections) == 1) && {isNull ((_testIntersections select 0) select 2)}) then { private _hitGroundASL = (_testIntersections select 0) select 0; private _hitHeightOffset = ((AGLtoASL _roundAGL) select 2) - (_hitGroundASL select 2); private _hit2dOffset = _roundAGL distance2D _hitGroundASL; private _slope = _hitHeightOffset atan2 _hit2dOffset; - if (_slope < 25) then { //Ignore ground hit if slope is reasonable + + // Ignore ground hit if slope is reasonable + if (_slope < 25) then { _testIntersections = []; }; }; + if (_testIntersections isNotEqualTo []) exitWith { TRACE_2("collision low/high",_roundAGL,_testIntersections); + _roundPointIsValid = false; }; + _point1ASL = (AGLtoASL _roundAGL) vectorAdd [_radiusOfItem * cos _angle, _radiusOfItem * sin _angle, 0.5]; _point2ASL = (AGLtoASL _roundAGL) vectorAdd [-_radiusOfItem * cos _angle, -_radiusOfItem * sin _angle, 1]; _testIntersections = lineIntersectsSurfaces [_point1ASL, _point2ASL]; + if (_testIntersections isNotEqualTo []) exitWith { TRACE_2("collision mid",_roundAGL,_testIntersections); + _roundPointIsValid = false; }; }; + if (_roundPointIsValid) then { - TRACE_3("Valid point found", _rangeToCheck,_roundAGL, (_originAGL distance _roundAGL)); - //Raise it slightly so we don't sink through the floor: - (_roundAGL vectorAdd [0,0,0.05]) breakOut "main"; + TRACE_3("Valid point found",_rangeToCheck,_roundAGL,_originAGL distance _roundAGL); + + // Raise it slightly so we don't sink through the floor + (_roundAGL vectorAdd [0, 0, 0.05]) breakOut "main"; // return }; }; + _rangeToCheck = _rangeToCheck + (_maxDistance / MAX_TESTS); }; TRACE_1("no valid spots found",_rangeToCheck); -[] //return empty array + +[] // return diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index f57e3623755..0de1db9e726 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -30,8 +30,17 @@ private _inBuilding = _unit call FUNC(isObjectOnObject); [QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; [QEGVAR(common,fixCollision), _target, _target] call CBA_fnc_targetEvent; -// Release object -detach _target; +private _cursorObject = cursorObject; +_tryLoad = _tryLoad && {!isNull _cursorObject} && {[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)}; +private _loadCargo = false; + +// Don't release object if loading into vehicle (object might be released into vehicle) +if (_tryLoad && {!(_target isKindOf "CAManBase")} && {["ace_cargo"] call EFUNC(common,isModLoaded)} && {[_target, _cursorObject] call EFUNC(cargo,canLoadItemIn)}) then { + _loadCargo = true; +} else { + // Release object + detach _target; +}; // Fix anim when aborting carrying persons if (_target isKindOf "CAManBase" || {animationState _unit in CARRY_ANIMATIONS}) then { @@ -97,11 +106,11 @@ if (_mass != 0) then { // Reset temp direction _target setVariable [QGVAR(carryDirection_temp), nil]; -private _cursorObject = cursorObject; - -// Try loading into vehicle -if (_tryLoad && {!isNull _cursorObject} && {[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)}) then { - if (_target isKindOf "CAManBase") then { +// (Try) loading into vehicle +if (_loadCargo) then { + [_unit, _target, _cursorObject] call EFUNC(cargo,startLoadIn); +} else { + if (_tryLoad && {_target isKindOf "CAManBase"}) then { private _vehicles = [_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat); if ([_cursorObject] isEqualTo _vehicles) then { @@ -111,12 +120,5 @@ if (_tryLoad && {!isNull _cursorObject} && {[_unit, _cursorObject, ["isNotCarryi [_unit, _target, _cursorObject] call EFUNC(common,loadPerson); }; }; - } else { - if ( - ["ace_cargo"] call EFUNC(common,isModLoaded) && - {[_target, _cursorObject] call EFUNC(cargo,canLoadItemIn)} - ) then { - [_unit, _target, _cursorObject] call EFUNC(cargo,startLoadIn); - }; }; }; diff --git a/addons/rearm/initSettings.sqf b/addons/rearm/initSettings.sqf index d83ac3c7602..fc4e85be620 100644 --- a/addons/rearm/initSettings.sqf +++ b/addons/rearm/initSettings.sqf @@ -1,4 +1,4 @@ -private _category = [LELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(DisplayName)]; +private _category = [ELSTRING(OptionsMenu,CategoryLogistics), LLSTRING(DisplayName)]; [ QGVAR(enabled), "CHECKBOX", diff --git a/addons/refuel/initSettings.sqf b/addons/refuel/initSettings.sqf index 087e253dc4d..8650a5b3dbb 100644 --- a/addons/refuel/initSettings.sqf +++ b/addons/refuel/initSettings.sqf @@ -1,7 +1,9 @@ +private _category = [ELSTRING(OptionsMenu,CategoryLogistics), "str_state_refuel"]; + [ QGVAR(rate), "SLIDER", [LSTRING(RefuelSettings_speed_DisplayName), LSTRING(RefuelSettings_speed_Description)], - [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_refuel"], + _category, [0,25,1,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] true, // isGlobal {[QGVAR(rate), _this] call EFUNC(common,cbaSettings_settingChanged)} @@ -10,7 +12,7 @@ [ QGVAR(cargoRate), "SLIDER", [LSTRING(RefuelSettings_speedCargo_DisplayName), LSTRING(RefuelSettings_speedCargo_Description)], - [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_refuel"], + _category, [0,250,10,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] true, // isGlobal {[QGVAR(cargoRate), _this] call EFUNC(common,cbaSettings_settingChanged)} @@ -19,7 +21,7 @@ [ QGVAR(hoseLength), "SLIDER", [LSTRING(RefuelSettings_hoseLength_DisplayName)], - [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_refuel"], + _category, [0,50,12,1], // [min, max, default value, trailing decimals (-1 for whole numbers only)] true, // isGlobal {[QGVAR(hoseLength), _this] call EFUNC(common,cbaSettings_settingChanged)} @@ -28,7 +30,7 @@ [ QGVAR(progressDuration), "TIME", [LSTRING(RefuelSettings_progressDuration_DisplayName), LSTRING(RefuelSettings_progressDuration_Description)], - [localize ELSTRING(OptionsMenu,CategoryLogistics), localize "str_state_refuel"], + _category, [0, 10, 2], // [min, max, default value] true, // isGlobal {[QGVAR(progressDuration), _this] call EFUNC(common,cbaSettings_settingChanged)} diff --git a/addons/towing/initSettings.sqf b/addons/towing/initSettings.sqf index 8361dccccd7..aecc9113fe1 100644 --- a/addons/towing/initSettings.sqf +++ b/addons/towing/initSettings.sqf @@ -1,7 +1,7 @@ [ QGVAR(addRopeToVehicleInventory), "CHECKBOX", LSTRING(Setting_addRopeToVehicleInventory_DisplayName), - LELSTRING(OptionsMenu,CategoryLogistics), + ELSTRING(OptionsMenu,CategoryLogistics), true, true, { diff --git a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf index 208e7813197..2e4efca6e0b 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareTrack.sqf @@ -32,10 +32,10 @@ if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(c if !(alive _mouseOverUnit) then { [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { - if (getNumber (configFile >> "CfgVehicles" >> "ACE_Track" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { + if ("ACE_Track" call EFUNC(cargo,getSizeItem) > _mouseOverUnit call EFUNC(cargo,getCargoSpaceLeft)) then { [LSTRING(OnlyEnoughCargoSpace)] call FUNC(showMessage); } else { - ["ace_addCargo", ["ACE_Track", _mouseOverUnit, 1, true]] call CBA_fnc_localEvent; + ["ace_addCargo", ["ACE_Track", _mouseOverUnit, 1]] call CBA_fnc_localEvent; }; }; }; diff --git a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf index 1746b1045a0..d913300709d 100644 --- a/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf +++ b/addons/zeus/functions/fnc_moduleAddSpareWheel.sqf @@ -32,10 +32,10 @@ if !(["ace_cargo"] call EFUNC(common,isModLoaded) && ["ace_repair"] call EFUNC(c if !(alive _mouseOverUnit) then { [LSTRING(OnlyAlive)] call FUNC(showMessage); } else { - if (getNumber (configFile >> "CfgVehicles" >> "ACE_Wheel" >> QEGVAR(cargo,size)) > [_mouseOverUnit] call EFUNC(cargo,getCargoSpaceLeft)) then { + if ("ACE_Wheel" call EFUNC(cargo,getSizeItem) > _mouseOverUnit call EFUNC(cargo,getCargoSpaceLeft)) then { [LSTRING(OnlyEnoughCargoSpace)] call FUNC(showMessage); } else { - ["ace_addCargo", ["ACE_Wheel", _mouseOverUnit, 1, true]] call CBA_fnc_localEvent; + ["ace_addCargo", ["ACE_Wheel", _mouseOverUnit, 1]] call CBA_fnc_localEvent; }; }; }; diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index 5f8a5e8c8c0..9d87c696cf5 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -21,6 +21,8 @@ class CfgVehicles { class yourVehicleBaseClass { ace_cargo_space = 4; // Cargo space your vehicle has ace_cargo_hasCargo = 1; // Enables cargo to be loaded inside the vehicle (1-yes, 0-no) + ace_cargo_loadmasterTurrets = {{1}}; // If vehicle inherits from "Air", you can set this attribute. + // When sitting in the turret paths you define here, you can paradrop cargo items. By default, pilots and co-pilots can paradrop cargo items. }; }; ``` @@ -73,12 +75,12 @@ To disable cargo for a mission object use: ### 4.2 Adjusting cargo size of an object `ace_cargo_fnc_setSize` -Note that this function can be used to make objects loadable/unloadable (set to `-1` for unloadable). +Note that this function can be used to make objects loadable/unloadable (set to `-1` to disable cargo interactions). ```sqf - * Set the cargo size of any object. Has global effect. + * Sets the cargo size of any object. Has global effect. * Adds the load action menu if necessary. - * Negative size makes unloadable. + * A negative size disables the object's cargo interactions. * * Arguments: * 0: Object @@ -97,7 +99,7 @@ Note that this function can be used to make objects loadable/unloadable (set to Note that this function can be used to enable/disable a vehicle's cargo space (set to `0` to disable). ```sqf - * Set the cargo space of any object. Has global effect. + * Sets the cargo space of any object. Has global effect. * Adds the cargo action menu if necessary. * * Arguments: @@ -113,14 +115,17 @@ Note that this function can be used to enable/disable a vehicle's cargo space (s ### 4.4 Load cargo into vehicle -`ace_cargo_fnc_loadItem` (Also callable from cba event `ace_loadCargo`) -Note first arg can be a in-game object or a classname of an object type. +`ace_cargo_fnc_loadItem` (Also callable from CBA event `ace_loadCargo`) +Note first argument can be a in-game object or a classname of an object type. ```sqf + * Load an object into a vehicle. + * Objects loaded via classname remain virtual until unloaded. + * * Arguments: - * 0: Item - * 1: Vehicle - * 2: Ignore interaction distance and stability checks + * 0: Item to be loaded or + * 1: Holder object (vehicle) + * 2: Ignore interaction distance and stability checks (default: false) * * Return Value: * Object loaded @@ -131,16 +136,16 @@ Note first arg can be a in-game object or a classname of an object type. ### 4.5 Unload cargo from vehicle -`ace_cargo_fnc_unloadItem` (Also callable from cba event `ace_unloadCargo`) +`ace_cargo_fnc_unloadItem` (Also callable from CBA event `ace_unloadCargo`) ```sqf * Arguments: - * 0: Item - * 1: Vehicle + * 0: Item to be unloaded or + * 1: Holder object (vehicle) * 2: Unloader (default: objNull) * * Return Value: - * Object was unloaded + * Object unloaded * * Example: * [object, vehicle] call ace_cargo_fnc_unloadItem @@ -152,8 +157,8 @@ Note first arg can be a in-game object or a classname of an object type. ```sqf * Arguments: - * 0: Item or - * 1: Vehicle + * 0: Item to be removed or + * 1: Holder object (vehicle) * 2: Amount (default: 1) * * Return Value: @@ -167,5 +172,5 @@ Note first arg can be a in-game object or a classname of an object type. ### 4.7 Disable cargo renaming via script ```sqf -cargoBox setVariable ["ace_cargo_noRename", true] +cargoBox setVariable ["ace_cargo_noRename", true, _disableGlobally] ``` From 15980de5fc273cab68bee18b1fbdd48f3a853963 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 3 Nov 2023 21:30:35 +0100 Subject: [PATCH 03/13] Update menu.hpp --- addons/cargo/menu.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cargo/menu.hpp b/addons/cargo/menu.hpp index ac05c9824f8..8c41fc43a5f 100644 --- a/addons/cargo/menu.hpp +++ b/addons/cargo/menu.hpp @@ -4,7 +4,7 @@ class GVAR(menu) { idd = 314614; movingEnable = 1; onLoad = QUOTE([_this select 0] call FUNC(onMenuOpen)); - onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(menuDisplay),nil)];); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(menuDisplay),nil)]); class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; From 3cdf603cfd715dc053264b8d3e78c10c44bfe13e Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sun, 5 Nov 2023 10:45:03 +0100 Subject: [PATCH 04/13] Updated status effect key --- addons/cargo/XEH_postInit.sqf | 2 +- addons/cargo/functions/fnc_loadItem.sqf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index ee0617df278..a7e32548c69 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -42,7 +42,7 @@ _item hideObjectGlobal false; _item setPosASL (AGLtoASL _emptyPosAGL); - [_item, "blockDamage", "ACE_cargo", false] call EFUNC(common,statusEffect_set); + [_item, "blockDamage", QUOTE(ADDON), false] call EFUNC(common,statusEffect_set); }] call CBA_fnc_addEventHandler; [QGVAR(paradropItem), { diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index db21c542ae6..96ae95328c7 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -50,7 +50,7 @@ if (_item isEqualType objNull) then { [QEGVAR(common,hideObjectGlobal), [_item, true]] call CBA_fnc_serverEvent; // Some objects below water will take damage over time, eventually becoming "water logged" and unfixable (because of negative z attach) - [_item, "blockDamage", "ACE_cargo", true] call EFUNC(common,statusEffect_set); + [_item, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); }; // Invoke listenable event From 5d5e296bd5aca448bea6f33040bb565bbe958432 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:49:08 +0100 Subject: [PATCH 05/13] Update fnc_onMenuOpen.sqf --- addons/cargo/functions/fnc_onMenuOpen.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index f61d724c608..8341a15c90f 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -82,4 +82,4 @@ if (GVAR(interactionParadrop)) then { } forEach (_vehicle getVariable [QGVAR(loaded), []]); _label ctrlSetText format [LLSTRING(labelSpace), (_vehicle call FUNC(getCargoSpaceLeft)) max 0]; -}, 0.25, GVAR(interactionVehicle)] call CBA_fnc_addPerFrameHandler; +}, 0, GVAR(interactionVehicle)] call CBA_fnc_addPerFrameHandler; From 68d064e5c43eb84016a3aa82e288840180a3677d Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 11 Nov 2023 11:45:28 +0100 Subject: [PATCH 06/13] Update fnc_onMenuOpen.sqf --- addons/cargo/functions/fnc_onMenuOpen.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 8341a15c90f..914460b288e 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -40,7 +40,7 @@ if (GVAR(interactionParadrop)) then { if ( !alive _vehicle || {locked _vehicle >= 2} || - {!(_vehicle getVariable [QGVAR(hasCargo), getNumber (configOf _vehicle >> QGVAR(hasCargo)) == 1])} || + {!(_vehicle getVariable [QGVAR(hasCargo), true])} || // if the cargo menu could be opened, the vehicle has QGVAR(hasCargo) in its config or the variable is set using FUNC(setSpace) {(([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != _vehicle}} ) exitWith { closeDialog 0; From ad93661a4df9a33183b7f7d4a1074cf2608ae90c Mon Sep 17 00:00:00 2001 From: LinkIsGrim Date: Sat, 11 Nov 2023 07:56:50 -0300 Subject: [PATCH 07/13] fix comment from merge --- addons/cargo/functions/fnc_loadItem.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 2741604e7bc..21ebc0d52ad 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -60,7 +60,7 @@ if (_item isEqualType objNull) then { [QEGVAR(zeus,removeObjects), [[_item], _objectCurators]] call CBA_fnc_serverEvent; }; - // Some objects below water will take damage over time and eventualy become "water logged" and unfixable (because of negative z attach) + // Some objects below water will take damage over time, eventually becoming "water logged" and unfixable (because of negative z attach) [_item, "blockDamage", QUOTE(ADDON), true] call EFUNC(common,statusEffect_set); }; From c8ef5d96a72c580148dd2005c3be197238cfbc13 Mon Sep 17 00:00:00 2001 From: LinkIsGrim Date: Sat, 11 Nov 2023 08:11:16 -0300 Subject: [PATCH 08/13] nil interaction GVARs on menu close --- addons/cargo/functions/fnc_onMenuOpen.sqf | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 914460b288e..8e2a84f6e6b 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -33,6 +33,8 @@ if (GVAR(interactionParadrop)) then { private _display = uiNamespace getVariable QGVAR(menuDisplay); if (isNil "_display") exitWith { + GVAR(interactionVehicle) = nil; + GVAR(interactionParadrop) = nil; _pfhID call CBA_fnc_removePerFrameHandler; }; @@ -44,7 +46,8 @@ if (GVAR(interactionParadrop)) then { {(([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != _vehicle}} ) exitWith { closeDialog 0; - + GVAR(interactionVehicle) = nil; + GVAR(interactionParadrop) = nil; _pfhID call CBA_fnc_removePerFrameHandler; }; From 878df86e486b15559b9d39d185bf34e7cdb51ac5 Mon Sep 17 00:00:00 2001 From: LinkIsGrim Date: Sat, 11 Nov 2023 09:01:05 -0300 Subject: [PATCH 09/13] fix carry bug --- addons/cargo/functions/fnc_startLoadIn.sqf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 5f5cb0780bc..9a675e20d85 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -62,8 +62,15 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { }, { TRACE_1("load fail",_this); + private _item = _this select 0 select 0; - [objNull, _this select 0 select 0, true] call EFUNC(common,claim); + [objNull, _item, true] call EFUNC(common,claim); + + // Fix cancelling loading a carried item + if (!isNull attachedTo _item) then { + detach _item; + [{_this awake true}, _item] call CBA_fnc_execNextFrame; + }; }, LLSTRING(loadingItem), { @@ -75,6 +82,10 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { true // return } else { [[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); + if (!isNull attachedTo _item) then { + detach _item; + _item awake true; + }; false // return }; From 96ad7a21c1b5678b6bc9010f3afd61a9297dc8cb Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 11 Nov 2023 15:50:04 +0100 Subject: [PATCH 10/13] Fix floating objects in MP --- addons/cargo/functions/fnc_onMenuOpen.sqf | 3 + addons/cargo/functions/fnc_startLoadIn.sqf | 20 +- addons/cargo/functions/fnc_startUnload.sqf | 2 +- addons/cargo/renameMenu.hpp | 22 +- addons/common/define.hpp | 1223 ++++++++++---------- 5 files changed, 656 insertions(+), 614 deletions(-) diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 8e2a84f6e6b..692fbf27e59 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -35,6 +35,7 @@ if (GVAR(interactionParadrop)) then { if (isNil "_display") exitWith { GVAR(interactionVehicle) = nil; GVAR(interactionParadrop) = nil; + _pfhID call CBA_fnc_removePerFrameHandler; }; @@ -46,8 +47,10 @@ if (GVAR(interactionParadrop)) then { {(([ACE_player, _vehicle] call EFUNC(interaction,getInteractionDistance)) >= MAX_LOAD_DISTANCE) && {(vehicle ACE_player) != _vehicle}} ) exitWith { closeDialog 0; + GVAR(interactionVehicle) = nil; GVAR(interactionParadrop) = nil; + _pfhID call CBA_fnc_removePerFrameHandler; }; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 9a675e20d85..8c10bc1145a 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -62,14 +62,20 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { }, { TRACE_1("load fail",_this); - private _item = _this select 0 select 0; + (_this select 0) params ["_item", "_vehicle"]; [objNull, _item, true] call EFUNC(common,claim); // Fix cancelling loading a carried item if (!isNull attachedTo _item) then { detach _item; - [{_this awake true}, _item] call CBA_fnc_execNextFrame; + + // Prevent coliisions between item and vehicle + [QEGVAR(common,fixCollision), _vehicle, _vehicle] call CBA_fnc_targetEvent; + [QEGVAR(common,fixCollision), _item, _item] call CBA_fnc_targetEvent; + + [QEGVAR(common,fixPosition), _item, _item] call CBA_fnc_targetEvent; + [QEGVAR(common,fixFloating), _item, _item] call CBA_fnc_targetEvent; }; }, LLSTRING(loadingItem), @@ -82,9 +88,17 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { true // return } else { [[LSTRING(loadingFailed), [_item, true] call FUNC(getNameItem)], 3] call EFUNC(common,displayTextStructured); + + // Fix cancelling loading a carried item if (!isNull attachedTo _item) then { detach _item; - _item awake true; + + // Prevent coliisions between item and vehicle + [QEGVAR(common,fixCollision), _vehicle, _vehicle] call CBA_fnc_targetEvent; + [QEGVAR(common,fixCollision), _item, _item] call CBA_fnc_targetEvent; + + [QEGVAR(common,fixPosition), _item, _item] call CBA_fnc_targetEvent; + [QEGVAR(common,fixFloating), _item, _item] call CBA_fnc_targetEvent; }; false // return diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 82de13338ab..2b46326ca49 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -80,7 +80,7 @@ if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { // Close cargo menu closeDialog 0; - ["ace_unloadCargo", [_item, GVAR(interactionVehicle), _unit]] call CBA_fnc_localEvent + ["ace_unloadCargo", [_item, GVAR(interactionVehicle), _unit]] call CBA_fnc_localEvent; }; [ diff --git a/addons/cargo/renameMenu.hpp b/addons/cargo/renameMenu.hpp index ac841e9ff13..b6acc9ad4e3 100644 --- a/addons/cargo/renameMenu.hpp +++ b/addons/cargo/renameMenu.hpp @@ -3,8 +3,8 @@ class GVAR(renameMenu) { idd = 314615; movingEnable = 0; - onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuDisplay)),_this select 0)];); - onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(menuDisplay)),nil)];); + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(menuDisplay),_this select 0)]); + onUnload = QUOTE(uiNamespace setVariable [ARR_2(QQGVAR(menuDisplay),nil)]); class controlsBackground { class HeaderBackground: ACE_gui_backgroundBase { idc = -1; @@ -20,7 +20,7 @@ class GVAR(renameMenu) { h = "2.9 * ((((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])"}; + colorBackground[] = {0, 0, 0, "(profilenamespace getVariable ['GUI_BCG_RGB_A',0.9])"}; }; }; @@ -36,11 +36,11 @@ class GVAR(renameMenu) { font = "RobotoCondensed"; 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])"}; + 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(renameObjectUI); }; class edit: ACE_gui_editBase { - onLoad = QUOTE((_this select 0) ctrlSetText (GVAR(interactionVehicle) getVariable [ARR_2(QUOTE(QGVAR(customName)),'')])); + onLoad = QUOTE((_this select 0) ctrlSetText (GVAR(interactionVehicle) getVariable [ARR_2(QQGVAR(customName),'')])); idc = 100; canModify = 1; x = "13.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; @@ -65,12 +65,12 @@ class GVAR(renameMenu) { 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}; + 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); diff --git a/addons/common/define.hpp b/addons/common/define.hpp index 485f423cd1d..9e9e92ecb54 100644 --- a/addons/common/define.hpp +++ b/addons/common/define.hpp @@ -83,25 +83,42 @@ #define FONT_ACE "RobotoCondensed" class ACE_gui_backgroundBase { - type = CT_STATIC; - idc = -1; - style = ST_PICTURE; - colorBackground[] = {0, 0, 0, 0}; - colorText[] = {1, 1, 1, 1}; - font = FONT_ACE; - text = ""; - sizeEx = 0.032; + type = CT_STATIC; + idc = -1; + style = ST_PICTURE; + colorBackground[] = {0,0,0,0}; + colorText[] = {1, 1, 1, 1}; + font = FONT_ACE; + text = ""; + sizeEx = 0.032; }; - class ACE_gui_editBase { type = 2; x = 0; y = 0; h = 0.04; w = 0.2; - colorBackground[] = {0, 0, 0, 1}; - colorText[] = {0.95, 0.95, 0.95, 1}; - colorSelection[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", 1}; + colorBackground[] = + { + 0, + 0, + 0, + 1 + }; + colorText[] = + { + 0.95, + 0.95, + 0.95, + 1 + }; + colorSelection[] = + { + "(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])", + "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])", + "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])", + 1 + }; autocomplete = ""; text = ""; size = 0.2; @@ -109,621 +126,629 @@ class ACE_gui_editBase { font = "RobotoCondensed"; shadow = 2; sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)"; - colorDisabled[] = {1, 1, 1, 0.25}; + colorDisabled[] = + { + 1, + 1, + 1, + 0.25 + }; }; -class ACE_gui_buttonBase { - idc = -1; - type = 16; - style = ST_LEFT; - text = ""; - action = ""; - x = 0; - y = 0; - w = 0.25; - h = 0.04; - size = 0.03921; - sizeEx = 0.03921; - color[] = {1, 1, 1, 1}; - color2[] = {1, 1, 1, 1}; - colorBackground[] = {1, 1, 1, 0.95}; - colorbackground2[] = {1, 1, 1, 0.95}; - colorDisabled[] = {1, 1, 1, 0.6}; - colorFocused[] = {1, 1, 1, 1}; - colorBackgroundFocused[] = {1, 1, 1, 1}; - periodFocus = 1.2; - periodOver = 0.8; - default = 0; - - class HitZone { - left = 0; - top = 0; - right = 0; - bottom = 0; - }; - class ShortcutPos { - left = 0; - top = 0; - w = 0; - h = 0; - }; - class TextPos { - left = 0.002; - top = 0.0004; - right = 0; - bottom = 0; - }; - textureNoShortcut = ""; - 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)"; - period = 0.5; + +class ACE_gui_buttonBase { + idc = -1; + type = 16; + style = ST_LEFT; + text = ""; + action = ""; + x = 0.0; + y = 0.0; + w = 0.25; + h = 0.04; + size = 0.03921; + sizeEx = 0.03921; + color[] = {1.0, 1.0, 1.0, 1}; + color2[] = {1.0, 1.0, 1.0, 1}; + colorBackground[] = {1,1,1,0.95}; + colorbackground2[] = {1,1,1,0.95}; + colorDisabled[] = {1,1,1,0.6}; + colorFocused[] = {1,1,1,1}; + colorBackgroundFocused[] = {1,1,1,1}; + periodFocus = 1.2; + periodOver = 0.8; + default = 0; + class HitZone { + left = 0.00; + top = 0.00; + right = 0.00; + bottom = 0.00; + }; + + class ShortcutPos { + left = 0.00; + top = 0.00; + w = 0.00; + h = 0.00; + }; + + class TextPos { + left = 0.002; + top = 0.0004; + right = 0.0; + bottom = 0.00; + }; + textureNoShortcut = ""; + 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)"; + period = 0.5; + font = FONT_ACE; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.0,0}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.07,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + class Attributes { font = FONT_ACE; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick", 0.09, 1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush", 0, 0}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter", 0.07, 1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape", 0.09, 1}; - - class Attributes { - font = FONT_ACE; - color = "#E5E5E5"; - align = "center"; - shadow = "true"; - }; - class AttributesImage { - font = FONT_ACE; - color = "#E5E5E5"; - align = "left"; - shadow = "true"; - }; + color = "#E5E5E5"; + align = "center"; + shadow = "true"; + }; + class AttributesImage { + font = FONT_ACE; + color = "#E5E5E5"; + align = "left"; + shadow = "true"; + }; }; class ACE_gui_RscProgress { - type = 8; - style = 0; - colorFrame[] = {1, 1, 1, 0.7}; - colorBar[] = {1, 1, 1, 0.7}; - texture = "#(argb,8,8,3)color(1,1,1,0.7)"; - x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; - y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; - w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 8; + style = 0; + colorFrame[] = {1,1,1,0.7}; + colorBar[] = {1,1,1,0.7}; + texture = "#(argb,8,8,3)color(1,1,1,0.7)"; + x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)"; + y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)"; + w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; }; + class ACE_gui_staticBase { - idc = -1; - type = CT_STATIC; - x = 0; - y = 0; - w = 0.183825; - h = 0.104575; - style = ST_LEFT; - font = FONT_ACE; - sizeEx = 0.03921; - colorText[] = {0.95, 0.95, 0.95, 1}; - colorBackground[] = {0, 0, 0, 0}; - text = ""; + idc = -1; + type = CT_STATIC; + x = 0.0; + y = 0.0; + w = 0.183825; + h = 0.104575; + style = ST_LEFT; + font = FONT_ACE; + sizeEx = 0.03921; + colorText[] = {0.95, 0.95, 0.95, 1.0}; + colorBackground[] = {0, 0, 0, 0}; + text = ""; }; class RscListBox; class ACE_gui_listBoxBase: RscListBox { - type = CT_LISTBOX; - style = ST_MULTI; - font = FONT_ACE; - sizeEx = 0.03921; - color[] = {1, 1, 1, 1}; - colorText[] = {0.543, 0.5742, 0.4102, 1}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 1}; - colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1}; - colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; - period = 1.2; - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 1}; - maxHistoryDelay = 1; - autoScrollSpeed = -1; + type = CT_LISTBOX; + style = ST_MULTI; + font = FONT_ACE; + sizeEx = 0.03921; + color[] = {1, 1, 1, 1}; + colorText[] = {0.543, 0.5742, 0.4102, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 1}; + colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; + colorDisabled[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.5])", 0.25}; + period = 1.2; + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 1}; + maxHistoryDelay = 1.0; + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + soundSelect[] = {"",0.1,1}; + soundExpand[] = {"",0.1,1}; + soundCollapse[] = {"",0.1,1}; + class ListScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; autoScrollDelay = 5; + autoScrollEnabled = 0; autoScrollRewind = 0; - soundSelect[] = {"", 0.1, 1}; - soundExpand[] = {"", 0.1, 1}; - soundCollapse[] = {"", 0.1, 1}; - - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; - class ScrollBar { - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = ""; - arrowFull = ""; - arrowEmpty = ""; - border = ""; - }; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {1,1,1,0.6}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; + class ScrollBar { + color[] = {1, 1, 1, 0.6}; + colorActive[] = {1, 1, 1, 1}; + colorDisabled[] = {1, 1, 1, 0.3}; + thumb = ""; + arrowFull = ""; + arrowEmpty = ""; + border = ""; + }; }; -class ACE_gui_listNBox { - type = CT_LISTNBOX; // 102; - style = ST_MULTI; - w = 0.4; - h = 0.4; - font = FONT_ACE; - sizeEx = 0.031; - autoScrollSpeed = -1; +class ACE_gui_listNBox { + type = CT_LISTNBOX;// 102; + style =ST_MULTI; + w = 0.4; + h = 0.4; + font = FONT_ACE; + sizeEx = 0.031; + + autoScrollSpeed = -1; + autoScrollDelay = 5; + autoScrollRewind = 0; + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + columns[] = {0.0}; + color[] = {1, 1, 1, 1}; + + rowHeight = 0.03; + colorBackground[] = {0, 0, 0, 0.2}; + colorText[] = {1,1, 1, 1.0}; + colorScrollbar[] = {0.95, 0.95, 0.95, 1}; + colorSelect[] = {0.95, 0.95, 0.95, 1}; + colorSelect2[] = {0.95, 0.95, 0.95, 1}; + colorSelectBackground[] = {0, 0, 0, 0.0}; + colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5}; + colorActive[] = {0,0,0,1}; + colorDisabled[] = {0,0,0,0.3}; + rows = 1; + + drawSideArrows = 0; + idcLeft = -1; + idcRight = -1; + maxHistoryDelay = 1; + soundSelect[] = {"", 0.1, 1}; + period = 1; + shadow = 2; + class ScrollBar { + arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; + arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; + border = "#(argb,8,8,3)color(1,1,1,1)"; + color[] = {1,1,1,0.6}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.3}; + thumb = "#(argb,8,8,3)color(1,1,1,1)"; + }; + class ListScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; autoScrollDelay = 5; + autoScrollEnabled = 0; autoScrollRewind = 0; - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - columns[] = {0}; - color[] = {1, 1, 1, 1}; - - rowHeight = 0.03; - colorBackground[] = {0, 0, 0, 0.2}; - colorText[] = {1, 1, 1, 1}; - colorScrollbar[] = {0.95, 0.95, 0.95, 1}; - colorSelect[] = {0.95, 0.95, 0.95, 1}; - colorSelect2[] = {0.95, 0.95, 0.95, 1}; - colorSelectBackground[] = {0, 0, 0, 0}; - colorSelectBackground2[] = {0, 0, 0, 0.5}; - colorActive[] = {0, 0, 0, 1}; - colorDisabled[] = {0, 0, 0, 0.3}; - rows = 1; - - drawSideArrows = 0; - idcLeft = -1; - idcRight = -1; - maxHistoryDelay = 1; - soundSelect[] = {"", 0.1, 1}; - period = 1; - shadow = 2; - - class ScrollBar { - arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)"; - arrowFull = "#(argb,8,8,3)color(1,1,1,1)"; - border = "#(argb,8,8,3)color(1,1,1,1)"; - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - thumb = "#(argb,8,8,3)color(1,1,1,1)"; - }; - class ListScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {1, 1, 1, 0.6}; - colorActive[] = {1, 1, 1, 1}; - colorDisabled[] = {1, 1, 1, 0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {1,1,1,0.6}; + colorActive[] = {1,1,1,1}; + colorDisabled[] = {1,1,1,0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; }; + class RscCombo; class ACE_gui_comboBoxBase: RscCombo { - idc = -1; - type = 4; - style = "0x10 + 0x200"; - x = 0; - y = 0; - w = 0.3; - h = 0.035; - color[] = {0, 0, 0, 0.6}; - colorActive[] = {1, 0, 0, 1}; - colorBackground[] = {0, 0, 0, 1}; - colorDisabled[] = {1, 1, 1, 0.25}; - colorScrollbar[] = {1, 0, 0, 1}; - colorSelect[] = {0, 0, 0, 1}; - colorSelectBackground[] = {1, 1, 1, 0.7}; - colorText[] = {1, 1, 1, 1}; - - arrowEmpty = ""; - arrowFull = ""; - wholeHeight = 0.45; - font = FONT_ACE; - sizeEx = 0.031; - soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect", 0.1, 1}; - soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand", 0.1, 1}; - soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse", 0.1, 1}; - maxHistoryDelay = 1; - - class ScrollBar { - color[] = {0.3, 0.3, 0.3, 0.6}; - colorActive[] = {0.3, 0.3, 0.3, 1}; - colorDisabled[] = {0.3, 0.3, 0.3, 0.3}; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - border = ""; - }; - class ComboScrollBar { - arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; - arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; - autoScrollDelay = 5; - autoScrollEnabled = 0; - autoScrollRewind = 0; - autoScrollSpeed = -1; - border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; - color[] = {0.3, 0.3, 0.3, 0.6}; - colorActive[] = {0.3, 0.3, 0.3, 1}; - colorDisabled[] = {0.3, 0.3, 0.3, 0.3}; - height = 0; - scrollSpeed = 0.06; - shadow = 0; - thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; - width = 0; - }; + idc = -1; + type = 4; + style = "0x10 + 0x200"; + x = 0; + y = 0; + w = 0.3; + h = 0.035; + color[] = {0,0,0,0.6}; + colorActive[] = {1,0,0,1}; + colorBackground[] = {0,0,0,1}; + colorDisabled[] = {1,1,1,0.25}; + colorScrollbar[] = {1,0,0,1}; + colorSelect[] = {0,0,0,1}; + colorSelectBackground[] = {1,1,1,0.7}; + colorText[] = {1,1,1,1}; + + arrowEmpty = ""; + arrowFull = ""; + wholeHeight = 0.45; + font = FONT_ACE; + sizeEx = 0.031; + soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1}; + soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1}; + soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1}; + maxHistoryDelay = 1.0; + class ScrollBar { + color[] = {0.3,0.3,0.3,0.6}; + colorActive[] = {0.3,0.3,0.3,1}; + colorDisabled[] = {0.3,0.3,0.3,0.3}; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + border = ""; + }; + class ComboScrollBar { + arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa"; + arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa"; + autoScrollDelay = 5; + autoScrollEnabled = 0; + autoScrollRewind = 0; + autoScrollSpeed = -1; + border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa"; + color[] = {0.3,0.3,0.3,0.6}; + colorActive[] = {0.3,0.3,0.3,1}; + colorDisabled[] = {0.3,0.3,0.3,0.3}; + height = 0; + scrollSpeed = 0.06; + shadow = 0; + thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa"; + width = 0; + }; }; -class ACE_gui_mapBase { - moveOnEdges = 1; - x = "SafeZoneXAbs"; - y = "SafeZoneY + 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "SafeZoneWAbs"; - h = "SafeZoneH - 1.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - type = 100; // Use 100 to hide markers - style = 48; - shadow = 0; - ptsPerSquareSea = 5; - ptsPerSquareTxt = 3; - ptsPerSquareCLn = 10; - ptsPerSquareExp = 10; - ptsPerSquareCost = 10; - ptsPerSquareFor = 9; - ptsPerSquareForEdge = 9; - ptsPerSquareRoad = 6; - ptsPerSquareObj = 9; - showCountourInterval = 0; - scaleMin = 0.001; - scaleMax = 1; - scaleDefault = 0.16; - maxSatelliteAlpha = 0.85; - alphaFadeStartScale = 0.35; - alphaFadeEndScale = 0.4; - colorBackground[] = {0.969, 0.957, 0.949, 1}; - colorSea[] = {0.467, 0.631, 0.851, 0.5}; - colorForest[] = {0.624, 0.78, 0.388, 0.5}; - colorForestBorder[] = {0, 0, 0, 0}; - colorRocks[] = {0, 0, 0, 0.3}; - colorRocksBorder[] = {0, 0, 0, 0}; - colorLevels[] = {0.286, 0.177, 0.094, 0.5}; - colorMainCountlines[] = {0.572, 0.354, 0.188, 0.5}; - colorCountlines[] = {0.572, 0.354, 0.188, 0.25}; - colorMainCountlinesWater[] = {0.491, 0.577, 0.702, 0.6}; - colorCountlinesWater[] = {0.491, 0.577, 0.702, 0.3}; - colorPowerLines[] = {0.1, 0.1, 0.1, 1}; - colorRailWay[] = {0.8, 0.2, 0, 1}; - colorNames[] = {0.1, 0.1, 0.1, 0.9}; - colorInactive[] = {1, 1, 1, 0.5}; - colorOutside[] = {0, 0, 0, 1}; - colorTracks[] = {0.84, 0.76, 0.65, 0.15}; - colorTracksFill[] = {0.84, 0.76, 0.65, 1}; - colorRoads[] = {0.7, 0.7, 0.7, 1}; - colorRoadsFill[] = {1, 1, 1, 1}; - colorMainRoads[] = {0.9, 0.5, 0.3, 1}; - colorMainRoadsFill[] = {1, 0.6, 0.4, 1}; - colorGrid[] = {0.1, 0.1, 0.1, 0.6}; - colorGridMap[] = {0.1, 0.1, 0.1, 0.6}; - colorText[] = {1, 1, 1, 0.85}; - font = "RobotoCondensed"; - sizeEx = 0.027; - stickX[] = {0.2, {"Gamma", 1, 1.5}}; - stickY[] = {0.2, {"Gamma", 1, 1.5}}; - onMouseButtonClick = ""; - onMouseButtonDblClick = ""; - - fontLabel = "RobotoCondensed"; - sizeExLabel = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontGrid = "TahomaB"; - sizeExGrid = 0.02; - fontUnits = "TahomaB"; - sizeExUnits = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontNames = "RobotoCondensed"; - sizeExNames = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; - fontInfo = "RobotoCondensed"; - sizeExInfo = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - fontLevel = "TahomaB"; - sizeExLevel = 0.02; - text = "#(argb,8,8,3)color(1,1,1,1)"; - - class ActiveMarker { - color[] = {0.3, 0.1, 0.9, 1}; - size = 50; - }; - class Legend { - x = "SafeZoneX + (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "SafeZoneY + safezoneH - 4.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "3.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - font = "RobotoCondensed"; - sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; - colorBackground[] = {1, 1, 1, 0.5}; - color[] = {0, 0, 0, 1}; - }; - class Task { - icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; - iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; - iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; - iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; - iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; - color[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])", "(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])", "(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])", "(profilenamespace getVariable ['IGUI_TEXT_RGB_A',0.8])"}; - colorCreated[] = {1, 1, 1, 1}; - colorCanceled[] = {0.7, 0.7, 0.7, 1}; - colorDone[] = {0.7, 1, 0.3, 1}; - colorFailed[] = {1, 0.3, 0.2, 1}; - size = 27; - importance = 1; - coefMin = 1; - coefMax = 1; - }; - class Waypoint { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.9; - coefMax = 4; - }; - class WaypointCompleted { - icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 20; - importance = "1.2 * 16 * 0.05"; - coefMin = 0.9; - coefMax = 4; - }; - class CustomMark { - icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 24; - importance = 1; - coefMin = 1; - coefMax = 1; - }; - class Command { - icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; - color[] = {1, 1, 1, 1}; - size = 18; - importance = 1; - coefMin = 1; - coefMax = 1; - }; - class Bush { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45, 0.64, 0.33, 0.4}; - size = "14/2"; - importance = "0.2 * 14 * 0.05 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Rock { - icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; - color[] = {0.1, 0.1, 0.1, 0.8}; - size = 12; - importance = "0.5 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class SmallTree { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45, 0.64, 0.33, 0.4}; - size = 12; - importance = "0.6 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Tree { - icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; - color[] = {0.45, 0.64, 0.33, 0.4}; - size = 12; - importance = "0.9 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class busstop { - icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class fuelstation { - icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class hospital { - icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class church { - icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class lighthouse { - icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class power { - icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class powersolar { - icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class powerwave { - icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class powerwind { - icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class quay { - icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class shipwreck { - icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class transmitter { - icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class watertower { - icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; - color[] = {1, 1, 1, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class Cross { - icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; - color[] = {0, 0, 0, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class Chapel { - icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; - color[] = {0, 0, 0, 1}; - size = 24; - importance = 1; - coefMin = 0.85; - coefMax = 1; - }; - class Bunker { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 14; - importance = "1.5 * 14 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Fortress { - icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 16; - importance = "2 * 16 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Fountain { - icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 11; - importance = "1 * 12 * 0.05"; - coefMin = 0.25; - coefMax = 4; - }; - class Ruin { - icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 16; - importance = "1.2 * 16 * 0.05"; - coefMin = 1; - coefMax = 4; - }; - class Stack { - icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 20; - importance = "2 * 16 * 0.05"; - coefMin = 0.9; - coefMax = 4; - }; - class Tourism { - icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 16; - importance = "1 * 16 * 0.05"; - coefMin = 0.7; - coefMax = 4; - }; - class ViewTower { - icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; - color[] = {0, 0, 0, 1}; - size = 16; - importance = "2.5 * 16 * 0.05"; - coefMin = 0.5; - coefMax = 4; - }; + +class ACE_gui_mapBase { + moveOnEdges = 1; + x = "SafeZoneXAbs"; + y = "SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "SafeZoneWAbs"; + h = "SafeZoneH - 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + type = 100; // Use 100 to hide markers + style = 48; + shadow = 0; + + ptsPerSquareSea = 5; + ptsPerSquareTxt = 3; + ptsPerSquareCLn = 10; + ptsPerSquareExp = 10; + ptsPerSquareCost = 10; + ptsPerSquareFor = 9; + ptsPerSquareForEdge = 9; + ptsPerSquareRoad = 6; + ptsPerSquareObj = 9; + showCountourInterval = 0; + scaleMin = 0.001; + scaleMax = 1.0; + scaleDefault = 0.16; + maxSatelliteAlpha = 0.85; + alphaFadeStartScale = 0.35; + alphaFadeEndScale = 0.4; + colorBackground[] = {0.969,0.957,0.949,1.0}; + colorSea[] = {0.467,0.631,0.851,0.5}; + colorForest[] = {0.624,0.78,0.388,0.5}; + colorForestBorder[] = {0.0,0.0,0.0,0.0}; + colorRocks[] = {0.0,0.0,0.0,0.3}; + colorRocksBorder[] = {0.0,0.0,0.0,0.0}; + colorLevels[] = {0.286,0.177,0.094,0.5}; + colorMainCountlines[] = {0.572,0.354,0.188,0.5}; + colorCountlines[] = {0.572,0.354,0.188,0.25}; + colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6}; + colorCountlinesWater[] = {0.491,0.577,0.702,0.3}; + colorPowerLines[] = {0.1,0.1,0.1,1.0}; + colorRailWay[] = {0.8,0.2,0.0,1.0}; + colorNames[] = {0.1,0.1,0.1,0.9}; + colorInactive[] = {1.0,1.0,1.0,0.5}; + colorOutside[] = {0.0,0.0,0.0,1.0}; + colorTracks[] = {0.84,0.76,0.65,0.15}; + colorTracksFill[] = {0.84,0.76,0.65,1.0}; + colorRoads[] = {0.7,0.7,0.7,1.0}; + colorRoadsFill[] = {1.0,1.0,1.0,1.0}; + colorMainRoads[] = {0.9,0.5,0.3,1.0}; + colorMainRoadsFill[] = {1.0,0.6,0.4,1.0}; + colorGrid[] = {0.1,0.1,0.1,0.6}; + colorGridMap[] = {0.1,0.1,0.1,0.6}; + colorText[] = {1, 1, 1, 0.85}; +font = "RobotoCondensed"; +sizeEx = 0.0270000; +stickX[] = {0.20, {"Gamma", 1.00, 1.50} }; +stickY[] = {0.20, {"Gamma", 1.00, 1.50} }; +onMouseButtonClick = ""; +onMouseButtonDblClick = ""; + + fontLabel = "RobotoCondensed"; + sizeExLabel = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontGrid = "TahomaB"; + sizeExGrid = 0.02; + fontUnits = "TahomaB"; + sizeExUnits = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontNames = "RobotoCondensed"; + sizeExNames = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2"; + fontInfo = "RobotoCondensed"; + sizeExInfo = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + fontLevel = "TahomaB"; + sizeExLevel = 0.02; + text = "#(argb,8,8,3)color(1,1,1,1)"; + class ActiveMarker { + color[] = {0.30, 0.10, 0.90, 1.00}; + size = 50; + }; + class Legend { + x = "SafeZoneX + ( ((safezoneW / safezoneH) min 1.2) / 40)"; + y = "SafeZoneY + safezoneH - 4.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + h = "3.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + font = "RobotoCondensed"; + sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)"; + colorBackground[] = {1,1,1,0.5}; + color[] = {0,0,0,1}; + }; + class Task { + icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa"; + iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa"; + iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; + iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; + iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa"; + color[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_A',0.8])"}; + colorCreated[] = {1,1,1,1}; + colorCanceled[] = {0.7,0.7,0.7,1}; + colorDone[] = {0.7,1,0.3,1}; + colorFailed[] = {1,0.3,0.2,1}; + size = 27; + importance = 1; + coefMin = 1; + coefMax = 1; + }; + class Waypoint { + icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + color[] = {0,0,0,1}; + size = 20; + importance = "1.2 * 16 * 0.05"; + coefMin = 0.900000; + coefMax = 4; + }; + class WaypointCompleted { + icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa"; + color[] = {0,0,0,1}; + size = 20; + importance = "1.2 * 16 * 0.05"; + coefMin = 0.900000; + coefMax = 4; + }; + class CustomMark { + icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa"; + size = 24; + importance = 1; + coefMin = 1; + coefMax = 1; + color[] = {0,0,0,1}; + }; + class Command { + icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa"; + size = 18; + importance = 1; + coefMin = 1; + coefMax = 1; + color[] = {1,1,1,1}; + }; + class Bush { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45,0.64,0.33,0.4}; + size = "14/2"; + importance = "0.2 * 14 * 0.05 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Rock { + icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa"; + color[] = {0.1,0.1,0.1,0.8}; + size = 12; + importance = "0.5 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class SmallTree { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45,0.64,0.33,0.4}; + size = 12; + importance = "0.6 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class Tree { + icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa"; + color[] = {0.45,0.64,0.33,0.4}; + size = 12; + importance = "0.9 * 16 * 0.05"; + coefMin = 0.25; + coefMax = 4; + }; + class busstop { + icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class fuelstation { + icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class hospital { + icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class church { + icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class lighthouse { + icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class power { + icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class powersolar { + icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class powerwave { + icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class powerwind { + icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class quay { + icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class shipwreck { + icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class transmitter { + icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class watertower { + icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {1,1,1,1}; + }; + class Cross { + icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {0,0,0,1}; + }; + class Chapel { + icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa"; + size = 24; + importance = 1; + coefMin = 0.85; + coefMax = 1.0; + color[] = {0,0,0,1}; + }; + class Bunker { + icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + size = 14; + importance = "1.5 * 14 * 0.05"; + coefMin = 0.25; + coefMax = 4; + color[] = {0,0,0,1}; + }; + class Fortress { + icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa"; + size = 16; + importance = "2 * 16 * 0.05"; + coefMin = 0.25; + coefMax = 4; + color[] = {0,0,0,1}; + }; + class Fountain { + icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa"; + size = 11; + importance = "1 * 12 * 0.05"; + coefMin = 0.25; + coefMax = 4; + color[] = {0,0,0,1}; + }; + class Ruin { + icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa"; + size = 16; + importance = "1.2 * 16 * 0.05"; + coefMin = 1; + coefMax = 4; + color[] = {0,0,0,1}; + }; + class Stack { + icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa"; + size = 20; + importance = "2 * 16 * 0.05"; + coefMin = 0.9; + coefMax = 4; + color[] = {0,0,0,1}; + }; + class Tourism { + icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa"; + size = 16; + importance = "1 * 16 * 0.05"; + coefMin = 0.7; + coefMax = 4; + color[] = {0,0,0,1}; + }; + class ViewTower { + icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa"; + size = 16; + importance = "2.5 * 16 * 0.05"; + coefMin = 0.5; + coefMax = 4; + color[] = {0,0,0,1}; + }; }; #endif From b06a8f524f177397cc54c449d027f9b7f8c8dbbd Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Sat, 11 Nov 2023 17:54:05 +0100 Subject: [PATCH 11/13] Updated ace_cargoAdded doc --- addons/cargo/functions/fnc_addCargoItem.sqf | 8 ++++++-- docs/wiki/framework/cargo-framework.md | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 5bddf7a5931..38ccdc0dd94 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -23,10 +23,14 @@ TRACE_3("params",_item,_vehicle,_amount); // Get config sensitive case name if (_item isEqualType "") then { _item = _item call EFUNC(common,getConfigName); -}; -for "_i" from 1 to _amount do { + for "_i" from 1 to _amount do { + [_item, _vehicle] call FUNC(loadItem); + }; +} else { [_item, _vehicle] call FUNC(loadItem); + + _item = typeOf _item; }; // Invoke listenable event diff --git a/docs/wiki/framework/cargo-framework.md b/docs/wiki/framework/cargo-framework.md index 9d87c696cf5..99b0ef3de14 100644 --- a/docs/wiki/framework/cargo-framework.md +++ b/docs/wiki/framework/cargo-framework.md @@ -52,8 +52,9 @@ class CfgVehicles { Event Name | Passed Parameter(s) | Locality | Description ---------- | ----------- | ------------------- | -------- -`ace_cargoLoaded` | [_item, _vehicle] | Global | Cargo has been Loaded into vehicle -`ace_cargoUnloaded` | [_item, _vehicle, _unloadType] | Global | Cargo has been Unloaded from vehicle +`ace_cargoAdded` | [_itemClass, _vehicle, _amount] | Global | Cargo has been added to vehicle +`ace_cargoLoaded` | [_item, _vehicle] | Global | Cargo has been loaded into vehicle +`ace_cargoUnloaded` | [_item, _vehicle, _unloadType] | Global | Cargo has been unloaded from vehicle `ace_cargoRemoved` | [_itemClass, _vehicle, _amountRequested, _amountRemoved] | Global | Cargo has been removed (deleted) from vehicle ## 3. Editor Attributes From f5e6edac567d30a6a4817f4f9cd2dd1be75b1f9c Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Thu, 16 Nov 2023 21:54:34 +0100 Subject: [PATCH 12/13] Fix progress bar prematurely stopping --- addons/cargo/functions/fnc_startLoadIn.sqf | 2 -- addons/cargo/functions/fnc_startUnload.sqf | 17 +++++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index 8c10bc1145a..767e5b8d68f 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -40,8 +40,6 @@ if ([_item, _vehicle] call FUNC(canLoadItemIn)) then { // If load time is 0, don't show a progress bar if (_duration <= 0) exitWith { - closeDialog 0; - ["ace_loadCargo", [_item, _vehicle]] call CBA_fnc_localEvent; true // return diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 0a2c87372b3..72bb07d0ffc 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -33,18 +33,19 @@ if (isNil "_item") exitWith {}; params ["_unit"]; if (GVAR(interactionParadrop)) exitWith { + // Close the cargo menu + closeDialog 0; + private _duration = GVAR(paradropTimeCoefficent) * (_item call FUNC(getSizeItem)); // If drop time is 0, don't show a progress bar if (_duration <= 0) exitWith { - // Close cargo menu - closeDialog 0; - [QGVAR(paradropItem), [_item, GVAR(interactionVehicle)]] call CBA_fnc_localEvent; }; // Start progress bar - paradrop - [ + // Delay execution by a frame, to avoid progress bar stopping prematurely because of the cargo menu still being open + [EFUNC(common,progressBar), [ _duration, [_item, GVAR(interactionVehicle)], { @@ -69,18 +70,18 @@ if (GVAR(interactionParadrop)) exitWith { }, ["isNotSwimming", "isNotInside"], false - ] call EFUNC(common,progressBar); + ]] call CBA_fnc_execNextFrame; }; // Start progress bar - normal ground unload if ([_item, GVAR(interactionVehicle), _unit] call FUNC(canUnloadItem)) then { + // Close the cargo menu + closeDialog 0; + private _duration = GVAR(loadTimeCoefficient) * (_item call FUNC(getSizeItem)); // If unload time is 0, don't show a progress bar if (_duration <= 0) exitWith { - // Close cargo menu - closeDialog 0; - ["ace_unloadCargo", [_item, GVAR(interactionVehicle), _unit]] call CBA_fnc_localEvent; }; From c5636b976f8016a7a2252086091eaa329f093325 Mon Sep 17 00:00:00 2001 From: johnb432 <58661205+johnb432@users.noreply.github.com> Date: Fri, 17 Nov 2023 10:44:01 +0100 Subject: [PATCH 13/13] Finer cursor object selection --- addons/dragging/functions/fnc_carryObjectPFH.sqf | 4 ++-- addons/dragging/functions/fnc_dropObject_carry.sqf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf index e00666bb230..b73ff972619 100644 --- a/addons/dragging/functions/fnc_carryObjectPFH.sqf +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -72,13 +72,13 @@ if (_previousHint isEqualType "") exitWith {}; // Mouse hint private _hintLMB = LLSTRING(Drop); -getCursorObjectParams params ["_cursorObject", "", "_distance"]; +private _cursorObject = cursorObject; if ( !isNull _cursorObject && {[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)} && { if (_target isKindOf "CAManBase") then { - (_distance <= MAX_LOAD_DISTANCE_MAN) && {[_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat) isNotEqualTo []} + (_unit distance _cursorObject <= MAX_LOAD_DISTANCE_MAN) && {[_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat) isNotEqualTo []} } else { ["ace_cargo"] call EFUNC(common,isModLoaded) && {EGVAR(cargo,enable)} && diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf index 65408302bd9..f3f15fac141 100644 --- a/addons/dragging/functions/fnc_dropObject_carry.sqf +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -30,7 +30,7 @@ private _inBuilding = _unit call FUNC(isObjectOnObject); [QEGVAR(common,fixCollision), _unit] call CBA_fnc_localEvent; [QEGVAR(common,fixCollision), _target, _target] call CBA_fnc_targetEvent; -getCursorObjectParams params ["_cursorObject", "", "_distance"]; +private _cursorObject = cursorObject; _tryLoad = _tryLoad && {!isNull _cursorObject} && {[_unit, _cursorObject, ["isNotCarrying"]] call EFUNC(common,canInteractWith)}; private _loadCargo = false; @@ -110,7 +110,7 @@ _target setVariable [QGVAR(carryDirection_temp), nil]; if (_loadCargo) then { [_unit, _target, _cursorObject] call EFUNC(cargo,startLoadIn); } else { - if (_tryLoad && {_distance <= MAX_LOAD_DISTANCE_MAN} && {_target isKindOf "CAManBase"}) then { + if (_tryLoad && {_unit distance _cursorObject <= MAX_LOAD_DISTANCE_MAN} && {_target isKindOf "CAManBase"}) then { private _vehicles = [_cursorObject, 0, true] call EFUNC(common,nearestVehiclesFreeSeat); if ([_cursorObject] isEqualTo _vehicles) then {