From bd1a6d14a80ba54238ebdceaffe179df13d1afe3 Mon Sep 17 00:00:00 2001 From: jokoho48 Date: Sun, 9 Aug 2015 02:33:00 +0200 Subject: [PATCH 01/12] Code cleanup of Dagr module --- addons/dagr/XEH_postInit.sqf | 2 +- addons/dagr/functions/fnc_menuInit.sqf | 16 ++++++++-------- addons/dagr/functions/fnc_outputData.sqf | 13 +++++++------ addons/dagr/functions/fnc_outputVector.sqf | 19 +++++++++---------- addons/dagr/functions/fnc_outputWP.sqf | 19 ++++++++++--------- addons/dagr/functions/fnc_toggleOverlay.sqf | 5 +++-- 6 files changed, 38 insertions(+), 36 deletions(-) diff --git a/addons/dagr/XEH_postInit.sqf b/addons/dagr/XEH_postInit.sqf index 39f2a7ea28..883a73d418 100644 --- a/addons/dagr/XEH_postInit.sqf +++ b/addons/dagr/XEH_postInit.sqf @@ -30,4 +30,4 @@ GVAR(vectorConnected) = false; GVAR(noVectorData) = true; GVAR(vectorGrid) = "00000000"; -["RangerfinderData", {_this call FUNC(handleRangeFinderData)}] call EFUNC(common,addEventHandler); +["RangerfinderData", FUNC(handleRangeFinderData)] call EFUNC(common,addEventHandler); diff --git a/addons/dagr/functions/fnc_menuInit.sqf b/addons/dagr/functions/fnc_menuInit.sqf index 739f41df0b..e4fb341537 100644 --- a/addons/dagr/functions/fnc_menuInit.sqf +++ b/addons/dagr/functions/fnc_menuInit.sqf @@ -74,13 +74,13 @@ GVAR(menuRun) = true; GVAR(menuRun) = false; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + if (GVAR(MENU_B)) then { GVAR(menu) = "main"; GVAR(selection) = 0; GVAR(numSelections) = 5; }; - + if (!GVAR(add) && !GVAR(edit)) then { if (GVAR(DOWN)) then { GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1); @@ -90,7 +90,7 @@ GVAR(menuRun) = true; }; GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 }; }; - + if (GVAR(LEFT)) then { GVAR(pointer) = (8 + GVAR(pointer) - 1); }; @@ -98,7 +98,7 @@ GVAR(menuRun) = true; GVAR(pointer) = (8 + GVAR(pointer) + 1); }; GVAR(pointer) = GVAR(pointer) % 8; - + (__dsp displayCtrl __PSelection1) ctrlSetText ""; (__dsp displayCtrl __PSelection2) ctrlSetText ""; (__dsp displayCtrl __PSelection3) ctrlSetText ""; @@ -113,7 +113,7 @@ GVAR(menuRun) = true; (__dsp displayCtrl __Selection2) ctrlSetText ""; (__dsp displayCtrl __Selection3) ctrlSetText ""; (__dsp displayCtrl __Selection4) ctrlSetText ""; - + (__dsp displayCtrl __F1) ctrlSetText ""; (__dsp displayCtrl __F2) ctrlSetText ""; (__dsp displayCtrl __F3) ctrlSetText ""; @@ -124,7 +124,7 @@ GVAR(menuRun) = true; (__dsp displayCtrl __Option2) ctrlSetText ""; (__dsp displayCtrl __Option3) ctrlSetText ""; (__dsp displayCtrl __Option4) ctrlSetText ""; - + switch (GVAR(menu)) do { case "main": { if (GVAR(SEL)) then { @@ -500,7 +500,7 @@ GVAR(menuRun) = true; case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 }; case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 }; case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 }; - }; + }; }; }; }; @@ -590,7 +590,7 @@ GVAR(menuRun) = true; }; }; }; - + if (!GVAR(busy)) then { GVAR(F3) = false; GVAR(F2) = false; diff --git a/addons/dagr/functions/fnc_outputData.sqf b/addons/dagr/functions/fnc_outputData.sqf index 9bcf244fbc..63350c71a3 100644 --- a/addons/dagr/functions/fnc_outputData.sqf +++ b/addons/dagr/functions/fnc_outputData.sqf @@ -31,18 +31,19 @@ if (GVAR(outputPFH) != -1) exitWith {}; GVAR(outputPFH) = [{ private["_dagrElevation", "_dagrGrid", "_dagrHeading", "_dagrSpeed", "_dagrTime", "_elevation", "_gridArray", "_speed"]; - + // Abort Condition if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { GVAR(outputPFH) = -1; 135471 cutText ["", "PLAIN"]; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + // GRID _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); - _dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; - + _gridArray params ["_gridArrayX","_gridArrayY"]; + _dagrGrid = format ["%1 %2", ((_gridArrayX) select [0,4]), ((_gridArrayY) select [0,4])]; + // SPEED _speed = speed (vehicle ACE_player); _speed = floor (_speed * 10) / 10; @@ -68,7 +69,7 @@ GVAR(outputPFH) = [{ __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _dagrSpeed]; __elevationControl ctrlSetText format ["%1", _dagrElevation]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 ", _dagrHeading] }); + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 �", _dagrHeading] }); __timeControl ctrlSetText format ["%1", _dagrTime]; - + }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index ad9068344f..7787a7ff96 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -14,7 +14,7 @@ */ #include "script_component.hpp" -private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; +private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"]; 135471 cutRsc ["DAGR_DISPLAY", "plain down"]; @@ -30,15 +30,14 @@ private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dag __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); if (GVAR(noVectorData)) exitwith {}; - -_pos = [GVAR(LAZPOS) select 0, GVAR(LAZPOS) select 1]; +GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"]; // Incase grids go neg due to 99-00 boundry -if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];}; -if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];}; - +if (_lazPosX < 0) then { _lazPosX = _lazPosX + 99999;}; +if (_lazPosY < 0) then {_lazPosY = _lazPosY + 99999;}; + // Find laser position -_xGrid = toArray Str(round(_pos select 0)); +_xGrid = toArray Str(round _lazPosX); while {count _xGrid < 5} do { _xGrid = [48] + _xGrid; @@ -47,7 +46,7 @@ _xGrid resize 4; _xGrid = toString _xGrid; _xGrid = parseNumber _xGrid; -_yGrid = toArray Str(round(_pos select 1)); +_yGrid = toArray Str(round _lazPosY); while {count _yGrid < 5} do { _yGrid = [48] + _yGrid; }; @@ -72,7 +71,7 @@ _yCoord = switch true do { _dagrGrid = _xCoord + " " + _yCoord; // Find target elevation -_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(common,mapAltitude)); +_elevation = floor (_lazPosZ) + EGVAR(common,mapAltitude)); _dagrElevation = str _elevation + "m"; // Time @@ -94,5 +93,5 @@ GVAR(vectorGrid) = _dagrGrid; __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _dagrDist]; __elevationControl ctrlSetText format ["%1", _dagrElevation]; -__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1", _bearing] }); +__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1�", _bearing] }); __timeControl ctrlSetText format ["%1", _dagrTime]; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 71c3e7c1a7..77bee00398 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -31,22 +31,23 @@ if (GVAR(outputPFH) != -1) exitWith {}; GVAR(outputPFH) = [{ private["_MYpos", "_WPpos", "_bearing", "_dagrDistance", "_dagrGrid", "_dagrHeading", "_distance", "_gridArray"]; - + // Abort Condition if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith { GVAR(outputPFH) = -1; 135471 cutText ["", "PLAIN"]; [_this select 1] call CBA_fnc_removePerFrameHandler; }; - + // GRID _gridArray = [(getPos ACE_player), false] call EFUNC(common,getMapGridFromPos); - _dagrGrid = format ["%1 %2", ((_gridArray select 0) select [0,4]), ((_gridArray select 1) select [0,4])]; + _gridArray params ["_gridArrayX","_gridArrayY"]; + _dagrGrid = format ["%1 %2", (_gridArrayX select [0,4]), (_gridArrayY select [0,4])]; // WP Grid _xGrid2 = floor (DAGR_WP_INFO / 10000); _yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000; - + _xCoord2 = switch true do { case (_xGrid2 >= 1000): { "" + Str(_xGrid2) }; case (_xGrid2 >= 100): { "0" + Str(_xGrid2) }; @@ -60,7 +61,7 @@ GVAR(outputPFH) = [{ case (_yGrid2 >= 10): { "00" + Str(_yGrid2) }; default { "000" + Str(_yGrid2) }; }; - + _dagrGrid2 = _xCoord2 + " " + _yCoord2; // Distance @@ -69,7 +70,7 @@ GVAR(outputPFH) = [{ _distance = _MYpos distance _WPpos; _distance = floor (_distance * 10) / 10; _dagrDistance = str _distance + "m"; - + // Heading _dagrHeading = floor (if (GVAR(useDegrees)) then { direction (vehicle ACE_player) @@ -79,12 +80,12 @@ GVAR(outputPFH) = [{ // WP Heading _bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir); - + // Output __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _bearing]; __elevationControl ctrlSetText format ["%1", _dagrGrid2]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1", _dagrHeading] }); + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1�", _dagrHeading] }); __timeControl ctrlSetText format ["%1", _dagrDistance]; - + }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dagr/functions/fnc_toggleOverlay.sqf b/addons/dagr/functions/fnc_toggleOverlay.sqf index 1fcb87d0ff..d48a83ae51 100644 --- a/addons/dagr/functions/fnc_toggleOverlay.sqf +++ b/addons/dagr/functions/fnc_toggleOverlay.sqf @@ -23,11 +23,12 @@ if (GVAR(run)) then { }; GVAR(hidden) = true; [{ - EXPLODE_1_PVT(_this select 0,_vehicle); + params ["_args", "_idPFH"]; + _args params ["_vehicle"]; if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith { GVAR(run) = false; 135471 cutText ["", "PLAIN"]; - [_this select 1] call CBA_fnc_removePerFrameHandler; + [_idPFH] call CBA_fnc_removePerFrameHandler; }; if (cameraView == "GUNNER") then { if (!GVAR(hidden)) then { From f65f6e9b729ed3462bbf1e8ab70adbd099e52004 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 27 Sep 2015 17:19:40 +0100 Subject: [PATCH 02/12] Add support for virtual cargo Allows cargo objects to be added via classname and reduces simulation/synchronization overhead. Objects become physical upon unloading and cannot be re-made virtual, only scripts can add such virtual objects. Also separates the player feedback from the loading/unloading code and adds a progress bar. --- addons/cargo/XEH_postInit.sqf | 44 ++++++++++++++++++- addons/cargo/functions/fnc_addCargoItem.sqf | 17 ++----- addons/cargo/functions/fnc_canLoadItemIn.sqf | 24 +++++++--- addons/cargo/functions/fnc_canUnloadItem.sqf | 9 ++-- addons/cargo/functions/fnc_getSizeItem.sqf | 22 +++++++--- .../cargo/functions/fnc_handleDestroyed.sqf | 9 ++-- addons/cargo/functions/fnc_loadItem.sqf | 25 ++++------- addons/cargo/functions/fnc_onMenuOpen.sqf | 5 ++- addons/cargo/functions/fnc_startLoadIn.sqf | 21 ++++++--- addons/cargo/functions/fnc_startUnload.sqf | 17 ++++++- addons/cargo/functions/fnc_unloadItem.sqf | 38 +++++++--------- .../functions/fnc_validateCargoSpace.sqf | 4 +- addons/cargo/stringtable.xml | 12 +++++ 13 files changed, 159 insertions(+), 88 deletions(-) diff --git a/addons/cargo/XEH_postInit.sqf b/addons/cargo/XEH_postInit.sqf index 6501044c9d..2aeb3ab630 100644 --- a/addons/cargo/XEH_postInit.sqf +++ b/addons/cargo/XEH_postInit.sqf @@ -1,5 +1,45 @@ #include "script_component.hpp" -["LoadCargo", {_this call FUNC(loadItem)}] call EFUNC(common,addEventHandler); -["UnloadCargo", {_this call FUNC(unloadItem)}] call EFUNC(common,addEventHandler); ["AddCargoByClass", {_this call FUNC(addCargoItem)}] call EFUNC(common,addEventHandler); + +["LoadCargo", { + (_this select 0) params ["_item","_vehicle"]; + private ["_loaded", "_hint", "_itemName", "_vehicleName"]; + + _loaded = [_item, _vehicle] call FUNC(loadItem); + + // Show hint as feedback + _hint = [LSTRING(LoadingFailed), LSTRING(LoadedItem)] select _loaded; + _itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); + _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + + ["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); + + if (_loaded) then { + // Invoke listenable event + ["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + }; +}] call EFUNC(common,addEventHandler); + +["UnloadCargo", { + (_this select 0) params ["_item","_vehicle"]; + private ["_unloaded", "_itemClass", "_hint", "_itemName", "_vehicleName"]; + + _unloaded = [_item, _vehicle] call FUNC(unloadItem); + + _itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + + // Show hint as feedback + _hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded; + _itemName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); + _vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + + ["displayTextStructured", [[_hint, _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); + + if (_unloaded) then { + // Invoke listenable event + ["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); + }; + + // TOOO maybe drag/carry the unloaded item? +}] call EFUNC(common,addEventHandler); diff --git a/addons/cargo/functions/fnc_addCargoItem.sqf b/addons/cargo/functions/fnc_addCargoItem.sqf index 1233d0228d..f3282d7718 100644 --- a/addons/cargo/functions/fnc_addCargoItem.sqf +++ b/addons/cargo/functions/fnc_addCargoItem.sqf @@ -21,18 +21,9 @@ private ["_position", "_item", "_i"]; params ["_itemClass", "_vehicle", ["_amount", 1]]; TRACE_3("params",_itemClass,_vehicle,_amount); -_position = getPos _vehicle; -_position set [1, (_position select 1) + 1]; -_position set [2, (_position select 2) + 7.5]; - for "_i" from 1 to _amount do { - _item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"]; - - // Load item or delete it if no space left - if !([_item, _vehicle] call FUNC(loadItem)) exitWith { - deleteVehicle _item; - }; - - // Invoke listenable event - ["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); + [_item, _vehicle] call FUNC(loadItem); }; + +// Invoke listenable event +["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent); diff --git a/addons/cargo/functions/fnc_canLoadItemIn.sqf b/addons/cargo/functions/fnc_canLoadItemIn.sqf index 8cfe9e194b..fda60aaf65 100644 --- a/addons/cargo/functions/fnc_canLoadItemIn.sqf +++ b/addons/cargo/functions/fnc_canLoadItemIn.sqf @@ -3,7 +3,7 @@ * Check if item can be loaded into other Object. * * Arguments: - * 0: Item Object + * 0: Item * 1: Holder Object (Vehicle) * * Return value: @@ -16,14 +16,24 @@ */ #include "script_component.hpp" -params ["_item", "_vehicle"]; +params [["_item", "", [objNull,""]], "_vehicle"]; if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false}; -private "_itemSize"; -_itemSize = ([_item] call FUNC(getSizeItem)); +private ["_itemSize", "_validItem"]; +_itemSize = [_item] call FUNC(getSizeItem); -(_itemSize > 0) && -{alive _item && alive _vehicle} && -{(_item distance _vehicle <= MAX_LOAD_DISTANCE)} && +if (typeName _item == "STRING") then { + _validItem = + isClass (configFile >> "CfgVehicles" >> _item) && + {getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1}; +} else { + _validItem = + (alive _item) && + {(_item distance _vehicle) <= MAX_LOAD_DISTANCE}; +}; + +_validItem && +{_itemSize > 0} && +{alive _vehicle} && {_itemSize <= ([_vehicle] call FUNC(getCargoSpaceLeft))} diff --git a/addons/cargo/functions/fnc_canUnloadItem.sqf b/addons/cargo/functions/fnc_canUnloadItem.sqf index 779a7533a9..8c741a5448 100644 --- a/addons/cargo/functions/fnc_canUnloadItem.sqf +++ b/addons/cargo/functions/fnc_canUnloadItem.sqf @@ -16,18 +16,19 @@ */ #include "script_component.hpp" -private ["_loaded", "_validVehiclestate", "_emptyPos"]; - params ["_item", "_vehicle"]; +private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"]; _loaded = _vehicle getVariable [QGVAR(loaded), []]; if !(_item in _loaded) exitWith {false}; +_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _validVehiclestate = true; _emptyPos = []; if (_vehicle isKindOf "Ship" ) then { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot. } else { if (_vehicle isKindOf "Air" ) then { if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; @@ -35,7 +36,7 @@ if (_vehicle isKindOf "Ship" ) then { _emptyPos = [(_emptyPos select 0) + random(5), (_emptyPos select 1) + random(5), _emptyPos select 2 ]; } else { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); }; }; diff --git a/addons/cargo/functions/fnc_getSizeItem.sqf b/addons/cargo/functions/fnc_getSizeItem.sqf index dacd6a4982..807251365c 100644 --- a/addons/cargo/functions/fnc_getSizeItem.sqf +++ b/addons/cargo/functions/fnc_getSizeItem.sqf @@ -3,7 +3,7 @@ * Get the cargo size of an object. * * Arguments: - * 0: Object + * 0: Item * * Return value: * Cargo size (default: -1) @@ -15,14 +15,24 @@ */ #include "script_component.hpp" -private "_config"; - params ["_item"]; +private ["_isVirtual","_itemClass","_config"]; +scopeName "return"; -_config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); +_isVirtual = (typeName _item == "STRING"); +_itemClass = if (_isVirtual) then {_item} else {typeOf _item}; +_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size)); -if (isNumber (_config)) exitWith { - _item getVariable [QGVAR(size), getNumber (_config)] +if (_isVirtual) then { + if (isNumber _config) then { + (getNumber _config) breakOut "return"; + }; +} else { + _config = (configFile >> "CfgVehicles" >> typeOf _item >> QGVAR(size)); + + if (isNumber _config) then { + (_item getVariable [QGVAR(size), getNumber _config]) breakOut "return"; + }; }; -1 diff --git a/addons/cargo/functions/fnc_handleDestroyed.sqf b/addons/cargo/functions/fnc_handleDestroyed.sqf index c11dd3bfad..1022497719 100644 --- a/addons/cargo/functions/fnc_handleDestroyed.sqf +++ b/addons/cargo/functions/fnc_handleDestroyed.sqf @@ -20,12 +20,13 @@ params ["_vehicle"]; private["_loaded"]; _loaded = _vehicle getVariable [QGVAR(loaded), []]; -if (count _loaded == 0) exitWith {}; +if (_loaded isEqualTo []) exitWith {}; { - // TODO deleteVehicle or just delete vehicle? Do we want to be able to recover destroyed equipment? - deleteVehicle _x; - //_x setDamage 1; + // TODO Do we want to be able to recover destroyed equipment? + if (typeName _x == "OBJECT") then { + deleteVehicle _x; + }; } count _loaded; [_vehicle] call FUNC(validateCargoSpace); diff --git a/addons/cargo/functions/fnc_loadItem.sqf b/addons/cargo/functions/fnc_loadItem.sqf index 3c79604a04..5f519476ef 100644 --- a/addons/cargo/functions/fnc_loadItem.sqf +++ b/addons/cargo/functions/fnc_loadItem.sqf @@ -1,9 +1,10 @@ /* * Author: Glowbal * Load object into vehicle. + * Objects loaded via classname remain virtual until unloaded. * * Arguments: - * 0: Object + * 0: Item * 1: Vehicle * * Return value: @@ -16,10 +17,9 @@ */ #include "script_component.hpp" +params [["_item","",[objNull,""]], ["_vehicle",objNull,[objNull]]]; private ["_loaded", "_space", "_itemSize"]; -params ["_item", "_vehicle"]; - if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; @@ -30,19 +30,10 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), _space - _itemSize, true]; -detach _item; -_item attachTo [_vehicle,[0,0,100]]; -["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); - -// show hint -private ["_itemName", "_vehicleName"]; - -_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); -_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - -["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); - -// Invoke listenable event -["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent); +if (typeName _item == "OBJECT") then { + detach _item; + _item attachTo [_vehicle,[0,0,-100]]; + ["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); +}; true diff --git a/addons/cargo/functions/fnc_onMenuOpen.sqf b/addons/cargo/functions/fnc_onMenuOpen.sqf index 031bea01cc..85557835bf 100644 --- a/addons/cargo/functions/fnc_onMenuOpen.sqf +++ b/addons/cargo/functions/fnc_onMenuOpen.sqf @@ -22,7 +22,7 @@ params ["_display"]; uiNamespace setVariable [QGVAR(menuDisplay), _display]; [{ - private ["_display","_loaded", "_ctrl", "_label"]; + private ["_display","_loaded", "_ctrl", "_class", "_label"]; disableSerialization; _display = uiNamespace getVariable QGVAR(menuDisplay); if (isnil "_display") exitWith { @@ -40,7 +40,8 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display]; lbClear _ctrl; { - _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> typeOf _x >> "displayName")); + _class = if (typeName _x == "STRING") then {_x} else {typeOf _x}; + _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName")); true } count _loaded; diff --git a/addons/cargo/functions/fnc_startLoadIn.sqf b/addons/cargo/functions/fnc_startLoadIn.sqf index b4ba50fbb6..1ce5d62407 100644 --- a/addons/cargo/functions/fnc_startLoadIn.sqf +++ b/addons/cargo/functions/fnc_startLoadIn.sqf @@ -16,16 +16,25 @@ #include "script_component.hpp" params ["_player", "_object"]; +private ["_vehicle", "_size", "_displayName"]; -private ["_nearestVehicle"]; -_nearestVehicle = [_player] call FUNC(findNearestVehicle); +_vehicle = [_player] call FUNC(findNearestVehicle); -if (isNull _nearestVehicle || _nearestVehicle isKindOf "Cargo_Base_F") then { +if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then { { - if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_nearestVehicle = _x}; + if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; } foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); }; -if (isNull _nearestVehicle) exitWith {false}; +if (isNull _vehicle) exitWith {false}; -[_object, _nearestVehicle] call FUNC(loadItem) +// Start progress bar +if ([_object, _vehicle] call FUNC(canLoadItemIn)) then { + _size = [_object] call FUNC(getSizeItem); + + [5 * _size, [_object,_vehicle], "LoadCargo", {}, localize LSTRING(LoadingItem)] call EFUNC(common,progressBar); +} else { + _displayName = getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName"); + + ["displayTextStructured", [[LSTRING(LoadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); +}; diff --git a/addons/cargo/functions/fnc_startUnload.sqf b/addons/cargo/functions/fnc_startUnload.sqf index 28ae034167..013de1dc64 100644 --- a/addons/cargo/functions/fnc_startUnload.sqf +++ b/addons/cargo/functions/fnc_startUnload.sqf @@ -20,7 +20,7 @@ private ["_display", "_loaded", "_ctrl", "_selected", "_item"]; disableSerialization; _display = uiNamespace getVariable QGVAR(menuDisplay); -if (isnil "_display") exitWith {}; +if (isNil "_display") exitWith {}; _loaded = GVAR(interactionVehicle) getVariable [QGVAR(loaded), []]; if (count _loaded == 0) exitWith {}; @@ -32,4 +32,17 @@ _selected = (lbCurSel _ctrl) max 0; if (count _loaded <= _selected) exitWith {}; _item = _loaded select _selected; -[_item, GVAR(interactionVehicle)] call FUNC(unloadItem); + +// Start progress bar +private ["_size", "_itemClass", "_displayName"]; + +if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then { + _size = [_item] call FUNC(getSizeItem); + + [5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar); +} else { + _itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); + + ["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); +}; diff --git a/addons/cargo/functions/fnc_unloadItem.sqf b/addons/cargo/functions/fnc_unloadItem.sqf index 2630f2104a..81cca7154b 100644 --- a/addons/cargo/functions/fnc_unloadItem.sqf +++ b/addons/cargo/functions/fnc_unloadItem.sqf @@ -3,7 +3,7 @@ * Unload object from vehicle. * * Arguments: - * 0: Object + * 0: Item * 1: Vehicle * * Return value: @@ -16,20 +16,21 @@ */ #include "script_component.hpp" -private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"]; - params ["_item", "_vehicle"]; +private ["_loaded", "_space", "_itemSize", "_emptyPos", "_validVehiclestate"]; if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith { false }; +_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; + _validVehiclestate = true; _emptyPos = []; if (_vehicle isKindOf "Ship" ) then { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; TRACE_1("SHIP Ground Check", getPosATL _vehicle ); - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, typeOf _item]); // TODO: if spot is underwater pick another spot. + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 15, _itemClass]); // TODO: if spot is underwater pick another spot. } else { if (_vehicle isKindOf "Air" ) then { if !(speed _vehicle <1 && {isTouchingGround _vehicle}) then {_validVehiclestate = false}; @@ -39,38 +40,29 @@ if (_vehicle isKindOf "Ship" ) then { } else { if !(speed _vehicle <1 && {(((getPosATL _vehicle) select 2) < 2)}) then {_validVehiclestate = false}; TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); - _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, typeOf _item]); + _emptyPos = ((getPosASL _vehicle) call EFUNC(common,ASLtoPosition) findEmptyPosition [0, 13, _itemClass]); }; }; TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); if (!_validVehiclestate) exitWith {false}; -if (count _emptyPos == 0) exitWith {false}; //consider displaying text saying there are no safe places to exit the vehicle +if (count _emptyPos == 0) exitWith {false}; _loaded = _vehicle getVariable [QGVAR(loaded), []]; -_loaded = _loaded - [_item]; +_loaded deleteAt (_loaded find _item); _vehicle setVariable [QGVAR(loaded), _loaded, true]; _space = [_vehicle] call FUNC(getCargoSpaceLeft); _itemSize = [_item] call FUNC(getSizeItem); _vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; -detach _item; -_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); -["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); - -// show hint -private ["_itemName", "_vehicleName"]; - -_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName"); -_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); - -["displayTextStructured", [[localize LSTRING(UnloadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent); - -// TOOO maybe drag/carry the unloaded item? - -// Invoke listenable event -["cargoUnloaded", [_item, _vehicle]] call EFUNC(common,globalEvent); +if (typeName _item == "OBJECT") then { + detach _item; + _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); + ["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); +} else { + createVehicle [_item, _emptyPos, [], 0, ""]; +}; true diff --git a/addons/cargo/functions/fnc_validateCargoSpace.sqf b/addons/cargo/functions/fnc_validateCargoSpace.sqf index 6caf664ca5..7634b131e6 100644 --- a/addons/cargo/functions/fnc_validateCargoSpace.sqf +++ b/addons/cargo/functions/fnc_validateCargoSpace.sqf @@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []]; _newLoaded = []; _totalSpaceOccupied = 0; { - if !(isNull _x) then { + if ((typeName _x == "STRING") || {!isNull _x}) then { _newLoaded pushback _x; _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); }; @@ -35,4 +35,4 @@ if (count _loaded != count _newLoaded) then { _vehicle setVariable [QGVAR(loaded), _newLoaded, true]; }; -_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; +_vehicle setVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(space)) - _totalSpaceOccupied, true]; diff --git a/addons/cargo/stringtable.xml b/addons/cargo/stringtable.xml index 7f9ac40a15..6902a1aae1 100644 --- a/addons/cargo/stringtable.xml +++ b/addons/cargo/stringtable.xml @@ -95,5 +95,17 @@ 1%<br/>kirakodva ebből:<br/>%2 %1<br/>разгружен из<br/>%2 + + Loading Cargo + + + Unloading Cargo + + + %1<br/>could not be loaded + + + %1<br/>could not be unloaded + From 326d5495104ae02caeee04a05c11c7e7a3dcad14 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 8 Oct 2015 20:32:14 -0500 Subject: [PATCH 03/12] #2696 - Rangecard check bounds before select --- .../functions/fnc_calculateAmmoTemperatureVelocityShift.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index 8b0c78e86c..fefdbb16e4 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -18,7 +18,8 @@ private ["_muzzleVelocityShiftTableUpperLimit", "_temperatureIndexFunction", "_temperatureIndexA", "_temperatureIndexB", "_interpolationRatio"]; params["_muzzleVelocityShiftTable", "_temperature"]; -// Check if muzzleVelocityShiftTable is Larger Than 11 Entrys +// Check if muzzleVelocityShiftTable is Less Than 11 Entrys +if ((count _muzzleVelocityShiftTable) < 11) exitWith {0}; _muzzleVelocityShiftTableUpperLimit = _muzzleVelocityShiftTable select 10; if (isNil "_muzzleVelocityShiftTableUpperLimit") exitWith { 0 }; From f8ca3693fd49d92ef43e8be66d9952b683d9cf7c Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Thu, 8 Oct 2015 21:22:00 -0500 Subject: [PATCH 04/12] #2709 - Fix AB handleFired _muzzleVelocityShift --- .../functions/fnc_handleFired.sqf | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index d97c9b952a..8d9cb73509 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -24,12 +24,12 @@ if (!hasInterface) exitWith {}; if (!GVAR(enabled)) exitWith {}; // Parameterization -private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; +private ["_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletLength", "_barrelTwist", "_stabilityFactor", "_aceTimeSecond", "_barrelVelocityShift", "_ammoTemperatureVelocityShift"]; + params ["_unit", "_weapon", "", "_mode", "_ammo", "_magazine", "_bullet"]; _abort = false; - if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (!alive _bullet) exitWith {}; if (!([_unit] call EFUNC(common,isPlayer))) exitWith {}; @@ -75,22 +75,22 @@ _WeaponCacheEntry params ["_barrelTwist", "_twistDirection", "_barrelLength"]; _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; +_barrelVelocityShift = 0; if (GVAR(barrelLengthInfluenceEnabled)) then { - _barrelVelocityShift = uiNamespace getVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],nil]; - if (isNil "_barrelVelocityShift") then { - _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); - uiNamespace setVariable [format [QGVAR(%1_muzzleVelocityShift),_weapon],_muzzleVelocityShift]; - }; + _barrelVelocityShift = [_barrelLength, _muzzleVelocityTable, _barrelLengthTable, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); }; +_ammoTemperatureVelocityShift = 0; if (GVAR(ammoTemperatureEnabled)) then { _temperature = ((getPosASL _unit) select 2) call EFUNC(weather,calculateTemperatureAtHeight); - _temperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); + _ammoTemperatureVelocityShift = ([_ammoTempMuzzleVelocityShifts, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift)); }; if (GVAR(ammoTemperatureEnabled) || GVAR(barrelLengthInfluenceEnabled)) then { + _muzzleVelocityShift = _barrelVelocityShift + _ammoTemperatureVelocityShift; + TRACE_4("shift",_muzzleVelocity,_muzzleVelocityShift, _barrelVelocityShift, _ammoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { - _muzzleVelocity = _muzzleVelocity + (_barrelVelocityShift + _ammoTemperatureVelocityShift); + _muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift; _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; }; From d091fcbdbce63cf5c04ad653bacb805cb65d99dc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 12 Oct 2015 16:14:35 -0500 Subject: [PATCH 05/12] #2706 - Local privates to search_privates.py --- tools/search_privates.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tools/search_privates.py b/tools/search_privates.py index 207c6403e0..7c6b042c1a 100644 --- a/tools/search_privates.py +++ b/tools/search_privates.py @@ -16,7 +16,7 @@ def get_private_declare(content): priv_dec_str = ''.join(priv_srch_declared) - srch = re.compile('(? Date: Fri, 6 Nov 2015 01:05:25 -0600 Subject: [PATCH 06/12] #2772 - Display basicMed wounds for AI in mixed mode --- addons/medical/functions/fnc_displayPatientInformation.sqf | 4 ++-- addons/medical/functions/fnc_modifyMedicalAction.sqf | 2 +- addons/medical_menu/functions/fnc_updateUIInfo.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/medical/functions/fnc_displayPatientInformation.sqf b/addons/medical/functions/fnc_displayPatientInformation.sqf index f73376cb29..222de4463f 100644 --- a/addons/medical/functions/fnc_displayPatientInformation.sqf +++ b/addons/medical/functions/fnc_displayPatientInformation.sqf @@ -54,7 +54,7 @@ if (_show) then { _allInjuryTexts = []; _genericMessages = []; - if (GVAR(level) >= 2) then { + if (GVAR(level) >= 2 && {([_unit] call FUNC(hasMedicalEnabled))}) then { _partText = [LSTRING(Head), LSTRING(Torso), LSTRING(LeftArm) ,LSTRING(RightArm) ,LSTRING(LeftLeg), LSTRING(RightLeg)] select _selectionN; _genericMessages pushback [localize _partText, [1, 1, 1, 1]]; }; @@ -87,7 +87,7 @@ if (_show) then { _damaged = [false, false, false, false, false, false]; _selectionBloodLoss = [0,0,0,0,0,0]; - if (GVAR(level) >= 2) then { + if (GVAR(level) >= 2 && {([_target] call FUNC(hasMedicalEnabled))}) then { _openWounds = _target getvariable [QGVAR(openWounds), []]; private "_amountOf"; { diff --git a/addons/medical/functions/fnc_modifyMedicalAction.sqf b/addons/medical/functions/fnc_modifyMedicalAction.sqf index 8feaa7bfca..d16ab762d5 100644 --- a/addons/medical/functions/fnc_modifyMedicalAction.sqf +++ b/addons/medical/functions/fnc_modifyMedicalAction.sqf @@ -19,7 +19,7 @@ params ["_target", "_player", "_selectionN", "_actionData"]; -if (GVAR(level) < 2) exitwith { +if (GVAR(level) < 2 || {!([_target] call FUNC(hasMedicalEnabled))}) exitwith { private ["_pointDamage"]; _pointDamage = (_target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]]) select _selectionN; diff --git a/addons/medical_menu/functions/fnc_updateUIInfo.sqf b/addons/medical_menu/functions/fnc_updateUIInfo.sqf index bcc9811905..56a22689db 100644 --- a/addons/medical_menu/functions/fnc_updateUIInfo.sqf +++ b/addons/medical_menu/functions/fnc_updateUIInfo.sqf @@ -62,7 +62,7 @@ _damaged = [false, false, false, false, false, false]; _selectionBloodLoss = [0, 0, 0, 0, 0, 0]; _allInjuryTexts = []; -if (EGVAR(medical,level) >= 2) then { +if ((EGVAR(medical,level) >= 2) && {([_target] call EFUNC(medical,hasMedicalEnabled))}) then { _openWounds = _target getVariable [QEGVAR(medical,openWounds), []]; private "_amountOf"; { From 7ec480c98e6341d8f8938d8ef1a109693b3be4a9 Mon Sep 17 00:00:00 2001 From: Jonathan Pereira Date: Sat, 7 Nov 2015 11:39:02 -0200 Subject: [PATCH 07/12] Added ace_captives translation to PT-BR --- addons/captives/stringtable.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index d4166a495d..ea1d99419a 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -1,4 +1,4 @@ - + @@ -181,9 +181,11 @@ Make Unit Handcuffed + Fazer unidade algemada Sync a unit to make them handcuffed.<br />Source: ace_captives + Sincronizar uma unidade para deixá-la algemada.<br/>Source: ace_captives Captives Settings @@ -284,4 +286,4 @@ Rendición o desarme - + \ No newline at end of file From ff60cdcfa316b24046038e989cbc240a346e0481 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 Nov 2015 11:44:31 -0600 Subject: [PATCH 08/12] #2828 - Fix empty flashlightProxy model --- addons/map/CfgAmmo.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/map/CfgAmmo.hpp b/addons/map/CfgAmmo.hpp index 805e7b3627..9e98d0efea 100644 --- a/addons/map/CfgAmmo.hpp +++ b/addons/map/CfgAmmo.hpp @@ -6,7 +6,7 @@ class CfgAmmo { class F_20mm_White: FlareBase {}; class ACE_FlashlightProxy_White: F_20mm_White { - model = ""; + model = "\A3\Weapons_f\empty"; effectFlare = "FlareShell"; triggerTime = 0; From 01d679c5dc92162f6cd812d1ce5863d35cf8a6ee Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 Nov 2015 14:33:41 -0600 Subject: [PATCH 09/12] #2810 - Delete map glow light from DC players --- addons/map/XEH_postInitClient.sqf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index c162f8802d..a89e3fb8e3 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,5 +1,22 @@ #include "script_component.hpp" +//Delete map glow lights from disconnecting players #2810 +if (isServer) then { + addMissionEventHandler ["HandleDisconnect",{ + params ["_disconnectedPlayer"]; + + if ((!GVAR(mapGlow)) || {isNull _disconnectedPlayer}) exitWith {}; + { + if (_x isKindOf "ACE_FlashlightProxy_White") then { + // ACE_LOGINFO_2("Deleting leftover light [%1:%2] from DC player [%3]", _x, typeOf _x, _disconnectedPlayer); + deleteVehicle _x; + }; + } forEach attachedObjects _disconnectedPlayer; + + nil + }]; +}; + // Exit on Headless as well if (!hasInterface) exitWith {}; From dad1388eec5c91f6f3be679652db079fa7db3b4b Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 7 Nov 2015 18:34:46 -0600 Subject: [PATCH 10/12] RealisticNames - add ka-60 v2 (black and white) --- addons/realisticnames/CfgVehicles.hpp | 3 +++ addons/realisticnames/stringtable.xml | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index c3288815dd..9aea632247 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -308,6 +308,9 @@ class CfgVehicles { class O_Heli_Light_02_F: Heli_Light_02_base_F { displayName = CSTRING(Heli_Light_02_Name); }; + class O_Heli_Light_02_v2_F: Heli_Light_02_base_F { + displayName = CSTRING(Heli_Light_02_v2_Name); + }; class Heli_Light_02_unarmed_base_F; class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { displayName = CSTRING(Heli_Light_02_unarmed_Name); diff --git a/addons/realisticnames/stringtable.xml b/addons/realisticnames/stringtable.xml index 5f84a4f16d..fbf1e37226 100644 --- a/addons/realisticnames/stringtable.xml +++ b/addons/realisticnames/stringtable.xml @@ -817,6 +817,17 @@ Ka-60 Kasatka Ka-60 Kasatka + + Ka-60 Kasatka (Black & White) + Ka-60 Kasatka (černobílá) + Ka-60 Kasatka (noir et blanc) + Ka-60 Kasatka (Schwarz-weiß) + Ka-60 Kasatka (bianco e nero) + Ka-60 Kasatka (czarno-biały) + Ka-60 Kasatka (preto e branco) + Ka-60 Касатка (белый и черный) + Ka-60 Kasatka (blanco y negro) + Ka-60 Kasatka (unarmed) Ka-60 Kasatka (unbewaffnet) From e2e74e0f5d228bae5007e32bb6d9828a6e7e8963 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 10 Nov 2015 16:17:22 -0600 Subject: [PATCH 11/12] =?UTF-8?q?DAGR=20-=20Fix=20degrees=20(=C2=B0=20-=20?= =?UTF-8?q?seems=20to=20need=20UTF-8=20BOM)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/dagr/functions/fnc_outputVector.sqf | 4 ++-- addons/dagr/functions/fnc_outputWP.sqf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index 7787a7ff96..93a34899ca 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -1,4 +1,4 @@ -/* +/* * Author: Rosuto * DAGR vector output loop * @@ -93,5 +93,5 @@ GVAR(vectorGrid) = _dagrGrid; __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _dagrDist]; __elevationControl ctrlSetText format ["%1", _dagrElevation]; -__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1�", _bearing] }); +__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] }); __timeControl ctrlSetText format ["%1", _dagrTime]; diff --git a/addons/dagr/functions/fnc_outputWP.sqf b/addons/dagr/functions/fnc_outputWP.sqf index 77bee00398..204a5ef556 100644 --- a/addons/dagr/functions/fnc_outputWP.sqf +++ b/addons/dagr/functions/fnc_outputWP.sqf @@ -1,4 +1,4 @@ -/* +/* * Author: Rosuto * DAGR waypoint output loop * @@ -85,7 +85,7 @@ GVAR(outputPFH) = [{ __gridControl ctrlSetText format ["%1", _dagrGrid]; __speedControl ctrlSetText format ["%1", _bearing]; __elevationControl ctrlSetText format ["%1", _dagrGrid2]; - __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1�", _dagrHeading] }); + __headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] }); __timeControl ctrlSetText format ["%1", _dagrDistance]; }, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler; From 4ff31771d35e5de72f2db12e965c6b9c90ddc0cf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 10 Nov 2015 20:51:00 -0600 Subject: [PATCH 12/12] DAGR - missing ( --- addons/dagr/functions/fnc_outputVector.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/dagr/functions/fnc_outputVector.sqf b/addons/dagr/functions/fnc_outputVector.sqf index 93a34899ca..7f36facae8 100644 --- a/addons/dagr/functions/fnc_outputVector.sqf +++ b/addons/dagr/functions/fnc_outputVector.sqf @@ -71,7 +71,7 @@ _yCoord = switch true do { _dagrGrid = _xCoord + " " + _yCoord; // Find target elevation -_elevation = floor (_lazPosZ) + EGVAR(common,mapAltitude)); +_elevation = floor ((_lazPosZ) + EGVAR(common,mapAltitude)); _dagrElevation = str _elevation + "m"; // Time