Merge pull request #5 from acemod/master

Fork update from master
This commit is contained in:
[OMCB]kaban 2015-12-01 00:28:31 +03:00
commit 155162b501
600 changed files with 8650 additions and 5276 deletions

View File

@ -1,4 +1,4 @@
# ACE3 CONTRIBUTOR LIST # ACE3 CONTRIBUTOR LIST
# If you contributed, but are not listed here, contact me: # If you contributed, but are not listed here, contact me:
# koffeinflummi@gmail.com # koffeinflummi@gmail.com
# #
@ -37,6 +37,7 @@ alef <alefor@gmail.com>
Aleksey EpMAK Yermakov <epmak777@gmail.com> Aleksey EpMAK Yermakov <epmak777@gmail.com>
Alganthe <alganthe@live.fr> Alganthe <alganthe@live.fr>
Anthariel <Contact@storm-simulation.com> Anthariel <Contact@storm-simulation.com>
Arkhir <wonsz666@gmail.com >
Asgar Serran <piechottaf@web.de> Asgar Serran <piechottaf@web.de>
Bamse <bamsis@gmail.com> Bamse <bamsis@gmail.com>
Bla1337 Bla1337
@ -108,6 +109,7 @@ Toaster <jonathan.pereira@gmail.com>
Tonic Tonic
Tourorist <tourorist@gmail.com> Tourorist <tourorist@gmail.com>
Valentin Torikian <valentin.torikian@gmail.com> Valentin Torikian <valentin.torikian@gmail.com>
voiper
VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com> VyMajoris(W-Cephei)<vycanismajoriscsa@gmail.com>
Winter <simon@agius-muscat.net> Winter <simon@agius-muscat.net>
zGuba zGuba

View File

@ -36,7 +36,7 @@ GVAR(Protractor) = true;
if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith { if !(GVAR(Protractor) && !(weaponLowered ACE_player) && currentWeapon ACE_player == primaryWeapon ACE_player) exitWith {
GVAR(Protractor) = false; GVAR(Protractor) = false;
1 cutText ["", "PLAIN"]; 1 cutText ["", "PLAIN"];
[_idPFH] call cba_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
1 cutRsc ["RscProtractor", "PLAIN", 1, false]; 1 cutRsc ["RscProtractor", "PLAIN", 1, false];

View File

@ -26,19 +26,19 @@ _aceTimeSecond = floor ACE_time;
_bulletSpeed = vectorMagnitude _bulletVelocity; _bulletSpeed = vectorMagnitude _bulletVelocity;
if (!alive _bullet || _bulletSpeed < 100) exitWith { if (!alive _bullet || _bulletSpeed < 100) then {
GVAR(allBullets) deleteAt (_forEachIndex - _deleted); GVAR(allBullets) deleteAt (GVAR(allBullets) find _x);
_deleted = _deleted + 1; } else {
_bulletPosition = getPosASL _bullet;
if (_bulletTraceVisible && _bulletSpeed > 500) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
};
call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]);
}; };
nil
_bulletPosition = getPosASL _bullet; } count +GVAR(allBullets);
if (_bulletTraceVisible && _bulletSpeed > 500) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.02*_caliber,0.01*_caliber],[[0,0,0,0.65],[0,0,0,0.2]],[1,0],0,0,"","",""];
};
call compile ("ace_advanced_ballistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, ACE_wind, ASLToATL(_bulletPosition) select 2, _aceTimeSecond, ACE_time - _aceTimeSecond]);
} forEach GVAR(allBullets);
if (GVAR(allBullets) isEqualTo []) then { if (GVAR(allBullets) isEqualTo []) then {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;

View File

@ -54,7 +54,7 @@ if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _wea
if (_abort || !(GVAR(extensionAvailable))) exitWith { if (_abort || !(GVAR(extensionAvailable))) exitWith {
if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then { if (missionNamespace getVariable [QEGVAR(windDeflection,enabled), false]) then {
EGVAR(windDeflection,trackedBullets) pushBack [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")]; EGVAR(windDeflection,trackedBullets) pushBack [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")];
}; };
}; };

View File

@ -40,7 +40,7 @@ GVAR(currentGrid) = 0;
#ifdef DEBUG_MODE_FULL #ifdef DEBUG_MODE_FULL
systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)]; systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(ACE_time - _initStartTime)];
#endif #endif
[_idPFH] call cba_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
}; };
for "_i" from 1 to 50 do { for "_i" from 1 to 50 do {

View File

@ -20,9 +20,11 @@ _weaponConfig = (configFile >> "CfgWeapons" >> _this);
_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist"); _barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
_twistDirection = 1; _twistDirection = 1;
_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection"); if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
if !(_twistDirection in [-1, 0, 1]) then { _twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
_twistDirection = 1; if !(_twistDirection in [-1, 0, 1]) then {
_twistDirection = 1;
};
}; };
_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength"); _barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");

View File

@ -54,7 +54,7 @@ GVAR(active) = true;
GVAR(DialogPFH) = [{ GVAR(DialogPFH) = [{
if (!GVAR(active)) exitWith { if (!GVAR(active)) exitWith {
[_this select 1] call cba_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
__ctrlBackground ctrlSetText format [QUOTE(PATHTOF(UI\ATRAG_%1.paa)), ["N", "D"] select (call EFUNC(common,ambientBrightness))]; __ctrlBackground ctrlSetText format [QUOTE(PATHTOF(UI\ATRAG_%1.paa)), ["N", "D"] select (call EFUNC(common,ambientBrightness))];
}, 60, []] call CBA_fnc_addPerFrameHandler; }, 60, []] call CBA_fnc_addPerFrameHandler;

View File

@ -2,4 +2,4 @@
uiNamespace setVariable ['ATragMX_Display', nil]; uiNamespace setVariable ['ATragMX_Display', nil];
GVAR(active) = false; GVAR(active) = false;
[GVAR(DialogPFH)] call cba_fnc_removePerFrameHandler; [GVAR(DialogPFH)] call CBA_fnc_removePerFrameHandler;

View File

@ -37,7 +37,7 @@ if !(ctrlVisible 9000) then {
false call FUNC(show_target_speed_assist_timer); false call FUNC(show_target_speed_assist_timer);
true call FUNC(show_target_speed_assist); true call FUNC(show_target_speed_assist);
[_this select 1] call cba_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
}; };
ctrlSetText [9001, Str(Round((ACE_time - _startTime) * 10) / 10)]; ctrlSetText [9001, Str(Round((ACE_time - _startTime) * 10) / 10)];

View File

@ -10,7 +10,7 @@
* Arguments: * Arguments:
* 0: Unit (player) <OBJECT> * 0: Unit (player) <OBJECT>
* 1: attachToVehicle <OBJECT> * 1: attachToVehicle <OBJECT>
* 2: Item Classname (cfgWeapon/cfgMagazine) <STRING> * 2: Item Classname (CfgWeapon/CfgMagazine) <STRING>
* 3: Light Vehicle Classname <STRING> * 3: Light Vehicle Classname <STRING>
* 4: On Attach Text <STRING> * 4: On Attach Text <STRING>
* 5: Starting Pos of dummy item <ARRAY> * 5: Starting Pos of dummy item <ARRAY>

View File

@ -14,7 +14,7 @@
params ["_backpack"]; params ["_backpack"];
if (typeName _backpack == "OBJECT") then { if (_backpack isEqualType objNull) then {
_backpack = typeOf _backpack; _backpack = typeOf _backpack;
}; };

View File

@ -192,6 +192,7 @@ class CfgVehicles {
scope = 2; scope = 2;
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
isGlobal = 1; isGlobal = 1;
isSingular = 1;
class Arguments { class Arguments {
class allowHandcuffOwnSide { class allowHandcuffOwnSide {
displayName = CSTRING(ModuleSettings_handcuffSide_name); displayName = CSTRING(ModuleSettings_handcuffSide_name);

View File

@ -45,7 +45,7 @@ if (_state) then {
}; };
if (!(_unit getVariable [QGVAR(isEscorting), false])) then { if (!(_unit getVariable [QGVAR(isEscorting), false])) then {
[(_this select 1)] call cba_fnc_removePerFrameHandler; [(_this select 1)] call CBA_fnc_removePerFrameHandler;
[objNull, _target, false] call EFUNC(common,claim); [objNull, _target, false] call EFUNC(common,claim);
detach _target; detach _target;
_unit removeAction _actionID; _unit removeAction _actionID;

View File

@ -21,10 +21,10 @@ params ["_newUnit","_oldUnit"];
//set showHUD based on new unit status: //set showHUD based on new unit status:
if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then { if ((_newUnit getVariable [QGVAR(isHandcuffed), false]) || {_newUnit getVariable [QGVAR(isSurrendering), false]}) then {
TRACE_1("Player Change (showHUD false)",_newUnit); TRACE_1("Player Change (showHUD false)",_newUnit);
showHUD false; ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud);
} else { } else {
TRACE_1("Player Change (showHUD true)",_newUnit); TRACE_1("Player Change (showHUD true)",_newUnit);
showHUD true; ["captive", []] call EFUNC(common,showHud); //same as showHud true;
}; };
//If old player was escorting, stop //If old player was escorting, stop

View File

@ -23,9 +23,9 @@ params ["_unit","_zeusIsOpen"];
if (!_zeusIsOpen) then { if (!_zeusIsOpen) then {
if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then { if ((_unit getVariable [QGVAR(isHandcuffed), false]) || {_unit getVariable [QGVAR(isSurrendering), false]}) then {
TRACE_1("Player Change (showHUD false)",_unit); TRACE_1("Player Change (showHUD false)",_unit);
showHUD false; ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud);
} else { } else {
TRACE_1("Player Change (showHUD true)",_unit); TRACE_1("Player Change (showHUD true)",_unit);
showHUD true; ["captive", []] call EFUNC(common,showHud); //same as showHud true;
}; };
}; };

View File

@ -19,7 +19,7 @@
params ["_unit","_state"]; params ["_unit","_state"];
TRACE_2("params",_unit,_state); TRACE_2("params",_unit,_state);
if (!local _unit) exitwith { if (!local _unit) exitWith {
ERROR("running setHandcuffed on remote unit"); ERROR("running setHandcuffed on remote unit");
}; };
if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith { if ((_unit getVariable [QGVAR(isHandcuffed), false]) isEqualTo _state) exitWith {
@ -38,7 +38,7 @@ if (_state) then {
_unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true]; _unit setVariable [QGVAR(CargoIndex), ((vehicle _unit) getCargoIndex _unit), true];
if (_unit == ACE_player) then { if (_unit == ACE_player) then {
showHUD false; ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud);
}; };
// fix anim on mission start (should work on dedicated servers) // fix anim on mission start (should work on dedicated servers)
@ -107,7 +107,7 @@ if (_state) then {
}; };
if (_unit == ACE_player) then { if (_unit == ACE_player) then {
showHUD true; ["captive", []] call EFUNC(common,showHud); //same as showHud true;
}; };
}; };

View File

@ -19,7 +19,7 @@
params ["_unit","_state"]; params ["_unit","_state"];
TRACE_2("params",_unit,_state); TRACE_2("params",_unit,_state);
if (!local _unit) exitwith { if (!local _unit) exitWith {
ERROR("running surrender on remote unit"); ERROR("running surrender on remote unit");
}; };
@ -36,7 +36,7 @@ if (_state) then {
[_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus); [_unit, QGVAR(Surrendered), true] call EFUNC(common,setCaptivityStatus);
if (_unit == ACE_player) then { if (_unit == ACE_player) then {
showHUD false; ["captive", [false, false, false, false, false, false, false, false]] call EFUNC(common,showHud);
}; };
[_unit] call EFUNC(common,fixLoweredRifleAnimation); [_unit] call EFUNC(common,fixLoweredRifleAnimation);
@ -75,7 +75,7 @@ if (_state) then {
if (_unit == ACE_player) then { if (_unit == ACE_player) then {
//only re-enable HUD if not handcuffed //only re-enable HUD if not handcuffed
if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then { if (!(_unit getVariable [QGVAR(isHandcuffed), false])) then {
showHUD true; ["captive", []] call EFUNC(common,showHud); //same as showHud true;
}; };
}; };

View File

@ -181,11 +181,13 @@
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName"> <Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName">
<English>Make Unit Handcuffed</English> <English>Make Unit Handcuffed</English>
<Polish>Skuj jednostkę</Polish>
<Portuguese>Fazer unidade algemada</Portuguese> <Portuguese>Fazer unidade algemada</Portuguese>
<Russian>Связать юнита</Russian> <Russian>Связать юнита</Russian>
</Key> </Key>
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description"> <Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
<English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English> <English>Sync a unit to make them handcuffed.&lt;br /&gt;Source: ace_captives</English>
<Polish>Zsynchronizuj z jednostką, aby została skuta.&lt;br /&gt;Źródło: ace_captives</Polish>
<Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese> <Portuguese>Sincronizar uma unidade para deixá-la algemada.&lt;br/&gt;Source: ace_captives</Portuguese>
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.&lt;br /&gt;Источник: ace_captives</Russian> <Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.&lt;br /&gt;Источник: ace_captives</Russian>
</Key> </Key>
@ -288,4 +290,4 @@
<Spanish>Rendición o desarme</Spanish> <Spanish>Rendición o desarme</Spanish>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -48,6 +48,11 @@ class Extended_InitPost_EventHandlers {
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle)); init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
}; };
}; };
class RoadCone_F {
class ADDON {
init = QUOTE(_this call DFUNC(initObject); _this call DFUNC(initVehicle));
};
};
class Car { class Car {
class ADDON { class ADDON {
init = QUOTE(_this call DFUNC(initVehicle)); init = QUOTE(_this call DFUNC(initVehicle));

View File

@ -8,6 +8,7 @@ class CfgVehicles {
function = QFUNC(moduleSettings); function = QFUNC(moduleSettings);
functionPriority = 1; functionPriority = 1;
isGlobal = 1; isGlobal = 1;
isSingular = 1;
isTriggerActivated = 0; isTriggerActivated = 0;
author = ECSTRING(common,ACETeam); author = ECSTRING(common,ACETeam);
@ -236,7 +237,15 @@ class CfgVehicles {
GVAR(size) = 6; GVAR(size) = 6;
}; };
// objects
class RoadCone_F: ThingX {
GVAR(size) = 1;
GVAR(canLoad) = 1;
};
class RoadBarrier_F: RoadCone_F {
GVAR(size) = 2;
};
class Scrapyard_base_F; class Scrapyard_base_F;
class Land_PaperBox_closed_F: Scrapyard_base_F { class Land_PaperBox_closed_F: Scrapyard_base_F {

View File

@ -27,7 +27,7 @@
_unloaded = [_item, _vehicle] call FUNC(unloadItem); _unloaded = [_item, _vehicle] call FUNC(unloadItem);
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
// Show hint as feedback // Show hint as feedback
_hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded; _hint = [LSTRING(UnloadingFailed), LSTRING(UnloadedItem)] select _unloaded;

View File

@ -18,12 +18,11 @@
*/ */
#include "script_component.hpp" #include "script_component.hpp"
private ["_position", "_item", "_i"];
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ]; params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
TRACE_3("params",_itemClass,_vehicle,_amount); TRACE_3("params",_itemClass,_vehicle,_amount);
for "_i" from 1 to _amount do { for "_i" from 1 to _amount do {
[_item, _vehicle] call FUNC(loadItem); [_itemClass, _vehicle] call FUNC(loadItem);
}; };
// Invoke listenable event // Invoke listenable event

View File

@ -23,7 +23,7 @@ if (speed _vehicle > 1 || (((getPos _vehicle) select 2) > 3)) exitWith {false};
private ["_itemSize", "_validItem"]; private ["_itemSize", "_validItem"];
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
if (typeName _item == "STRING") then { if (_item isEqualType "") then {
_validItem = _validItem =
isClass (configFile >> "CfgVehicles" >> _item) && isClass (configFile >> "CfgVehicles" >> _item) &&
{getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1}; {getNumber (configFile >> "CfgVehicles" >> _item >> QGVAR(canLoad)) == 1};

View File

@ -22,7 +22,7 @@ private ["_loaded", "_itemClass", "_validVehiclestate", "_emptyPos"];
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
if !(_item in _loaded) exitWith {false}; if !(_item in _loaded) exitWith {false};
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_validVehiclestate = true; _validVehiclestate = true;
_emptyPos = []; _emptyPos = [];

View File

@ -17,4 +17,4 @@
params ["_object"]; params ["_object"];
_object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeof _object >> QGVAR(space))] _object getVariable [QGVAR(space), getNumber (configFile >> "CfgVehicles" >> typeOf _object >> QGVAR(space))]

View File

@ -19,7 +19,7 @@ params ["_item"];
private ["_isVirtual","_itemClass","_config"]; private ["_isVirtual","_itemClass","_config"];
scopeName "return"; scopeName "return";
_isVirtual = (typeName _item == "STRING"); _isVirtual = (_item isEqualType "");
_itemClass = if (_isVirtual) then {_item} else {typeOf _item}; _itemClass = if (_isVirtual) then {_item} else {typeOf _item};
_config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size)); _config = (configFile >> "CfgVehicles" >> _itemClass >> QGVAR(size));

View File

@ -24,7 +24,7 @@ if (_loaded isEqualTo []) exitWith {};
{ {
// TODO Do we want to be able to recover destroyed equipment? // TODO Do we want to be able to recover destroyed equipment?
if (typeName _x == "OBJECT") then { if (_x isEqualType objNull) then {
deleteVehicle _x; deleteVehicle _x;
}; };
} count _loaded; } count _loaded;

View File

@ -24,7 +24,7 @@ private ["_loaded", "_space", "_itemSize"];
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false}; if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {false};
_loaded = _vehicle getVariable [QGVAR(loaded), []]; _loaded = _vehicle getVariable [QGVAR(loaded), []];
_loaded pushback _item; _loaded pushBack _item;
_vehicle setVariable [QGVAR(loaded), _loaded, true]; _vehicle setVariable [QGVAR(loaded), _loaded, true];
TRACE_1("added to loaded array",_loaded); TRACE_1("added to loaded array",_loaded);
@ -33,7 +33,7 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), _space - _itemSize, true]; _vehicle setVariable [QGVAR(space), _space - _itemSize, true];
if (typeName _item == "OBJECT") then { if (_item isEqualType objNull) then {
detach _item; detach _item;
_item attachTo [_vehicle,[0,0,-100]]; _item attachTo [_vehicle,[0,0,-100]];
["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent); ["hideObjectGlobal", [_item, true]] call EFUNC(common,serverEvent);

View File

@ -40,7 +40,7 @@ uiNamespace setVariable [QGVAR(menuDisplay), _display];
lbClear _ctrl; lbClear _ctrl;
{ {
_class = if (typeName _x == "STRING") then {_x} else {typeOf _x}; _class = if (_x isEqualType "") then {_x} else {typeOf _x};
_ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName")); _ctrl lbAdd (getText(configfile >> "CfgVehicles" >> _class >> "displayName"));
true true
} count _loaded; } count _loaded;

View File

@ -23,7 +23,7 @@ _vehicle = [_player] call FUNC(findNearestVehicle);
if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then { if (isNull _vehicle || _vehicle isKindOf "Cargo_Base_F") then {
{ {
if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x}; if ([_object, _x] call FUNC(canLoadItemIn)) exitWith {_vehicle = _x};
} foreach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]); } forEach (nearestObjects [_player, ["Cargo_base_F", "Land_PaperBox_closed_F"], MAX_LOAD_DISTANCE]);
}; };
if (isNull _vehicle) exitWith {false}; if (isNull _vehicle) exitWith {false};

View File

@ -41,7 +41,7 @@ if ([_item, GVAR(interactionVehicle)] call FUNC(canUnloadItem)) then {
[5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar); [5 * _size, [_item, GVAR(interactionVehicle)], "UnloadCargo", {}, localize LSTRING(UnloadingItem)] call EFUNC(common,progressBar);
} else { } else {
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName"); _displayName = getText (configFile >> "CfgVehicles" >> _itemClass >> "displayName");
["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent); ["displayTextStructured", [[LSTRING(UnloadingFailed), _displayName], 3.0]] call EFUNC(common,localEvent);

View File

@ -23,7 +23,7 @@ if !([_item, _vehicle] call FUNC(canUnloadItem)) exitWith {
false false
}; };
_itemClass = if (typeName _item == "STRING") then {_item} else {typeOf _item}; _itemClass = if (_item isEqualType "") then {_item} else {typeOf _item};
_validVehiclestate = true; _validVehiclestate = true;
_emptyPos = []; _emptyPos = [];
@ -57,7 +57,7 @@ _space = [_vehicle] call FUNC(getCargoSpaceLeft);
_itemSize = [_item] call FUNC(getSizeItem); _itemSize = [_item] call FUNC(getSizeItem);
_vehicle setVariable [QGVAR(space), (_space + _itemSize), true]; _vehicle setVariable [QGVAR(space), (_space + _itemSize), true];
if (typeName _item == "OBJECT") then { if (_item isEqualType objNull) then {
detach _item; detach _item;
_item setPosASL (_emptyPos call EFUNC(common,PositiontoASL)); _item setPosASL (_emptyPos call EFUNC(common,PositiontoASL));
["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent); ["hideObjectGlobal", [_item, false]] call EFUNC(common,serverEvent);

View File

@ -24,7 +24,7 @@ _loaded = _vehicle getVariable [QGVAR(loaded), []];
_newLoaded = []; _newLoaded = [];
_totalSpaceOccupied = 0; _totalSpaceOccupied = 0;
{ {
if ((typeName _x == "STRING") || {!isNull _x}) then { if ((_x isEqualType "") || {!isNull _x}) then {
_newLoaded pushback _x; _newLoaded pushback _x;
_totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem)); _totalSpaceOccupied = _totalSpaceOccupied + ([_x] call FUNC(getSizeItem));
}; };

View File

@ -98,18 +98,22 @@
<Key ID="STR_ACE_Cargo_LoadingItem"> <Key ID="STR_ACE_Cargo_LoadingItem">
<English>Loading Cargo</English> <English>Loading Cargo</English>
<Portuguese>Carregando carga</Portuguese> <Portuguese>Carregando carga</Portuguese>
<Polish>Ładowanie cargo</Polish>
</Key> </Key>
<Key ID="STR_ACE_Cargo_UnloadingItem"> <Key ID="STR_ACE_Cargo_UnloadingItem">
<English>Unloading Cargo</English> <English>Unloading Cargo</English>
<Portuguese>Descarregando carga</Portuguese> <Portuguese>Descarregando carga</Portuguese>
<Polish>Rozładowywanie cargo</Polish>
</Key> </Key>
<Key ID="STR_ACE_Cargo_LoadingFailed"> <Key ID="STR_ACE_Cargo_LoadingFailed">
<English>%1&lt;br/&gt;could not be loaded</English> <English>%1&lt;br/&gt;could not be loaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser carregado</Portuguese> <Portuguese>%1&lt;br/&gt;não pode ser carregado</Portuguese>
<Polish>%1&lt;br/&gt;nie mógł zostać załadowany</Polish>
</Key> </Key>
<Key ID="STR_ACE_Cargo_UnloadingFailed"> <Key ID="STR_ACE_Cargo_UnloadingFailed">
<English>%1&lt;br/&gt;could not be unloaded</English> <English>%1&lt;br/&gt;could not be unloaded</English>
<Portuguese>%1&lt;br/&gt;não pode ser descarregado</Portuguese> <Portuguese>%1&lt;br/&gt;não pode ser descarregado</Portuguese>
<Polish>%1&lt;br/&gt;nie mógł zostać rozładowany</Polish>
</Key> </Key>
</Package> </Package>
</Project> </Project>

View File

@ -35,6 +35,7 @@ class CfgVehicles {
function = QFUNC(moduleCheckPBOs); function = QFUNC(moduleCheckPBOs);
scope = 2; scope = 2;
isGlobal = 1; isGlobal = 1;
isSingular = 1;
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa)); icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
class Arguments { class Arguments {
class Action { class Action {

View File

@ -41,7 +41,7 @@ class GVAR(ProgressBar_Dialog) {
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)"; w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorFrame[] = {1,1,1,0.5}; colorFrame[] = {1,1,1,0.5};
colorBar[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"}; colorBar[] = {"(profilenamespace getVariable ['GUI_BCG_RGB_R',0.77])","(profilenamespace getVariable ['GUI_BCG_RGB_G',0.51])","(profilenamespace getVariable ['GUI_BCG_RGB_B',0.08])","(profilenamespace getVariable ['GUI_BCG_RGB_A',0.8])"};
texture = "#(argb,8,8,3)color(1,1,1,0.7)"; texture = "#(argb,8,8,3)color(1,1,1,0.7)";
}; };
class TitleText: TitleBackground { class TitleText: TitleBackground {

View File

@ -115,18 +115,18 @@ class RscDisplayInventory {
// map // map
class RscDisplayMainMap { class RscDisplayMainMap {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent););
}; };
class RscDisplayGetReady: RscDisplayMainMap { class RscDisplayGetReady: RscDisplayMainMap {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent););
}; };
class RscDisplayServerGetReady: RscDisplayGetReady { class RscDisplayServerGetReady: RscDisplayGetReady {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent););
}; };
class RscDisplayClientGetReady: RscDisplayGetReady { class RscDisplayClientGetReady: RscDisplayGetReady {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent);); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent););
}; };

View File

@ -29,17 +29,16 @@
GVAR(nextFrameNo) = diag_frameno + 1; GVAR(nextFrameNo) = diag_frameno + 1;
//Handle the waitUntilAndExec array: //Handle the waitUntilAndExec array:
private _deleted = 0;
{ {
// if condition is satisifed call statement // if condition is satisifed call statement
if ((_x select 2) call (_x select 0)) then { if ((_x select 2) call (_x select 0)) then {
// make sure to delete the correct handle when multiple conditions are met in one frame // make sure to delete the correct handle when multiple conditions are met in one frame
GVAR(waitUntilAndExecArray) deleteAt (_forEachIndex - _deleted); GVAR(waitUntilAndExecArray) deleteAt (GVAR(waitUntilAndExecArray) find _x);
_deleted = _deleted + 1;
(_x select 2) call (_x select 1); (_x select 2) call (_x select 1);
}; };
} forEach GVAR(waitUntilAndExecArray); nil
} count +GVAR(waitUntilAndExecArray);
END_COUNTER(waitAndExec); END_COUNTER(waitAndExec);
}, 0, []] call CBA_fnc_addPerFrameHandler; }, 0, []] call CBA_fnc_addPerFrameHandler;
@ -98,7 +97,6 @@
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler); ["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler); ["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler); ["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler);
["assignTeam", {(_this select 0) assignTeam (_this select 1)}] call FUNC(addEventHandler);
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler); ["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler);
if (isServer) then { if (isServer) then {
@ -194,9 +192,17 @@ call FUNC(checkFiles);
ACE_LOGINFO("Settings received from server."); ACE_LOGINFO("Settings received from server.");
if (isServer) then { //read settings from paramsArray
[] call FUNC(readSettingsFromParamsArray);
};
// Event so that ACE_Modules have their settings loaded: // Event so that ACE_Modules have their settings loaded:
["InitSettingsFromModules", []] call FUNC(localEvent); ["InitSettingsFromModules", []] call FUNC(localEvent);
if (isServer) then {
// Publish all settings data after all configs and modules are read
publicVariable QGVAR(settings);
};
// Load user settings from profile // Load user settings from profile
if (hasInterface) then { if (hasInterface) then {
call FUNC(loadSettingsFromProfile); call FUNC(loadSettingsFromProfile);

View File

@ -115,6 +115,7 @@ PREP(isInBuilding);
PREP(isModLoaded); PREP(isModLoaded);
PREP(isPlayer); PREP(isPlayer);
PREP(isTurnedOut); PREP(isTurnedOut);
PREP(isUnderwater);
PREP(letterToCode); PREP(letterToCode);
PREP(lightIntensityFromObject); PREP(lightIntensityFromObject);
PREP(loadPerson); PREP(loadPerson);
@ -139,6 +140,7 @@ PREP(playerSide);
PREP(positionToASL); PREP(positionToASL);
PREP(progressBar); PREP(progressBar);
PREP(readSettingFromModule); PREP(readSettingFromModule);
PREP(readSettingsFromParamsArray);
PREP(receiveRequest); PREP(receiveRequest);
PREP(removeCanInteractWithCondition); PREP(removeCanInteractWithCondition);
PREP(removeSpecificMagazine); PREP(removeSpecificMagazine);
@ -166,6 +168,7 @@ PREP(setVariableJIP);
PREP(setVariablePublic); PREP(setVariablePublic);
PREP(setVolume); PREP(setVolume);
PREP(sortAlphabeticallyBy); PREP(sortAlphabeticallyBy);
PREP(showHud);
PREP(stringCompare); PREP(stringCompare);
PREP(stringToColoredText); PREP(stringToColoredText);
PREP(stringRemoveWhiteSpace); PREP(stringRemoveWhiteSpace);
@ -290,6 +293,7 @@ PREP(hashListSet);
PREP(hashListPush); PREP(hashListPush);
GVAR(syncedEvents) = HASH_CREATE; GVAR(syncedEvents) = HASH_CREATE;
GVAR(showHudHash) = [] call FUNC(hashCreate);
//GVARS for execNextFrame and waitAndExec and waitUntilAndExecute //GVARS for execNextFrame and waitAndExec and waitUntilAndExecute
GVAR(waitAndExecArray) = []; GVAR(waitAndExecArray) = [];

View File

@ -88,7 +88,7 @@ class CfgUIGrids {
// check dll // check dll
class RscStandardDisplay; class RscStandardDisplay;
class RscDisplayMain: RscStandardDisplay { class RscDisplayMain: RscStandardDisplay {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getVariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage));
}; };
*/ */

View File

@ -116,9 +116,9 @@ class ACE_gui_editBase
}; };
colorSelection[] = colorSelection[] =
{ {
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", "(profilenamespace getVariable ['GUI_BCG_RGB_R',0.3843])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", "(profilenamespace getVariable ['GUI_BCG_RGB_G',0.7019])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", "(profilenamespace getVariable ['GUI_BCG_RGB_B',0.8862])",
1 1
}; };
autocomplete = ""; autocomplete = "";
@ -249,7 +249,7 @@ class ACE_gui_listBoxBase : RscListBox{
colorSelect2[] = {0.95, 0.95, 0.95, 1}; colorSelect2[] = {0.95, 0.95, 0.95, 1};
colorSelectBackground[] = {0, 0, 0, 1}; colorSelectBackground[] = {0, 0, 0, 1};
colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0}; 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}; 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; period = 1.2;
rowHeight = 0.03; rowHeight = 0.03;
colorBackground[] = {0, 0, 0, 1}; colorBackground[] = {0, 0, 0, 1};
@ -505,7 +505,7 @@ onMouseButtonDblClick = "";
iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa"; iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa";
iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa"; iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa";
iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_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])"}; 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}; colorCreated[] = {1,1,1,1};
colorCanceled[] = {0.7,0.7,0.7,1}; colorCanceled[] = {0.7,0.7,0.7,1};
colorDone[] = {0.7,1,0.3,1}; colorDone[] = {0.7,1,0.3,1};

View File

@ -32,7 +32,7 @@ if (isServer) then {
private "_eventLog"; private "_eventLog";
_eventLog = _internalData select 1; _eventLog = _internalData select 1;
_eventLog pushback [ACE_diagTime, _args, _ttl]; _eventLog pushBack [ACE_diagTime, _args, _ttl];
}; };
}; };

View File

@ -17,11 +17,11 @@
params ["_unit", "_action", "_condition", "_statement"]; params ["_unit", "_action", "_condition", "_statement"];
if (typeName _condition == "STRING") then { if (_condition isEqualType "") then {
_condition = compile _condition; _condition = compile _condition;
}; };
if (typeName _statement == "STRING") then { if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };

View File

@ -21,19 +21,19 @@
params ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", ["_priority", 0]]; params ["_unit", "_displayName", "_action", "_condition", "_statement", "_condition2", "_statement2", ["_priority", 0]];
if (typeName _condition == "STRING") then { if (_condition isEqualType "") then {
_condition = compile _condition; _condition = compile _condition;
}; };
if (typeName _statement == "STRING") then { if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };
if (typeName _condition2 == "STRING") then { if (_condition2 isEqualType "") then {
_condition2 = compile _condition2; _condition2 = compile _condition2;
}; };
if (typeName _statement2 == "STRING") then { if (_statement2 isEqualType "") then {
_statement2 = compile _statement2; _statement2 = compile _statement2;
}; };

View File

@ -18,6 +18,6 @@ _dlg = ctrlParent _this;
_dlg displayAddEventHandler ["unload", { _dlg displayAddEventHandler ["unload", {
if (_this select 1 == 1) then { if (_this select 1 == 1) then {
[missionnamespace getvariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent); [missionnamespace getVariable ["BIS_fnc_initCuratorAttributes_target", objNull]] call FUNC(fixCrateContent);
}; };
}]; }];

View File

@ -14,7 +14,7 @@
params ["_statement"]; params ["_statement"];
if (typeName _statement == "STRING") then { if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };

View File

@ -15,7 +15,7 @@
params ["_statement"]; params ["_statement"];
if (typeName _statement == "STRING") then { if (_statement isEqualType "") then {
_statement = compile _statement; _statement = compile _statement;
}; };

View File

@ -22,14 +22,14 @@
params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]]; params ["_list", "_variable", "_setting", "_global", ["_vehicle", false]];
if (typeName _list == "STRING") then { if (_list isEqualType "") then {
_list = [_list, true, true] call FUNC(parseList); _list = [_list, true, true] call FUNC(parseList);
TRACE_1("Parsed",_list) TRACE_1("Parsed",_list)
}; };
{ {
if (!isNil "_x") then { if (!isNil "_x") then {
if (typeName _x == typeName objNull) then { if (_x isEqualType objNull) then {
if (local _x) then { if (local _x) then {
if (_vehicle) then { if (_vehicle) then {
(vehicle _x) setVariable [_variable, _setting, _global]; (vehicle _x) setVariable [_variable, _setting, _global];

View File

@ -16,7 +16,7 @@ if (!hasInterface) exitWith {};
params ["_id", ["_show", false]]; params ["_id", ["_show", false]];
if (typeName _show == "SCALAR") then { if (_show isEqualType 0) then {
_show = _show == 1; _show = _show == 1;
}; };
@ -28,7 +28,7 @@ if (_show) then {
GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushBack _id; GVAR(SHOW_BLUR_SCREEN_COLLECTION) pushBack _id;
// show blur // show blur
if (isnil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then { if (isNil QGVAR(MENU_ppHandle_GUI_BLUR_SCREEN)) then {
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102]; GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = ppEffectCreate ["DynamicBlur", 102];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9]; GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectAdjust [0.9];
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true; GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) ppEffectEnable true;

View File

@ -14,7 +14,7 @@
params ["_function"]; params ["_function"];
if (typeName _function == "STRING") exitWith {_function}; if (_function isEqualType "") exitWith {_function};
_function = toArray str _function; _function = toArray str _function;
_function deleteAt 0; _function deleteAt 0;

View File

@ -22,7 +22,7 @@ private ["_defaultLoglevel", "_defaultLogDisplayLevel"];
_defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL); _defaultLoglevel = [GVAR(LOGLEVEL), DEFAULT_LOGGING_LEVEL] select isNil QGVAR(LOGLEVEL);
if (_defaultLoglevel < 0) exitwith {false}; if (_defaultLoglevel < 0) exitWith {false};
_defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL); _defaultLogDisplayLevel = [GVAR(LOGDISPLAY_LEVEL), DEFAULT_TEXT_DISPLAY] select isNil QGVAR(LOGDISPLAY_LEVEL);

View File

@ -14,5 +14,5 @@
params ["_entity"]; params ["_entity"];
GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getvariable ["logDisplayLevel","4"]); GVAR(LOGDISPLAY_LEVEL) = call compile (_entity getVariable ["logDisplayLevel","4"]);
GVAR(LOGLEVEL) = call compile (_entity getvariable ["logLevel","4"]); GVAR(LOGLEVEL) = call compile (_entity getVariable ["logLevel","4"]);

View File

@ -21,7 +21,7 @@ params ["_name", "_value", "_defaultGlobal", "_category", ["_code", 0], ["_persi
if (isNil "_defaultGlobal") exitWith {}; if (isNil "_defaultGlobal") exitWith {};
if (typeName _name != "STRING") exitwith { if (!(_name isEqualType "")) exitwith {
[format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug); [format ["Tried to the deinfe a variable with an invalid name: %1 Arguments: %2", _name, _this]] call FUNC(debug);
}; };

View File

@ -22,7 +22,7 @@ private ["_validIndex", "_realIndex"];
_validIndex = -1; _validIndex = -1;
if (typeName _searchOffsetOrName == "STRING") then { if (_searchOffsetOrName isEqualType "") then {
{ {
if (_x select 0 == _searchOffsetOrName) exitWith { if (_x select 0 == _searchOffsetOrName) exitWith {
_validIndex = _forEachIndex; _validIndex = _forEachIndex;

View File

@ -73,11 +73,11 @@ _refresh = {
_ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000]; _ctrl = (findDisplay 46) ctrlCreate ["RscPicture", _forEachIndex + 19000];
_position = switch (_setting) do { _position = switch (_setting) do {
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]}; case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]}; case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_forEachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]};
default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]}; default {[X_POS_ICONS, Y_POS_ICONS + (_forEachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
}; };
_ctrl ctrlSetPosition _position; _ctrl ctrlSetPosition _position;
@ -97,7 +97,7 @@ if (_show) then {
_list pushBack [_iconId, _icon, _color, ACE_time]; _list pushBack [_iconId, _icon, _color, ACE_time];
} else { } else {
{ {
if (_x select 0 == _iconId) exitwith { if (_x select 0 == _iconId) exitWith {
_list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]]; _list set [_forEachIndex, [_iconId, _icon, _color, ACE_time]];
}; };
} forEach _list; } forEach _list;

View File

@ -20,10 +20,10 @@ params ["_text", "_image", ["_imageColor", [1,1,1]], ["_target", ACE_player]];
if (_target != ACE_player) exitWith {}; if (_target != ACE_player) exitWith {};
if (typeName _text != "TEXT") then { if (typeName _text != "TEXT") then {
if (typeName _text == "ARRAY") then { if (_text isEqualType []) then {
if (count _text > 0) then { if (count _text > 0) then {
{ {
if (typeName _x == "STRING" && {isLocalized _x}) then { if (_x isEqualType "" && {isLocalized _x}) then {
_text set [_forEachIndex, localize _x]; _text set [_forEachIndex, localize _x];
}; };
} forEach _text; } forEach _text;
@ -32,7 +32,7 @@ if (typeName _text != "TEXT") then {
}; };
}; };
if (typeName _text == "STRING" && {isLocalized _text}) then { if (_text isEqualType "" && {isLocalized _text}) then {
_text = localize _text; _text = localize _text;
}; };

View File

@ -19,17 +19,17 @@ params ["_text", ["_size", 1.5], ["_target", ACE_player]];
if (_target != ACE_player) exitWith {}; if (_target != ACE_player) exitWith {};
if (typeName _text != "TEXT") then { if (typeName _text != "TEXT") then {
if (typeName _text == "ARRAY") then { if (_text isEqualType []) then {
if (count _text > 0) then { if (count _text > 0) then {
{ {
if (typeName _x == "STRING" && {isLocalized _x}) then { if (_x isEqualType "" && {isLocalized _x}) then {
_text set [_foreachIndex, localize _x]; _text set [_foreachIndex, localize _x];
}; };
}foreach _text; }foreach _text;
_text = format _text; _text = format _text;
}; };
}; };
if (typeName _text == "STRING" && {isLocalized _text}) then { if (_text isEqualType "" && {isLocalized _text}) then {
_text = localize _text; _text = localize _text;
}; };
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]]; _text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
@ -48,10 +48,10 @@ _ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor);
_ctrlHint ctrlSetTextColor GVAR(displayTextFontColor); _ctrlHint ctrlSetTextColor GVAR(displayTextFontColor);
/* /*
// This does not function at the moment. Has been disabled until it fixed. // This does not function at the moment. Has been disabled until it fixed.
_xPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))]; _xPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))];
_yPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH]; _yPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH];
_wPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))]; _wPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))];
_hPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))]; _hPos = profilenamespace getVariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))];
*/ */
_xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)); _xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));

View File

@ -31,7 +31,7 @@ if (isNull (call BIS_fnc_displayMission)) exitWith {
params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]]; params ["_textHeader", "_textMessage", ["_onOK", {}], ["_onCancel", {}]];
if (typeName _textMessage == "STRING") then { if (_textMessage isEqualType "") then {
_textMessage = parseText _textMessage; _textMessage = parseText _textMessage;
}; };
@ -92,7 +92,7 @@ _bottomPosY = (_ctrlBcgCommonPos select 1) + _ctrlTextPosH + (_marginY * 2) + _b
_xPos set [1, _bottomPosY]; _xPos set [1, _bottomPosY];
_x ctrlSetPosition _xPos; _x ctrlSetPosition _xPos;
_x ctrlCommit 0; _x ctrlCommit 0;
} foreach [ } forEach [
_ctrlBackgroundButtonOK, _ctrlBackgroundButtonOK,
_ctrlBackgroundButtonMiddle, _ctrlBackgroundButtonMiddle,
_ctrlBackgroundButtonCancel, _ctrlBackgroundButtonCancel,

View File

@ -27,7 +27,7 @@ TRACE_3("params", _arguments, _function, _unit);
_function = call compile _function; _function = call compile _function;
if (typeName _unit == "SCALAR") exitWith { if (_unit isEqualType 0) exitWith {
switch (_unit) do { switch (_unit) do {
case 0 : { case 0 : {
_arguments call _function; _arguments call _function;

View File

@ -18,7 +18,7 @@ params ["_target"];
if (isNil "_x") then { if (isNil "_x") then {
ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex); ACE_LOGERROR_1("No arguments and function for remote function. ID: %1",_forEachIndex);
} else { } else {
if (typeName _x == "ARRAY") then { if (_x isEqualType []) then {
[_x select 0, _target] call (_x select 1); [_x select 0, _target] call (_x select 1);
}; };
}; };

View File

@ -41,8 +41,8 @@ _fnc_logEntries = {
case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false}; case (isClass _e1): {[_e1, _d + 1] call _fnc_logEntries; false};
}; };
if (typeName _e2 != "BOOL") then { if (!(_e2 isEqualType false)) then {
if (typeName _e2 == "ARRAY") then { if (_e2 isEqualType []) then {
_e2 = toArray str _e2; _e2 = toArray str _e2;
{ {
if (_x == toArray "[" select 0) then { if (_x == toArray "[" select 0) then {

View File

@ -20,14 +20,14 @@
params ["_object", ["_category", ""]]; params ["_object", ["_category", ""]];
if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitwith {[]}; if (isNil QGVAR(OBJECT_VARIABLES_STORAGE)) exitWith {[]};
private ["_return", "_val"]; private ["_return", "_val"];
_return = []; _return = [];
{ {
_val = _object getvariable (_x select 0); _val = _object getVariable (_x select 0);
if (!isNil "_val") then { if (!isNil "_val") then {
if (_category == "" || _category == _x select 3) then { if (_category == "" || _category == _x select 3) then {

View File

@ -16,7 +16,7 @@
params ["_unit", "_variable", "_defaultValue"]; params ["_unit", "_variable", "_defaultValue"];
private "_value"; private "_value";
_value = _unit getvariable _variable; _value = _unit getVariable _variable;
if (isNil "_value") then { if (isNil "_value") then {
if (!isNil "_defaultValue") then { if (!isNil "_defaultValue") then {

View File

@ -17,7 +17,7 @@ params ["_varName"];
private "_variableDefinition"; private "_variableDefinition";
_variableDefinition = [_varName] call FUNC(getDefinedVariableInfo); _variableDefinition = [_varName] call FUNC(getDefinedVariableInfo);
if !(_variableDefinition isEqualTo []) exitwith { if !(_variableDefinition isEqualTo []) exitWith {
_variableDefinition select 1; _variableDefinition select 1;
}; };

View File

@ -24,7 +24,7 @@ _hitPointsWithSelections = getAllHitPointsDamage _vehicle;
// get correct format on vehicles without any hitpoints // get correct format on vehicles without any hitpoints
if (_hitPointsWithSelections isEqualTo []) then { if (_hitPointsWithSelections isEqualTo []) then {
_hitPointsWithSelections = [[],[],[]]; _hitPointsWithSelections = [[],[],[]];
}; };
_hitPointsWithSelections resize 2; _hitPointsWithSelections resize 2;

View File

@ -1,29 +1,19 @@
/* /*
* Author: Glowbal * Author: Glowbal
* Check if unit is underwater * Check if unit's head is underwater
* *
* Arguments: * Arguments:
* 0: Unit <OBJECT> * 0: Unit <OBJECT>
* *
* Return Value: * Return Value:
* if unit is in the water (BOOLEAN) * If unit's head is underwater <BOOL>
* *
* Public: Yes * Public: Yes
*
* Deprecated
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; ACE_DEPRECATED("ace_common_fnc_inWater","3.5.0","ace_common_fnc_isUnderwater");
private "_return"; _this call FUNC(isUnderwater)
_return = false;
if (surfaceIsWater getPosASL _unit) then {
private "_pos";
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
if (_pos select 2 < 0) then {
_return = true;
};
};
_return

View File

@ -14,4 +14,4 @@
params ["_unit"]; params ["_unit"];
!(_unit getvariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getvariable ["ACE_isDead", false]) // return !(_unit getVariable ["ACE_isUnconscious", false]) && alive _unit && !(_unit getVariable ["ACE_isDead", false]) // return

View File

@ -8,10 +8,17 @@
* Return Value: * Return Value:
* is the unit an engineer <BOOL> * is the unit an engineer <BOOL>
* *
* Example:
* [player] call ace_common_fnc_isEngineer
*
* Public: Yes * Public: Yes
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_unit"]; params ["_unit"];
_unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1] // return private _isEngineer = _unit getVariable ["ACE_isEngineer", getNumber (configFile >> "CfgVehicles" >> typeOf _unit >> "engineer") == 1];
//Handle ace_repair modules setting this to a number
if (_isEngineer isEqualType 0) then {_isEngineer = _isEngineer > 0};
_isEngineer

View File

@ -14,4 +14,4 @@
params ["_modName"]; params ["_modName"];
isClass (configFile >> "cfgPatches" >> _modName) // return isClass (configFile >> "CfgPatches" >> _modName) // return

View File

@ -0,0 +1,29 @@
/*
* Author: Glowbal
* Check if unit's head is underwater
*
* Arguments:
* 0: Unit <OBJECT>
*
* Return Value:
* If unit's head is underwater <BOOL>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit"];
private "_return";
_return = false;
if (surfaceIsWater getPosASL _unit) then {
private "_pos";
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
if (_pos select 2 < 0) then {
_return = true;
};
};
_return

View File

@ -21,7 +21,7 @@ private ["_vehicle", "_loadcar", "_loadair", "_loadtank", "_loadboat"];
_vehicle = objNull; _vehicle = objNull;
if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitwith {_vehicle}; if (!([_caller, _unit, ["isNotDragging", "isNotCarrying"]] call FUNC(canInteractWith)) || {_caller == _unit}) exitWith {_vehicle};
_loadcar = nearestObject [_unit, "Car"]; _loadcar = nearestObject [_unit, "Car"];

View File

@ -27,7 +27,7 @@
// If the setting is stored on the profile // If the setting is stored on the profile
if !(isNil "_profileValue") then { if !(isNil "_profileValue") then {
// If the profile variable has the correct type // If the profile variable has the correct type
if (typeName _profileValue == typeName (missionNamespace getVariable _name)) then { if (_profileValue isEqualType (missionNamespace getVariable _name)) then {
// Load the setting from the profile // Load the setting from the profile
missionNamespace setVariable [_name, _profileValue]; missionNamespace setVariable [_name, _profileValue];
}; };

View File

@ -16,7 +16,7 @@ private "_fnc_parseConfigForDisplayNames";
_fnc_parseConfigForDisplayNames = { _fnc_parseConfigForDisplayNames = {
params ["_optionEntry"]; params ["_optionEntry"];
if !(isClass _optionEntry) exitwith {false}; if !(isClass _optionEntry) exitWith {false};
private "_values"; private "_values";
_values = getArray (_optionEntry >> "values"); _values = getArray (_optionEntry >> "values");
@ -30,17 +30,28 @@ _fnc_parseConfigForDisplayNames = {
private "_text"; private "_text";
_text = _x; _text = _x;
if (typeName _text == "STRING" && {count _text > 1} && {_text select [0, 1] == "$"}) then { if (_text isEqualType "" && {count _text > 1} && {_text select [0, 1] == "$"}) then {
_text = localize (_text select [1]); //chop off the leading $ _text = localize (_text select [1]); //chop off the leading $
_values set [_forEachIndex, _text]; _values set [_forEachIndex, _text];
}; };
} forEach _values; } forEach _values;
if (!(_values isEqualTo [])) then {
if (_typeOf != "SCALAR") then {
ACE_LOGWARNING_2("Setting [%1] has values[] but is not SCALAR (%2)", _name, _typeOf);
} else {
private _value = missionNamespace getVariable [_name, -1];
if ((_value < 0) || {_value >= (count _values)}) then {
ACE_LOGWARNING_3("Setting [%1] out of bounds %2 (values[] count is %3)(", _name, _value, count _values);
};
};
};
true true
}; };
// Iterate through settings // Iterate through settings
{ {
_x params ["_name"]; _x params ["_name", "_typeOf"];
if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then { if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then {
if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then { if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then {

View File

@ -51,8 +51,6 @@ _fnc_parseConfigForSettings = {
// mission side settings // mission side settings
[missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings; [missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings;
// Publish all settings data
publicVariable QGVAR(settings);
// Publish all setting values // Publish all setting values
{ {
publicVariable (_x select 0); publicVariable (_x select 0);

View File

@ -16,9 +16,9 @@ params ["_unit", "_id", "_accepted"];
private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"]; private ["_requestID", "_info", "_callBack", "_caller", "_replyParams", "_requestMessage", "_target"];
_info = _unit getvariable _id; _info = _unit getVariable _id;
if (!isnil "_info") then { if (!isNil "_info") then {
_caller = _info select 0; _caller = _info select 0;
_target = _info select 1; _target = _info select 1;
_requestID = _info select 2; _requestID = _info select 2;
@ -26,16 +26,16 @@ if (!isnil "_info") then {
_callBack = _info select 4; _callBack = _info select 4;
_replyParams = [_info, _accepted]; _replyParams = [_info, _accepted];
[_replyParams, QFUNC(requestCallback), _caller, false] call FUNC(execRemoteFnc); [_replyParams, QFUNC(requestCallback), _caller, false] call FUNC(execRemoteFnc);
_unit setvariable [_id, nil]; _unit setVariable [_id, nil];
}; };
GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil; GVAR(RECIEVE_REQUEST_ID_KEY_BINDING) = nil;
if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then { if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT)) then {
_unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT); _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT);
GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil; GVAR(RECIEVE_REQUEST_ADD_ACTION_ACCEPT) = nil;
}; };
if (!isnil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then { if (!isNil QGVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE)) then {
_unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE); _unit removeAction GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE);
GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil; GVAR(RECIEVE_REQUEST_ADD_ACTION_DECLINE) = nil;
}; };

View File

@ -85,13 +85,13 @@ _fnc_perFrameFunction = {
[_this select 1] call CBA_fnc_removePerFrameHandler; [_this select 1] call CBA_fnc_removePerFrameHandler;
if (_errorCode == 0) then { if (_errorCode == 0) then {
if (typeName _onFinish == "STRING") then { if (_onFinish isEqualType "") then {
[_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent); [_onFinish, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
} else { } else {
[_args, _elapsedTime, _totalTime, _errorCode] call _onFinish; [_args, _elapsedTime, _totalTime, _errorCode] call _onFinish;
}; };
} else { } else {
if (typeName _onFail == "STRING") then { if (_onFail isEqualType "") then {
[_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent); [_onFail, [_args, _elapsedTime, _totalTime, _errorCode]] call FUNC(localEvent);
} else { } else {
[_args, _elapsedTime, _totalTime, _errorCode] call _onFail; [_args, _elapsedTime, _totalTime, _errorCode] call _onFail;

View File

@ -0,0 +1,63 @@
/*
* Author: PabstMirror
* Read settins from paramsArray that have a ACE_setting = 1.
* Happens before modules but after all other configs (for force priority)
*
* Arguments:
* None
*
* Return Value:
* None
*
* Example:
* [] call ace_common_fnc_readSettingsFromParamsArray
*
* Public: No
*/
#include "script_component.hpp"
//paramsArray is a normal variable not a command
private _paramsArray = missionnamespace getVariable ["paramsArray", []];
TRACE_1("Reading missionConfigFile params",_paramsArray);
{
private _config = (missionConfigFile >> "params") select _forEachIndex;
if ((getNumber (_config >> "ACE_setting")) > 0) then {
private _settingName = configName _config;
private _settingValue = _x;
private _title = getText (_config >> "title");
TRACE_3("ace_setting",_title,_settingName,_settingValue);
// Check if the variable is already defined
if (isNil _settingName) exitWith {
ACE_LOGERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName);
};
private _settingData = [_settingName] call FUNC(getSettingData);
_settingData params ["", "_typeName", "", "", "", "", "_isForced"];
// Check if it's already forced and quit
if (_isForced) exitWith {ACE_LOGWARNING_1("readSettingsFromParamsArray - param [%1] is already set and forced", _settingName);};
// The setting is not forced, so update the value
// Read entry and cast it to the correct type from the existing variable
private _validValue = false;
switch (true) do {
case (_typeName == "SCALAR"): {_validValue = true;};
case (_typeName == "BOOL"): {
_settingValue = _settingValue > 0;
_validValue = true;
};
//TODO: Handle ARRAY,COLOR,STRING??? (bool/scalar covers most important settings)
};
if (!_validValue) exitWith {
ACE_LOGWARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_typeName);
};
// Update the variable globaly and Force
[_settingName, _settingValue, true, true] call FUNC(setSetting);
};
} forEach _paramsArray;

View File

@ -53,7 +53,7 @@ GVAR(RECIEVE_REQUEST_TIME_OUT_SCRIPT) = [ACE_time, _target, _requestID] spawn {
private "_id"; private "_id";
_id = _target getVariable _requestID; _id = _target getVariable _requestID;
waituntil { waitUntil {
_id = _target getVariable _requestID; _id = _target getVariable _requestID;
(ACE_time > _time || isNil "_id") (ACE_time > _time || isNil "_id")

View File

@ -14,8 +14,8 @@
params ["_unit"]; params ["_unit"];
_unit setvariable ["ACE_isDead", nil, true]; _unit setVariable ["ACE_isDead", nil, true];
_unit setvariable ["ACE_isUnconscious", nil, true]; _unit setVariable ["ACE_isUnconscious", nil, true];
if (isPlayer _unit) then { if (isPlayer _unit) then {
[true] call FUNC(setVolume); [true] call FUNC(setVolume);
@ -36,7 +36,7 @@ if (isPlayer _unit) then {
{ {
if !(_x select 4) then { if !(_x select 4) then {
_unit setvariable [_x select 0, nil, _x select 3]; _unit setVariable [_x select 0, nil, _x select 3];
}; };
false false
} count ([_unit] call FUNC(getAllDefinedSetVariables)); } count ([_unit] call FUNC(getAllDefinedSetVariables));

View File

@ -1,6 +1,6 @@
/* /*
* Author: Glowbal * Author: Glowbal
* Setvariable value * setVariable value
* *
* Arguments: * Arguments:
* 0: Unit <OBJECT> * 0: Unit <OBJECT>
@ -23,7 +23,7 @@ if (isNil "_global") then {
_definedVariable params ["", "", ["_global", false]]; _definedVariable params ["", "", ["_global", false]];
}; };
if (!isNil "_value") exitwith { if (!isNil "_value") exitWith {
_unit setVariable [_variable, _value, _global]; _unit setVariable [_variable, _value, _global];
}; };

View File

@ -19,7 +19,7 @@ params ["_name", "_value"];
// Hack to keep backward compatibility for the moment // Hack to keep backward compatibility for the moment
if (typeName (missionNamespace getVariable _name) == "BOOL") then { if (typeName (missionNamespace getVariable _name) == "BOOL") then {
if (typeName _value == "SCALAR") then { if (_value isEqualType 0) then {
_value = _value > 0; _value = _value > 0;
}; };
}; };

View File

@ -13,27 +13,39 @@
* Return Value: * Return Value:
* None * None
* *
* Example:
* ["ace_map_gestures_enabled", true, false, true] call ace_common_fnc_setSetting
*
* Public: No * Public: No
*/ */
#include "script_component.hpp" #include "script_component.hpp"
params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]]; params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]];
private ["_settingData", "_failed"]; private _settingData = [_name] call FUNC(getSettingData);
_settingData = [_name] call FUNC(getSettingData);
// Exit if the setting does not exist // Exit if the setting does not exist
if (count _settingData == 0) exitWith {}; if (_settingData isEqualTo []) exitWith {
ACE_LOGERROR_1("SetSetting [%1] setting does not exist", _name);
};
_settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"];
// Exit if the setting is already forced // Exit if the setting is already forced
if (_settingData select 6) exitWith {}; if (_isForced) exitWith {
ACE_LOGINFO_1("SetSetting [%1] Trying to set forced setting", _name);
};
//This does NOT broadcast changes to GVAR(settings), so clients would not get updated force status
if ((missionNamespace getVariable [QEGVAR(modules,serverModulesRead), false]) && {!(_isForced isEqualTo _force)}) then {
ACE_LOGWARNING_3("SetSetting [%1] attempting to broadcast a change to force (%2 to %3)", _name, _isForced, _force);
};
// If the type is not equal, try to cast it // If the type is not equal, try to cast it
_failed = false; private _failed = false;
if (typeName _value != _settingData select 1) then { if (typeName _value != _settingData select 1) then {
_failed = true; _failed = true;
if (_settingData select 1 == "BOOL" && typeName _value == "SCALAR") then { if ((_typeName == "BOOL") && {_value isEqualType 0}) then {
// If value is not 0 or 1 consider it invalid and don't set anything // If value is not 0 or 1 consider it invalid and don't set anything
if (_value isEqualTo 0) then { if (_value isEqualTo 0) then {
_value = false; _value = false;
@ -44,12 +56,12 @@ if (typeName _value != _settingData select 1) then {
_failed = false; _failed = false;
}; };
}; };
if (_settingData select 1 == "COLOR" && typeName _value == "ARRAY") then { if ((_typeName == "COLOR") && {_value isEqualType []}) then {
_failed = false; _failed = false;
}; };
}; };
if (_failed) exitWith {}; if (_failed) exitWith {ACE_LOGERROR_3("SetSetting [%1] bad data type expected %2 got %3", _name, _typeName, typeName _value);};
// Force it if it was required // Force it if it was required
_settingData set [6, _force]; _settingData set [6, _force];

View File

@ -38,19 +38,16 @@ GVAR(setVariablePublicArray) pushBack [_object, _varName, _syncTime, _idName];
if (isNil QGVAR(setVariablePublicPFH)) exitWith {}; if (isNil QGVAR(setVariablePublicPFH)) exitWith {};
GVAR(setVariablePublicPFH) = [{ GVAR(setVariablePublicPFH) = [{
private "_delete";
_delete = 0;
{ {
_x params ["_object", "_varName", "_syncTime", "_idName"]; _x params ["_object", "_varName", "_syncTime", "_idName"];
if (ACE_diagTime > _syncTime) then { if (ACE_diagTime > _syncTime) then {
// set value public // set value public
_object setVariable [_varName, _object getVariable _varName, true]; _object setVariable [_varName, _object getVariable _varName, true];
GVAR(setVariablePublicArray) deleteAt _forEachIndex - _delete; GVAR(setVariablePublicArray) deleteAt (GVAR(setVariablePublicArray) find _x);
GVAR(setVariableNames) deleteAt _forEachIndex - _delete; GVAR(setVariableNames) deleteAt (GVAR(setVariableNames) find _x);
_delete = _delete + 1;
}; };
} forEach GVAR(setVariablePublicArray); nil
} count +GVAR(setVariablePublicArray);
if (GVAR(setVariablePublicArray) isEqualTo []) then { if (GVAR(setVariablePublicArray) isEqualTo []) then {
[GVAR(setVariablePublicPFH)] call CBA_fnc_removePerFrameHandler; [GVAR(setVariablePublicPFH)] call CBA_fnc_removePerFrameHandler;

View File

@ -0,0 +1,66 @@
/*
* Author: PabstMirror
* Allows multiple sources to not overwrite showHud command
* Bitwise AND Logic (a single false in a mask will make it false)
*
* Arguments:
* 0: Source ID <STRING><OPTIONAL>
* 1: Show Hud Bool Array (8 to set, empty to remove) <ARRAY><OPTIONAL>
* - [hud, info, radar, compass, direction, menu, group, cursors]
* - hud: Boolean - show scripted HUD (same as normal showHUD true/false)
* - info: Boolean - show vehicle + soldier info (hides weapon info from the HUD as well)
* - radar: Boolean - show vehicle radar
* - compass: Boolean - show vehicle compass
* - direction: Boolean - show tank direction indicator (not present in vanilla Arma 3)
* - menu: Boolean - show commanding menu (hides HC related menus)
* - group: Boolean - show group info bar (hides squad leader info bar)
* - cursors: Boolean - show HUD weapon cursors (connected with scripted HUD)
*
* Return Value:
* Resulting ShowHud Array <ARRAY>
*
* Example:
* ["hideHud", [false, true, true, true, true, true, true, false]] call ace_common_fnc_showHud; //This is equivalent to the old showHud false
* [] call ace_common_fnc_showHud; //sets `showHud` and returns the result array used
*
* Public: Yes
*/
#include "script_component.hpp"
if (!hasInterface) exitWith {[-1]};
params [["_reason", "", [""]], ["_mask", [], [[]], [0,8]]];
if (isArray (missionConfigFile >> "showHUD")) then {
//(showHud = 0;) is fine - the array is the problem
ACE_LOGWARNING("showHUD[] in Description.ext breaks the showHud command");
};
if (_reason != "") then {
_reason = toLower _reason;
if (_mask isEqualTo []) then {
TRACE_2("Setting", _reason, _mask);
[GVAR(showHudHash), _reason] call FUNC(hashRem);
} else {
TRACE_2("Removing", _reason, _mask);
[GVAR(showHudHash), _reason, _mask] call FUNC(hashSet);
};
};
GVAR(showHudHash) params ["_reasons", "_masks"];
private _resultMask = [];
for "_index" from 0 to 7 do {
private _set = true; //Default to true
{
if (!(_x select _index)) exitWith {
_set = false; //Any false will make it false
};
} forEach _masks;
_resultMask pushBack _set;
};
TRACE_2("showHud", _resultMask, _reasons);
showHud _resultMask;
_resultMask

View File

@ -25,8 +25,8 @@ _elements = [];
{ {
_theElement = toArray (_x select _elementN); _theElement = toArray (_x select _elementN);
_indexes pushback _foreachIndex; _indexes pushBack _forEachIndex;
_elements pushback _theElement; _elements pushBack _theElement;
} forEach _array; } forEach _array;
for "_i" from 1 to (count _elements) - 1 do { for "_i" from 1 to (count _elements) - 1 do {
@ -45,7 +45,7 @@ for "_i" from 1 to (count _elements) - 1 do {
_returnArray = []; _returnArray = [];
{ {
_returnArray pushback (_array select _x); _returnArray pushBack (_array select _x);
} forEach _indexes; } forEach _indexes;
_returnArray _returnArray

View File

@ -18,7 +18,7 @@
params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]]; params [["_unit", objNull], ["_switch", false], ["_id", ""], ["_side", side _unit]];
private "_previousGroupsList"; private "_previousGroupsList";
_previousGroupsList = _unit getvariable [QGVAR(previousGroupSwitchTo), []]; _previousGroupsList = _unit getVariable [QGVAR(previousGroupSwitchTo), []];
if (_switch) then { if (_switch) then {
// go forward // go forward
@ -27,7 +27,7 @@ if (_switch) then {
_previousGroup = group _unit; _previousGroup = group _unit;
_originalSide = side group _unit; _originalSide = side group _unit;
if (count units _previousGroup == 1 && _originalSide == _side) exitwith { if (count units _previousGroup == 1 && _originalSide == _side) exitWith {
[format ["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug); [format ["Current group has only 1 member and is of same side as switch. Not switching unit %1", _id]] call FUNC(debug);
}; };
@ -41,7 +41,7 @@ if (_switch) then {
private ["_currentGroup", "_newGroup"]; private ["_currentGroup", "_newGroup"];
{ {
if (_id == (_x select 2)) exitwith { if (_id == (_x select 2)) exitWith {
_x set [ 3, false]; _x set [ 3, false];
_previousGroupsList set [_forEachIndex, _x]; _previousGroupsList set [_forEachIndex, _x];
[format["found group with ID: %1", _id]] call FUNC(debug); [format["found group with ID: %1", _id]] call FUNC(debug);
@ -51,7 +51,7 @@ if (_switch) then {
reverse _previousGroupsList; reverse _previousGroupsList;
{ {
if (_x select 3) exitwith {}; // stop at first id set to true if (_x select 3) exitWith {}; // stop at first id set to true
if !(_x select 3) then { if !(_x select 3) then {
_currentGroup = group _unit; _currentGroup = group _unit;
if (!isNull (_x select 0)) then { if (!isNull (_x select 0)) then {

View File

@ -35,7 +35,7 @@ if (!isServer) exitWith {false};
_eventEntry = _x; _eventEntry = _x;
_ttlReturn = true; _ttlReturn = true;
if (typeName _globalEventTTL == "CODE") then { if (_globalEventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL; _ttlReturn = [_eventTime, _eventEntry] call _globalEventTTL;
} else { } else {
_ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}}; _ttlReturn = call {_globalEventTTL < 1 || {ACE_diagTime < (_eventEntry select 0) + _globalEventTTL}};
@ -45,7 +45,7 @@ if (!isServer) exitWith {false};
// Do event based TTL check // Do event based TTL check
_eventEntry params ["_time", "", "_eventTTL"]; _eventEntry params ["_time", "", "_eventTTL"];
if (typeName _eventTTL == "CODE") then { if (_eventTTL isEqualType {}) then {
_ttlReturn = [_eventTime, _eventEntry] call _eventTTL; _ttlReturn = [_eventTime, _eventEntry] call _eventTTL;
} else { } else {
_ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}}; _ttlReturn = call {_eventTTL < 1 || {ACE_diagTime < _time + _eventTTL}};

View File

@ -17,6 +17,6 @@
params ["_value"]; params ["_value"];
if (typeName _value == "SCALAR") exitWith {_value}; if (_value isEqualType 0) exitWith {_value};
parseNumber _value // return parseNumber _value // return

View File

@ -24,7 +24,7 @@ if (_vehicle == _unit) exitWith {false};
if (speed _vehicle > 1 || getPos _vehicle select 2 > 2) exitWith {false}; if (speed _vehicle > 1 || getPos _vehicle select 2 > 2) exitWith {false};
private "_emptyPos"; private "_emptyPos";
_emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeof _unit]; // @todo to small? _emptyPos = (getPos _vehicle) findEmptyPosition [0, 10, typeOf _unit]; // @todo to small?
if (count _emptyPos == 0) exitWith {false}; if (count _emptyPos == 0) exitWith {false};

View File

@ -27,7 +27,7 @@ if (_vehicle isKindOf "Ship") then {
TRACE_1("SHIP Ground Check",getPos _vehicle); TRACE_1("SHIP Ground Check",getPos _vehicle);
_emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]; // TODO: if spot is underwater pick another spot. _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeOf _unit]; // TODO: if spot is underwater pick another spot.
} else { } else {
if (_vehicle isKindOf "Air") then { if (_vehicle isKindOf "Air") then {
if (speed _vehicle > 1 || {isTouchingGround _vehicle}) then { if (speed _vehicle > 1 || {isTouchingGround _vehicle}) then {
@ -45,18 +45,18 @@ if (_vehicle isKindOf "Ship") then {
TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle); TRACE_1("Vehicle Ground Check", isTouchingGround _vehicle);
_emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeof _unit]; _emptyPos = (ASLToAGL getPosASL _vehicle) findEmptyPosition [0, 13, typeOf _unit];
}; };
}; };
TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle); TRACE_1("getPosASL Vehicle Check", getPosASL _vehicle);
if !(_validVehiclestate) exitwith { if !(_validVehiclestate) exitWith {
ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle); ACE_LOGWARNING_4("Unable to unload patient because invalid (%1) vehicle state. Either moving or Not close enough on the ground. position: %2 isTouchingGround: %3 Speed: %4",_vehicle,getPos _vehicle,isTouchingGround _vehicle,speed _vehicle);
false false
}; };
if (count _emptyPos == 0) exitwith { if (count _emptyPos == 0) exitWith {
ACE_LOGWARNING_1("No safe empty spots to unload patient. %1",_emptyPos); ACE_LOGWARNING_1("No safe empty spots to unload patient. %1",_emptyPos);
false false
}; //consider displaying text saying there are no safe places to exit the vehicle }; //consider displaying text saying there are no safe places to exit the vehicle
@ -95,9 +95,9 @@ _unit action ["Eject", vehicle _unit];
[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide); [_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide);
_loaded = _vehicle getvariable [QGVAR(loaded_persons),[]]; _loaded = _vehicle getVariable [QGVAR(loaded_persons),[]];
_loaded deleteAt (_loaded find _unit); _loaded deleteAt (_loaded find _unit);
_vehicle setvariable [QGVAR(loaded_persons), _loaded, true]; _vehicle setVariable [QGVAR(loaded_persons), _loaded, true];
true true

View File

@ -15,7 +15,7 @@
#include "script_component.hpp" #include "script_component.hpp"
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine // If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith { if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitWith {
[{ [{
_this call FUNC(dismount); _this call FUNC(dismount);
}, _this] call EFUNC(common,execNextFrame); }, _this] call EFUNC(common,execNextFrame);

View File

@ -57,7 +57,7 @@ if (_mode == 0) then {
if (count _no > 0) exitWith { if (count _no > 0) exitWith {
_found = true; //diag_log "found"; _found = true; //diag_log "found";
}; };
} foreach _wireCheckPosAr; } forEach _wireCheckPosAr;
// Double coil found! // Double coil found!
if (_found) then { if (_found) then {
_mode = 1; _mode = 1;

View File

@ -29,7 +29,7 @@ private ["_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevati
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa)); __background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa));
if (GVAR(noVectorData)) exitwith {}; if (GVAR(noVectorData)) exitWith {};
GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"]; GVAR(LAZPOS) params ["_lazPosX", "_lazPosY", "_lazPosZ"];
// Incase grids go neg due to 99-00 boundry // Incase grids go neg due to 99-00 boundry

View File

@ -14,7 +14,7 @@
true true
}, },
{false}, {false},
[0, [false, true, false]], false] call cba_fnc_addKeybind; // (empty default key) [0, [false, true, false]], false] call CBA_fnc_addKeybind; // (empty default key)
["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR", ["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR",
{ {
@ -27,7 +27,7 @@
true true
}, },
{false}, {false},
[0, [false, false, false]], false] call cba_fnc_addKeybind; // (empty default key) [0, [false, false, false]], false] call CBA_fnc_addKeybind; // (empty default key)
//Add deviceKey entry: //Add deviceKey entry:
private ["_conditonCode", "_toggleCode", "_closeCode"]; private ["_conditonCode", "_toggleCode", "_closeCode"];

View File

@ -20,7 +20,7 @@ params ["_caller", "_target"];
private "_display"; private "_display";
#define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa" #define DEFUALTPATH "\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa"
//Sanity Checks //Sanity Checks
if (_caller != ACE_player) exitwith {ERROR("Player isn't caller?");}; if (_caller != ACE_player) exitWith {ERROR("Player isn't caller?");};
if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");}; if (!([_player, _target] call FUNC(canPlayerDisarmUnit))) exitWith {ERROR("Can't Disarm Unit");};
if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;}; if (dialog) then {ERROR("Dialog open when trying to open disarm dialog"); closeDialog 0;};

View File

@ -33,13 +33,13 @@ class GVAR(remoteInventory) {
fadeout = 0; fadeout = 0;
class Colors { class Colors {
dragValidBgr[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])",0.5}; dragValidBgr[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])",0.5};
dragInvalidBgr[] = {"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",0.5}; dragInvalidBgr[] = {"(profilenamespace getVariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getVariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getVariable ['IGUI_ERROR_RGB_B',0.0])",0.5};
dragValidBar[] = {"(profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.0])",0.5}; dragValidBar[] = {"(profilenamespace getVariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getVariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getVariable ['IGUI_WARNING_RGB_B',0.0])",0.5};
dragInvalidBar[] = {"(profilenamespace getvariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getvariable ['IGUI_ERROR_RGB_B',0.0])",0.5}; dragInvalidBar[] = {"(profilenamespace getVariable ['IGUI_ERROR_RGB_R',0.8])","(profilenamespace getVariable ['IGUI_ERROR_RGB_G',0.0])","(profilenamespace getVariable ['IGUI_ERROR_RGB_B',0.0])",0.5};
progressBar[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])",1}; progressBar[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])",1};
progressBarBgr[] = {"(profilenamespace getvariable ['IGUI_BCG_RGB_R',0])","(profilenamespace getvariable ['IGUI_BCG_RGB_G',1])","(profilenamespace getvariable ['IGUI_BCG_RGB_B',1])",0.75}; progressBarBgr[] = {"(profilenamespace getVariable ['IGUI_BCG_RGB_R',0])","(profilenamespace getVariable ['IGUI_BCG_RGB_G',1])","(profilenamespace getVariable ['IGUI_BCG_RGB_B',1])",0.75};
highlight[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])",0.5}; highlight[] = {"(profilenamespace getVariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getVariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getVariable ['IGUI_TEXT_RGB_B',1])",0.5};
}; };
class controlsBackground {}; class controlsBackground {};

View File

@ -52,7 +52,7 @@ if !([_unit] call EFUNC(common,isPlayer)) then {
//don't do anything until projectile is null (exploded/max range) //don't do anything until projectile is null (exploded/max range)
if (isNull _projectile) then { if (isNull _projectile) then {
//Remove PFEH: //Remove PFEH:
[_idPFH] call cba_fnc_removePerFrameHandler; [_idPFH] call CBA_fnc_removePerFrameHandler;
//If (tube is dropped) OR (is dead) OR (is player) just exit //If (tube is dropped) OR (is dead) OR (is player) just exit
if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {}; if (((secondaryWeapon _unit) != _tube) || {!alive _unit} || {([_unit] call EFUNC(common,isPlayer))}) exitWith {};

View File

@ -84,6 +84,22 @@ class CfgVehicles {
GVAR(canDrag) = 0; GVAR(canDrag) = 0;
}; };
// Barrier
class RoadCone_F: thingX {
XEH_ENABLED;
GVAR(canCarry) = 1;
GVAR(carryPosition[]) = {0,1,1};
GVAR(carryDirection) = 0;
GVAR(canDrag) = 1;
GVAR(dragPosition[]) = {0,1.2,0};
GVAR(dragDirection) = 0;
};
class RoadBarrier_F: RoadCone_F {
GVAR(carryPosition[]) = {0,1,0.300671};
};
class ACE_RepairItem_Base: ThingX {}; class ACE_RepairItem_Base: ThingX {};
class ACE_Track: ACE_RepairItem_Base { class ACE_Track: ACE_RepairItem_Base {

View File

@ -21,4 +21,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging (ignore UAV AI) // a static weapon has to be empty for dragging (ignore UAV AI)
if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; if (((typeOf _target) isKindOf "StaticWeapon") && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})} alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canCarry), false]} && {animationState _target in ["", "unconscious"] || (_target getVariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}

View File

@ -24,4 +24,4 @@ if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false};
// a static weapon has to be empty for dragging (ignore UAV AI) // a static weapon has to be empty for dragging (ignore UAV AI)
if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false}; if ((typeOf _target) isKindOf "StaticWeapon" && {{(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"} count crew _target > 0}) exitWith {false};
alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getvariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})}; alive _target && {vehicle _target == _target} && {_target getVariable [QGVAR(canDrag), false]} && {animationState _target in ["", "unconscious"] || (_target getVariable ["ACE_isUnconscious", false]) || (_target isKindOf "CAManBase" && {(_target getHitPointDamage "HitLegs") > 0.4})};

Some files were not shown because too many files have changed in this diff Show More