diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index ac86d71915..651edbcf86 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -27,12 +27,11 @@ if (isServer) then { ["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler); ["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler); -//TODO: Medical Integration Events??? +//Medical Integration Events??? +["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler); -// [_unit, "knockedOut", { -// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut}; -// }] call ACE_Core_fnc_addCustomEventhandler; +if (!hasInterface) exitWith {}; -// [_unit, "wokeUp", { -// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp}; -// }] call ACE_Core_fnc_addCustomEventhandler; +["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition); +["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition); +["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/captives/XEH_preInit.sqf b/addons/captives/XEH_preInit.sqf index 34c9bca910..c09f81e51b 100644 --- a/addons/captives/XEH_preInit.sqf +++ b/addons/captives/XEH_preInit.sqf @@ -19,10 +19,9 @@ PREP(doUnloadCaptive); PREP(handleGetIn); PREP(handleGetOut); PREP(handleKilled); -PREP(handleKnockedOut); +PREP(handleOnUnconscious); PREP(handlePlayerChanged); PREP(handleUnitInitPost); -PREP(handleWokeUp); PREP(handleZeusDisplayChanged); PREP(moduleSurrender); PREP(setHandcuffed); diff --git a/addons/captives/config.cpp b/addons/captives/config.cpp index 27b7c4ec60..57de6ee970 100644 --- a/addons/captives/config.cpp +++ b/addons/captives/config.cpp @@ -16,16 +16,3 @@ class CfgPatches { #include "CfgMoves.hpp" #include "CfgVehicles.hpp" #include "CfgWeapons.hpp" - - -class ACE_canInteractConditions { - class GVAR(isNotEscorting) { - condition = QUOTE(!(GETVAR(player,QGVAR(isEscorting),false))); - }; - class GVAR(isNotHandcuffed) { - condition = QUOTE(!(GETVAR(player,QGVAR(isHandcuffed),false))); - }; - class GVAR(isNotSurrendering) { - condition = QUOTE(!(GETVAR(player,QGVAR(isSurrendering),false))); - }; -}; diff --git a/addons/captives/functions/fnc_doEscortCaptive.sqf b/addons/captives/functions/fnc_doEscortCaptive.sqf index 299aa81631..08f44a1437 100644 --- a/addons/captives/functions/fnc_doEscortCaptive.sqf +++ b/addons/captives/functions/fnc_doEscortCaptive.sqf @@ -51,7 +51,7 @@ if (_state) then { _unit setVariable [QGVAR(escortedUnit), objNull, true]; }; }; - [_escortFnc, 0.2, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; + [_escortFnc, 0, [_unit, _target, _actionID]] call CBA_fnc_addPerFrameHandler; } else { _unit setVariable [QGVAR(isEscorting), false, true]; diff --git a/addons/captives/functions/fnc_handleKnockedOut.sqf b/addons/captives/functions/fnc_handleKnockedOut.sqf deleted file mode 100644 index 1cd969807d..0000000000 --- a/addons/captives/functions/fnc_handleKnockedOut.sqf +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Author: commy2, PabstMirror - * Handles when a unit gets knocked out. Ends surrendering. - * - * Arguments: - * 0: Unit - * - * Return Value: - * Nothing - * - * Example: - * [bob, true] call ACE_captives_fnc_handleKnockedOut - * - * Public: No - */ -#include "script_component.hpp" - - -//ToDo: Waiting on medical integration - -PARAMS_1(_unit); - -if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop - [_unit, false] call FUNC(setSurrendered); -}; diff --git a/addons/captives/functions/fnc_handleOnUnconscious.sqf b/addons/captives/functions/fnc_handleOnUnconscious.sqf new file mode 100644 index 0000000000..9b73d34485 --- /dev/null +++ b/addons/captives/functions/fnc_handleOnUnconscious.sqf @@ -0,0 +1,36 @@ +/* + * Author: commy2, PabstMirror + * Handles the "medical_onUnconscious" event + * + * Arguments: + * 0: Unit + * 0: Is Unconsisisiouses + * + * Return Value: + * Nothing + * + * Example: + * [bob, true] call ACE_captives_fnc_handleOnUnconscious + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_2(_unit,_isUnconc); + +if (!local _unit) exitWith {}; + +systemChat format ["med: %1", _this]; + +if (_isUnconc) then { + //Knocked out: If surrendering, stop + if (_unit getVariable [QGVAR(isSurrendering), false]) then { + [_unit, false] call FUNC(setSurrendered); + }; +} else { + //Woke up: if handcuffed, goto animation + if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { + [_unit] call EFUNC(common,fixLoweredRifleAnimation); + [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); + }; +}; diff --git a/addons/captives/functions/fnc_handleWokeUp.sqf b/addons/captives/functions/fnc_handleWokeUp.sqf deleted file mode 100644 index 9bf2e1a2bc..0000000000 --- a/addons/captives/functions/fnc_handleWokeUp.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Author: commy2 - * TODO - * - * Arguments: - * 0: _unit - * - * Return Value: - * The return value - * - * Example: - * [bob] call ACE_captives_fnc_handleWokeUp - * - * Public: No - */ -#include "script_component.hpp" - -PARAMS_1(_unit); - -if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then { - [_unit] call EFUNC(common,fixLoweredRifleAnimation); - [_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation); -}; diff --git a/addons/captives/functions/fnc_setHandcuffed.sqf b/addons/captives/functions/fnc_setHandcuffed.sqf index 0deb68dc8b..5917532874 100644 --- a/addons/captives/functions/fnc_setHandcuffed.sqf +++ b/addons/captives/functions/fnc_setHandcuffed.sqf @@ -52,7 +52,7 @@ if (_state) then { //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); - if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then { + if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { ERROR("Handcuff animation interrupted"); systemChat format ["debug %2: new %1", _newAnimation, time]; [_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation); @@ -71,8 +71,8 @@ if (_state) then { _unit removeEventHandler ["AnimChanged", _animChangedEHID]; _unit setVariable [QGVAR(handcuffAnimEHID), -1]; - if ((vehicle _unit) == _unit) then { - //Break out of hands up animation loop (doAnimation handles Unconscious prioity) + if (((vehicle _unit) == _unit) && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { + //Break out of hands up animation loop [_unit, "ACE_AmovPercMstpScapWnonDnon_AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation); }; diff --git a/addons/captives/functions/fnc_setSurrendered.sqf b/addons/captives/functions/fnc_setSurrendered.sqf index e49c6e9453..3a7436abc7 100644 --- a/addons/captives/functions/fnc_setSurrendered.sqf +++ b/addons/captives/functions/fnc_setSurrendered.sqf @@ -50,7 +50,7 @@ if (_state) then { //If we get a change in animation then redo the animation (handles people vaulting to break the animation chain) _animChangedEHID = _unit addEventHandler ["AnimChanged", { PARAMS_2(_unit,_newAnimation); - if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && (_newAnimation != "Unconscious")) then { + if ((_newAnimation != "ACE_AmovPercMstpSsurWnonDnon") && {!(_unit getVariable ["ACE_isUnconscious", false])}) then { ERROR("Surrender animation interrupted"); systemChat format ["debug %2: new %1", _newAnimation, time]; [_unit, "ACE_AmovPercMstpSsurWnonDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/common/CfgWeapons.hpp b/addons/common/CfgWeapons.hpp index 5df5d75da8..5da1bff649 100644 --- a/addons/common/CfgWeapons.hpp +++ b/addons/common/CfgWeapons.hpp @@ -7,14 +7,22 @@ class CfgWeapons { simulation = "ItemMineDetector"; }; - class Rifle_Base_F; + class Rifle; + class Rifle_Base_F: Rifle { + class WeaponSlotsInfo; + }; + class ACE_FakePrimaryWeapon: Rifle_Base_F { + scope = 2; + displayName = ""; + model = ""; + picture = ""; + magazines[] = {"ACE_FakeMagazine"}; discreteDistance[] = {}; discreteDistanceInitIndex = 0; - displayName = ""; - picture = ""; - model = ""; - magazines[] = {"ACE_FakeMagazine"}; - scope = 2; + + class WeaponSlotsInfo: WeaponSlotsInfo { + mass = 0; + }; }; }; diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index 35b0f5c3fe..1d951c3ceb 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -20,6 +20,19 @@ if (hasInterface) then { }; }] call FUNC(addEventhandler); +["fixCollision", DFUNC(fixCollision)] call FUNC(addEventhandler); +["fixFloating", DFUNC(fixFloating)] call FUNC(addEventhandler); +["fixPosition", DFUNC(fixPosition)] call FUNC(addEventhandler); + +["lockVehicle", { + _this setVariable [QGVAR(lockStatus), locked _this]; + _this lock 2; +}] call FUNC(addEventhandler); + +["unlockVehicle", { + _this lock (_this getVariable [QGVAR(lockStatus), locked _this]); +}] call FUNC(addEventhandler); + // hack to get PFH to work in briefing [QGVAR(onBriefingPFH), "onEachFrame", { if (time > 0) exitWith { @@ -55,8 +68,6 @@ if (_currentVersion != _previousVersion) then { if (!hasInterface) exitWith {}; call COMPILE_FILE(scripts\assignedItemFix); - -call COMPILE_FILE(scripts\initCanInteractFunction); call COMPILE_FILE(scripts\initScrollWheel); 0 spawn { @@ -88,6 +99,7 @@ GVAR(OldZeusDisplayIsOpen) = !(isNull findDisplay 312); GVAR(OldCameraView) = cameraView; GVAR(OldPlayerVehicle) = vehicle ACE_player; GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); +GVAR(OldPlayerWeapon) = currentWeapon ACE_player; // PFH to raise varios events [{ @@ -148,6 +160,14 @@ GVAR(OldPlayerTurret) = [ACE_player] call FUNC(getTurretIndex); ["playerTurretChanged", [ACE_player, _newPlayerTurret]] call FUNC(localEvent); }; + // "playerWeaponChanged" event + _newPlayerWeapon = currentWeapon ACE_player; + if (_newPlayerWeapon != GVAR(OldPlayerWeapon)) then { + // Raise ACE event locally + GVAR(OldPlayerWeapon) = _newPlayerWeapon; + ["playerWeaponChanged", [ACE_player, _newPlayerWeapon]] call FUNC(localEvent); + }; + }, 0, []] call cba_fnc_addPerFrameHandler; [QGVAR(StateArrested),false,true,QUOTE(ADDON)] call FUNC(defineVariable); @@ -161,3 +181,5 @@ _vehicle setFuel _fuelLevel; ["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler); ["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler); + +["notOnMap", {!visibleMap}] call FUNC(addCanInteractWithCondition); diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index c71232a55a..de848941fd 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -7,6 +7,7 @@ ADDON = false; PREP(addActionEventHandler); PREP(addActionMenuEventHandler); PREP(addCameraEventHandler); +PREP(addCanInteractWithCondition); PREP(addCustomEventHandler); PREP(addLineToDebugDraw); PREP(addMapMarkerCreatedEventHandler); @@ -54,7 +55,10 @@ PREP(execPersistentFnc); PREP(execRemoteFnc); PREP(executePersistent); PREP(filter); +PREP(fixCollision); +PREP(fixFloating); PREP(fixLoweredRifleAnimation); +PREP(fixPosition); PREP(getAllDefinedSetVariables); PREP(getAllGear); PREP(getCaptivityStatus); @@ -147,6 +151,7 @@ PREP(receiveRequest); PREP(removeActionEventHandler); PREP(removeActionMenuEventHandler); PREP(removeCameraEventHandler); +PREP(removeCanInteractWithCondition); PREP(removeCustomEventHandler); PREP(removeMapMarkerCreatedEventHandler); PREP(removeScrollWheelEventHandler); diff --git a/addons/common/config.cpp b/addons/common/config.cpp index d562d185ec..8081a05637 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -51,12 +51,6 @@ class ACE_Rsc_Control_Base { h = 0; }; -class ACE_canInteractConditions { - class GVAR(notOnMap) { - condition = "!visibleMap"; - }; -}; - class ACE_Settings { /* *class GVAR(sampleSetting) { diff --git a/addons/common/functions/fnc_addCanInteractWithCondition.sqf b/addons/common/functions/fnc_addCanInteractWithCondition.sqf new file mode 100644 index 0000000000..99815a08a7 --- /dev/null +++ b/addons/common/functions/fnc_addCanInteractWithCondition.sqf @@ -0,0 +1,38 @@ +/* + * Author: commy2 + * + * Add a condition that gets checked by ace_common_fnc_canInteractWith. + * + * Arguments: + * 0: The conditions id. Used to remove later or as exception name. An already existing name overwrites. (String) + * 1: The condition to check. format of "_this" is "[_player, _target]". (Code) + * + * Return Value: + * Unit can interact? + * + */ +#include "script_component.hpp" + +private ["_conditionName", "_conditionFunc"]; + +_conditionName = toLower (_this select 0); +_conditionFunc = _this select 1; + +private ["_conditions", "_conditionNames", "_conditionFuncs"]; + +_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; + +_conditionNames = _conditions select 0; +_conditionFuncs = _conditions select 1; + +private "_index"; +_index = _conditionNames find _conditionName; + +if (_index == -1) then { + _index = count _conditionNames; +}; + +_conditionNames set [_index, _conditionName]; +_conditionFuncs set [_index, _conditionFunc]; + +GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs]; diff --git a/addons/common/functions/fnc_ambientBrightness.sqf b/addons/common/functions/fnc_ambientBrightness.sqf index 034129735a..f29ff9e8e5 100644 --- a/addons/common/functions/fnc_ambientBrightness.sqf +++ b/addons/common/functions/fnc_ambientBrightness.sqf @@ -11,4 +11,4 @@ */ #include "script_component.hpp" -sunOrMoon * sunOrMoon + moonIntensity/5 min 1 +sunOrMoon * sunOrMoon * (1 - overcast * 0.25) + (moonIntensity/5 min 1) * (1 - overcast) diff --git a/addons/common/functions/fnc_canInteractWith.sqf b/addons/common/functions/fnc_canInteractWith.sqf index 9c5405452e..b74f2092b4 100644 --- a/addons/common/functions/fnc_canInteractWith.sqf +++ b/addons/common/functions/fnc_canInteractWith.sqf @@ -1,11 +1,49 @@ -// by commy2 +/* + * Author: commy2 + * + * Check if the unit can interact. + * + * Arguments: + * 0: The player. (Object) + * 1: The interaction target. objNull to ignore. (Object) + * 2: Exceptions. What general conditions are to skip? (Array) + * + * Return Value: + * Unit can interact? + * + */ #include "script_component.hpp" -private ["_unit", "_target", "_owner"]; +private ["_unit", "_target", "_exceptions"]; _unit = _this select 0; _target = _this select 1; +_exceptions = _this select 2; -_owner = _target getVariable ["ACE_isUsedBy", objNull]; +_exceptions = [_exceptions, {toLower _this}] call FUNC(map); -isNull _owner || {_unit == _owner} || {!isPlayer _owner} +// exit if the target is not free to interact +private "_owner"; +_owner = _target getVariable [QGVAR(owner), objNull]; + +if (!isNull _owner && {_unit != _owner}) exitWith {false}; + +// check general conditions + +private ["_conditions", "_conditionNames", "_conditionFuncs"]; + +_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; + +_conditionNames = _conditions select 0; +_conditionFuncs = _conditions select 1; + +private "_canInteract"; +_canInteract = true; + +{ + if (!(_x in _exceptions) && {!([_unit, _target] call (_conditionFuncs select _forEachIndex))}) exitWith { + _canInteract = false; + }; +} forEach _conditionNames; + +_canInteract diff --git a/addons/common/functions/fnc_claim.sqf b/addons/common/functions/fnc_claim.sqf index cf960ac462..73317ee876 100644 --- a/addons/common/functions/fnc_claim.sqf +++ b/addons/common/functions/fnc_claim.sqf @@ -1,7 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * + * Unit claims the ownership over an object. This is used to prevent multiple players from draging the same ammo box or using up the same wheel when repairing etc. + * + * Arguments: + * 0: Unit that claims another object. ObjNull to remove claim. (Object) + * 1: The object that gets claimed. (Object) + * 2: Lock the claimed object aswell? (Bool) + * + * Return Value: + * NONE + * + */ #include "script_component.hpp" -private ["_unit", "_target", "_lockTarget", "_owner"]; +private ["_unit", "_target", "_lockTarget"]; _unit = _this select 0; _target = _this select 1; @@ -9,20 +22,26 @@ _lockTarget = _this select 2; if (isNil "_lockTarget") then {_lockTarget = false}; -_owner = _target getVariable ["ACE_isUsedBy", objNull]; +private "_owner"; +_owner = _target getVariable [QGVAR(owner), objNull]; if (!isNull _owner && {!isNull _unit} && {_unit != _owner}) then { diag_log text "[ACE] ERROR: Claiming already owned object."; }; -_target setVariable ["ACE_isUsedBy", _unit, true]; +// transfer this immediately +_target setVariable [QGVAR(owner), _unit, true]; +// lock target object if (_lockTarget) then { - if (!isNull _unit) then { - [_target, "{_locked = locked _this; _this setVariable ['ACE_lockStatus', _locked]; _this lock 2}", _target] call FUNC(execRemoteFnc); - } else { - [_target, "{_this lock (_this getVariable ['ACE_lockStatus', locked _this])}", _target] call FUNC(execRemoteFnc); - }; + if (!isNull _unit) then { + ["lockVehicle", _target, _target] call FUNC(targetEvent); + } else { + ["unlockVehicle", _target, _target] call FUNC(targetEvent); + }; }; -//systemChat str locked _target; systemChat str (_target getVariable ['ACE_lockStatus', locked _target]); +/* +systemChat str locked _target; +systemChat str (_target getVariable [QGVAR(lockStatus), locked _target]); +*/ diff --git a/addons/common/functions/fnc_fixCollision.sqf b/addons/common/functions/fnc_fixCollision.sqf new file mode 100644 index 0000000000..6b43cec469 --- /dev/null +++ b/addons/common/functions/fnc_fixCollision.sqf @@ -0,0 +1,21 @@ +/* + * Author: commy2 + * Attempt to fix physx collisions causing unreasonable impact forces and damage. + * + * Arguments: + * 0: Object + * + * Return Value: + * Nothing + * + */ +#include "script_component.hpp" + +// allowDamage requires local object +if (!local _this) exitWith {}; + +// prevent collision damage, @todo allowDamage API +_this allowDamage false; + +// re-allow damage after 2 seconds +[{_this allowDamage true}, _this, 2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/common/functions/fnc_fixFloating.sqf b/addons/common/functions/fnc_fixFloating.sqf new file mode 100644 index 0000000000..6f08af1482 --- /dev/null +++ b/addons/common/functions/fnc_fixFloating.sqf @@ -0,0 +1,32 @@ +/* + * Author: commy2 + * Attempt to fix floating physx with disabled damage after setPosXXX commands. + * + * Arguments: + * Physx object (Object) + * + * Return Value: + * Nothing + * + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this; + +// setHitPointDamage requires local object +if (!local _object) exitWith {}; + +// save and restore hitpoints, see below why +private ["_hitPoints", "_hitPointDamages"]; + +_hitPoints = [_object] call FUNC(getHitpoints); +_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map); + +// this prevents physx objects from floating when near other physx objects with allowDamage false +_object setDamage damage _object; + +{ + _object setHitPointDamage [_x, _hitPointDamages select _forEachIndex]; +} forEach _hitPoints; diff --git a/addons/common/functions/fnc_fixPosition.sqf b/addons/common/functions/fnc_fixPosition.sqf new file mode 100644 index 0000000000..32cde87e52 --- /dev/null +++ b/addons/common/functions/fnc_fixPosition.sqf @@ -0,0 +1,29 @@ +/* + * Author: commy2 + * + * Fixes position of an object. E.g. moves object above ground and adjusts to terrain slope. Requires local object. + * + * Argument: + * Object (Object) + * + * Return value: + * NONE + */ +#include "script_component.hpp" + +// setVectorUp requires local object +if (!local _this) exitWith {}; + +private "_position"; +_position = getPos _this; + +// don't place the object below the ground +if (_position select 2 < -0.1) then { + _position set [2, -0.1]; + _this setPos _position; +}; + +// adjust position to sloped terrain, if placed on ground +if (getPosATL _this select 2 == _position select 2) then { + _this setVectorUp surfaceNormal _position; +}; diff --git a/addons/common/functions/fnc_owned.sqf b/addons/common/functions/fnc_owned.sqf index 4fa1dbeb98..5588c23781 100644 --- a/addons/common/functions/fnc_owned.sqf +++ b/addons/common/functions/fnc_owned.sqf @@ -1,8 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * + * Counterpart of ace_common_fnc_claim. Check if the given object is claimed by another unit. + * + * Arguments: + * 0: Any object. (Object) + * + * Return Value: + * Is this object claimed by someone? + * + */ #include "script_component.hpp" -private "_object"; +private "_target"; -_object = _this select 0; +_target = _this select 0; -!isNull (_object getVariable ["ACE_isUsedBy", objNull]) +!isNull (_target getVariable [QGVAR(owner), objNull]) diff --git a/addons/common/functions/fnc_progressBar.sqf b/addons/common/functions/fnc_progressBar.sqf index 0b8fcc7ac4..15fbab1e24 100644 --- a/addons/common/functions/fnc_progressBar.sqf +++ b/addons/common/functions/fnc_progressBar.sqf @@ -11,7 +11,7 @@ * 3: CODE or STRING - On Failure: Code called or STRING raised as event. * 4: STRING - (Optional) Localized Title * 5: CODE - (Optional) Code to check each frame -* 6: ARRAY - (Optional) Exceptions for checking EGVAR(common,canInteract) +* 6: ARRAY - (Optional) Exceptions for checking EGVAR(common,canInteractWith) * * Return value: * Nothing @@ -62,7 +62,7 @@ _perFrameFunction = { if (!([_args, _elapsedTime, _totalTime, _errorCode] call _condition)) then { _errorCode = 3; } else { - if (!(_exceptions call EGVAR(common,canInteract))) then { + if (!([_player, objNull, _exceptions] call EGVAR(common,canInteractWith))) then { _errorCode = 4; } else { if (_elapsedTime >= _totalTime) then { diff --git a/addons/common/functions/fnc_removeCanInteractWithCondition.sqf b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf new file mode 100644 index 0000000000..6cfd751c4c --- /dev/null +++ b/addons/common/functions/fnc_removeCanInteractWithCondition.sqf @@ -0,0 +1,34 @@ +/* + * Author: commy2 + * + * Remove a condition that gets checked by ace_common_fnc_canInteractWith. + * + * Arguments: + * 0: The conditions id. (String) + * + * Return Value: + * Unit can interact? + * + */ +#include "script_component.hpp" + +private "_conditionName"; + +_conditionName = toLower (_this select 0); + +private ["_conditions", "_conditionNames", "_conditionFuncs"]; + +_conditions = missionNamespace getVariable [QGVAR(InteractionConditions), [[],[]]]; + +_conditionNames = _conditions select 0; +_conditionFuncs = _conditions select 1; + +private "_index"; +_index = _conditionNames find _conditionName; + +if (_index == -1) exitWith {}; + +_conditionNames deleteAt _index; +_conditionFuncs deleteAt _index; + +GVAR(InteractionConditions) = [_conditionNames, _conditionFuncs]; diff --git a/addons/common/scripts/initCanInteractFunction.sqf b/addons/common/scripts/initCanInteractFunction.sqf deleted file mode 100644 index a0a6eb787f..0000000000 --- a/addons/common/scripts/initCanInteractFunction.sqf +++ /dev/null @@ -1,20 +0,0 @@ -// by commy2 -#include "script_component.hpp" - -private ["_function", "_configFile", "_count", "_index", "_config", "_configName", "_condition"]; - -_function = "private '_exceptions'; _exceptions = _this; alive ACE_player"; - -_configFile = configFile >> "ACE_canInteractConditions"; -_count = count _configFile; - -for "_index" from 0 to (_count -1) do { - _config = _configFile select _index; - _configName = configName _config; - - _condition = getText (_config >> "condition"); - - _function = _function + format ["&& {%1 || {'%2' in _exceptions}}", _condition, _configName]; -}; - -GVAR(canInteract) = compileFinal _function; diff --git a/addons/dragging/$PBOPREFIX$ b/addons/dragging/$PBOPREFIX$ new file mode 100644 index 0000000000..4090738414 --- /dev/null +++ b/addons/dragging/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\dragging \ No newline at end of file diff --git a/addons/dragging/CfgEventHandlers.hpp b/addons/dragging/CfgEventHandlers.hpp new file mode 100644 index 0000000000..6a6aa440f7 --- /dev/null +++ b/addons/dragging/CfgEventHandlers.hpp @@ -0,0 +1,47 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit)); + serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit)); + }; +}; + +class Extended_Init_EventHandlers { + class StaticWeapon { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + class StaticMortar { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; + class ReammoBox_F { + class ADDON { + init = QUOTE(_this call DFUNC(initObject)); + }; + }; +}; + +class Extended_Killed_EventHandlers { + class CAManBase { + class ADDON { + killed = QUOTE(_this call DFUNC(handleKilled)); + }; + }; +}; + +class Extended_AnimChanged_EventHandlers { + class CAManBase { + class ADDON { + animChanged = QUOTE(_this call DFUNC(handleAnimChanged)); + }; + }; +}; diff --git a/addons/dragging/CfgVehicles.hpp b/addons/dragging/CfgVehicles.hpp new file mode 100644 index 0000000000..5ac84b7038 --- /dev/null +++ b/addons/dragging/CfgVehicles.hpp @@ -0,0 +1,86 @@ + +class CfgVehicles { + // Static weapons + class LandVehicle; + class StaticWeapon: LandVehicle { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1.2,0}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + //remove actions from Taru Pods + class Pod_Heli_Transport_04_base_F: StaticWeapon { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + + class StaticMortar; + class Mortar_01_base_F: StaticMortar { + GVAR(canCarry) = 1; + GVAR(carryPosition[]) = {0,1.2,0}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 1; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + // ammo boxes + class ThingX; + class ReammoBox_F: ThingX { + XEH_ENABLED; + GVAR(canCarry) = 0; + GVAR(carryPosition[]) = {0,1,1}; + GVAR(carryDirection) = 0; + + GVAR(canDrag) = 0; + GVAR(dragPosition[]) = {0,1.2,0}; + GVAR(dragDirection) = 0; + }; + + class Slingload_base_F: ReammoBox_F { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + + class EAST_Box_Base: ReammoBox_F { + GVAR(canCarry) = 1; + GVAR(canDrag) = 1; + }; + class IND_Box_Base: ReammoBox_F { + GVAR(canCarry) = 1; + GVAR(canDrag) = 1; + }; + /*class FIA_Box_Base_F: ReammoBox_F { + GVAR(canCarry) = 1; + GVAR(canDrag) = 1; + };*/ + class NATO_Box_Base: ReammoBox_F { + GVAR(canCarry) = 1; + GVAR(canDrag) = 1; + }; + + // Remove Larger crate dragging support. + // Would be better to allow some sort of joint push/drag functionality + // Requiring 2 units to access the larger crates and attaching them together (a crappy method of doing it) + // in order to move the bigger ones. Currently simply remove support. + // I believe these crates are currently broken (hitbox doesn't work or something) in 1.22 (2014-07-04) + class Box_East_AmmoVeh_F: EAST_Box_Base { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + + class Box_NATO_AmmoVeh_F: NATO_Box_Base { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; + + class Box_IND_AmmoVeh_F: IND_Box_Base { + GVAR(canCarry) = 0; + GVAR(canDrag) = 0; + }; +}; diff --git a/addons/dragging/XEH_clientInit.sqf b/addons/dragging/XEH_clientInit.sqf new file mode 100644 index 0000000000..da9c6eefd6 --- /dev/null +++ b/addons/dragging/XEH_clientInit.sqf @@ -0,0 +1,19 @@ +// by PabstMirror, commy2 +#include "script_component.hpp" + +[{_this call DFUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler); + +if (isNil "ACE_maxWeightDrag") then { + ACE_maxWeightDrag = 800; +}; + +if (isNil "ACE_maxWeightCarry") then { + ACE_maxWeightCarry = 600; +}; + +["isNotDragging", {!((_this select 0) getVariable [QGVAR(isDragging), false])}] call EFUNC(common,addCanInteractWithCondition); +["isNotCarrying", {!((_this select 0) getVariable [QGVAR(isCarrying), false])}] call EFUNC(common,addCanInteractWithCondition); + +// release object on player change. This does work when returning to lobby, but not when hard disconnecting. +["playerChanged", {_this call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler); +["playerWeaponChanged", {_this call DFUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler); diff --git a/addons/dragging/XEH_preInit.sqf b/addons/dragging/XEH_preInit.sqf new file mode 100644 index 0000000000..7a0be053ad --- /dev/null +++ b/addons/dragging/XEH_preInit.sqf @@ -0,0 +1,28 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(canCarry); +PREP(canDrag); +PREP(canDrop); +PREP(canDrop_carry); +PREP(carryObject); +PREP(carryObjectPFH); +PREP(dragObject); +PREP(dragObjectPFH); +PREP(dropObject); +PREP(dropObject_carry); +PREP(getWeight); +PREP(handleAnimChanged); +PREP(handleKilled); +PREP(handlePlayerChanged); +PREP(handlePlayerWeaponChanged); +PREP(handleScrollWheel); +PREP(initObject); +PREP(isObjectOnObject); +PREP(setCarryable); +PREP(setDraggable); +PREP(startDrag); +PREP(startDragPFH); + +ADDON = true; diff --git a/addons/dragging/XEH_serverInit.sqf b/addons/dragging/XEH_serverInit.sqf new file mode 100644 index 0000000000..f6c231d275 --- /dev/null +++ b/addons/dragging/XEH_serverInit.sqf @@ -0,0 +1,5 @@ +// by commy2 +#include "script_component.hpp" + +// release object on hard disconnection. Function is identical to killed +addMissionEventHandler ["HandleDisconnect", {_this call DFUNC(handleKilled)}]; diff --git a/addons/dragging/config.cpp b/addons/dragging/config.cpp new file mode 100644 index 0000000000..2d5854d86f --- /dev/null +++ b/addons/dragging/config.cpp @@ -0,0 +1,16 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common","ace_interaction","ace_interact_menu"}; + author[] = {"Garth 'L-H' de Wet","commy2"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" +#include "CfgVehicles.hpp" diff --git a/addons/dragging/functions/fnc_canCarry.sqf b/addons/dragging/functions/fnc_canCarry.sqf new file mode 100644 index 0000000000..13402b53b5 --- /dev/null +++ b/addons/dragging/functions/fnc_canCarry.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Check if unit can carry the object. Doesn't check weight. + * + * Argument: + * 0: Unit that should do the carrying (Object) + * 1: Object to carry (Object) + * + * Return value: + * Can the unit carry the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; + +// a static weapon has to be empty for dragging +if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; + +alive _target && {_target getVariable [QGVAR(canCarry), false]} diff --git a/addons/dragging/functions/fnc_canDrag.sqf b/addons/dragging/functions/fnc_canDrag.sqf new file mode 100644 index 0000000000..9771496aa2 --- /dev/null +++ b/addons/dragging/functions/fnc_canDrag.sqf @@ -0,0 +1,25 @@ +/* + * Author: commy2 + * + * Check if unit can drag the object. Doesn't check weight. + * + * Argument: + * 0: Unit that should do the dragging (Object) + * 1: Object to drag (Object) + * + * Return value: + * Can the unit drag the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, []] call EFUNC(common,canInteractWith)) exitWith {false}; + +// a static weapon has to be empty for dragging +if ((typeOf _target) isKindOf "StaticWeapon" && {count crew _target > 0}) exitWith {false}; + +alive _target && {_target getVariable [QGVAR(canDrag), false]} diff --git a/addons/dragging/functions/fnc_canDrop.sqf b/addons/dragging/functions/fnc_canDrop.sqf new file mode 100644 index 0000000000..df75b9540f --- /dev/null +++ b/addons/dragging/functions/fnc_canDrop.sqf @@ -0,0 +1,22 @@ +/* + * Author: commy2 + * + * Check if unit can drop the object. + * + * Argument: + * 0: Unit that currently drags a object (Object) + * 1: Object that is dragged (Object) + * + * Return value: + * Can the unit drop the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; + +_unit getVariable [QGVAR(draggedObject), objNull] == _target diff --git a/addons/dragging/functions/fnc_canDrop_carry.sqf b/addons/dragging/functions/fnc_canDrop_carry.sqf new file mode 100644 index 0000000000..9efbbe9b0f --- /dev/null +++ b/addons/dragging/functions/fnc_canDrop_carry.sqf @@ -0,0 +1,22 @@ +/* + * Author: commy2 + * + * Check if unit can drop the carried object. + * + * Argument: + * 0: Unit that currently carries a object (Object) + * 1: Object that is carried (Object) + * + * Return value: + * Can the unit drop the object? (Bool) + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +if !([_unit, _target, ["isNotCarrying"]] call EFUNC(common,canInteractWith)) exitWith {false}; + +_unit getVariable [QGVAR(carriedObject), objNull] == _target diff --git a/addons/dragging/functions/fnc_carryObject.sqf b/addons/dragging/functions/fnc_carryObject.sqf new file mode 100644 index 0000000000..5fe3f36ccb --- /dev/null +++ b/addons/dragging/functions/fnc_carryObject.sqf @@ -0,0 +1,80 @@ +/* + * Author: commy2 + * + * Carry an object. + * + * Argument: + * 0: Unit that should do the carrying (Object) + * 1: Object to carry (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// check weight +private "_weight"; +_weight = [_target] call FUNC(getWeight); + +if (_weight > GETMVAR(ACE_maxWeightCarry,1E11)) exitWith { + [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); +}; + +// select no weapon and stop sprinting +_unit action ["SwitchWeapon", _unit, _unit, 99]; + +[_unit, "isDragging", true] call EFUNC(common,setforceWalkStatus); + +// prevent multiple players from accessing the same object +[_unit, _target, true] call EFUNC(common,claim); + +// get attachTo offset and direction. +private ["_position", "_direction"]; + +_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]]; +_direction = _target getVariable [QGVAR(carryDirection), 0]; + +// add height offset of model +private "_offset"; +_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + +_position = _position vectorAdd [0, 0, _offset]; + +// attach object +_target attachTo [_unit, _position]; +_target setDir _direction; + +_unit setVariable [QGVAR(isCarrying), true, true]; +_unit setVariable [QGVAR(carriedObject), _target, true]; + +// add scrollwheel action to release object +private "_actionID"; +_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + +if (_actionID != -1) then { + _unit removeAction _actionID; +}; + +_actionID = _unit addAction [ + format ["%1", localize "STR_ACE_Dragging_Drop"], + QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])] call FUNC(dropObject_carry)), + nil, + 20, + false, + true, + "", + QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(carriedObject)),objNull)])) +]; + +_unit setVariable [QGVAR(ReleaseActionID), _actionID]; + +// check everything +[FUNC(carryObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; + +// reset current dragging height. +GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_carryObjectPFH.sqf b/addons/dragging/functions/fnc_carryObjectPFH.sqf new file mode 100644 index 0000000000..81b2369624 --- /dev/null +++ b/addons/dragging/functions/fnc_carryObjectPFH.sqf @@ -0,0 +1,13 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; + +// drop if the crate is destroyed +if !([_target] call EFUNC(common,isAlive)) then { + [_unit, _target] call FUNC(dropObject_carry); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/dragging/functions/fnc_dragObject.sqf b/addons/dragging/functions/fnc_dragObject.sqf new file mode 100644 index 0000000000..2f04e0e599 --- /dev/null +++ b/addons/dragging/functions/fnc_dragObject.sqf @@ -0,0 +1,64 @@ +/* + * Author: commy2 + * + * Drag an object. Called from ace_dragging_fnc_startDrag + * + * Argument: + * 0: Unit that should do the dragging (Object) + * 1: Object to drag (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// get attachTo offset and direction. +private ["_position", "_direction"]; + +_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]]; +_direction = _target getVariable [QGVAR(dragDirection), 0]; + +// add height offset of model +private "_offset"; +_offset = (_target modelToWorld [0, 0, 0] select 2) - (_unit modelToWorld [0, 0, 0] select 2); + +_position = _position vectorAdd [0, 0, _offset]; + +// attach object +_target attachTo [_unit, _position]; +_target setDir _direction; + +_unit setVariable [QGVAR(isDragging), true, true]; +_unit setVariable [QGVAR(draggedObject), _target, true]; + +// add scrollwheel action to release object +private "_actionID"; +_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1]; + +if (_actionID != -1) then { + _unit removeAction _actionID; +}; + +_actionID = _unit addAction [ + format ["%1", localize "STR_ACE_Dragging_Drop"], + QUOTE([ARR_2(_this select 0, (_this select 0) getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])] call FUNC(dropObject)), + nil, + 20, + false, + true, + "", + QUOTE(!isNull (_this getVariable [ARR_2(QUOTE(QGVAR(draggedObject)),objNull)])) +]; + +_unit setVariable [QGVAR(ReleaseActionID), _actionID]; + +// check everything +[FUNC(dragObjectPFH), 0, [_unit, _target]] call CBA_fnc_addPerFrameHandler; + +// reset current dragging height. +GVAR(currentHeightChange) = 0; diff --git a/addons/dragging/functions/fnc_dragObjectPFH.sqf b/addons/dragging/functions/fnc_dragObjectPFH.sqf new file mode 100644 index 0000000000..e741b01f17 --- /dev/null +++ b/addons/dragging/functions/fnc_dragObjectPFH.sqf @@ -0,0 +1,13 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; + +// drop if the crate is destroyed +if !([_target] call EFUNC(common,isAlive)) then { + [_unit, _target] call FUNC(dropObject); + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/dragging/functions/fnc_dropObject.sqf b/addons/dragging/functions/fnc_dropObject.sqf new file mode 100644 index 0000000000..00aa7a6bca --- /dev/null +++ b/addons/dragging/functions/fnc_dropObject.sqf @@ -0,0 +1,50 @@ +/* + * Author: commy2 + * + * Drop a dragged object. + * + * Argument: + * 0: Unit that drags the other object (Object) + * 1: Dragged object to drop (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// remove scroll wheel action +_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); + +private "_inBuilding"; +_inBuilding = [_unit] call FUNC(isObjectOnObject); + +// play release animation +_unit playAction "released"; + +// prevent collision damage +["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); +["fixCollision", _target, _target] call EFUNC(common,targetEvent); + +// release object +detach _target; + +_unit removeWeapon "ACE_FakePrimaryWeapon"; + +// prevent object from flipping inside buildings +if (_inBuilding) then { + _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); +}; + +_unit setVariable [QGVAR(isDragging), false, true]; +_unit setVariable [QGVAR(draggedObject), objNull, true]; + +// make object accesable for other units +[objNull, _target, true] call EFUNC(common,claim); + +["fixPosition", _target, _target] call EFUNC(common,targetEvent); +["fixFloating", _target, _target] call EFUNC(common,targetEvent); diff --git a/addons/dragging/functions/fnc_dropObject_carry.sqf b/addons/dragging/functions/fnc_dropObject_carry.sqf new file mode 100644 index 0000000000..497b96b95c --- /dev/null +++ b/addons/dragging/functions/fnc_dropObject_carry.sqf @@ -0,0 +1,50 @@ +/* + * Author: commy2 + * + * Drop a carried object. + * + * Argument: + * 0: Unit that carries the other object (Object) + * 1: Carried object to drop (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// remove scroll wheel action +_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]); + +private "_inBuilding"; +_inBuilding = [_unit] call FUNC(isObjectOnObject); + +// prevent collision damage +["fixCollision", _unit, _unit] call EFUNC(common,targetEvent); +["fixCollision", _target, _target] call EFUNC(common,targetEvent); + +// release object +detach _target; + +// reselect weapon and re-enable sprint +_unit selectWeapon primaryWeapon _unit; + +[_unit, "isDragging", false] call EFUNC(common,setforceWalkStatus); + +// prevent object from flipping inside buildings +if (_inBuilding) then { + _target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]); +}; + +_unit setVariable [QGVAR(isCarrying), false, true]; +_unit setVariable [QGVAR(carriedObject), objNull, true]; + +// make object accesable for other units +[objNull, _target, true] call EFUNC(common,claim); + +["fixPosition", _target, _target] call EFUNC(common,targetEvent); +["fixFloating", _target, _target] call EFUNC(common,targetEvent); diff --git a/addons/dragging/functions/fnc_getWeight.sqf b/addons/dragging/functions/fnc_getWeight.sqf new file mode 100644 index 0000000000..2b44bf90d9 --- /dev/null +++ b/addons/dragging/functions/fnc_getWeight.sqf @@ -0,0 +1,54 @@ +/* + Name: AGM_Drag_fnc_GetWeight + + Author(s): + L-H, edited by commy2 + + Description: + Returns the weight of a crate. + + Parameters: + 0: OBJECT - Crate to get weight of + + Returns: + NUMBER - Weight + + Example: + _weight = Crate1 call AGM_Drag_fnc_GetWeight; +*/ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +private ["_totalWeight", "_fnc","_fnc_Extra"]; +_totalWeight = 0; +_fnc_Extra = { + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> (_this select 2) >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight +}; +_fnc = { + private ["_weight", "_items"]; + _items = _this select 0; + _weight = 0; + { + _weight = _weight + (getNumber (ConfigFile >> (_this select 1) >> _x >> "mass") * ((_items select 1) select _foreachIndex)); + } foreach (_items select 0); + + _weight +}; +_totalWeight = ([getMagazineCargo _object, "CfgMagazines"] call _fnc); +_totalWeight = _totalWeight + ([getItemCargo _object, "CfgWeapons", "ItemInfo"] call _fnc_Extra); +_totalWeight = _totalWeight + ([getWeaponCargo _object, "CfgWeapons", "WeaponSlotsInfo"] call _fnc_Extra); +_totalWeight = _totalWeight + ([getBackpackCargo _object, "CfgVehicles"] call _fnc); + +_totalWeight = _totalWeight * 0.5; // Mass in Arma isn't an exact amount but rather a volume/weight value. This attempts to work around that by making it a usable value. (sort of). + +_totalWeight diff --git a/addons/dragging/functions/fnc_handleAnimChanged.sqf b/addons/dragging/functions/fnc_handleAnimChanged.sqf new file mode 100644 index 0000000000..b5eb4d4d8f --- /dev/null +++ b/addons/dragging/functions/fnc_handleAnimChanged.sqf @@ -0,0 +1,31 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_anim"]; + +_unit = _this select 0; +_anim = _this select 1; + +if (_unit getVariable [QGVAR(isDragging), false]) then { + + // drop dragged object when not in valid animation + if !(_anim in DRAG_ANIMATIONS) then { + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + + [_unit, _draggedObject] call FUNC(dropObject); + }; + +}; + +if (_unit getVariable [QGVAR(isCarrying), false]) then { + + // drop carried object when not standing + if (stance _unit != "STAND") then { + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; + +}; diff --git a/addons/dragging/functions/fnc_handleKilled.sqf b/addons/dragging/functions/fnc_handleKilled.sqf new file mode 100644 index 0000000000..4dcfc77fcd --- /dev/null +++ b/addons/dragging/functions/fnc_handleKilled.sqf @@ -0,0 +1,20 @@ +// by commy2 +#include "script_component.hpp" + +private "_unit"; + +_unit = _this select 0; + +if (_unit getVariable [QGVAR(isDragging), false]) then { + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + + [_unit, _draggedObject] call FUNC(dropObject); +}; + +if (_unit getVariable [QGVAR(isCarrying), false]) then { + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + [_unit, _carriedObject] call FUNC(dropObject_carry); +}; diff --git a/addons/dragging/functions/fnc_handlePlayerChanged.sqf b/addons/dragging/functions/fnc_handlePlayerChanged.sqf new file mode 100644 index 0000000000..e2dd41021b --- /dev/null +++ b/addons/dragging/functions/fnc_handlePlayerChanged.sqf @@ -0,0 +1,17 @@ +// by commy2 +#include "script_component.hpp" + +private ["_newPlayer", "_oldPlayer"]; + +_newPlayer = _this select 0; +_oldPlayer = _this select 1; + +{ + if (_x getVariable [QGVAR(isDragging), false]) then { + [_x, _x getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject); + }; + + if (_x getVariable [QGVAR(isCarrying), false]) then { + [_x, _x getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry); + }; +} forEach [_newPlayer, _oldPlayer]; diff --git a/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf new file mode 100644 index 0000000000..44160b54c1 --- /dev/null +++ b/addons/dragging/functions/fnc_handlePlayerWeaponChanged.sqf @@ -0,0 +1,31 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_weapon"]; + +_unit = _this select 0; +_weapon = _this select 1; + +if (_unit getVariable [QGVAR(isDragging), false]) then { + + // drop dragged object when selecting a non-primary weapon + if (_weapon != primaryWeapon _unit) then { + private "_draggedObject"; + _draggedObject = _unit getVariable [QGVAR(draggedObject), objNull]; + + [_unit, _draggedObject] call FUNC(dropObject); + }; + +}; + +if (_unit getVariable [QGVAR(isCarrying), false]) then { + + // drop carried object when selecting any weapon + if (_weapon != "") then { + private "_carriedObject"; + _carriedObject = _unit getVariable [QGVAR(carriedObject), objNull]; + + [_unit, _carriedObject] call FUNC(dropObject_carry); + }; + +}; diff --git a/addons/dragging/functions/fnc_handleScrollWheel.sqf b/addons/dragging/functions/fnc_handleScrollWheel.sqf new file mode 100644 index 0000000000..ce100abf50 --- /dev/null +++ b/addons/dragging/functions/fnc_handleScrollWheel.sqf @@ -0,0 +1,45 @@ +/* + * Author: L-H, commy2 + * + * Handles raising and lowering the dragged weapon to be able to place it on top of objects. + * + * Argument: + * 0: Scroll amount (Number) + * + * Return value: + * Handled or not. (Bool) + */ +#include "script_component.hpp" + +// requires modifier key to be hold down +if (GETMVAR(ACE_Modifier,0) == 0) exitWith {false}; + +private "_unit"; +_unit = ACE_player; + +// EH is always assigned. Exit and don't overwrite input if not carrying +if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false}; + +private "_scrollAmount"; + +_scrollAmount = _this select 0; + +// move carried item 15 cm per scroll interval +_scrollAmount = _scrollAmount * 0.15; + +private "_carriedItem"; +_carriedItem = _unit getVariable [QGVAR(carriedObject),objNull]; + +private ["_position", "_maxHeight"]; + +_position = getPosATL _carriedItem; +_maxHeight = (_unit ModelToWorld [0,0,0]) select 2; + +_position set [2, ((_position select 2) + _scrollAmount min (_maxHeight + 1.5)) max _maxHeight]; + +// move up/down object and reattach at current position +detach _carriedItem; +_carriedItem setPosATL _position; +_carriedItem attachTo [_unit]; + +true diff --git a/addons/dragging/functions/fnc_initObject.sqf b/addons/dragging/functions/fnc_initObject.sqf new file mode 100644 index 0000000000..65866bd028 --- /dev/null +++ b/addons/dragging/functions/fnc_initObject.sqf @@ -0,0 +1,37 @@ +/* + * Author: commy2 + * + * Initialize variables for drag or carryable objects. Called from init EH. + * + * Argument: + * 0: Any object (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private "_object"; + +_object = _this select 0; + +private "_config"; +_config = configFile >> "CfgVehicles" >> typeOf _object; + +if (getNumber (_config >> QGVAR(canDrag)) == 1) then { + private ["_position", "_direction"]; + + _position = getArray (_config >> QGVAR(dragPosition)); + _direction = getNumber (_config >> QGVAR(dragDirection)); + + [_object, true, _position, _direction] call FUNC(setDraggable); +}; + +if (getNumber (_config >> QGVAR(canCarry)) == 1) then { + private ["_position", "_direction"]; + + _position = getArray (_config >> QGVAR(carryPosition)); + _direction = getNumber (_config >> QGVAR(carryDirection)); + + [_object, true, _position, _direction] call FUNC(setCarryable); +}; diff --git a/addons/dragging/functions/fnc_isObjectOnObject.sqf b/addons/dragging/functions/fnc_isObjectOnObject.sqf new file mode 100644 index 0000000000..0a8624820e --- /dev/null +++ b/addons/dragging/functions/fnc_isObjectOnObject.sqf @@ -0,0 +1,6 @@ +// by commy2 + +private "_object"; +_object = _this select 0; + +(getPosATL _object select 2) - (getPos _object select 2) > 1E-5 diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf new file mode 100644 index 0000000000..d1dd9cf1a9 --- /dev/null +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -0,0 +1,52 @@ +/* + * Author: commy2 + * + * Enable the object to be carried. + * + * Argument: + * 0: Any object (Object) + * 1: true to enable carrying, false to disable (Bool) + * 2: Position offset for attachTo command (Array, optinal; default: [0,1,1]) + * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_object", "_enableCarry", "_position", "_direction"]; + +_this resize 4; + +_object = _this select 0; +_enableCarry = _this select 1; +_position = _this select 2; +_direction = _this select 3; + +if (isNil "_position") then { + _position = _object getVariable [QGVAR(carryPosition), [0,1,1]]; +}; + +if (isNil "_direction") then { + _direction = _object getVariable [QGVAR(carryDirection), 0]; +}; + +// update variables +_object setVariable [QGVAR(canCarry), _enableCarry]; +_object setVariable [QGVAR(carryPosition), _position]; +_object setVariable [QGVAR(carryDirection), _direction]; + +// add action to class if it is not already present +private ["_type", "_initializedClasses"]; + +_type = typeOf _object; +_initializedClasses = GETGVAR(initializedClasses_carry,[]); + +// do nothing if the class is already initialized +if (_type in _initializedClasses) exitWith {}; + +_initializedClasses pushBack _type; +GVAR(initializedClasses_carry) = _initializedClasses; + +[_type, 0, ["ACE_MainActions", QGVAR(carry)], localize "STR_ACE_Dragging_Carry", "", "", {[_player, _target] call FUNC(carryObject)}, {[_player, _target] call FUNC(canCarry)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drop_carry)], localize "STR_ACE_Dragging_Drop", "", "", {[_player, _target] call FUNC(dropObject_carry)}, {[_player, _target] call FUNC(canDrop_carry)}, 2] call EFUNC(interact_menu,addClassAction); diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf new file mode 100644 index 0000000000..82ebc201e2 --- /dev/null +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -0,0 +1,52 @@ +/* + * Author: commy2 + * + * Enable the object to be dragged. + * + * Argument: + * 0: Any object (Object) + * 1: true to enable dragging, false to disable (Bool) + * 2: Position offset for attachTo command (Array, optinal; default: [0,0,0]) + * 3: Direction in degree to rotate the object after attachTo (Number, optional; default: 0) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_object", "_enableDrag", "_position", "_direction"]; + +_this resize 4; + +_object = _this select 0; +_enableDrag = _this select 1; +_position = _this select 2; +_direction = _this select 3; + +if (isNil "_position") then { + _position = _object getVariable [QGVAR(dragPosition), [0,0,0]]; +}; + +if (isNil "_direction") then { + _direction = _object getVariable [QGVAR(dragDirection), 0]; +}; + +// update variables +_object setVariable [QGVAR(canDrag), _enableDrag]; +_object setVariable [QGVAR(dragPosition), _position]; +_object setVariable [QGVAR(dragDirection), _direction]; + +// add action to class if it is not already present +private ["_type", "_initializedClasses"]; + +_type = typeOf _object; +_initializedClasses = GETGVAR(initializedClasses,[]); + +// do nothing if the class is already initialized +if (_type in _initializedClasses) exitWith {}; + +_initializedClasses pushBack _type; +GVAR(initializedClasses) = _initializedClasses; + +[_type, 0, ["ACE_MainActions", QGVAR(drag)], localize "STR_ACE_Dragging_Drag", "", "", {[_player, _target] call FUNC(startDrag)}, {[_player, _target] call FUNC(canDrag)}, 2] call EFUNC(interact_menu,addClassAction); +[_type, 0, ["ACE_MainActions", QGVAR(drop)], localize "STR_ACE_Dragging_Drop", "", "", {[_player, _target] call FUNC(dropObject)}, {[_player, _target] call FUNC(canDrop)}, 2] call EFUNC(interact_menu,addClassAction); diff --git a/addons/dragging/functions/fnc_startDrag.sqf b/addons/dragging/functions/fnc_startDrag.sqf new file mode 100644 index 0000000000..1e286fb4a4 --- /dev/null +++ b/addons/dragging/functions/fnc_startDrag.sqf @@ -0,0 +1,43 @@ +/* + * Author: commy2 + * + * Start the dragging process. + * + * Argument: + * 0: Unit that should do the dragging (Object) + * 1: Object to drag (Object) + * + * Return value: + * NONE. + */ +#include "script_component.hpp" + +private ["_unit", "_target"]; + +_unit = _this select 0; +_target = _this select 1; + +// check weight +private "_weight"; +_weight = [_target] call FUNC(getWeight); + +if (_weight > GETMVAR(ACE_maxWeightDrag,1E11)) exitWith { + [localize "STR_ACE_Dragging_UnableToDrag"] call EFUNC(common,displayTextStructured); +}; + +// add a primary weapon if the unit has none. +// @todo prevent opening inventory when equipped with a fake weapon +if (primaryWeapon _unit == "") then { + _unit addWeapon "ACE_FakePrimaryWeapon"; +}; + +// select primary, otherwise the drag animation actions don't work. +_unit selectWeapon primaryWeapon _unit; + +// prevent multiple players from accessing the same object +[_unit, _target, true] call EFUNC(common,claim); + +// can't play action that depends on weapon if it was added the same frame +[{_this playActionNow "grabDrag";}, _unit] call EFUNC(common,execNextFrame); + +[FUNC(startDragPFH), 0.2, [_unit, _target, time + 5]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/dragging/functions/fnc_startDragPFH.sqf b/addons/dragging/functions/fnc_startDragPFH.sqf new file mode 100644 index 0000000000..b6515aa2d9 --- /dev/null +++ b/addons/dragging/functions/fnc_startDragPFH.sqf @@ -0,0 +1,20 @@ +// by commy2 +#include "script_component.hpp" + +private ["_unit", "_target", "_timeOut"]; + +_unit = _this select 0 select 0; +_target = _this select 0 select 1; +_timeOut = _this select 0 select 2; + +// timeout. Do nothing. Quit. time, because anim length is linked to ingame time. +if (time > _timeOut) exitWith { + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; + +// unit is ready to start dragging +if (animationState _unit in DRAG_ANIMATIONS) exitWith { + [_unit, _target] call FUNC(dragObject); + + [_this select 1] call CBA_fnc_removePerFrameHandler; +}; diff --git a/addons/dragging/functions/script_component.hpp b/addons/dragging/functions/script_component.hpp new file mode 100644 index 0000000000..9d257a69d3 --- /dev/null +++ b/addons/dragging/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\dragging\script_component.hpp" \ No newline at end of file diff --git a/addons/dragging/script_component.hpp b/addons/dragging/script_component.hpp new file mode 100644 index 0000000000..0f601ae8d9 --- /dev/null +++ b/addons/dragging/script_component.hpp @@ -0,0 +1,14 @@ +#define COMPONENT dragging +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_DRAGGING + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_ENABLED_DRAGGING + #define DEBUG_SETTINGS DEBUG_ENABLED_DRAGGING +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define DRAG_ANIMATIONS ["amovpercmstpslowwrfldnon_acinpknlmwlkslowwrfldb_2", "amovpercmstpsraswpstdnon_acinpknlmwlksnonwpstdb_2", "amovpercmstpsnonwnondnon_acinpknlmwlksnonwnondb_2", "acinpknlmstpsraswrfldnon", "acinpknlmstpsnonwpstdnon", "acinpknlmstpsnonwnondnon", "acinpknlmwlksraswrfldb", "acinpknlmwlksnonwnondb"] diff --git a/addons/dragging/stringtable.xml b/addons/dragging/stringtable.xml new file mode 100644 index 0000000000..1fca04fee1 --- /dev/null +++ b/addons/dragging/stringtable.xml @@ -0,0 +1,56 @@ + + + + + + Drag + Тащить + Arrastrar + Ciągnij + Táhnout + Tracter + Ziehen + Arrastar + Trascina + Húzás + + + Release + Отпустить + Soltar + Puść + Položit + Lâcher + Loslassen + Largar + Lascia + Elengedés + + + Item to heavy + Gegenstand zu schwer + + + + Carry + Tragen + Portar + Nieś + Porter + Nést + Carregar + Trascina + Felvesz + Нести + + + diff --git a/addons/fcs/CfgEventHandlers.hpp b/addons/fcs/CfgEventHandlers.hpp index 961a05b27d..a03ca847ea 100644 --- a/addons/fcs/CfgEventHandlers.hpp +++ b/addons/fcs/CfgEventHandlers.hpp @@ -36,6 +36,11 @@ class Extended_Init_EventHandlers { serverInit = QUOTE(_this call FUNC(vehicleInit)); }; }; + class StaticWeapon { + class ADDON { + serverInit = QUOTE(_this call FUNC(vehicleInit)); + }; + }; }; class Extended_Respawn_EventHandlers { @@ -64,6 +69,11 @@ class Extended_Respawn_EventHandlers { respawn = QUOTE(_this call FUNC(vehicleInit)); }; }; + class StaticWeapon { + class ADDON { + respawn = QUOTE(_this call FUNC(vehicleInit)); + }; + }; }; class Extended_FiredBIS_EventHandlers { @@ -92,4 +102,9 @@ class Extended_FiredBIS_EventHandlers { firedBIS = QUOTE(_this call FUNC(firedEH)); }; }; + class StaticWeapon { + class ADDON { + firedBIS = QUOTE(_this call FUNC(firedEH)); + }; + }; }; diff --git a/addons/fcs/initKeybinds.sqf b/addons/fcs/initKeybinds.sqf index f573a7e9d9..c30e93dba0 100644 --- a/addons/fcs/initKeybinds.sqf +++ b/addons/fcs/initKeybinds.sqf @@ -3,8 +3,7 @@ ["ACE3", QGVAR(lazeTarget), localize "STR_ACE_FCS_LaseTarget", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false}; @@ -21,8 +20,7 @@ GVAR(isDownStateKey1) = false; // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(GVAR(enabled) && FUNC(canUseFCS)) exitWith {false}; @@ -35,8 +33,7 @@ ["ACE3", QGVAR(adjustRangeUp), localize "STR_ACE_FCS_AdjustRangeUp", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; @@ -50,8 +47,7 @@ ["ACE3", QGVAR(adjustRangDown), localize "STR_ACE_FCS_AdjustRangeDown", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(call FUNC(canUseRangefinder) || FUNC(canUseFCS)) exitWith {false}; diff --git a/addons/grenades/XEH_postInit.sqf b/addons/grenades/XEH_postInit.sqf index 89f4e05bb4..6229871679 100644 --- a/addons/grenades/XEH_postInit.sqf +++ b/addons/grenades/XEH_postInit.sqf @@ -13,8 +13,7 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true; ["ACE3", QGVAR(switchGrenadeMode), localize "STR_ACE_Grenades_SwitchGrenadeMode", { // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if (!([ACE_player] call EFUNC(common,canUseWeapon))) exitWith {false}; diff --git a/addons/hearing/CfgAmmo.hpp b/addons/hearing/CfgAmmo.hpp index dea7901434..ddc2bf3297 100644 --- a/addons/hearing/CfgAmmo.hpp +++ b/addons/hearing/CfgAmmo.hpp @@ -4,4 +4,4 @@ class CfgAmmo { class B_127x108_Ball: BulletBase { audibleFire = 15; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/CfgEventHandlers.hpp b/addons/hearing/CfgEventHandlers.hpp index 9f0acc6c7c..94b1ab0703 100644 --- a/addons/hearing/CfgEventHandlers.hpp +++ b/addons/hearing/CfgEventHandlers.hpp @@ -22,7 +22,7 @@ class Extended_Init_EventHandlers { class Extended_FiredNear_EventHandlers { class CAManBase { class GVAR(FiredNear) { - clientFiredNear = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(firedNear)}; ); + clientFiredNear = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(firedNear)}; ); }; }; }; @@ -30,7 +30,7 @@ class Extended_FiredNear_EventHandlers { class Extended_Explosion_EventHandlers { class CAManBase { class GVAR(ExplosionNear) { - clientExplosion = QUOTE( if (_this select 0 == ACE_player) then {_this call FUNC(explosionNear)}; ); + clientExplosion = QUOTE( if (GVAR(enableCombatDeafness) && {_this select 0 == ACE_player}) then {_this call FUNC(explosionNear)}; ); }; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/CfgSounds.hpp b/addons/hearing/CfgSounds.hpp index 17436088c3..ac64f42c4e 100644 --- a/addons/hearing/CfgSounds.hpp +++ b/addons/hearing/CfgSounds.hpp @@ -11,4 +11,4 @@ class CfgSounds { sound[] = {QUOTE(PATHTOF(sounds\ACE_earringing_heavy.wav)),8,1.7}; titles[] = {}; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 1f499d88a4..c4ea1f2349 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -4,8 +4,8 @@ class CfgVehicles { class ACE_SelfActions { class ACE_Equipment { class ACE_PutInEarplugs { - displayName = "$STR_ACE_Hearing_Earbuds_On"; - condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarBuds' in items _player} ); + displayName = "$STR_ACE_Hearing_EarPlugs_On"; + condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarPlugs' in items _player} ); statement = QUOTE( [_player] call FUNC(putInEarPlugs) ); showDisabled = 0; priority = 2.5; @@ -14,7 +14,7 @@ class CfgVehicles { enableInside = 1; }; class ACE_RemoveEarplugs { - displayName = "$STR_ACE_Hearing_Earbuds_Off"; + displayName = "$STR_ACE_Hearing_EarPlugs_Off"; condition = QUOTE( [_player] call FUNC(hasEarPlugsIn) ); statement = QUOTE( [_player] call FUNC(removeEarPlugs) ); showDisabled = 0; @@ -35,61 +35,84 @@ class CfgVehicles { class Box_NATO_Support_F: NATO_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class B_supplyCrate_F: ReammoBox_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class Box_East_Support_F: EAST_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class O_supplyCrate_F: B_supplyCrate_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class Box_IND_Support_F: IND_Box_Base { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class Box_FIA_Support_F: FIA_Box_Base_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class I_supplyCrate_F: B_supplyCrate_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class IG_supplyCrate_F: ReammoBox_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class C_supplyCrate_F: ReammoBox_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); }; }; class ACE_Box_Misc: Box_NATO_Support_F { class TransportItems { - MACRO_ADDITEM(ACE_EarBuds,12); + MACRO_ADDITEM(ACE_EarPlugs,12); + }; + }; + + + class Module_F; + class ACE_ModuleHearing: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Hearing"; + function = QFUNC(moduleHearing); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconHearing_ca.paa); + class Arguments { + class EnableCombatDeafness { + displayName = "Enable combat deafness?"; + description = "Enable combat deafness?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; default = 1; }; + class No { name = "No"; value = 0; }; + }; + }; }; }; }; diff --git a/addons/hearing/CfgWeapons.hpp b/addons/hearing/CfgWeapons.hpp index 15fa2097a3..e70cc62c25 100644 --- a/addons/hearing/CfgWeapons.hpp +++ b/addons/hearing/CfgWeapons.hpp @@ -2,9 +2,9 @@ class CfgWeapons { class ACE_ItemCore; class InventoryItem_Base_F; - class ACE_EarBuds: ACE_ItemCore { - displayName = "$STR_ACE_Hearing_Earbuds_Name"; - descriptionShort = "$STR_ACE_Hearing_Earbuds_Description"; + class ACE_EarPlugs: ACE_ItemCore { + displayName = "$STR_ACE_Hearing_EarPlugs_Name"; + descriptionShort = "$STR_ACE_Hearing_EarPlugs_Description"; model = PATHTOF(ACE_earplugs.p3d); picture = PATHTOF(UI\ACE_earplugs_x_ca.paa); scope = 2; @@ -12,4 +12,4 @@ class CfgWeapons { mass = 1; }; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/UI/IconHearing_ca.paa b/addons/hearing/UI/IconHearing_ca.paa new file mode 100644 index 0000000000..128f08f6f0 Binary files /dev/null and b/addons/hearing/UI/IconHearing_ca.paa differ diff --git a/addons/hearing/XEH_preInit.sqf b/addons/hearing/XEH_preInit.sqf index 95d317b4b1..0785a32aff 100644 --- a/addons/hearing/XEH_preInit.sqf +++ b/addons/hearing/XEH_preInit.sqf @@ -7,6 +7,7 @@ PREP(earRinging); PREP(explosionNear); PREP(firedNear); PREP(hasEarPlugsIn); +PREP(moduleHearing); PREP(putInEarPlugs); PREP(removeEarPlugs); PREP(updateVolume); diff --git a/addons/hearing/config.cpp b/addons/hearing/config.cpp index 4499e647f6..0616ffa0e1 100644 --- a/addons/hearing/config.cpp +++ b/addons/hearing/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"ACE_EarBuds"}; + weapons[] = {"ACE_EarPlugs"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common", "ace_interaction"}; author[] = {"KoffeinFlummi", "CAA-Picard", "HopeJ", "commy2"}; @@ -23,10 +23,22 @@ class CfgPatches { #include "CfgAmmo.hpp" class ACE_Settings { + class GVAR(EnableCombatDeafness) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(EarplugsVolume) { + value = 0.5; + typeName = "SCALAR"; + }; + class GVAR(UnconsciousnessVolume) { + value = 0.4; + typeName = "SCALAR"; + }; class GVAR(DisableEarRinging) { - default = 1; + value = 0; typeName = "BOOL"; isClientSetable = 1; displayName = "$STR_ACE_Hearing_DisableEarRinging"; }; -}; \ No newline at end of file +}; diff --git a/addons/hearing/functions/fnc_addEarPlugs.sqf b/addons/hearing/functions/fnc_addEarPlugs.sqf index 9253717c11..455de07fd9 100644 --- a/addons/hearing/functions/fnc_addEarPlugs.sqf +++ b/addons/hearing/functions/fnc_addEarPlugs.sqf @@ -1,13 +1,17 @@ /* * Author: commy2 - * * Called on unit initialization. Adds earplugs if the unit is equipped with either a really loud primary weapon or a rocket launcher. * - * Argument: - * 0: A Soldier (Object) + * Arguments: + * 0: A Soldier * - * Return value: - * Nothing + * Return Value: + * None + * + * Example: + * [guy] call ace_hearing_fnc_addEarPlugs + * + * Public: No */ #include "script_component.hpp" @@ -19,7 +23,7 @@ _unit = _this select 0; _launcher = secondaryWeapon _unit; if (_launcher != "") exitWith { - _unit addItem "ACE_EarBuds"; + _unit addItem "ACE_EarPlugs"; }; // otherwise add earplugs if the soldier has a big rifle @@ -32,5 +36,5 @@ if (isNil "_magazine") exitWith {}; _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo"); if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "audiblefire") > 8) then { - _unit addItem "ACE_EarBuds"; + _unit addItem "ACE_EarPlugs"; }; diff --git a/addons/hearing/functions/fnc_earRinging.sqf b/addons/hearing/functions/fnc_earRinging.sqf index 4581a6fdd9..2460e0fd5c 100644 --- a/addons/hearing/functions/fnc_earRinging.sqf +++ b/addons/hearing/functions/fnc_earRinging.sqf @@ -1,13 +1,18 @@ /* * Author: KoffeinFlummi, commy2 - * * Creates ear ringing effect with set strength. * * Arguments: - * 0: strength of ear ringing (Number between 0 and 1) + * 0: Unit (player) + * 1: strength of ear ringing (Number between 0 and 1) * * Return Value: - * none + * None + * + * Example: + * [clientExplosionEvent] call ace_hearing_fnc_earRinging + * + * Public: No */ #include "script_component.hpp" @@ -17,7 +22,7 @@ _unit = _this select 0; _strength = _this select 1; if (_unit getVariable ["ACE_hasEarPlugsin", false]) then { - _strength = _strength / 4; + _strength = _strength / 4; }; GVAR(newStrength) = GVAR(newStrength) max _strength; @@ -28,24 +33,24 @@ if (missionNamespace getVariable [QGVAR(isEarRingingPlaying), false]) exitWith { if (GVAR(DisableEarRinging)) exitWith {}; if (_strength > 0.75) exitWith { - playSound "ACE_EarRinging_Heavy"; - GVAR(isEarRingingPlaying) = true; - [ + playSound "ACE_EarRinging_Heavy"; + GVAR(isEarRingingPlaying) = true; + [ {GVAR(isEarRingingPlaying) = false;}, [], 7.0, 0.25 - ] call EFUNC(common,waitAndExecute); + ] call EFUNC(common,waitAndExecute); }; if (_strength > 0.5) exitWith { - playSound "ACE_EarRinging_Medium"; - GVAR(isEarRingingPlaying) = true; - [ + playSound "ACE_EarRinging_Medium"; + GVAR(isEarRingingPlaying) = true; + [ {GVAR(isEarRingingPlaying) = false;}, [], 5.0, 0.25 - ] call EFUNC(common,waitAndExecute); + ] call EFUNC(common,waitAndExecute); }; if (_strength > 0.2) exitWith { - playSound "ACE_EarRinging_Weak"; - GVAR(isEarRingingPlaying) = true; + playSound "ACE_EarRinging_Weak"; GVAR(isEarRingingPlaying) = true; - [ + GVAR(isEarRingingPlaying) = true; + [ {GVAR(isEarRingingPlaying) = false;}, [], 3.0, 0.25 - ] call EFUNC(common,waitAndExecute); + ] call EFUNC(common,waitAndExecute); }; diff --git a/addons/hearing/functions/fnc_explosionNear.sqf b/addons/hearing/functions/fnc_explosionNear.sqf index 8c7b477da0..b213a1304a 100644 --- a/addons/hearing/functions/fnc_explosionNear.sqf +++ b/addons/hearing/functions/fnc_explosionNear.sqf @@ -1,13 +1,18 @@ /* * Author: KoffeinFlummi, commy2 - * * Handles deafness due to explosions going off near the player. * * Arguments: - * -> Explosion Event Handler + * 0: vehicle - Object the event handler is assigned to (player) + * 1: damage - Damage inflicted to the object * * Return Value: - * none + * None + * + * Example: + * [clientExplosionEvent] call ace_hearing_fnc_explosionNear + * + * Public: No */ #include "script_component.hpp" @@ -19,7 +24,4 @@ _damage = _this select 1; _strength = (_damage * 2) min 1; if (_strength < 0.01) exitWith {}; -[_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); -}; +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_firedNear.sqf b/addons/hearing/functions/fnc_firedNear.sqf index 10e8508617..c66361801e 100644 --- a/addons/hearing/functions/fnc_firedNear.sqf +++ b/addons/hearing/functions/fnc_firedNear.sqf @@ -1,13 +1,23 @@ /* * Author: KoffeinFlummi, commy2 - * * Handles deafness due to large-caliber weapons going off near the player. * * Arguments: - * -> FiredNear Event Handler + * 0: Unit - Object the event handler is assigned to + * 1: Firer: Object - Object which fires a weapon near the unit + * 2: Distance - Distance in meters between the unit and firer + * 3: weapon - Fired weapon + * 4: muzzle - Muzzle that was used + * 5: mod - Current mode of the fired weapon + * 6: ammo - Ammo used * * Return Value: - * none + * None + * + * Example: + * [clientFiredNearEvent] call ace_hearing_fnc_firedNear + * + * Public: No */ #include "script_component.hpp" @@ -25,17 +35,17 @@ if (_weapon in ["Throw", "Put"]) exitWith {}; if (_unit != vehicle _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {}; _silencer = switch (_weapon) do { - case (primaryWeapon _unit) : {primaryWeaponItems _unit select 0}; - case (secondaryWeapon _unit) : {secondaryWeaponItems _unit select 0}; - case (handgunWeapon _unit) : {handgunItems _unit select 0}; - default {""}; + case (primaryWeapon _firer) : {(primaryWeaponItems _firer) select 0}; + case (secondaryWeapon _firer) : {(secondaryWeaponItems _firer) select 0}; + case (handgunWeapon _firer) : {(handgunItems _firer) select 0}; + default {""}; }; _audibleFireCoef = 1; //_audibleFireTimeCoef = 1; if (_silencer != "") then { - _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); - //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime"); + _audibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFire"); + //_audibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "audibleFireTime"); }; _audibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "audibleFire"); @@ -46,7 +56,4 @@ _strength = _loudness - (_loudness/50 * _distance); // linear drop off if (_strength < 0.01) exitWith {}; -[_unit, _strength] spawn { - sleep 0.2; - _this call FUNC(earRinging); -}; +[{_this call FUNC(earRinging)}, [_unit, _strength], 0.2, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf index 8fcfe1eeb1..58dc302888 100644 --- a/addons/hearing/functions/fnc_hasEarPlugsIn.sqf +++ b/addons/hearing/functions/fnc_hasEarPlugsIn.sqf @@ -1,18 +1,20 @@ /* * Author: commy2 - * * Check if the unit has earplugs put in. * - * Argument: - * A soldier (Object) + * Arguments: + * 0:Unit (player) * - * Return value: - * Boolean (Bool) + * Return Value: + * Have Earplugs in + * + * Example: + * [ace_player] call ace_hearing_fnc_hasEarPlugsIn + * + * Public: No */ #include "script_component.hpp" -private "_unit"; - -_unit = _this select 0; +PARAMS_1(_unit); _unit getVariable ["ACE_hasEarPlugsin", false] diff --git a/addons/hearing/functions/fnc_moduleHearing.sqf b/addons/hearing/functions/fnc_moduleHearing.sqf new file mode 100644 index 0000000000..78e79d971e --- /dev/null +++ b/addons/hearing/functions/fnc_moduleHearing.sqf @@ -0,0 +1,20 @@ +/* + * Author: CAA-Picard + * Initializes the Map module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "script_component.hpp" + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(enableCombatDeafness), "EnableCombatDeafness"] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Interaction Module Initialized."; diff --git a/addons/hearing/functions/fnc_putInEarplugs.sqf b/addons/hearing/functions/fnc_putInEarplugs.sqf index 767ec9c698..b02a19d5bc 100644 --- a/addons/hearing/functions/fnc_putInEarplugs.sqf +++ b/addons/hearing/functions/fnc_putInEarplugs.sqf @@ -1,27 +1,28 @@ /* - * Author: Hope Johnson - * Edited by commy2 - * - * Puts in / takes out earplugs. + * Author: Hope Johnson and commy2 + * Puts in earplugs. * * Arguments: - * none + * 0:Unit (player) * * Return Value: - * none + * None + * + * Example: + * [ace_player] call ace_hearing_fnc_putInEarplugs + * + * Public: No */ #include "script_component.hpp" -private "_player"; +PARAMS_1(_player); -_player = _this select 0; - -// Buds in inventory, putting them in -_player removeItem "ACE_EarBuds"; +// Plugs in inventory, putting them in +_player removeItem "ACE_EarPlugs"; _player setVariable ["ACE_hasEarPlugsIn", true, true]; -[localize "STR_ACE_Hearing_Earbuds_Are_On"] call EFUNC(common,displayTextStructured); +[localize "STR_ACE_Hearing_EarPlugs_Are_On"] call EFUNC(common,displayTextStructured); -/*// No Ear Buds in inventory, telling user -[localize "STR_ACE_Hearing_NoBuds"] call EFUNC(common,displayTextStructured);*/ +/*// No Ear Plugs in inventory, telling user +[localize "STR_ACE_Hearing_NoPlugs"] call EFUNC(common,displayTextStructured);*/ diff --git a/addons/hearing/functions/fnc_removeEarplugs.sqf b/addons/hearing/functions/fnc_removeEarplugs.sqf index 9436807a46..e2d0b68d51 100644 --- a/addons/hearing/functions/fnc_removeEarplugs.sqf +++ b/addons/hearing/functions/fnc_removeEarplugs.sqf @@ -1,28 +1,29 @@ /* - * Author: Hope Johnson - * Edited by commy2 - * - * Puts in / takes out earplugs. + * Author: Hope Johnson and commy2 + * Takes out earplugs. * * Arguments: - * none + * 0:Unit (player) * * Return Value: - * none + * None + * + * Example: + * [ace_player] call ace_hearing_fnc_removeEarplugs + * + * Public: No */ #include "script_component.hpp" -private "_player"; +PARAMS_1(_player); -_player = _this select 0; - -if !(_player canAdd "ACE_EarBuds") exitWith { // inventory full - [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured); +if !(_player canAdd "ACE_EarPlugs") exitWith { // inventory full + [localize "STR_ACE_Hearing_Inventory_Full"] call EFUNC(common,displayTextStructured); }; -// Buds already in and removing them. -_player addItem "ACE_EarBuds"; +// Plugs already in and removing them. +_player addItem "ACE_EarPlugs"; _player setVariable ["ACE_hasEarPlugsIn", false, true]; -[localize "STR_ACE_Hearing_Earbuds_Are_Off"] call EFUNC(common,displayTextStructured); +[localize "STR_ACE_Hearing_EarPlugs_Are_Off"] call EFUNC(common,displayTextStructured); diff --git a/addons/hearing/functions/fnc_updateVolume.sqf b/addons/hearing/functions/fnc_updateVolume.sqf index 187d4ce116..634537922c 100644 --- a/addons/hearing/functions/fnc_updateVolume.sqf +++ b/addons/hearing/functions/fnc_updateVolume.sqf @@ -1,22 +1,39 @@ -// by commy2 and CAA-Picard +/* + * Author: commy2 and CAA-Picard + * Updates and applys the current deafness. Called every 0.1 sec from a PFEH. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_hearing_fnc_updateVolume + * + * Public: No + */ #include "script_component.hpp" #define STRENGHTODEAFNESS 3 #define MAXDEAFNESS 1.1 +// Exit if combat deafness is disabled +if !(GVAR(enableCombatDeafness)) exitWith {}; + // Check if new noises increase deafness if (GVAR(newStrength) * STRENGHTODEAFNESS > GVAR(currentDeafness)) then { - GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS; + GVAR(currentDeafness) = GVAR(newStrength) * STRENGHTODEAFNESS min MAXDEAFNESS; }; GVAR(newStrength) = 0; // Recover rate is slower if deafness is severe _recoverRate = 0.01; if (GVAR(currentDeafness) > 0.7) then { - _recoverRate = 0.005; - if (GVAR(currentDeafness) > 0.9) then { - _recoverRate = 0.002; - }; + _recoverRate = 0.005; + if (GVAR(currentDeafness) > 0.9) then { + _recoverRate = 0.002; + }; }; // Deafness recovers with time @@ -27,19 +44,19 @@ _volume = (1 - GVAR(currentDeafness) max 0)^2 max 0.04; // Earplugs reduce hearing 50% if ([ACE_player] call FUNC(hasEarPlugsIn)) then { - _volume = _volume min 0.5; + _volume = _volume min GVAR(EarplugsVolume); }; // Reduce volume if player is unconscious if (ACE_player getVariable ["ACE_isUnconscious", false]) then { - _volume = _volume min 0.4; + _volume = _volume min GVAR(UnconsciousnessVolume); }; if (!(missionNameSpace getVariable [QGVAR(disableVolumeUpdate), false])) then { - 0.1 fadeSound _volume; - 0.1 fadeSpeech _volume; - ACE_player setVariable ["tf_globalVolume", _volume]; - ACE_player setVariable ["acre_sys_core_globalVolume", _volume]; + 0.1 fadeSound _volume; + 0.1 fadeSpeech _volume; + ACE_player setVariable ["tf_globalVolume", _volume]; + if (!isNil "acre_api_fnc_setGlobalVolume") then {[_volume] call acre_api_fnc_setGlobalVolume;}; }; //hintSilent format ["GVAR(currentDeafness), _Volume = %1, %2", GVAR(currentDeafness), _volume]; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index 385bf35936..7f6110915a 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -2,7 +2,7 @@ - + Ear Plugs Ohrenstöpsel Tapones para los oídos @@ -14,8 +14,8 @@ Protetor auricular Tappi auricolari - - Protective Ear Buds allow the wearer to be near loud weaponry without damage to his hearing. + + Protective Ear Plugs allow the wearer to be near loud weaponry without damage to his hearing. Schützende Ohrenstöpsel, die es dem Träger ermöglichen, sich in der Nähe lauter Waffen aufzuhalten. Los tapones para los oídos permiten al usuario operar armamento ruidoso sin sufrir pérdida de audición. Stopery do uszu umożliwiają użytkownikowi przebywać w pobliżu głośnej broni bez poniesienia konsekwencji jaką jest utrata słuchu. @@ -26,7 +26,7 @@ Protetor para ouvidos permitem que o usuário esteja próximo a ruídos sem danificar sua audição. Proteggono l'apparato uditivo, permettendo a chi li indossa di resistere ai suoni particolarmente forti senza alcun danno. - + Earplugs in Ohrenstöpsel drinnen Poner tapones @@ -38,7 +38,7 @@ Protetores colocados Indossa i tappi auricolari - + Earplugs out Ohrenstöpsel raus Quitar tapones @@ -50,7 +50,7 @@ Protetores retirados Levati i tappi auricolari - + Earplugs in Ohrenstöpsel drinnen Tapones puestos @@ -62,7 +62,7 @@ Protetores colocados Indossa i tappi auricolari - + Earplugs out Ohrenstöpsel raus Tapones quitados @@ -74,7 +74,7 @@ Protetores retirados Levati i tappi auricolari - + You have no ear plugs Keine Ohrenstöpsel im Inventar No tienes tapones para los oídos diff --git a/addons/interact_menu/functions/fnc_compileMenu.sqf b/addons/interact_menu/functions/fnc_compileMenu.sqf index 5ba4a1b5a7..e6a2744f03 100644 --- a/addons/interact_menu/functions/fnc_compileMenu.sqf +++ b/addons/interact_menu/functions/fnc_compileMenu.sqf @@ -46,7 +46,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, _target, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; diff --git a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf index 9407ce6dcd..81f4a25ef1 100644 --- a/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_compileMenuSelfAction.sqf @@ -43,7 +43,7 @@ _recurseFnc = { if (_condition == "") then {_condition = "true"}; // Add canInteract (including exceptions) and canInteractWith to condition - _condition = _condition + format [QUOTE( && {%1 call EGVAR(common,canInteract)} && {[ARR_2(ACE_player, _target)] call EFUNC(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; + _condition = _condition + format [QUOTE( && {[ARR_3(ACE_player, objNull, %1)] call EGVAR(common,canInteractWith)} ), getArray (_entryCfg >> "exceptions")]; _showDisabled = (getNumber (_entryCfg >> "showDisabled")) > 0; _enableInside = (getNumber (_entryCfg >> "enableInside")) > 0; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 4a0592b5b8..4c8ffd8b3a 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -19,5 +19,7 @@ if(!GVAR(keyDown)) then { GVAR(keyDown) = true; GVAR(keyDownTime) = diag_tickTime; + + ["interactMenuOpened", [0]] call EFUNC(common,localEvent); }; true diff --git a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf index 0f58a246d2..63c81b58bc 100644 --- a/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf +++ b/addons/interact_menu/functions/fnc_keyDownSelfAction.sqf @@ -17,6 +17,8 @@ if(!GVAR(keyDownSelfAction)) then { GVAR(keyDown) = false; GVAR(keyDownTime) = diag_tickTime; + ["interactMenuOpened", [1]] call EFUNC(common,localEvent); + GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || visibleMap; if (GVAR(useCursorMenu)) then { diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 947c2e2579..1bd1e81be2 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -497,4 +497,17 @@ class CfgVehicles { class ACE_SelfActions {}; }; + class thingX; + class ReammoBox_F: thingX { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 2; + condition = "true"; + }; + }; + class ACE_SelfActions {}; + }; + }; diff --git a/addons/interaction/XEH_clientInit.sqf b/addons/interaction/XEH_clientInit.sqf index 0e05014cf7..e303fae857 100644 --- a/addons/interaction/XEH_clientInit.sqf +++ b/addons/interaction/XEH_clientInit.sqf @@ -19,8 +19,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(openDoor), localize "STR_ACE_Interaction_OpenDoor", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if (GVAR(isOpeningDoor) || {[2] call FUNC(getDoor) select 1 == ''}) exitWith {false}; @@ -40,8 +39,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(tapShoulder), localize "STR_ACE_Interaction_TapShoulder", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false}; @@ -55,8 +53,7 @@ GVAR(isOpeningDoor) = false; ["ACE3", QGVAR(modifierKey), localize "STR_ACE_Interaction_ModifierKey", { // Conditions: canInteract - _exceptions = ["ACE_Drag_isNotDragging"]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + //if !([ACE_player, objNull, ["isNotDragging"]] call EGVAR(common,canInteractWith)) exitWith {false}; // not needed // Statement ACE_Modifier = 1; @@ -69,3 +66,5 @@ GVAR(isOpeningDoor) = false; false; }, [29, [false, false, false]], false] call cba_fnc_addKeybind; + +["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition); diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index c9cfd2c0b4..a39e8f8bf5 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -24,9 +24,3 @@ class ACE_Settings { typeName = "BOOL"; }; }; - -class ACE_canInteractConditions { - class GVAR(isNotSwimming) { - condition = QUOTE( !underwater ACE_player ); - }; -}; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 616538a6ff..0d67ae7a55 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -47,7 +47,7 @@ playSound "ACE_Sound_Click"; !GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1} }; - if (!_usedMouseWheel && {time < _time} && {[] call EGVAR(common,canInteract)}) then { + if (!_usedMouseWheel && {time < _time} && {[ACE_player, objNull, []] call EGVAR(common,canInteractWith)}) then { _phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5); {_house animate [_x, _phase]} forEach _animations; diff --git a/addons/inventory/RscDisplayInventory.hpp b/addons/inventory/RscDisplayInventory.hpp new file mode 100644 index 0000000000..c8c93ab142 --- /dev/null +++ b/addons/inventory/RscDisplayInventory.hpp @@ -0,0 +1,516 @@ +/* +Adjust the scaling of the inventory screen +- changes it from scaling based on user's interface size to a dynamic size based on a setting variable +- text size and row height size are uneffected (so more rows in a list) +- also tweaks the height of the two ProgressBars which looked odd scaled up so much + +regex: +x = "[-+]?(\d*[.]?\d+).* +x = X_PART\(\1\); + */ + +class RscText; +class RscPicture; +class RscListBox; +class RscProgress; +class RscStructuredText; +class RscActiveText; +class RscCombo; + +#define X_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)) +#define Y_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)) +#define W_BIS(num) (num * (((safezoneW / safezoneH) min 1.2) / 40)) +#define H_BIS(num) (num * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)) + +#define X_MAKEITBIGGA(num) (num * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)) +#define Y_MAKEITBIGGA(num) (num * (safeZoneH / 30) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)) +#define W_MAKEITBIGGA(num) (num * (safeZoneH / 40)) +#define H_MAKEITBIGGA(num) (num * (safeZoneH / 30)) + +#define X_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), X_BIS(num), X_MAKEITBIGGA(num))]) +#define Y_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), Y_BIS(num), Y_MAKEITBIGGA(num))]) +#define W_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), W_BIS(num), W_MAKEITBIGGA(num))]) +#define H_PART(num) QUOTE(linearConversion [ARR_5(0, 2, (missionNamespace getVariable [ARR_2(QUOTE(QGVAR(inventoryDisplaySize)), 0)]), H_BIS(num), H_MAKEITBIGGA(num))]) + +class RscDisplayInventory { + class controls { + class CA_ContainerBackground: RscText { + //crate: GroundLoad adjust size + x = X_PART(1); + y = Y_PART(1); + w = W_PART(12); + h = H_PART(22.5); + }; + class CA_PlayerBackground: RscText { + //center player's container: decrease height because of progressbar height decrease + x = X_PART(14.6); + y = Y_PART(2); + w = W_PART(24.4); + h = H_PART(21.5); + }; + class TitleBackground: RscText { + x = X_PART(14.6); + y = Y_PART(1); + w = W_PART(24.4); + h = H_PART(1); + }; + class PlayersName: RscText { + x = X_PART(15.6); + y = Y_PART(1); + w = W_PART(19.8); + h = H_PART(1); + }; + class RankBackground: RscText { + x = X_PART(15.1); + y = Y_PART(1.25); + w = W_PART(0.6); + h = H_PART(0.6); + }; + class RankPicture: RscPicture { + x = X_PART(15.1); + y = Y_PART(1.25); + w = W_PART(0.6); + h = H_PART(0.6); + }; + class ButtonBack: RscActiveText { + x = X_PART(38); + y = Y_PART(1); + w = W_PART(1); + h = H_PART(1); + }; + class BackgroundSlotPrimary: RscPicture { + x = X_PART(26.6); + y = Y_PART(6); + w = W_PART(11.9); + h = H_PART(3); + }; + class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondary: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(11.5); + w = W_PART(11.9); + h = H_PART(3); + }; + class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgun: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(17); + w = W_PART(11.9); + h = H_PART(3); + }; + class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgunOptics: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class BackgroundSlotHeadgear: BackgroundSlotPrimary { + x = X_PART(26.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotGoggles: BackgroundSlotPrimary { + x = X_PART(29.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotHMD: BackgroundSlotPrimary { + x = X_PART(32.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotBinoculars: BackgroundSlotPrimary { + x = X_PART(35.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class BackgroundSlotMap: BackgroundSlotPrimary { + x = X_PART(15.1); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotGPS: BackgroundSlotPrimary { + x = X_PART(17.32); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotCompass: BackgroundSlotPrimary { + x = X_PART(21.76); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotRadio: BackgroundSlotPrimary { + x = X_PART(19.54); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class BackgroundSlotWatch: BackgroundSlotPrimary { + x = X_PART(23.98); + y = Y_PART(20.1); + w = W_PART(2.12); + h = H_PART(2); + }; + class ExternalContainerBackground: RscPicture { + x = X_PART(1.5); + y = Y_PART(3.7); + w = W_PART(11); + h = H_PART(18.4); + }; + class PlayerContainerBackground: ExternalContainerBackground { + x = X_PART(15.1); + y = Y_PART(6); + w = W_PART(11); + h = H_PART(14); + }; + class GroundTab: RscActiveText { + x = X_PART(1.5); + y = Y_PART(1.5); + w = W_PART(5.5); + h = H_PART(1); + }; + class SoldierTab: GroundTab { + x = X_PART(7); + y = Y_PART(1.5); + w = W_PART(5.5); + h = H_PART(1); + }; + class GroundContainer: RscListBox { + x = X_PART(1.5); + y = Y_PART(3.7); + w = W_PART(11); + h = H_PART(18.4); + }; + class GroundFilter: RscCombo { + x = X_PART(1.5); + y = Y_PART(2.6); + w = W_PART(11); + h = H_PART(1); + }; + class GroundLoad: RscProgress { + //crate: GroundLoad adjust size + x = X_PART(1.5); + y = Y_PART(22.5); + w = W_PART(11); + h = H_PART(0.5); + }; + class SlotPrimary: GroundTab { + x = X_PART(26.6); + y = Y_PART(6); + w = W_PART(11.9); + h = H_PART(3); + }; + class SlotPrimaryMuzzle: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotPrimaryGrip: SlotPrimary { + w = 0; + h = 0; + x = X_PART(39); + y = Y_PART(9); + }; + class SlotPrimaryFlashlight: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotPrimaryOptics: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotPrimaryMagazine: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(9.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondary: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(11.5); + w = W_PART(11.9); + h = H_PART(3); + }; + class SlotSecondaryMuzzle: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondaryGrip: SlotPrimary { + w = 0; + h = 0; + x = X_PART(39); + y = Y_PART(14.5); + }; + class SlotSecondaryFlashlight: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondaryOptics: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotSecondaryMagazine: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(14.6); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgun: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(17); + w = W_PART(11.9); + h = H_PART(3); + }; + class SlotHandgunMuzzle: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgunGrip: SlotPrimary { + w = 0; + h = 0; + x = X_PART(39); + y = Y_PART(20); + }; + class SlotHandgunFlashlight: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgunOptics: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHandgunMagazine: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(20.1); + w = W_PART(2.9); + h = H_PART(2); + }; + class SlotHeadgear: SlotPrimary { + x = X_PART(26.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotGoggles: SlotPrimary { + x = X_PART(29.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotHMD: SlotPrimary { + x = X_PART(32.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotBinoculars: SlotPrimary { + x = X_PART(35.6); + y = Y_PART(2.5); + w = W_PART(2.9); + h = H_PART(2.9); + }; + class SlotMap: SlotPrimary { + x = X_PART(15.16); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotGPS: SlotPrimary { + x = X_PART(17.38); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotCompass: SlotPrimary { + x = X_PART(21.82); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotRadio: SlotPrimary { + x = X_PART(19.6); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class SlotWatch: SlotPrimary { + x = X_PART(24.04); + y = Y_PART(20.1); + w = W_PART(2); + h = H_PART(2); + }; + class UniformTab: GroundTab { + x = X_PART(15.1); + y = Y_PART(2.5); + w = W_PART(3.5); + h = H_PART(3); + }; + class UniformSlot: SlotPrimary { + x = X_PART(15.35); + y = Y_PART(2.5); + w = W_PART(3); + h = H_PART(3); + }; + class UniformLoad: GroundLoad { + x = X_PART(15.1); + y = Y_PART(5.5); + w = W_PART(3.5); + h = H_PART(0.5); + }; + class UniformContainer: GroundContainer { + x = X_PART(15.1); + y = Y_PART(6); + w = W_PART(11); + h = H_PART(14); + }; + class VestTab: UniformTab { + x = X_PART(18.85); + y = Y_PART(2.5); + w = W_PART(3.5); + h = H_PART(3); + }; + class VestSlot: SlotPrimary { + x = X_PART(19.1); + y = Y_PART(2.5); + w = W_PART(3); + h = H_PART(3); + }; + class VestLoad: GroundLoad { + x = X_PART(18.85); + y = Y_PART(5.5); + w = W_PART(3.5); + h = H_PART(0.5); + }; + class BackpackTab: UniformTab { + x = X_PART(22.6); + y = Y_PART(2.5); + w = W_PART(3.5); + h = H_PART(3); + }; + class BackpackSlot: SlotPrimary { + x = X_PART(22.85); + y = Y_PART(2.5); + w = W_PART(3); + h = H_PART(3); + }; + class BackpackLoad: GroundLoad { + x = X_PART(22.6); + y = Y_PART(5.5); + w = W_PART(3.5); + h = H_PART(0.5); + }; + class TotalLoad: GroundLoad { + //center: progressbar height decrease + x = X_PART(15.1); + y = Y_PART(22.5); + w = W_PART(23.4); + h = H_PART(0.5); + }; + class ContainerMarker: GroundTab { + x = X_PART(0); + y = Y_PART(24); + w = W_PART(1); + h = H_PART(1); + }; + class GroundMarker: ContainerMarker { + x = X_PART(1.5); + y = Y_PART(24); + w = W_PART(1); + h = H_PART(1); + }; + class SoldierMarker: ContainerMarker { + x = X_PART(3); + y = Y_PART(24); + w = W_PART(1); + h = H_PART(1); + }; + }; +}; diff --git a/addons/inventory/config.cpp b/addons/inventory/config.cpp index e933cc40a4..c7b6649be6 100644 --- a/addons/inventory/config.cpp +++ b/addons/inventory/config.cpp @@ -12,503 +12,16 @@ class CfgPatches { }; }; +#include "RscDisplayInventory.hpp" -class RscText; -class RscPicture; -class RscListBox; -class RscProgress; -class RscStructuredText; -class RscActiveText; -class RscCombo; -class RscControlsGroupNoScrollbars; - -/* -Adjust the scaling of the inventory screen - - changes it from scaling based on user's interface size to a static size - - text size and row height size are uneffected - - also tweaks the height of the two ProgressBars which looked odd scaled up so much -*/ - -class RscDisplayInventory { - class controls { - class CA_ContainerBackground: RscText { - //crate: GroundLoad adjust size - x = "1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "12 * (safeZoneH / 40)"; - h = "22.5 * ((safeZoneH / 1.2) / 25)"; - }; - class CA_PlayerBackground: RscText { - //center player's container: decrease height because of progressbar height decrease - x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "24.4 * (safeZoneH / 40)"; - h = "21.5 * ((safeZoneH / 1.2) / 25)"; - }; - class TitleBackground: RscText { - x = "14.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "24.4 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class PlayersName: RscText { - text = "Player name:"; - x = "15.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "19.8 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class RankBackground: RscText { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "0.6 * (safeZoneH / 40)"; - h = "0.6 * ((safeZoneH / 1.2) / 25)"; - }; - class RankPicture: RscPicture { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.25 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "0.6 * (safeZoneH / 40)"; - h = "0.6 * ((safeZoneH / 1.2) / 25)"; - }; - class ButtonBack: RscActiveText { - x = "38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimary: RscPicture { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondary: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgun: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunOptics: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHeadgear: BackgroundSlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotGoggles: BackgroundSlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotHMD: BackgroundSlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotBinoculars: BackgroundSlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotMap: BackgroundSlotPrimary { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotGPS: BackgroundSlotPrimary { - x = "17.32 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotCompass: BackgroundSlotPrimary { - x = "21.76 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotRadio: BackgroundSlotPrimary { - x = "19.54 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class BackgroundSlotWatch: BackgroundSlotPrimary { - x = "23.98 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.12 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class ExternalContainerBackground: RscPicture { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "18.4 * ((safeZoneH / 1.2) / 25)"; - }; - class PlayerContainerBackground: ExternalContainerBackground { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "14 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundTab: RscActiveText { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "5.5 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class SoldierTab: GroundTab { - x = "7 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "1.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "5.5 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundContainer: RscListBox { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "3.7 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "18.4 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundFilter: RscCombo { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundLoad: RscProgress { - //crate: GroundLoad adjust size - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimary: GroundTab { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryMuzzle: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryGrip: SlotPrimary { - w = 0; - h = 0; - x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - }; - class SlotPrimaryFlashlight: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryOptics: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotPrimaryMagazine: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "9.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondary: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "11.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryMuzzle: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryGrip: SlotPrimary { - w = 0; - h = 0; - x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - }; - class SlotSecondaryFlashlight: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryOptics: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotSecondaryMagazine: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "14.6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgun: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "17 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11.9 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunMuzzle: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunGrip: SlotPrimary { - w = 0; - h = 0; - x = "39 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - }; - class SlotHandgunFlashlight: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunOptics: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHandgunMagazine: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHeadgear: SlotPrimary { - x = "26.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotGoggles: SlotPrimary { - x = "29.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotHMD: SlotPrimary { - x = "32.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotBinoculars: SlotPrimary { - x = "35.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2.9 * (safeZoneH / 40)"; - h = "2.9 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotMap: SlotPrimary { - x = "15.16 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotGPS: SlotPrimary { - x = "17.38 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotCompass: SlotPrimary { - x = "21.82 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotRadio: SlotPrimary { - x = "19.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class SlotWatch: SlotPrimary { - x = "24.04 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "20.1 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "2 * (safeZoneH / 40)"; - h = "2 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformTab: GroundTab { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformSlot: SlotPrimary { - x = "15.35 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformLoad: GroundLoad { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class UniformContainer: GroundContainer { - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "6 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "11 * (safeZoneH / 40)"; - h = "14 * ((safeZoneH / 1.2) / 25)"; - }; - class VestTab: UniformTab { - x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class VestSlot: SlotPrimary { - x = "19.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class VestLoad: GroundLoad { - x = "18.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class BackpackTab: UniformTab { - x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackpackSlot: SlotPrimary { - x = "22.85 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "2.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3 * (safeZoneH / 40)"; - h = "3 * ((safeZoneH / 1.2) / 25)"; - }; - class BackpackLoad: GroundLoad { - x = "22.6 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "5.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "3.5 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class TotalLoad: GroundLoad { - //center: progressbar height decrease - x = "15.1 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "22.5 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "23.4 * (safeZoneH / 40)"; - h = "0.5 * ((safeZoneH / 1.2) / 25)"; - }; - class ContainerMarker: GroundTab { - x = "0 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class GroundMarker: ContainerMarker { - x = "1.5 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; - class SoldierMarker: ContainerMarker { - x = "3 * (safeZoneH / 40) + (safezoneX + (safezoneW - safeZoneH)/2)"; - y = "24 * ((safeZoneH / 1.2) / 25) + (safezoneY + (safezoneH - (safeZoneH / 1.2))/2)"; - w = "1 * (safeZoneH / 40)"; - h = "1 * ((safeZoneH / 1.2) / 25)"; - }; +class ACE_Settings { + class GVAR(inventoryDisplaySize) { + value = 0; + typeName = "SCALAR"; + isClientSetable = 1; + displayName = "$STR_ACE_Inventory_SettingName"; + description = "$STR_ACE_Inventory_SettingDescription"; + values[] = {"Normal (Default Size)", "Medium", "Bigger"}; }; }; + diff --git a/addons/inventory/stringtable.xml b/addons/inventory/stringtable.xml new file mode 100644 index 0000000000..9ca01373d1 --- /dev/null +++ b/addons/inventory/stringtable.xml @@ -0,0 +1,12 @@ + + + + + + Make Inventory Display Bigger + + + Normally inventory display is scaled by UI size. This allows scaling the Inventory UI size up, but doesn't increase font size allowing more rows displayed. + + + \ No newline at end of file diff --git a/addons/laserpointer/config.cpp b/addons/laserpointer/config.cpp index 32357b31ef..b97587dac6 100644 --- a/addons/laserpointer/config.cpp +++ b/addons/laserpointer/config.cpp @@ -3,7 +3,7 @@ class CfgPatches { class ADDON { units[] = {}; - weapons[] = {"AGM_acc_pointer_red","AGM_acc_pointer_green"}; + weapons[] = {"ACE_acc_pointer_red","ACE_acc_pointer_green"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"commy2"}; diff --git a/addons/logistics_wirecutter/CfgEventHandlers.hpp b/addons/logistics_wirecutter/CfgEventHandlers.hpp index f0a9f14d91..79c3aaa959 100644 --- a/addons/logistics_wirecutter/CfgEventHandlers.hpp +++ b/addons/logistics_wirecutter/CfgEventHandlers.hpp @@ -4,3 +4,8 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_clientInit) ); + }; +}; diff --git a/addons/logistics_wirecutter/CfgVehicles.hpp b/addons/logistics_wirecutter/CfgVehicles.hpp deleted file mode 100644 index 8a16d1b828..0000000000 --- a/addons/logistics_wirecutter/CfgVehicles.hpp +++ /dev/null @@ -1,19 +0,0 @@ -class CfgVehicles { - class Man; - class CAManBase: Man { - class ACE_SelfActions { - class ACE_Equipment { - class GVAR(CutFence) { - displayName = "$STR_ACE_logistics_wirecutter_CutFence"; - condition = QUOTE([_player] call FUNC(canCutFence)); - statement = QUOTE([_player] call FUNC(cutDownFence)); - exceptions[] = {}; - showDisabled = 1; - priority = 0; - icon = PATHTOF(UI\wirecutter_ca.paa); - hotkey = "C"; - }; - }; - }; - }; -}; \ No newline at end of file diff --git a/addons/logistics_wirecutter/XEH_clientInit.sqf b/addons/logistics_wirecutter/XEH_clientInit.sqf new file mode 100644 index 0000000000..c46cab29f1 --- /dev/null +++ b/addons/logistics_wirecutter/XEH_clientInit.sqf @@ -0,0 +1,5 @@ +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +["interactMenuOpened", {_this call FUNC(interactEH)}] call EFUNC(common,addEventHandler); diff --git a/addons/logistics_wirecutter/XEH_preInit.sqf b/addons/logistics_wirecutter/XEH_preInit.sqf index 7588a109e6..44eb941c16 100644 --- a/addons/logistics_wirecutter/XEH_preInit.sqf +++ b/addons/logistics_wirecutter/XEH_preInit.sqf @@ -2,11 +2,11 @@ ADDON = false; -PREP(canCutFence); PREP(cutDownFence); PREP(cutDownFenceAbort); PREP(cutDownFenceCallback); PREP(getNearestFence); +PREP(interactEH); PREP(isFence); ADDON = true; diff --git a/addons/logistics_wirecutter/config.cpp b/addons/logistics_wirecutter/config.cpp index 7f292132fa..27d4467ccf 100644 --- a/addons/logistics_wirecutter/config.cpp +++ b/addons/logistics_wirecutter/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_interaction"}; + requiredAddons[] = {"ace_interact_menu"}; author[] = {"gpgpgpgp", "PabstMirror"}; authorUrl = ""; VERSION_CONFIG; @@ -13,6 +13,5 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "CfgVehicles.hpp" #include "CfgSounds.hpp" #include "CfgWeapons.hpp" diff --git a/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf b/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf deleted file mode 100644 index f57a970d58..0000000000 --- a/addons/logistics_wirecutter/functions/fnc_canCutFence.sqf +++ /dev/null @@ -1,18 +0,0 @@ -/* fnc_canCutFence.sqf -* -* Author: PabstMirror -* -* Condition check if player is able to cut a fence. -* Checks for "ACE_wirecutter" item and if there is a nearby fence. -* -* Argument: -* 0: OBJECT - Unit to check condition for (player) -* -* Return value: -* BOOL -*/ - -#include "script_component.hpp" -PARAMS_1(_unit); - -("ACE_wirecutter" in (items _unit)) && {!(isNull ([_unit] call FUNC(getNearestFence)))} diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf index 0a42d5d56b..ee4c512cd2 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFence.sqf @@ -1,20 +1,31 @@ -// by gpgpgpgp, edited by commy2 +/* + * Author: gpgpgpgp, edited by commy2, PabstMirror + * Starts cutting down a fence + * + * Arguments: + * 0: Unit + * 1: Fence + * + * Return Value: + * Nothing + * + * Example: + * [player, berlinWall] call ace_logistics_wirecutter_fnc_cutDownFence + * + * Public: No + */ #include "script_component.hpp" -PARAMS_1(_unit); +private ["_timeToCut"]; + +PARAMS_2(_unit,_fenceObject); if (_unit != ACE_player) exitWith {}; -_fenceObject = [ACE_player] call FUNC(getNearestFence); -if (isNull _fenceObject) exitWith {}; - -_timeToCut = 5; -if !([ACE_player] call EFUNC(common,isEngineer)) then { - _timeToCut = _timeToCut + 5; -}; +_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {5} else {10}; [ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation); -if (_timeToCut > 4.5) then { +if (_timeToCut > 5) then { playSound "ACE_wirecutter_sound_long"; } else { playSound "ACE_wirecutter_sound"; diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf index d17038af7c..20cb092131 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceAbort.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Stops cutting down fence (reset animation) + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Example: + * [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort + * + * Public: No + */ #include "script_component.hpp" [ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf index 57c0289461..77bc4f2ba6 100644 --- a/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf +++ b/addons/logistics_wirecutter/functions/fnc_cutDownFenceCallback.sqf @@ -1,7 +1,22 @@ +/* + * Author: PabstMirror + * Once progressbar is done: Fence is cutdown + * + * Arguments: + * 0: Fence Object + * + * Return Value: + * Nothing + * + * Example: + * [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback + * + * Public: No + */ #include "script_component.hpp" PARAMS_1(_fenceObject); _fenceObject setdamage 1; -[localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured); +// [localize "STR_ACE_logistics_wirecutter_FenceCut"] call EFUNC(common,displayTextStructured); [ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation); diff --git a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf index 5004315fcd..c9e59b41a0 100644 --- a/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_getNearestFence.sqf @@ -1,15 +1,18 @@ -/* fnc_getNearestFence.sqf -* -* Author: PabstMirror -* -* Gets nearest fence within 5 meters to the unit. -* -* Argument: -* 0: OBJECT - Unit to search for fence objects arround -* -* Return value: -* OBJECT - Nearest object that is a fence, objNull if none found. -*/ +/* + * Author: PabstMirror + * Gets nearest fence object (not actully used, left for utility) + * + * Arguments: + * 0: Unit + * + * Return Value: + * The return value + * + * Example: + * [player] call ace_logistics_wirecutter_fnc_getNearestFence + * + * Public: Yes + */ #include "script_component.hpp" private "_nearestFence"; @@ -20,6 +23,6 @@ _nearestFence = objNull; if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then { _nearestFence = _x; }; -} forEach nearestObjects [_unit, [], 5]; +} forEach nearestObjects [_unit, [], 15]; _nearestFence diff --git a/addons/logistics_wirecutter/functions/fnc_interactEH.sqf b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf new file mode 100644 index 0000000000..c81fc46c40 --- /dev/null +++ b/addons/logistics_wirecutter/functions/fnc_interactEH.sqf @@ -0,0 +1,64 @@ +/* + * Author: PabstMirror + * When interact_menu starts rendering (from "interact_keyDown" event) + * + * Arguments: + * Interact Menu Type (0 - world, 1 - self) + * + * Return Value: + * Nothing + * + * Example: + * [0] call ace_logistics_wirecutter_fnc_interactEH + * + * Public: Yes + */ +#include "script_component.hpp" + +PARAMS_1(_interactionType); + +if (_interactionType != 0) exitWith {}; + +//for performance only do stuff it they have a wirecutter item +//(if they somehow get one durring keydown they'll just have to reopen) +if (!("ACE_wirecutter" in (items ace_player))) exitWith {}; + +[{ + private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper"]; + PARAMS_2(_args,_pfID); + EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped); + + if (!EGVAR(interact_menu,keyDown)) then { + {deleteVehicle _x;} forEach _addedHelpers; + [_pfID] call CBA_fnc_removePerFrameHandler; + } else { + //If play moved >5 meters from last pos, then rescan + if (((getPosASL ace_player) distance _setPosition) > 5) then { + + _fncStatement = { + _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; + [ace_player, _attachedFence] call FUNC(cutDownFence); + }; + _fncCondition = { + _attachedFence = _target getVariable [QGVAR(attachedFence), objNull]; + ((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items ace_player))}) + }; + + { + if (!(_x in _fencesHelped)) then { + if ([_x] call FUNC(isFence)) then { + _fencesHelped pushBack _x; + _helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x); + [_helper, 0, [""], (localize "STR_ACE_logistics_wirecutter_CutFence"), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), [0,0,0], _fncStatement, _fncCondition, 5] call EFUNC(interact_menu,addAction); + _helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]); + _helper hideObject true; + _helper setVariable [QGVAR(attachedFence), _x]; + _addedHelpers pushBack _helper; + }; + }; + } forEach nearestObjects [ace_player, [], 15]; + + _args set [0, (getPosASL ace_player)]; + }; + }; +}, 0.1, [((getPosASL ace_player) vectorAdd [-100,0,0]), [], []]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/logistics_wirecutter/functions/fnc_isFence.sqf b/addons/logistics_wirecutter/functions/fnc_isFence.sqf index 2c00cec92b..aee9a22ef9 100644 --- a/addons/logistics_wirecutter/functions/fnc_isFence.sqf +++ b/addons/logistics_wirecutter/functions/fnc_isFence.sqf @@ -1,16 +1,19 @@ -/* fnc_isFence.sqf -* -* Author: PabstMirror -* -* Checks if object is a fence. Should work on any fence type, even (typeof == ""). -* Call is fairly expensive because of all of the string checking. -* -* Argument: -* 0: OBJECT - Ojbect to test -* -* Return value: -* BOOL -*/ +/* + * Author: PabstMirror + * Checks if object is a fence. Should work on any fence type, even (typeof == ""). + * Call is fairly expensive because of all of the string checking. + * + * Arguments: + * 0: An Object To Test + * + * Return Value: + * Is it a fence + * + * Example: + * [aFence] call ace_logistics_wirecutter_fnc_isFence + * + * Public: No + */ #include "script_component.hpp" //find is case sensitive, so keep everything lowercase @@ -27,14 +30,14 @@ _typeOf = toLower (typeOf _object); _returnValue = false; if (_typeOf != "") then { - _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES); + _returnValue = _typeOf in (FENCE_A3_TYPENAMES + FENCE_AIA_TYPENAMES); } else { - _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" - { - if ((_typeOf find _x) != -1) then { - _returnValue = true; - }; - } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS); + _typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d" + { + if ((_typeOf find _x) != -1) then { + _returnValue = true; + }; + } forEach (FENCE_A3_P3DS + FENCE_AIA_P3DS); }; _returnValue diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 33f1037905..8425c4ad1e 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -1,4 +1,5 @@ #include "\x\cba\addons\main\script_macros_common.hpp" +#include "\x\cba\addons\xeh\script_xeh.hpp" // Default versioning level #define DEFAULT_VERSIONING_LEVEL 2 diff --git a/addons/map/CfgEventHandlers.hpp b/addons/map/CfgEventHandlers.hpp index 23d60e02da..49b87fb4fd 100644 --- a/addons/map/CfgEventHandlers.hpp +++ b/addons/map/CfgEventHandlers.hpp @@ -1,12 +1,11 @@ class Extended_PreInit_EventHandlers { - class ADDON { - init = QUOTE( call COMPILE_FILE(XEH_preInit) ); - serverInit = QUOTE( call COMPILE_FILE(XEH_preInitServer) ); - }; + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit) ); + }; }; class Extended_PostInit_EventHandlers { - class ADDON { - clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); - }; + class ADDON { + clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) ); + }; }; diff --git a/addons/map/CfgMarkers.hpp b/addons/map/CfgMarkers.hpp index d6281a4a6e..0a04e4a691 100644 --- a/addons/map/CfgMarkers.hpp +++ b/addons/map/CfgMarkers.hpp @@ -1,67 +1,42 @@ // MARKERS class CfgMarkers { - class Flag; + class Flag; - // Reenable NATO symbols ... - class b_unknown: Flag {scope = 2;}; + // Reenable NATO symbols ... + class b_unknown: Flag {scope = 2;}; - // ... and disable all the useless ones - // If you think that some of these are needed, create an issue; But until - // there's a better way to place markers, there should be only the most - // important markers here. - // Keep in mind that all of these can still be placed in the editor. - class b_hq: b_unknown {scope = 1;}; - class b_installation: b_unknown {scope = 1;}; - class b_maint: b_unknown {scope = 1;}; - class b_med: b_unknown {scope = 1;}; - class b_service: b_unknown {scope = 1;}; - class b_support: b_unknown {scope = 1;}; + // ... and disable all the useless ones + // If you think that some of these are needed, create an issue; But until + // there's a better way to place markers, there should be only the most + // important markers here. + // Keep in mind that all of these can still be placed in the editor. + class b_hq: b_unknown {scope = 1;}; + class b_installation: b_unknown {scope = 1;}; + class b_maint: b_unknown {scope = 1;}; + class b_med: b_unknown {scope = 1;}; + class b_service: b_unknown {scope = 1;}; + class b_support: b_unknown {scope = 1;}; - class n_unknown: b_unknown {}; - class n_hq: n_unknown {scope = 1;}; - class n_installation: n_unknown {scope = 1;}; - class u_installation: n_unknown {scope = 1;}; // i have no idea... - class n_maint: n_unknown {scope = 1;}; - class n_med: n_unknown {scope = 1;}; - class n_service: n_unknown {scope = 1;}; - class n_support: n_unknown {scope = 1;}; + class n_unknown: b_unknown {}; + class n_hq: n_unknown {scope = 1;}; + class n_installation: n_unknown {scope = 1;}; + class u_installation: n_unknown {scope = 1;}; // i have no idea... + class n_maint: n_unknown {scope = 1;}; + class n_med: n_unknown {scope = 1;}; + class n_service: n_unknown {scope = 1;}; + class n_support: n_unknown {scope = 1;}; - class o_unknown: b_unknown {}; - class o_hq: o_unknown {scope = 1;}; - class o_installation: o_unknown {scope = 1;}; - class o_maint: o_unknown {scope = 1;}; - class o_med: o_unknown {scope = 1;}; - class o_service: o_unknown {scope = 1;}; - class o_support: o_unknown {scope = 1;}; + class o_unknown: b_unknown {}; + class o_hq: o_unknown {scope = 1;}; + class o_installation: o_unknown {scope = 1;}; + class o_maint: o_unknown {scope = 1;}; + class o_med: o_unknown {scope = 1;}; + class o_service: o_unknown {scope = 1;}; + class o_support: o_unknown {scope = 1;}; - // disable all civy markers (harbor etc.) - class c_unknown: b_unknown {scope = 1;}; + // disable all civy markers (harbor etc.) + class c_unknown: b_unknown {scope = 1;}; - // disable quantity indicators (fire team/squad/platoon ...) - class group_0: b_unknown {scope = 1;}; - - - class ACE_MapToolFixed { - name = "MapToolFixed"; - icon = PATHTOF(data\mapToolFixed.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class ACE_MapToolRotatingNormal { - name = "MapToolRotating"; - icon = PATHTOF(data\mapToolRotatingNormal.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; - - class ACE_MapToolRotatingSmall { - name = "MapToolRotating"; - icon = PATHTOF(data\mapToolRotatingSmall.paa); - scope = 0; - color[] = {1,1,1,1}; - size = 32; - }; + // disable quantity indicators (fire team/squad/platoon ...) + class group_0: b_unknown {scope = 1;}; }; diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index ffdfc0029b..7960fe67ee 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -1,155 +1,67 @@ class CfgVehicles { - class Man; - class CAManBase: Man { - class ACE_SelfActions { - - class ACE_MapTools { - displayName = "$STR_ACE_Map_MapTools_Menu"; - condition = QUOTE((call FUNC(canUseMapTools) || {call FUNC(canUseMapGPS)})); - statement = ""; - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 0; - priority = 100; - enableInside = 1; - - class ACE_MapToolsHide { - displayName = "$STR_ACE_Map_MapToolsHide"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 5; - enableInside = 1; + class Module_F; + class ACE_ModuleMap: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Map"; + function = QFUNC(moduleMap); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconMap_ca.paa); + class Arguments { + class MapIllumination { + displayName = "Map illumination?"; + description = "Calculate dynamic map illumination based on light conditions?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; default = 1; }; + class No { name = "No"; value = 0; }; + }; + }; + class MapShake { + displayName = "Map shake?"; + description = "Make map shake when walking?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; default = 1;}; + class No { name = "No"; value = 0; }; + }; + }; + class MapLimitZoom { + displayName = "Limit map zoom?"; + description = "Limit the amount of zoom available for the map?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; }; + class No { name = "No"; value = 0; default = 1;}; + }; + }; }; - class ACE_MapToolsShowNormal { - displayName = "$STR_ACE_Map_MapToolsShowNormal"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); - statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 4; - enableInside = 1; - }; - class ACE_MapToolsShowSmall { - displayName = "$STR_ACE_Map_MapToolsShowSmall"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); - statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 3; - enableInside = 1; - }; - class ACE_MapToolsAlignNorth { - displayName = "$STR_ACE_Map_MapToolsAlignNorth"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); - statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 2; - enableInside = 1; - }; - class ACE_MapToolsAlignCompass { - displayName = "$STR_ACE_Map_MapToolsAlignCompass"; - condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); - statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 1; - priority = 1; - enableInside = 1; - }; - class ACE_MapGpsShow { - displayName = "$STR_ACE_Map_MapGpsShow"; - condition = QUOTE((call FUNC(canUseMapGPS) && {!GVAR(mapGpsShow)})); - statement = QUOTE(GVAR(mapGpsShow) = true; [GVAR(mapGpsShow)] call FUNC(openMapGps)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 0; - priority = 0; - enableInside = 1; - }; - class ACE_MapGpsHide { - displayName = "$STR_ACE_Map_MapGpsHide"; - condition = QUOTE((call FUNC(canUseMapGPS) && {GVAR(mapGpsShow)})); - statement = QUOTE(GVAR(mapGpsShow) = false; [GVAR(mapGpsShow)] call FUNC(openMapGps)); - exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; - showDisabled = 0; - priority = 0; - enableInside = 1; - }; - }; }; - class ACE_Actions { - class ACE_MainActions { - class ACE_CopyMap { - displayName = "$STR_ACE_Map_CopyMap"; - condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); - statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); - showDisabled = 0; - priority = -1; + class ACE_ModuleBlueForceTracking: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Blue Force Tracking"; + function = QFUNC(blueForceTrackingModule); + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\IconBFTracking_ca.paa); + class Arguments { + class Interval { + displayName = "Interval"; + description = "How often the markers should be refreshed (in seconds)"; + defaultValue = 1; + }; + class HideAiGroups { + displayName = "Hide AI groups?"; + description = "Hide markers for 'AI only' groups?"; + typeName = "BOOL"; + class values { + class Yes { name = "Yes"; value = 1; }; + class No { name = "No"; value = 0; default = 1; }; + }; + }; }; - }; }; - }; - - class NATO_Box_Base; - class EAST_Box_Base; - class IND_Box_Base; - class FIA_Box_Base_F; - - class Box_NATO_Support_F: NATO_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12); - }; - }; - - class Box_East_Support_F: EAST_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12); - }; - }; - - class Box_IND_Support_F: IND_Box_Base { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12); - }; - }; - - class Box_FIA_Support_F: FIA_Box_Base_F { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12); - }; - }; - - class ACE_Box_Misc: Box_NATO_Support_F { - class TransportItems { - MACRO_ADDITEM(ACE_MapTools,12); - }; - }; - - class Module_F; - class ACE_ModuleBlueForceTracking: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Blue Force Tracking"; - function = QFUNC(blueForceTrackingModule); - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\IconBFTracking_ca.paa); - class Arguments { - class Interval { - displayName = "Interval"; - description = "How often the markers should be refreshed (in seconds)"; - defaultValue = 1; - }; - class HideAiGroups { - displayName = "Hide AI groups?"; - description = "Hide markers for 'AI only' groups?"; - typeName = "BOOL"; - class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1; }; - }; - }; - }; - }; }; diff --git a/addons/map/CfgWeapons.hpp b/addons/map/CfgWeapons.hpp deleted file mode 100644 index fa6d0897c5..0000000000 --- a/addons/map/CfgWeapons.hpp +++ /dev/null @@ -1,15 +0,0 @@ -class CfgWeapons { - class ACE_ItemCore; - class InventoryItem_Base_F; - - class ACE_MapTools: ACE_ItemCore { - displayName = "$STR_ACE_MapTools_Name"; - descriptionShort = "$STR_ACE_MapTools_Description"; - model = "\A3\weapons_F\ammo\mag_univ.p3d"; - picture = PATHTOF(UI\maptool_item.paa); - scope = 2; - class ItemInfo: InventoryItem_Base_F { - mass = 1; - }; - }; -}; diff --git a/addons/map/MapControls.hpp b/addons/map/MapControls.hpp index 3255cb7929..62256e2df4 100644 --- a/addons/map/MapControls.hpp +++ b/addons/map/MapControls.hpp @@ -1,93 +1,9 @@ class controls { - class ButtonPlayer: RscActiveText { - text = ""; - w = 0; - h = 0; - sizeEx = 0; - onButtonClick = ""; - }; - class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ColorBlack: RscButton { - idc = 36732; - x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.2,0.2,1}; - colorBackgroundActive[] = {0,0,0,1}; - colorFocused[] = {0,0,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorBlack""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),"ColorBlack")]); - }; - class ColorRed: RscButton { - idc = 36733; - x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.2,0.2,1}; - colorBackgroundActive[] = {1,0,0,1}; - colorFocused[] = {1,0,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorRed""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),QUOTE(ColorRed))]); - }; - class ColorGreen: RscButton { - idc = 36734; - x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.8,0.2,1}; - colorBackgroundActive[] = {0,1,0,1}; - colorFocused[] = {0,1,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorGreen""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor),"ColorGreen")]); - }; - class ColorBlue: RscButton { - idc = 36735; - x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.2,0.2,0.8,1}; - colorBackgroundActive[] = {0,0,1,1}; - colorFocused[] = {0,0,1,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorBlue""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorBlue")]); - }; - class ColorYellow: RscButton { - idc = 36736; - x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.8,0.2,1}; - colorBackgroundActive[] = {1,1,0,1}; - colorFocused[] = {1,1,0,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorYellow""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorYellow")]); - }; - class ColorWhite: RscButton { - idc = 36737; - x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; - y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; - h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; - colorBackground[] = {0.8,0.8,0.8,1}; - colorBackgroundActive[] = {1,1,1,1}; - colorFocused[] = {1,1,1,1}; - onButtonClick = "missionNamespace setVariable [""ACE_Map_drawing_drawColor"", ""ColorWhite""]"; - // onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QGVAR(drawing_drawColor), "ColorWhite")]); - }; + class ButtonPlayer: RscActiveText { + text = ""; + w = 0; + h = 0; + sizeEx = 0; + onButtonClick = ""; + }; }; diff --git a/addons/map/MapGpsUI.hpp b/addons/map/MapGpsUI.hpp deleted file mode 100644 index e21b8db0a1..0000000000 --- a/addons/map/MapGpsUI.hpp +++ /dev/null @@ -1,81 +0,0 @@ -#define GUI_GRID_X (0) -#define GUI_GRID_Y (0) -#define GUI_GRID_W (0.025) -#define GUI_GRID_H (0.04) - -#define ST_LEFT 0x00 -#define ST_RIGHT 0x01 -#define ST_CENTER 0x02 - -#define W_gps 0.4025 -#define H_gps 0.25 -#define X_gps safeZoneX + safeZoneW - 1.1 * W_gps -#define Y_gps safeZoneY + safeZoneH - 1.2 * H_gps - -class RscTitles { - class RscACE_MapGps { - idd = 9855; - movingEnable = 1; - duration = 3600; - fadein = 0; - fadeout = 0; - // onLoad = QUOTE(uiNamespace setVariable [ARR_2(QGVAR(ui_mapGpsDisplay), _this select 0)];); - onLoad = "uiNamespace setVariable ['ACE_map_ui_mapGpsDisplay', _this select 0];"; //@todo cbaify this - //onUnLoad = "_this call onRscLoad"; - class controls { - class back:RscPicture { - x = X_gps; - y = Y_gps; - w = W_gps; - h = H_gps; - text = PATHTOF(UI\mapGps.paa); - colorBackground[] = {1, 1, 1, 1}; - }; - class heading: RscText{ - idc = 913590; - x = X_gps + W_gps * 0.25; - y = Y_gps + H_gps * 0.12; - w = W_gps * 0.2; - h = H_gps * 0.16; - style = ST_LEFT; - text = "225"; - colorBackground[] = {0,0,0,0}; - colorText[] = {0.247,0.251,0.157,1}; - shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; - shadow = 0; - sizeEx = 0.042; - }; - class altitude: RscText{ - idc = 913591; - x = X_gps + W_gps * 0.55; - y = Y_gps + H_gps * 0.12; - w = W_gps * 0.2; - h = H_gps * 0.16; - style = ST_RIGHT; - text = "55 m"; - colorBackground[] = {0,0,0,0}; - colorText[] = {0.247,0.251,0.157,1}; - shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; - shadow = 0; - sizeEx = 0.042; - }; - class coordinates: RscText{ - idc = 913592; - x = X_gps + W_gps * 0.2; - y = Y_gps + H_gps * 0.33; - w = W_gps * 0.6; - h = H_gps * 0.35; - style = ST_CENTER; - text = "012.3 115.1"; - colorBackground[] = {0,0,0,0}; - colorText[] = {0.247,0.251,0.157,1}; - shadowColo[] = {0,0,0,0}; - font = "EtelkaNarrowMediumPro"; - shadow = 0; - sizeEx = 0.1; - }; - }; - }; -}; diff --git a/addons/map/MapTweaks.hpp b/addons/map/MapTweaks.hpp new file mode 100644 index 0000000000..2cf5786059 --- /dev/null +++ b/addons/map/MapTweaks.hpp @@ -0,0 +1,38 @@ +// Hide Bushes +class Bush { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 14; + importance = "0.2 * 14 * 0.05"; + coefMin = 0.250000; + coefMax = 4; +}; + +// Hide Trees +class SmallTree { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 12; + importance = "0.6 * 12 * 0.05"; + coefMin = 0.250000; + coefMax = 4; +}; +class Tree { + icon = ""; + color[] = {0.450000, 0.640000, 0.330000, 0.0}; + size = 12; + importance = "0.9 * 16 * 0.05"; + coefMin = 0.250000; + coefMax = 4; +}; + +class Legend { + x = SafeZoneX+SafeZoneW-.340; + y = SafeZoneY+SafeZoneH-.152; + font = "PuristaMedium"; + w = .340; + h = .152; + sizeEx = 0.039210; + colorBackground[] = {0.906000, 0.901000, 0.880000, 0.5}; + color[] = {0, 0, 0, 0.75}; +}; diff --git a/addons/map/README.md b/addons/map/README.md index e51efe71d5..6544d0f236 100644 --- a/addons/map/README.md +++ b/addons/map/README.md @@ -1,7 +1,12 @@ ace_map ======= -Various tweaks to the in-game map. +Various tweaks to the in-game map. Including: +- Better map styling (countours, legend, hiding bushes and trees, etc). +- Max zoom level (optional) +- Map shaking while walking (optional) +- Map illumination (optional) +- Blufor tracker (optional) ## Maintainers diff --git a/addons/map/UI/IconMap_ca.paa b/addons/map/UI/IconMap_ca.paa new file mode 100644 index 0000000000..128f08f6f0 Binary files /dev/null and b/addons/map/UI/IconMap_ca.paa differ diff --git a/addons/map/XEH_postInitClient.sqf b/addons/map/XEH_postInitClient.sqf index 24b906e61c..ccaf9041ab 100644 --- a/addons/map/XEH_postInitClient.sqf +++ b/addons/map/XEH_postInitClient.sqf @@ -1,71 +1,22 @@ -// by CAA-Picard - #include "script_component.hpp" -if (!hasInterface) exitWith{}; +ADDON = false; +LOG(MSG_INIT); -// Init variables -GVAR(mapVisableLastFrame) = false; -GVAR(mapGpsShow) = true; +// Calculate the maximum zoom allowed for this map +call FUNC(determineZoom); -GVAR(mapTool_Shown) = 0; -GVAR(mapTool_pos) = [0,0]; -GVAR(mapTool_angle) = 0; -GVAR(mapTool_isDragging) = false; -GVAR(mapTool_isRotating) = false; - -GVAR(drawing_isDrawing) = false; -GVAR(drawing_tempLineMarker) = []; -GVAR(drawing_lineMarkers) = []; -GVAR(drawing_drawColor) = "ColorBlack"; -GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; - -//Probably need this spawn, because CBA_fnc_addPerFrameHandler doesn't work durring breifing. +// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. +// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. [] spawn { - _fnc_installMapEvents = { - _d = _this; - diag_log format ["Installing EH in display %1", _d]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; - ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; - (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; - }; + // Wait until the map display is detected + waitUntil {(!isNull findDisplay 12)}; - // Wait until the briefing map is detected - // display = 37 for SP - // display = 52 for host server on MP; - // display = 53 for MP clients) - waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; + GVAR(lastStillPosition) = ((findDisplay 12) displayCtrl 51) ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillTime) = time; + GVAR(isShaking) = false; - if (isNull findDisplay 12) then { - // Install event handlers on the map control of the briefing screen (control = 51) - GVAR(drawing_syncMarkers) = true; - if (!isNull findDisplay 52) then { - 52 call _fnc_installMapEvents; - } else { - if (!isNull findDisplay 53) then { - 53 call _fnc_installMapEvents; - } else { - 37 call _fnc_installMapEvents; - }; - }; - } else { - // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing - GVAR(drawing_syncMarkers) = false; - { - _x call FUNC(addLineMarker); - } forEach GVAR(drawing_serverLineMarkers); - }; - - // Wait until the main map display is detected (display = 12) - waitUntil { !isNull findDisplay 12 }; - // Install event handlers on the map control and display (control = 51) - GVAR(drawing_syncMarkers) = false; - 12 call _fnc_installMapEvents; - - // Update the size and rotation of map tools - [] call FUNC(updateMapToolMarkers); - - [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; + ((findDisplay 12) displayCtrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapEffects);}]; }; + +ADDON = true; diff --git a/addons/map/XEH_preInit.sqf b/addons/map/XEH_preInit.sqf index 1ab43c7ca8..7899c6a637 100644 --- a/addons/map/XEH_preInit.sqf +++ b/addons/map/XEH_preInit.sqf @@ -1,35 +1,13 @@ #include "script_component.hpp" ADDON = false; +LOG(MSG_INIT); -PREP(addLineMarker); PREP(blueForceTrackingModule); PREP(blueForceTrackingUpdate); -PREP(calculateMapScale); -PREP(cancelDrawing); -PREP(canDraw); -PREP(canUseMapTools); -PREP(canUseMapGPS); -PREP(copyMapReceiveMarkers); -PREP(copyMapRemoteSend); -PREP(copyMapStart); -PREP(handleKeyDown); -PREP(handleMouseButton); -PREP(handleMouseMove); -PREP(handleMouseZChanged); -PREP(isInsideMapTool); -PREP(mapStateUpdater); -PREP(openMapGps); -PREP(openMapGpsUpdate); -PREP(removeLineMarker); -PREP(updateMapToolMarkers); -PREP(updateLineMarker); - -//Add Event Handlers: -["drawing_removeLineMarker", FUNC(removeLineMarker) ] call EFUNC(common,addEventHandler); -["drawing_addLineMarker", FUNC(addLineMarker) ] call EFUNC(common,addEventHandler); - -["drawing_requestMarkers", FUNC(copyMapRemoteSend) ] call EFUNC(common,addEventHandler); -["drawing_sendbackMarkers", FUNC(copyMapReceiveMarkers) ] call EFUNC(common,addEventHandler); +PREP(determineMapLight); +PREP(determineZoom); +PREP(moduleMap); +PREP(updateMapEffects); ADDON = true; diff --git a/addons/map/XEH_preInitServer.sqf b/addons/map/XEH_preInitServer.sqf deleted file mode 100644 index 1614e9a340..0000000000 --- a/addons/map/XEH_preInitServer.sqf +++ /dev/null @@ -1,6 +0,0 @@ -// by CAA-Picard - -#include "script_component.hpp" - -GVAR(drawing_serverLineMarkers) = []; -publicVariable QGVAR(drawing_serverLineMarkers); diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 36a6f85168..c779caa9b2 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -1,15 +1,15 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {"ACE_MapTools"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common", "ace_interaction"}; - author[] = {"KoffeinFlummi","CAA-Picard"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; + author[] = {"KoffeinFlummi","Rocko","CAA-Picard"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; }; class RscControlsGroup; @@ -28,10 +28,6 @@ class ACE_Settings { value = 1.0; typeName = "SCALAR"; }; - class GVAR(EveryoneCanDrawOnBriefing) { - value = 1; - typeName = "BOOL"; - }; class GVAR(BFT_Enabled) { value = 0; typeName = "BOOL"; @@ -40,116 +36,154 @@ class ACE_Settings { value = 0; typeName = "BOOL"; }; + class GVAR(mapIllumination) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapShake) { + value = 1; + typeName = "BOOL"; + }; + class GVAR(mapLimitZoom) { + value = 0; + typeName = "BOOL"; + }; }; -#include "MapGpsUI.hpp" #include "CfgEventHandlers.hpp" #include "CfgMarkers.hpp" #include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" - class RscMapControl { - sizeExGrid = 0.032; + maxSatelliteAlpha = 0.5; + + // From Arma 2 + colorTracks[] = {1.0,0.0,0.0,1}; + colorTracksFill[] = {1.0,1.0,0.0,1}; + colorRoads[] = {0.0,0.0,0.0,1}; + colorRoadsFill[] = {1,1,0,1}; + colorMainRoads[] = {0.0,0.0,0.0,1}; + colorMainRoadsFill[] = {1,0.6,0.4,1}; + colorRailWay[] = {0.8,0.2,0,1}; + + // From ACE2 + colorBackground[] = {0.929412, 0.929412, 0.929412, 1.0}; + colorOutside[] = {0.929412, 0.929412, 0.929412, 1.0}; + colorCountlines[] = {0.647059, 0.533333, 0.286275, 1}; + colorMainCountlines[] = {0.858824, 0, 0,1}; + colorForest[] = {0.6, 0.8, 0.2, 0.25}; + colorLevels[] = {0.0, 0.0, 0.0, 1.0}; + colorRocks[] = {0.50, 0.50, 0.50, 0.50}; + + sizeExLevel = 0.03; + showCountourInterval = 1; // refs #13673 + + sizeExGrid = 0.032; }; // REGULAR MAP class RscDisplayMainMap { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // Tweak map styling + class controlsBackground { + class CA_Map : RscMapControl { + #include "MapTweaks.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; // DIARY class RscDisplayDiary { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - class controls { - class ButtonPlayer: RscActiveText { - text = ""; - w = 0; - h = 0; - sizeEx = 0; - onButtonClick = ""; + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + class controls { + class ButtonPlayer: RscActiveText { + text = ""; + w = 0; + h = 0; + sizeEx = 0; + onButtonClick = ""; + }; + class CA_PlayerName: RscText { + x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfilePicture: RscPicture { + x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfileBackground: RscText { + x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class Separator1: RscPicture { + x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + }; }; - class CA_PlayerName: RscText { - x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfilePicture: RscPicture { - x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class ProfileBackground: RscText { - x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - class Separator1: RscPicture { - x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; - }; - }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; // BRIEFING SCREEN class RscDisplayGetReady: RscDisplayMainMap { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; class RscDisplayClientGetReady: RscDisplayGetReady { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; class RscDisplayServerGetReady: RscDisplayGetReady { - // get rid of the "center to player position" - button (as it works even on elite) - class controls { - class TopRight: RscControlsGroup { - #include "MapControls.hpp" + // get rid of the "center to player position" - button (as it works even on elite) + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; }; - }; - // scale up the compass - class objects { - class Compass: RscObject { - scale = 0.7; - zoomDuration = 0; + // scale up the compass + class objects { + class Compass: RscObject { + scale = 0.7; + zoomDuration = 0; + }; }; - }; }; diff --git a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf index b2619155c2..030daeaa36 100644 --- a/addons/map/functions/fnc_blueForceTrackingUpdate.sqf +++ b/addons/map/functions/fnc_blueForceTrackingUpdate.sqf @@ -2,37 +2,37 @@ // Delete last set of markers (always) { - deleteMarkerLocal _x; + deleteMarkerLocal _x; } forEach GVAR(BFT_markers); if (GVAR(BFT_Enabled) and {(!isNil "ACE_player") and {alive ACE_player}}) then { - _groupsToDrawMarkers = []; - _playerSide = call EFUNC(common,playerSide); + _groupsToDrawMarkers = []; + _playerSide = call EFUNC(common,playerSide); - if (GVAR(BFT_HideAiGroups)) then { - _groupsToDrawMarkers = [allGroups, {side _this == _playerSide}] call EFUNC(common,filter); - } else { - _groupsToDrawMarkers = [allGroups, { - _anyPlayers = { - [_x] call EFUNC(common,isPlayer); - } count units _this; - (side _this == _playerSide) && _anyPlayers > 0 - }] call EFUNC(common,filter); - }; + if !(GVAR(BFT_HideAiGroups)) then { + _groupsToDrawMarkers = [allGroups, {side _this == _playerSide}] call EFUNC(common,filter); + } else { + _groupsToDrawMarkers = [allGroups, { + _anyPlayers = { + [_x] call EFUNC(common,isPlayer); + } count units _this; + (side _this == _playerSide) && _anyPlayers > 0 + }] call EFUNC(common,filter); + }; + + { + _markerType = [_x] call EFUNC(common,getMarkerType); - { - _markerType = [_x] call EFUNC(common,getMarkerType); + _colour = format ["Color%1", side _x]; - _colour = format ["Color%1", side _x]; + _marker = createMarkerLocal [format ["ACE_BFT_%1", _forEachIndex], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; + _marker setMarkerTypeLocal _markerType; + _marker setMarkerColorLocal _colour; + _marker setMarkerTextLocal (groupID _x); - _marker = createMarkerLocal [format ["ACE_BFT_%1", _i], [(getPos leader _x) select 0, (getPos leader _x) select 1]]; - _marker setMarkerTypeLocal _markerType; - _marker setMarkerColorLocal _colour; - _marker setMarkerTextLocal (groupID _x); - - GVAR(BFT_markers) pushBack _marker; - } forEach _groupsToDrawMarkers; + GVAR(BFT_markers) pushBack _marker; + } forEach _groupsToDrawMarkers; }; diff --git a/addons/map/functions/fnc_determineMapLight.sqf b/addons/map/functions/fnc_determineMapLight.sqf new file mode 100644 index 0000000000..370bcdb167 --- /dev/null +++ b/addons/map/functions/fnc_determineMapLight.sqf @@ -0,0 +1,144 @@ +/* +* Author: Rocko and CAA-Picard +* Calculates the current map illumination for a given unit +* +* Arguments: +* 0: Unit +* +* Return Value: +* 0: Does the map needs shading? +* 1: Color of the overlay +* +* Public: No +*/ +#include "script_component.hpp" + +EXPLODE_1_PVT(_this,_unit); + +private ["_isEnclosed","_nearObjects","_light","_ll","_flashlight"]; + +// Blend two colors +_fnc_blendColor = { + EXPLODE_3_PVT(_this,_c1,_c2,_alpha); + [(_c1 select 0) * (1 - _alpha) + (_c2 select 0) * _alpha, + (_c1 select 1) * (1 - _alpha) + (_c2 select 1) * _alpha, + (_c1 select 2) * (1 - _alpha) + (_c2 select 2) * _alpha, + (_c1 select 3) * (1 - _alpha) + (_c2 select 3) * _alpha] +}; + +// Ambient light tint depending on time of day +_lightTint = switch (true) do { + case (sunOrMoon == 1.0) : { [0.5,0.5,0.5,1] }; + case (sunOrMoon > 0.80) : {[[1.0 - overcast,0.2,0,1], [1,1,1,1], (sunOrMoon - 0.8)/0.2] call _fnc_blendColor}; + case (sunOrMoon > 0.50) : {[[0,0,0.1,1], [1.0 - overcast,0.2,0,1], (sunOrMoon - 0.5)/0.3] call _fnc_blendColor}; + case (sunOrMoon <= 0.5) : { [0,0,0.1,1] }; +}; + +// Calculates overlay color from tint and light level +_fnc_calcColor = { + EXPLODE_2_PVT(_this,_c1,_lightLevel); + + if (_lightLevel < 0.5) then { + _l = _lightLevel / 0.5; + [(_c1 select 0) * _l, + (_c1 select 1) * _l, + (_c1 select 2) * _l, + (_c1 select 3) * (1 - _lightLevel)] + } else { + _l = (_lightLevel - 0.5) / 0.5; + [(_c1 select 0) * (1 - _l) + _l, + (_c1 select 1) * (1 - _l) + _l, + (_c1 select 2) * (1 - _l) + _l, + (_c1 select 3) * (1 - _lightLevel)] + }; +}; + +_lightLevel = 0.04 + (0.96 * call EFUNC(common,ambientBrightness)); + +// check if player has NVG enabled +if (currentVisionMode _unit == 1) exitWith { + // stick to nvg color + [true, [154/255,253/255,177/255,0.5]] +}; + +// Do not obscure the map if the ambient light level is above 0.95 +if (_lightLevel > 0.95) exitWith { + [false, [0.5,0.5,0.5,0]] +}; + +// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination) +if (vehicle _unit != _unit) then { + // Player is in a vehicle + if ((vehicle _unit) isKindOf "Tank") then { + _isEnclosed = true; + }; +}; +if (_isEnclosed) exitWith { + TRACE_1("Player in a enclosed vehicle",""); + [false, [1,1,1,0]] +}; + +// Player is not in a vehicle +TRACE_1("Player is on foot or in an open vehicle",""); + +// Check if player is near a campfires, lights or vehicles with lights on - 15m +_nearObjects = [nearestObjects [_unit, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter); +if (count (_nearObjects) > 0) then { + _light = _nearObjects select 0; + + _ll = (1 - (((((_unit distance _light) - 5)/10) max 0) min 1)); + if (_ll > _lightLevel) then { + _lightLevel = _ll; + TRACE_1("player near campfire",""); + }; +}; + + +// Gun with light +_nearObjects = [nearestObjects [_unit, ["CAManBase"], 10], { _this isFlashlightOn (currentWeapon _this)}] call EFUNC(common,filter); +if (count (_nearObjects) > 0) then { + _light = (_nearObjects select 0); + _flashlight = (_light weaponAccessories currentMuzzle _light) select 1; + + // Check if it's a day laser + if (_flashlight == "ACE_acc_pointer_red") exitWith {}; + if (_flashlight == "ACE_acc_pointer_green") exitWith {}; + + _lightLevel = _lightLevel max (1 - (((((_unit distance _light) - 2)/8) max 0) min 1)); + TRACE_1("Using gun light",""); +}; + + +// @todo: Illumination flares (timed) + + +// Using chemlights +_nearObjects = [_unit nearObjects ["SmokeShell", 4], { + alive _this && {(typeOf _this == "Chemlight_red") || { + (typeOf _this == "Chemlight_green") || { + (typeOf _this == "Chemlight_blue") || { + (typeOf _this == "Chemlight_yellow")}}}}}] call EFUNC(common,filter); +if (count (_nearObjects) > 0) then { + _light = _nearObjects select 0; + + _ll = (1 - ((((_unit distance _light) - 2)/2) max 0)) * 0.4; + if (_ll > _lightLevel) then { + _flareTint = switch (typeOf _light) do { + case "Chemlight_red" : {[1,0,0,1]}; + case "Chemlight_green" : {[0,1,0,1]}; + case "Chemlight_blue" : {[0,0,1,1]}; + case "Chemlight_yellow" : {[1,1,0,1]}; + }; + _lightTint = [_lightTint, _flareTint, (_ll - _lightLevel)/(1 - _lightLevel)] call _fnc_blendColor; + _lightLevel = _ll; + TRACE_1("player near chemlight",""); + }; +}; + +// Do not obscure the map if the ambient light level is above 0.95 +if (_lightLevel > 0.95) exitWith { + [false, [0.5,0.5,0.5,0]] +}; + +// Calculate resulting map color +[true, [_lightTint, _lightLevel] call _fnc_calcColor] diff --git a/addons/map/functions/fnc_determineZoom.sqf b/addons/map/functions/fnc_determineZoom.sqf new file mode 100644 index 0000000000..fdc620b417 --- /dev/null +++ b/addons/map/functions/fnc_determineZoom.sqf @@ -0,0 +1,43 @@ +/* +* Author: Rocko +* Calculate the maximum zoom level allowed for the current map +* +* Arguments: +* None +* +* Return Value: +* None +* +* Public: No +*/ +#include "script_component.hpp" + +private ["_grids", "_fourSize", "_sixSize", "_continue", "_size"]; +_grids = configFile >> "CfgWorlds" >> worldName >> "Grid"; +_fourSize = -1; +_sixSize = -1; +for "_i" from 1 to 10 do { + _continue = false; + if (isClass(_grids >> format["Zoom%1", _i])) then { + _continue = true; + _size = getText(_grids >> format["Zoom%1", _i] >> "formatX"); + if ((count toArray(_size)) == 2) then { + _fourSize = getNumber(_grids >> format["Zoom%1", _i] >> "zoomMax"); + }; + if ((count toArray(_size)) == 3) then { + _sixSize = getNumber(_grids >> format["Zoom%1", _i] >> "zoomMax"); + }; + if (_fourSize != -1 && {_sixSize != -1}) then { + _continue = false; + }; + }; + if (!_continue) exitWith {}; +}; + +if(_fourSize != -1 && {_sixSize != -1}) then { + if (isNil QGVAR(minMapSize)) then { + GVAR(minMapSize) = _sixSize + 0.01 + } else { + GVAR(minMapSize) = -1 + }; +}; diff --git a/addons/map/functions/fnc_moduleMap.sqf b/addons/map/functions/fnc_moduleMap.sqf new file mode 100644 index 0000000000..4fdea61420 --- /dev/null +++ b/addons/map/functions/fnc_moduleMap.sqf @@ -0,0 +1,22 @@ +/* + * Author: CAA-Picard + * Initializes the Map module. + * + * Arguments: + * Whatever the module provides. (I dunno.) + * + * Return Value: + * None + */ +#include "script_component.hpp" + +_logic = _this select 0; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(mapIllumination), "MapIllumination"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule); + +diag_log text "[ACE]: Interaction Module Initialized."; diff --git a/addons/map/functions/fnc_updateMapEffects.sqf b/addons/map/functions/fnc_updateMapEffects.sqf new file mode 100644 index 0000000000..ad32a02632 --- /dev/null +++ b/addons/map/functions/fnc_updateMapEffects.sqf @@ -0,0 +1,78 @@ +/* +* Author: Rocko and CAA-Picard +* On map draw, updates the effects +* +* Arguments: +* None +* +* Return Value: +* None +* +* Public: No +*/ +#include "script_component.hpp" + +private ["_mapCtrl","_mapScale"]; + +_mapCtrl = ((findDisplay 12) displayCtrl 51); +_mapScale = ctrlMapScale _mapCtrl; + +if (GVAR(mapIllumination)) then { + private ["_data","_darkenFill"]; + + // Calculate map illumination + _data = [[ACE_player], FUNC(determineMapLight), missionNamespace, QGVAR(mapLight), 0.1] call EFUNC(common,cachedCall); + + EXPLODE_2_PVT(_data,_darkenMap,_darkenColor); + if (_darkenMap) then { + _darkenFill = format["#(rgb,1,1,1)color(%1,%2,%3,%4)",_darkenColor select 0, _darkenColor select 1, _darkenColor select 2, _darkenColor select 3]; + _mapCtrl drawRectangle [(getArray(configFile >> 'CfgWorlds' >> worldName >> 'centerPosition')),80000,80000,0,_darkenColor,_darkenFill]; + }; +}; + +if (GVAR(mapShake)) then { + private ["_speed","_amplitude", "_time", "_shakePos"]; + + // Only shake map while moving on foot + _speed = 0; + if (vehicle ACE_player == ACE_player) then { + _speed = vectorMagnitude (velocity ACE_player); + }; + + // If speed is large enough, create anims to shake map + if (_speed > 0.1) then { + if (ctrlMapAnimDone _mapCtrl) then { + + _amplitude = (_speed - 0.1) / 5 * (1000 * _mapScale); + _time = 0.1; + + _shakePos = [(GVAR(lastStillPosition) select 0) + sin((time + _time - GVAR(lastStillTime))*100) * _amplitude * 0.25, + (GVAR(lastStillPosition) select 1) + sin((time + _time - GVAR(lastStillTime))*260) * _amplitude]; + + _mapCtrl ctrlMapAnimAdd [_time, _mapScale, _shakePos]; + ctrlMapAnimCommit _mapCtrl; + + GVAR(isShaking) = true; + }; + } else { + if (GVAR(isShaking)) then { + // Stop shaking, return to original position + _mapCtrl ctrlMapAnimAdd [0, _mapScale, GVAR(lastStillPosition)]; + ctrlMapAnimCommit _mapCtrl; + GVAR(isShaking) = false; + } else { + // The map is still, store state + ctrlMapAnimClear _mapCtrl; + GVAR(lastStillPosition) = _mapCtrl ctrlMapScreenToWorld [0.5, 0.5]; + GVAR(lastStillTime) = time; + }; + }; +}; + +if (GVAR(mapLimitZoom)) then { + if (GVAR(minMapSize) >= _mapScale) then { + ctrlMapAnimClear _mapCtrl; + _mapCtrl ctrlMapAnimAdd [0, GVAR(minMapSize) + 0.001, (_mapCtrl ctrlMapScreenToWorld [0.5, 0.5])]; + ctrlMapAnimCommit _mapCtrl; + }; +}; diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index afc6c2cec2..e3e2a6fe93 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -2,147 +2,6 @@ - - Map Tools - Herramientas de mapa - Outils de navigation - Narzędzia nawigacyjne - Kartenwerkzeug - Pomůcky k Mapě - Strumenti Cartografici - Ferramentas de Mapa - Térképészeti eszközök - Инструменты карты - - - The Map Tools allow you to measure distances and angles on the map. - Las herramientas de mapa permiten medir distancias y ángulos en el mapa. - Les outils de navigation permettent de mesurer des distances et des angles sur la carte. - Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. - Das Kartenwerkzeug erlaubt es dir, Distanzen und Winkel zu messen. - Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. - Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. - As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. - A térképészeti eszközökkel távolságokat és szögeket tud mérni a térképen. - Картографические инструменты позволяют измерять расстояния и углы на карте. - - - Map Tools >> - Herramientas de mapa >> - Outils de navigation >> - Narzędzia nawigacyjne >> - Kartenwerkzeug >> - Pomůcky k Mapě >> - Strumenti Cartografici >> - Ferramentas de Mapa >> - Térképészeti eszközök >> - Инструменты карты >> - - - Hide Map Tool - Verstecke Kartenwerkzeug - Ocultar herr. de mapa - Ranger les outils - Nascondi Strumenti Cartografici - Ocultar Ferramenta de Mapa - Térképészeti eszközök elrejtése - Ukryj narzędzia nawigacyjne - Schovat pomůcku k mapě - Скрыть инструменты - - - Show Normal Map Tool - Zeige Kartenwerkzeug (normal) - Mostrar herr. de mapa normal - Montrer outils normaux - Visualizza Strumenti Cartografici standard - Mostrar Ferramenta de Mapa Padrão - Térképészeti eszköz megjelenítése (normál méret) - Pokaż normalne narzędzia nawigacyjne - Zobrazit normální pomůcku k mapě - Показать инструменты (средн. размер) - - - Show Small Map Tool - Zeige Kartenwerkzeug (klein) - Mostrar herr. de mapa pequeñas - Montrer petits outils - Visualizza Strumenti Cartografici piccoli - Mostrar Ferramenta de Mapa Pequena - Térképészeti eszköz megjelenítése (kicsinyített) - Pokaż pomniejszone narzędzia nawigacyjne - Zobrazit malou pomůcku k mapě - Показать инструменты (малый размер) - - - Align Map Tool to North - Kartenwerkzeug nach Norden ausrichten - Alinear herr. de mapa al norte - Aligner au nord - Allinea gli Strumenti Cartografici con il Nord - Alinhar Ferramenta de Mapa com o Norte - Térképészeti eszköz Északhoz állítása - Wyrównaj linijkę do północy - Srovnat pomůcku k mapě na sever - Выровнять инструменты на север - - - Align Map Tool to Compass - Kartenwerkzeug am Kompass ausrichten - Alinear herr. de mapa a la brújula - Aligner sur la boussole - Allinea gli Strumenti Cartografici con la bussola - Alinhar Ferramenta de Mapa com a Bússola - Térképészeti eszköz iránytűhöz állítása - Wyrównaj linijkę do kompasu - Srovnat pomůcku k mapě ke kompasu - Выровнять инструменты по компасу - - - Show GPS on Map - Zeige GPS auf der Karte - Mostrar el GPS sobre el mapa - Ranger le GPS - Visualizza il GPS sulla mappa - Mostrar GPS no Mapa - GPS megjelnítése a térképen - Pokaż GPS na mapie - Zobrazit GPS na mapě - Показать GPS на карте - - - Hide GPS on Map - Verstecke GPS auf der Karte - Ocultar el GPS del mapa - Montrer le GPS - Nascondi il GPS sulla mappa - Ocultar GPS no Mapa - GPS elrejtése térképről - Ukryj GPS na mapie - Schovat GPS na mapě - Скрыть GPS на карте - - - Copy Map - Karte kopieren - Copiar mapa - Скопировать карту - Kopiuj oznaczenia mapy - Copier la carte - Zkopírovat mapu - Copiare Carta - Térkép másolása - Copiar Mapa - - - Direction: %1° - Drehung: %1° - Direction: %1° - Směr: %1° - Kierunek: %1° - Dirección: %1° - Irány: %1 - Направление:%1 - + \ No newline at end of file diff --git a/addons/maptools/$PBOPREFIX$ b/addons/maptools/$PBOPREFIX$ new file mode 100644 index 0000000000..11a24a58d8 --- /dev/null +++ b/addons/maptools/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\Addons\map \ No newline at end of file diff --git a/addons/maptools/CfgEventHandlers.hpp b/addons/maptools/CfgEventHandlers.hpp new file mode 100644 index 0000000000..27bbf326d3 --- /dev/null +++ b/addons/maptools/CfgEventHandlers.hpp @@ -0,0 +1,11 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + clientInit = QUOTE( call COMPILE_FILE(XEH_postInitClient) ); + }; +}; diff --git a/addons/maptools/CfgMarkers.hpp b/addons/maptools/CfgMarkers.hpp new file mode 100644 index 0000000000..8a2b86fc13 --- /dev/null +++ b/addons/maptools/CfgMarkers.hpp @@ -0,0 +1,26 @@ +// MARKERS +class CfgMarkers { + class ACE_MapToolFixed { + name = "MapToolFixed"; + icon = PATHTOF(data\mapToolFixed.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; + + class ACE_MapToolRotatingNormal { + name = "MapToolRotating"; + icon = PATHTOF(data\mapToolRotatingNormal.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; + + class ACE_MapToolRotatingSmall { + name = "MapToolRotating"; + icon = PATHTOF(data\mapToolRotatingSmall.paa); + scope = 0; + color[] = {1,1,1,1}; + size = 32; + }; +}; diff --git a/addons/maptools/CfgVehicles.hpp b/addons/maptools/CfgVehicles.hpp new file mode 100644 index 0000000000..4ecc649893 --- /dev/null +++ b/addons/maptools/CfgVehicles.hpp @@ -0,0 +1,128 @@ +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + + class ACE_MapTools { + displayName = "$STR_ACE_MapTools_MapTools_Menu"; + condition = QUOTE((call FUNC(canUseMapTools) || {call FUNC(canUseMapGPS)})); + statement = ""; + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 100; + enableInside = 1; + + class ACE_MapToolsHide { + displayName = "$STR_ACE_MapTools_MapToolsHide"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); + statement = QUOTE(GVAR(mapTool_Shown) = 0; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 5; + enableInside = 1; + }; + class ACE_MapToolsShowNormal { + displayName = "$STR_ACE_MapTools_MapToolsShowNormal"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 1})); + statement = QUOTE(GVAR(mapTool_Shown) = 1; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 4; + enableInside = 1; + }; + class ACE_MapToolsShowSmall { + displayName = "$STR_ACE_MapTools_MapToolsShowSmall"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 2})); + statement = QUOTE(GVAR(mapTool_Shown) = 2; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 3; + enableInside = 1; + }; + class ACE_MapToolsAlignNorth { + displayName = "$STR_ACE_MapTools_MapToolsAlignNorth"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0})); + statement = QUOTE(GVAR(mapTool_angle) = 0; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 2; + enableInside = 1; + }; + class ACE_MapToolsAlignCompass { + displayName = "$STR_ACE_MapTools_MapToolsAlignCompass"; + condition = QUOTE((call FUNC(canUseMapTools) && {GVAR(mapTool_Shown) != 0} && {('ItemCompass' in assigneditems ACE_player) || {'ItemCompass' in assigneditems ACE_player}})); + statement = QUOTE(GVAR(mapTool_angle) = getDir ACE_player; [] call FUNC(updateMapToolMarkers)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 1; + priority = 1; + enableInside = 1; + }; + class ACE_MapGpsShow { + displayName = "$STR_ACE_MapTools_MapGpsShow"; + condition = QUOTE((call FUNC(canUseMapGPS) && {!GVAR(mapGpsShow)})); + statement = QUOTE(GVAR(mapGpsShow) = true; [GVAR(mapGpsShow)] call FUNC(openMapGps)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 0; + enableInside = 1; + }; + class ACE_MapGpsHide { + displayName = "$STR_ACE_MapTools_MapGpsHide"; + condition = QUOTE((call FUNC(canUseMapGPS) && {GVAR(mapGpsShow)})); + statement = QUOTE(GVAR(mapGpsShow) = false; [GVAR(mapGpsShow)] call FUNC(openMapGps)); + exceptions[] = {"ACE_Drag_isNotDragging", QEGVAR(common,notOnMap)}; + showDisabled = 0; + priority = 0; + enableInside = 1; + }; + }; + }; + + class ACE_Actions { + class ACE_MainActions { + class ACE_CopyMap { + displayName = "$STR_ACE_MapTools_CopyMap"; + condition = QUOTE(([_target] call EFUNC(common,isPlayer) && {'ItemMap' in assigneditems _player} && {'ACE_MapTools' in items _player} && {'ItemMap' in assignedItems _target})); + statement = QUOTE([ARR_2(_player,_target)] call FUNC(copyMapStart)); + showDisabled = 0; + priority = -1; + }; + }; + }; + }; + + class NATO_Box_Base; + class EAST_Box_Base; + class IND_Box_Base; + class FIA_Box_Base_F; + + class Box_NATO_Support_F: NATO_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12); + }; + }; + + class Box_East_Support_F: EAST_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12); + }; + }; + + class Box_IND_Support_F: IND_Box_Base { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12); + }; + }; + + class Box_FIA_Support_F: FIA_Box_Base_F { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12); + }; + }; + + class ACE_Box_Misc: Box_NATO_Support_F { + class TransportItems { + MACRO_ADDITEM(ACE_MapTools,12); + }; + }; +}; diff --git a/addons/maptools/CfgWeapons.hpp b/addons/maptools/CfgWeapons.hpp new file mode 100644 index 0000000000..9d4d313c43 --- /dev/null +++ b/addons/maptools/CfgWeapons.hpp @@ -0,0 +1,15 @@ +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_MapTools: ACE_ItemCore { + displayName = "$STR_ACE_MapTools_Name"; + descriptionShort = "$STR_ACE_MapTools_Description"; + model = "\A3\weapons_F\ammo\mag_univ.p3d"; + picture = PATHTOF(UI\maptool_item.paa); + scope = 2; + class ItemInfo: InventoryItem_Base_F { + mass = 1; + }; + }; +}; diff --git a/addons/maptools/MapControls.hpp b/addons/maptools/MapControls.hpp new file mode 100644 index 0000000000..409796a6b1 --- /dev/null +++ b/addons/maptools/MapControls.hpp @@ -0,0 +1,80 @@ +class controls { + class CA_PlayerName: RscText { + x = "2 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfilePicture: RscPicture { + x = "13.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ProfileBackground: RscText { + x = "13.3 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class Separator1: RscPicture { + x = "14.5 * ( ((safezoneW / safezoneH) min 1.2) / 40)"; + }; + class ColorBlack: RscButton { + idc = 36732; + x = "0 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.2,0.2,1}; + colorBackgroundActive[] = {0,0,0,1}; + colorFocused[] = {0,0,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorBlack')]); + }; + class ColorRed: RscButton { + idc = 36733; + x = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.2,0.2,1}; + colorBackgroundActive[] = {1,0,0,1}; + colorFocused[] = {1,0,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorRed')]); + }; + class ColorGreen: RscButton { + idc = 36734; + x = "0.6 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.8,0.2,1}; + colorBackgroundActive[] = {0,1,0,1}; + colorFocused[] = {0,1,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorGreen')]); + }; + class ColorBlue: RscButton { + idc = 36735; + x = "0.9 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.2,0.2,0.8,1}; + colorBackgroundActive[] = {0,0,1,1}; + colorFocused[] = {0,0,1,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorBlue')]); + }; + class ColorYellow: RscButton { + idc = 36736; + x = "1.2 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.8,0.2,1}; + colorBackgroundActive[] = {1,1,0,1}; + colorFocused[] = {1,1,0,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorYellow')]); + }; + class ColorWhite: RscButton { + idc = 36737; + x = "1.5 * (((safezoneW / safezoneH) min 1.2) / 40)"; + y = "0.25 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + w = "0.3 * (((safezoneW / safezoneH) min 1.2) / 40)"; + h = "1.00 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"; + colorBackground[] = {0.8,0.8,0.8,1}; + colorBackgroundActive[] = {1,1,1,1}; + colorFocused[] = {1,1,1,1}; + onButtonClick = QUOTE(missionNamespace setVariable [ARR_2(QUOTE(QGVAR(drawing_drawColor)),'ColorWhite')]); + }; +}; diff --git a/addons/maptools/MapGpsUI.hpp b/addons/maptools/MapGpsUI.hpp new file mode 100644 index 0000000000..ff8ec8b96e --- /dev/null +++ b/addons/maptools/MapGpsUI.hpp @@ -0,0 +1,79 @@ +#define GUI_GRID_X (0) +#define GUI_GRID_Y (0) +#define GUI_GRID_W (0.025) +#define GUI_GRID_H (0.04) + +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 + +#define W_gps 0.4025 +#define H_gps 0.25 +#define X_gps safeZoneX + safeZoneW - 1.1 * W_gps +#define Y_gps safeZoneY + safeZoneH - 1.2 * H_gps + +class RscTitles { + class RscACE_MapGps { + idd = 9855; + movingEnable = 1; + duration = 3600; + fadein = 0; + fadeout = 0; + onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(ui_mapGpsDisplay)), _this select 0)];); + class controls { + class back:RscPicture { + x = X_gps; + y = Y_gps; + w = W_gps; + h = H_gps; + text = PATHTOF(UI\mapGps.paa); + colorBackground[] = {1, 1, 1, 1}; + }; + class heading: RscText{ + idc = 913590; + x = X_gps + W_gps * 0.25; + y = Y_gps + H_gps * 0.12; + w = W_gps * 0.2; + h = H_gps * 0.16; + style = ST_LEFT; + text = "225"; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.247,0.251,0.157,1}; + shadowColo[] = {0,0,0,0}; + font = "EtelkaNarrowMediumPro"; + shadow = 0; + sizeEx = 0.042; + }; + class altitude: RscText{ + idc = 913591; + x = X_gps + W_gps * 0.55; + y = Y_gps + H_gps * 0.12; + w = W_gps * 0.2; + h = H_gps * 0.16; + style = ST_RIGHT; + text = "55 m"; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.247,0.251,0.157,1}; + shadowColo[] = {0,0,0,0}; + font = "EtelkaNarrowMediumPro"; + shadow = 0; + sizeEx = 0.042; + }; + class coordinates: RscText{ + idc = 913592; + x = X_gps + W_gps * 0.2; + y = Y_gps + H_gps * 0.33; + w = W_gps * 0.6; + h = H_gps * 0.35; + style = ST_CENTER; + text = "012.3 115.1"; + colorBackground[] = {0,0,0,0}; + colorText[] = {0.247,0.251,0.157,1}; + shadowColo[] = {0,0,0,0}; + font = "EtelkaNarrowMediumPro"; + shadow = 0; + sizeEx = 0.1; + }; + }; + }; +}; diff --git a/addons/maptools/README.md b/addons/maptools/README.md new file mode 100644 index 0000000000..9248948efa --- /dev/null +++ b/addons/maptools/README.md @@ -0,0 +1,14 @@ +ace_maptools +============ + +Map tools: +- Roamer +- Map drawing +- Showing GPS on map + +## Maintainers + +The people responsible for merging changes to this component or answering potential questions. + +- [esteldunedain](https://github.com/esteldunedain) +- [NouberNou](https://github.com/NouberNou) diff --git a/addons/maptools/UI/IconBFTracking_ca.paa b/addons/maptools/UI/IconBFTracking_ca.paa new file mode 100644 index 0000000000..128f08f6f0 Binary files /dev/null and b/addons/maptools/UI/IconBFTracking_ca.paa differ diff --git a/addons/map/UI/mapGps.paa b/addons/maptools/UI/mapGps.paa similarity index 100% rename from addons/map/UI/mapGps.paa rename to addons/maptools/UI/mapGps.paa diff --git a/addons/map/UI/maptool_item.paa b/addons/maptools/UI/maptool_item.paa similarity index 100% rename from addons/map/UI/maptool_item.paa rename to addons/maptools/UI/maptool_item.paa diff --git a/addons/maptools/XEH_postInitClient.sqf b/addons/maptools/XEH_postInitClient.sqf new file mode 100644 index 0000000000..5267a8c802 --- /dev/null +++ b/addons/maptools/XEH_postInitClient.sqf @@ -0,0 +1,71 @@ +// by CAA-Picard + +#include "script_component.hpp" + +if (!hasInterface) exitWith {}; + +// Init variables +GVAR(mapVisableLastFrame) = false; +GVAR(mapGpsShow) = true; + +GVAR(mapTool_Shown) = 0; +GVAR(mapTool_pos) = [0,0]; +GVAR(mapTool_angle) = 0; +GVAR(mapTool_isDragging) = false; +GVAR(mapTool_isRotating) = false; + +GVAR(drawing_isDrawing) = false; +GVAR(drawing_tempLineMarker) = []; +GVAR(drawing_lineMarkers) = []; +GVAR(drawing_drawColor) = "ColorBlack"; +GVAR(drawing_controls) = [36732, 36733, 36734, 36735, 36736, 36737]; + +// This spawn is probably worth keeping, as pfh don't work natively on the briefing screen and IDK how reliable the hack we implemented for them is. +// The thread dies as soon as the mission start, so it's not really compiting for scheduler space. +[] spawn { + _fnc_installMapEvents = { + _d = _this; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseMoving", {_this call FUNC(handleMouseMove);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonDown", {[1, _this] call FUNC(handleMouseButton);}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["MouseButtonUp", {[0, _this] call FUNC(handleMouseButton)}]; + ((finddisplay _d) displayctrl 51) ctrlAddEventHandler ["Draw", {[] call FUNC(updateMapToolMarkers);}]; + (finddisplay _d) displayAddEventHandler ["KeyDown", {_this call FUNC(handleKeyDown);}]; + }; + + // Wait until the briefing map is detected + // display = 37 for SP + // display = 52 for host server on MP; + // display = 53 for MP clients) + waitUntil {(!isNull findDisplay 37) || (!isNull findDisplay 52) || (!isNull findDisplay 53) || (!isNull findDisplay 12)}; + + if (isNull findDisplay 12) then { + // Install event handlers on the map control of the briefing screen (control = 51) + GVAR(drawing_syncMarkers) = true; + if (!isNull findDisplay 52) then { + 52 call _fnc_installMapEvents; + } else { + if (!isNull findDisplay 53) then { + 53 call _fnc_installMapEvents; + } else { + 37 call _fnc_installMapEvents; + }; + }; + } else { + // Briefing screen was skipped; the player is JIP, create the markers defined during the briefing + GVAR(drawing_syncMarkers) = false; + { + _x call FUNC(addLineMarker); + } forEach GVAR(drawing_serverLineMarkers); + }; + + // Wait until the main map display is detected (display = 12) + waitUntil { !isNull findDisplay 12 }; + // Install event handlers on the map control and display (control = 51) + GVAR(drawing_syncMarkers) = false; + 12 call _fnc_installMapEvents; + + // Update the size and rotation of map tools + [] call FUNC(updateMapToolMarkers); + + [FUNC(mapStateUpdater), 0, []] call CBA_fnc_addPerFrameHandler; +}; diff --git a/addons/maptools/XEH_preInit.sqf b/addons/maptools/XEH_preInit.sqf new file mode 100644 index 0000000000..20777fb118 --- /dev/null +++ b/addons/maptools/XEH_preInit.sqf @@ -0,0 +1,38 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(addLineMarker); +PREP(calculateMapScale); +PREP(cancelDrawing); +PREP(canDraw); +PREP(canUseMapTools); +PREP(canUseMapGPS); +PREP(copyMapReceiveMarkers); +PREP(copyMapRemoteSend); +PREP(copyMapStart); +PREP(handleKeyDown); +PREP(handleMouseButton); +PREP(handleMouseMove); +PREP(handleMouseZChanged); +PREP(isInsideMapTool); +PREP(mapStateUpdater); +PREP(openMapGps); +PREP(openMapGpsUpdate); +PREP(removeLineMarker); +PREP(updateMapToolMarkers); +PREP(updateLineMarker); + +if (isServer) then { + GVAR(drawing_serverLineMarkers) = []; + publicVariable QGVAR(drawing_serverLineMarkers); +}; + +//Add Event Handlers: +["drawing_removeLineMarker", FUNC(removeLineMarker) ] call EFUNC(common,addEventHandler); +["drawing_addLineMarker", FUNC(addLineMarker) ] call EFUNC(common,addEventHandler); + +["drawing_requestMarkers", FUNC(copyMapRemoteSend) ] call EFUNC(common,addEventHandler); +["drawing_sendbackMarkers", FUNC(copyMapReceiveMarkers) ] call EFUNC(common,addEventHandler); + +ADDON = true; diff --git a/addons/maptools/config.cpp b/addons/maptools/config.cpp new file mode 100644 index 0000000000..ea39ca7708 --- /dev/null +++ b/addons/maptools/config.cpp @@ -0,0 +1,74 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {"ACE_MapTools"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common", "ace_interaction"}; + author[] = {"CAA-Picard"}; + authorUrl = "https://github.com/esteldunedain/"; + VERSION_CONFIG; + }; +}; + +class ACE_Settings { + class GVAR(EveryoneCanDrawOnBriefing) { + value = 1; + typeName = "BOOL"; + }; +}; + +class RscControlsGroup; +class RscActiveText; +class RscPicture; +class RscText; +class RscObject; +class RscButton; +class RscButtonMenuOK; +class RscButtonMenuCancel; +class RscButtonMenu; +class RscEdit; + +#include "MapGpsUI.hpp" +#include "CfgEventHandlers.hpp" +#include "CfgMarkers.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" + + +// REGULAR MAP +class RscDisplayMainMap { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; + +// BRIEFING SCREEN +class RscDisplayGetReady: RscDisplayMainMap { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; +class RscDisplayClientGetReady: RscDisplayGetReady { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; +class RscDisplayServerGetReady: RscDisplayGetReady { + // Create the drawing color selector + class controls { + class TopRight: RscControlsGroup { + #include "MapControls.hpp" + }; + }; +}; diff --git a/addons/map/data/mapToolFixed.paa b/addons/maptools/data/mapToolFixed.paa similarity index 100% rename from addons/map/data/mapToolFixed.paa rename to addons/maptools/data/mapToolFixed.paa diff --git a/addons/map/data/mapToolRotatingNormal.paa b/addons/maptools/data/mapToolRotatingNormal.paa similarity index 100% rename from addons/map/data/mapToolRotatingNormal.paa rename to addons/maptools/data/mapToolRotatingNormal.paa diff --git a/addons/map/data/mapToolRotatingSmall.paa b/addons/maptools/data/mapToolRotatingSmall.paa similarity index 100% rename from addons/map/data/mapToolRotatingSmall.paa rename to addons/maptools/data/mapToolRotatingSmall.paa diff --git a/addons/map/functions/fnc_addLineMarker.sqf b/addons/maptools/functions/fnc_addLineMarker.sqf similarity index 100% rename from addons/map/functions/fnc_addLineMarker.sqf rename to addons/maptools/functions/fnc_addLineMarker.sqf diff --git a/addons/map/functions/fnc_calculateMapScale.sqf b/addons/maptools/functions/fnc_calculateMapScale.sqf similarity index 100% rename from addons/map/functions/fnc_calculateMapScale.sqf rename to addons/maptools/functions/fnc_calculateMapScale.sqf diff --git a/addons/map/functions/fnc_canDraw.sqf b/addons/maptools/functions/fnc_canDraw.sqf similarity index 100% rename from addons/map/functions/fnc_canDraw.sqf rename to addons/maptools/functions/fnc_canDraw.sqf diff --git a/addons/map/functions/fnc_canUseMapGPS.sqf b/addons/maptools/functions/fnc_canUseMapGPS.sqf similarity index 100% rename from addons/map/functions/fnc_canUseMapGPS.sqf rename to addons/maptools/functions/fnc_canUseMapGPS.sqf diff --git a/addons/map/functions/fnc_canUseMapTools.sqf b/addons/maptools/functions/fnc_canUseMapTools.sqf similarity index 100% rename from addons/map/functions/fnc_canUseMapTools.sqf rename to addons/maptools/functions/fnc_canUseMapTools.sqf diff --git a/addons/map/functions/fnc_cancelDrawing.sqf b/addons/maptools/functions/fnc_cancelDrawing.sqf similarity index 100% rename from addons/map/functions/fnc_cancelDrawing.sqf rename to addons/maptools/functions/fnc_cancelDrawing.sqf diff --git a/addons/map/functions/fnc_copyMapReceiveMarkers.sqf b/addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf similarity index 100% rename from addons/map/functions/fnc_copyMapReceiveMarkers.sqf rename to addons/maptools/functions/fnc_copyMapReceiveMarkers.sqf diff --git a/addons/map/functions/fnc_copyMapRemoteSend.sqf b/addons/maptools/functions/fnc_copyMapRemoteSend.sqf similarity index 100% rename from addons/map/functions/fnc_copyMapRemoteSend.sqf rename to addons/maptools/functions/fnc_copyMapRemoteSend.sqf diff --git a/addons/map/functions/fnc_copyMapStart.sqf b/addons/maptools/functions/fnc_copyMapStart.sqf similarity index 100% rename from addons/map/functions/fnc_copyMapStart.sqf rename to addons/maptools/functions/fnc_copyMapStart.sqf diff --git a/addons/map/functions/fnc_handleKeyDown.sqf b/addons/maptools/functions/fnc_handleKeyDown.sqf similarity index 100% rename from addons/map/functions/fnc_handleKeyDown.sqf rename to addons/maptools/functions/fnc_handleKeyDown.sqf diff --git a/addons/map/functions/fnc_handleMouseButton.sqf b/addons/maptools/functions/fnc_handleMouseButton.sqf similarity index 100% rename from addons/map/functions/fnc_handleMouseButton.sqf rename to addons/maptools/functions/fnc_handleMouseButton.sqf diff --git a/addons/map/functions/fnc_handleMouseMove.sqf b/addons/maptools/functions/fnc_handleMouseMove.sqf similarity index 100% rename from addons/map/functions/fnc_handleMouseMove.sqf rename to addons/maptools/functions/fnc_handleMouseMove.sqf diff --git a/addons/map/functions/fnc_handleMouseZChanged.sqf b/addons/maptools/functions/fnc_handleMouseZChanged.sqf similarity index 100% rename from addons/map/functions/fnc_handleMouseZChanged.sqf rename to addons/maptools/functions/fnc_handleMouseZChanged.sqf diff --git a/addons/map/functions/fnc_isInsideMapTool.sqf b/addons/maptools/functions/fnc_isInsideMapTool.sqf similarity index 100% rename from addons/map/functions/fnc_isInsideMapTool.sqf rename to addons/maptools/functions/fnc_isInsideMapTool.sqf diff --git a/addons/map/functions/fnc_mapStateUpdater.sqf b/addons/maptools/functions/fnc_mapStateUpdater.sqf similarity index 100% rename from addons/map/functions/fnc_mapStateUpdater.sqf rename to addons/maptools/functions/fnc_mapStateUpdater.sqf diff --git a/addons/map/functions/fnc_openMapGps.sqf b/addons/maptools/functions/fnc_openMapGps.sqf similarity index 100% rename from addons/map/functions/fnc_openMapGps.sqf rename to addons/maptools/functions/fnc_openMapGps.sqf diff --git a/addons/map/functions/fnc_openMapGpsUpdate.sqf b/addons/maptools/functions/fnc_openMapGpsUpdate.sqf similarity index 100% rename from addons/map/functions/fnc_openMapGpsUpdate.sqf rename to addons/maptools/functions/fnc_openMapGpsUpdate.sqf diff --git a/addons/map/functions/fnc_removeLineMarker.sqf b/addons/maptools/functions/fnc_removeLineMarker.sqf similarity index 100% rename from addons/map/functions/fnc_removeLineMarker.sqf rename to addons/maptools/functions/fnc_removeLineMarker.sqf diff --git a/addons/map/functions/fnc_updateLineMarker.sqf b/addons/maptools/functions/fnc_updateLineMarker.sqf similarity index 100% rename from addons/map/functions/fnc_updateLineMarker.sqf rename to addons/maptools/functions/fnc_updateLineMarker.sqf diff --git a/addons/map/functions/fnc_updateMapToolMarkers.sqf b/addons/maptools/functions/fnc_updateMapToolMarkers.sqf similarity index 100% rename from addons/map/functions/fnc_updateMapToolMarkers.sqf rename to addons/maptools/functions/fnc_updateMapToolMarkers.sqf diff --git a/addons/maptools/functions/script_component.hpp b/addons/maptools/functions/script_component.hpp new file mode 100644 index 0000000000..adeb2788b5 --- /dev/null +++ b/addons/maptools/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\maptools\script_component.hpp" diff --git a/addons/maptools/script_component.hpp b/addons/maptools/script_component.hpp new file mode 100644 index 0000000000..a3dad97a49 --- /dev/null +++ b/addons/maptools/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT maptools +#include "\z\ace\Addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_MAPTOOLS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_MAPTOOLS + #define DEBUG_SETTINGS DEBUG_SETTINGS_MAPTOOLS +#endif + +#include "\z\ace\Addons\main\script_macros.hpp" + + +#define MARKERNAME_MAPTOOL_FIXED "ACE_MapToolFixed" +#define MARKERNAME_MAPTOOL_ROTATINGNORMAL "ACE_MapToolRotatingNormal" +#define MARKERNAME_MAPTOOL_ROTATINGSMALL "ACE_MapToolRotatingSmall" diff --git a/addons/maptools/stringtable.xml b/addons/maptools/stringtable.xml new file mode 100644 index 0000000000..1658856128 --- /dev/null +++ b/addons/maptools/stringtable.xml @@ -0,0 +1,148 @@ + + + + + + Map Tools + Herramientas de mapa + Outils de navigation + Narzędzia nawigacyjne + Kartenwerkzeug + Pomůcky k Mapě + Strumenti Cartografici + Ferramentas de Mapa + Térképészeti eszközök + Инструменты карты + + + The Map Tools allow you to measure distances and angles on the map. + Las herramientas de mapa permiten medir distancias y ángulos en el mapa. + Les outils de navigation permettent de mesurer des distances et des angles sur la carte. + Narzędzia nawigacyjne pozwalają na mierzenie odległości i kątów na mapie. + Das Kartenwerkzeug erlaubt es dir, Distanzen und Winkel zu messen. + Pomůcky k mapě slouží k měření vzdáleností a úhlů na mapě. + Gli Strumenti Cartografici ti consentono di misurare distanze ed angoli sulla mappa. + As Ferramentas de Mapa permitem que você meça distâncias e ângulos no mapa. + A térképészeti eszközökkel távolságokat és szögeket tud mérni a térképen. + Картографические инструменты позволяют измерять расстояния и углы на карте. + + + Map Tools >> + Herramientas de mapa >> + Outils de navigation >> + Narzędzia nawigacyjne >> + Kartenwerkzeug >> + Pomůcky k Mapě >> + Strumenti Cartografici >> + Ferramentas de Mapa >> + Térképészeti eszközök >> + Инструменты карты >> + + + Hide Map Tool + Verstecke Kartenwerkzeug + Ocultar herr. de mapa + Ranger les outils + Nascondi Strumenti Cartografici + Ocultar Ferramenta de Mapa + Térképészeti eszközök elrejtése + Ukryj narzędzia nawigacyjne + Schovat pomůcku k mapě + Скрыть инструменты + + + Show Normal Map Tool + Zeige Kartenwerkzeug (normal) + Mostrar herr. de mapa normal + Montrer outils normaux + Visualizza Strumenti Cartografici standard + Mostrar Ferramenta de Mapa Padrão + Térképészeti eszköz megjelenítése (normál méret) + Pokaż normalne narzędzia nawigacyjne + Zobrazit normální pomůcku k mapě + Показать инструменты (средн. размер) + + + Show Small Map Tool + Zeige Kartenwerkzeug (klein) + Mostrar herr. de mapa pequeñas + Montrer petits outils + Visualizza Strumenti Cartografici piccoli + Mostrar Ferramenta de Mapa Pequena + Térképészeti eszköz megjelenítése (kicsinyített) + Pokaż pomniejszone narzędzia nawigacyjne + Zobrazit malou pomůcku k mapě + Показать инструменты (малый размер) + + + Align Map Tool to North + Kartenwerkzeug nach Norden ausrichten + Alinear herr. de mapa al norte + Aligner au nord + Allinea gli Strumenti Cartografici con il Nord + Alinhar Ferramenta de Mapa com o Norte + Térképészeti eszköz Északhoz állítása + Wyrównaj linijkę do północy + Srovnat pomůcku k mapě na sever + Выровнять инструменты на север + + + Align Map Tool to Compass + Kartenwerkzeug am Kompass ausrichten + Alinear herr. de mapa a la brújula + Aligner sur la boussole + Allinea gli Strumenti Cartografici con la bussola + Alinhar Ferramenta de Mapa com a Bússola + Térképészeti eszköz iránytűhöz állítása + Wyrównaj linijkę do kompasu + Srovnat pomůcku k mapě ke kompasu + Выровнять инструменты по компасу + + + Show GPS on Map + Zeige GPS auf der Karte + Mostrar el GPS sobre el mapa + Ranger le GPS + Visualizza il GPS sulla mappa + Mostrar GPS no Mapa + GPS megjelnítése a térképen + Pokaż GPS na mapie + Zobrazit GPS na mapě + Показать GPS на карте + + + Hide GPS on Map + Verstecke GPS auf der Karte + Ocultar el GPS del mapa + Montrer le GPS + Nascondi il GPS sulla mappa + Ocultar GPS no Mapa + GPS elrejtése térképről + Ukryj GPS na mapie + Schovat GPS na mapě + Скрыть GPS на карте + + + Copy Map + Karte kopieren + Copiar mapa + Скопировать карту + Kopiuj oznaczenia mapy + Copier la carte + Zkopírovat mapu + Copiare Carta + Térkép másolása + Copiar Mapa + + + Direction: %1° + Drehung: %1° + Direction: %1° + Směr: %1° + Kierunek: %1° + Dirección: %1° + Irány: %1 + Направление:%1 + + + \ No newline at end of file diff --git a/addons/medical/functions/fnc_setUnconscious.sqf b/addons/medical/functions/fnc_setUnconscious.sqf index dbb0d115c3..890f4d2787 100644 --- a/addons/medical/functions/fnc_setUnconscious.sqf +++ b/addons/medical/functions/fnc_setUnconscious.sqf @@ -25,7 +25,7 @@ if !(!(isNull _unit) && {(_unit isKindOf "CaManBase") && ([_unit] call EFUNC(com // We only want this function to work on local machines if (!local _unit) exitwith { - [[_unit], QUOTE(DFUNC(setUnconsciousState)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ + [[_unit], QUOTE(DFUNC(setUnconscious)), _unit, false] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */ }; // Get rid of the object we are carrying, before we go unconscious. @@ -64,22 +64,21 @@ _unit setUnitPos "DOWN"; // So the AI does not get stuck, we are moving the unit to a temp group on its own. [_unit, true, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); -_captiveSwitch = [_unit, true] call EFUNC(common,setCaptiveSwitch); +[_unit, QGVAR(unconscious), true] call EFUNC(common,setCaptivityStatus); [_unit, [_unit] call EFUNC(common,getDeathAnim), 1, true] call EFUNC(common,doAnimation); _startingTime = time; _minWaitingTime = (round(random(10)+5)); [{ - private ["_unit", "_vehicleOfUnit","_lockSwitch","_minWaitingTime", "_oldAnimation", "_captiveSwitch", "_hasMovedOut"]; + private ["_unit", "_vehicleOfUnit","_minWaitingTime", "_oldAnimation", "_captiveSwitch", "_hasMovedOut"]; _args = _this select 0; _unit = _args select 0; _oldAnimation = _args select 1; - _captiveSwitch = _args select 2; - _originalPos = _args select 3; - _startingTime = _args select 4; - _minWaitingTime = _args select 5; - _hasMovedOut = _args select 6; + _originalPos = _args select 2; + _startingTime = _args select 3; + _minWaitingTime = _args select 4; + _hasMovedOut = _args select 5; // Since the unit is no longer alive, get rid of this PFH. if (!alive _unit) exitwith { // EXIT PFH @@ -104,10 +103,8 @@ _minWaitingTime = (round(random(10)+5)); }; if (!_hasMovedOut) then { // Reset the unit back to the previous captive state. - if (_captiveSwitch) then { - [_unit, false] call EFUNC(common,setCaptiveSwitch); - }; - + [_unit, QGVAR(unconscious), false] call EFUNC(common,setCaptivityStatus); + // Swhich the unit back to its original group [_unit, false, "ACE_isUnconscious", side group _unit] call EFUNC(common,switchToGroupSide); @@ -137,6 +134,6 @@ _minWaitingTime = (round(random(10)+5)); [_unit,([_unit] call FUNC(getDeathAnim)), 1, true] call EFUNC(common,doAnimation); // Reset animations if unit starts doing wierd things. }; -}, 0.1, [_unit,_animState, _captiveSwitch, _originalPos, _startingTime, _minWaitingTime, false] ] call CBA_fnc_addPerFrameHandler; +}, 0.1, [_unit,_animState, _originalPos, _startingTime, _minWaitingTime, false] ] call CBA_fnc_addPerFrameHandler; ["medical_onUnconscious", [_unit], [_unit, true]] call EFUNC(common,targetEvent); diff --git a/addons/movement/XEH_postInit.sqf b/addons/movement/XEH_postInit.sqf index 037e0105e9..9d2d48ce74 100644 --- a/addons/movement/XEH_postInit.sqf +++ b/addons/movement/XEH_postInit.sqf @@ -21,8 +21,7 @@ ["ACE3", QGVAR(climb), localize "STR_ACE_Movement_Climb", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if (ACE_player != (vehicle ACE_player)) exitWith {false}; diff --git a/addons/nametags/XEH_postInit.sqf b/addons/nametags/XEH_postInit.sqf index 2de39f5807..4d9a1341d7 100644 --- a/addons/nametags/XEH_postInit.sqf +++ b/addons/nametags/XEH_postInit.sqf @@ -10,8 +10,7 @@ if (!hasInterface) exitWith {}; ["ACE3", QGVAR(showNameTags), localize "STR_ACE_NameTags_ShowNames", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement GVAR(ShowNamesTime) = time; diff --git a/addons/nightvision/XEH_postInitClient.sqf b/addons/nightvision/XEH_postInitClient.sqf index 0707104fad..65d6e8c45f 100644 --- a/addons/nightvision/XEH_postInitClient.sqf +++ b/addons/nightvision/XEH_postInitClient.sqf @@ -40,8 +40,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["ACE3", QGVAR(IncreaseNVGBrightness), localize "STR_ACE_NightVision_IncreaseNVGBrightness", { // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode _player != 1)) exitWith {false}; @@ -55,8 +54,7 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0; ["ACE3", QGVAR(DecreaseNVGBrightness), localize "STR_ACE_NightVision_DecreaseNVGBrightness", { // Conditions: canInteract - _exceptions = [QEGVAR(captives,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if ((currentVisionMode _player != 1)) exitWith {false}; diff --git a/addons/optionsmenu/config.cpp b/addons/optionsmenu/config.cpp index 51a614bb5a..7850e5972e 100644 --- a/addons/optionsmenu/config.cpp +++ b/addons/optionsmenu/config.cpp @@ -6,8 +6,8 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {"Combat Space Enhancement"}; - authorUrl = "http://csemod.com"; + author[] = {"Glowbal", "PabstMirror"}; + authorUrl = "http://github.com/Glowbal"; VERSION_CONFIG; }; }; @@ -24,4 +24,4 @@ class CfgAddons { #include "CfgEventHandlers.hpp" #include "gui\define.hpp" #include "gui\settingsMenu.hpp" -#include "gui\pauseMenu.hpp" \ No newline at end of file +#include "gui\pauseMenu.hpp" diff --git a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf index 066bc76a8f..5846d0dccb 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxSettingsChanged.sqf @@ -1,12 +1,19 @@ -/** -* fnc_onListBoxSettingsChanged.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Called when the listbox selection is changed for an options (eg: chaning a setting from false to true) + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged + * + * Public: No + */ + #include "script_component.hpp" private ["_settingIndex", "_rightDropDownIndex"]; diff --git a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf index f4d41674bd..25fd99b5d8 100644 --- a/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onListBoxShowSelectionChanged.sqf @@ -1,12 +1,19 @@ -/** -* fnc_onListBoxShowSelectionChanged.sqf -* @Descr: called when the listbox selection has changed. Updates configuration menu information -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Changes which tab is open (options or colors) + * + * Arguments: + * The tab to open (defined in script_component) + * + * Return Value: + * None + * + * Example: + * [MENU_TAB_COLORS] call ACE_optionsmenu_fnc_onListBoxShowSelectionChanged + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_localizedHeader"]; diff --git a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf index e3137f8ca9..7c5f03af0b 100644 --- a/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf +++ b/addons/optionsmenu/functions/fnc_onSettingsMenuOpen.sqf @@ -1,34 +1,47 @@ -/** -* fnc_onSettingsMenuOpen.sqf -* @Descr: called when the settings or configuration menu has opened. Do not use anywhere else. -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Called from the onLoad of ACE_settingsMenu dialog. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [onLoadEvent] call ACE_optionsmenu_fnc_onSettingsMenuOpen + * + * Public: No + */ + #include "script_component.hpp" // Filter only user setable setting GVAR(clientSideOptions) = []; GVAR(clientSideColors) = []; { - // If the setting is user setable and not forced - if ((_x select 2) && !(_x select 6)) then { - // Append the current value to the setting metadata - _setting = + _x; - _setting pushBack (missionNamespace getVariable (_x select 0)); + // If the setting is user setable and not forced + if ((_x select 2) && !(_x select 6)) then { + // Append the current value to the setting metadata + _setting = + _x; + _setting pushBack (missionNamespace getVariable (_x select 0)); - // Categorize the setting according to types - // @todo: allow the user to modify other types of parameters? - if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { - GVAR(clientSideOptions) pushBack _setting; - }; - if ((_x select 1) == "COLOR") then { - GVAR(clientSideColors) pushBack _setting; - }; - }; + // Categorize the setting according to types + // @todo: allow the user to modify other types of parameters? + if ((_x select 1) == "SCALAR" || (_x select 1) == "BOOL") then { + GVAR(clientSideOptions) pushBack _setting; + }; + if ((_x select 1) == "COLOR") then { + GVAR(clientSideColors) pushBack _setting; + }; + }; } forEach EGVAR(common,settings); //Delay a frame [{ [MENU_TAB_OPTIONS] call FUNC(onListBoxShowSelectionChanged) }, []] call EFUNC(common,execNextFrame); + +private "_menu"; +disableSerialization; +_menu = uiNamespace getvariable "ACE_settingsMenu"; +(_menu displayCtrl 1002) ctrlEnable false; +(_menu displayCtrl 1003) ctrlEnable false; diff --git a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf index ac6f52469c..4e0e603862 100644 --- a/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf +++ b/addons/optionsmenu/functions/fnc_onSliderPosChanged.sqf @@ -1,29 +1,38 @@ -/** -* fnc_onSliderPosChanged.sqf -* @Descr: N/A -* @Author: PabstMirror -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: PabstMirror + * Called when one of the color sliders is moved. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onSliderPosChanged + * + * Public: No + */ + #include "script_component.hpp" private ["_newColor", "_settingIndex"]; -_newColor = []; -{ - _newColor pushBack ((sliderPosition _x) / 255); -} forEach [410, 411, 412, 413]; - _settingIndex = lbCurSel 200; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_COLORS): { - if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { - _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; - [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + case (MENU_TAB_COLORS): { + + _newColor = []; + { + _newColor pushBack ((sliderPosition _x) / 255); + } forEach [410, 411, 412, 413]; + + if ((_settingIndex >= 0) && (_settingIndex < (count GVAR(clientSideColors)))) then { + _settingIndex = (GVAR(clientSideColors) select _settingIndex) select 0; + [MENU_TAB_COLORS, _settingIndex, _newColor] call FUNC(updateSetting); + }; + [false] call FUNC(settingsMenuUpdateList); }; - [false] call FUNC(settingsMenuUpdateList); - }; + default {}; }; diff --git a/addons/optionsmenu/functions/fnc_resetSettings.sqf b/addons/optionsmenu/functions/fnc_resetSettings.sqf index dd4b951ef5..07fc43cdfc 100644 --- a/addons/optionsmenu/functions/fnc_resetSettings.sqf +++ b/addons/optionsmenu/functions/fnc_resetSettings.sqf @@ -1,30 +1,37 @@ -/** -* fnc_resetSettings.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Resets all settings to default. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_onListBoxSettingsChanged + * + * Public: No + */ + #include "script_component.hpp" private ["_name", "_default", "_lastSelected"]; { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_OPTIONS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideOptions); { - _name = _x select 0; - _default = _x select 7; - [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); + _name = _x select 0; + _default = _x select 7; + [MENU_TAB_COLORS, _name, _default] call FUNC(updateSetting); } forEach GVAR(clientSideColors); _lastSelected = lbCurSel 200; [GVAR(optionMenu_openTab)] call FUNC(onListBoxShowSelectionChanged); if (_lastSelected != -1) then { - lbSetCurSel [200, _lastSelected]; + lbSetCurSel [200, _lastSelected]; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf index c271ecd176..39bbdb8c94 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateKeyView.sqf @@ -1,12 +1,19 @@ -/** -* fnc_settingsMenuUpdateKeyView.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the right half of the option menu for the currently selected option. + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ACE_optionsmenu_fnc_settingsMenuUpdateKeyView + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_collection", "_settingIndex", "_setting", "_entryName", "_localizedName", "_localizedDescription", "_possibleValues", "_settingsValue", "_currentColor"]; @@ -16,58 +23,58 @@ _settingsMenu = uiNamespace getVariable 'ACE_settingsMenu'; _ctrlList = _settingsMenu displayCtrl 200; _collection = switch (GVAR(optionMenu_openTab)) do { -case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; -case MENU_TAB_COLORS: {GVAR(clientSideColors)}; - default {[]}; + case MENU_TAB_OPTIONS: {GVAR(clientSideOptions)}; + case MENU_TAB_COLORS: {GVAR(clientSideColors)}; + default {[]}; }; if (count _collection > 0) then { - _settingIndex = (lbCurSel _ctrlList); - if (_settingIndex > (count _collection)) then { - _settingIndex = count _collection - 1; - }; - - if (_settingIndex < 0) exitwith { - _settingIndex = 0; - }; - _setting = _collection select _settingIndex; - - _entryName = _setting select 0; - _localizedName = _setting select 3; - _localizedDescription = _setting select 4; - - if (_localizedName == "") then {_localizedName = _entryName;}; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; - - switch (GVAR(optionMenu_openTab)) do { - case (MENU_TAB_OPTIONS): { - _possibleValues = _setting select 5; - _settingsValue = _setting select 8; - - // Created disable/enable options for bools - if ((_setting select 1) == "BOOL") then { - lbClear 400; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; - lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; - _settingsValue = [0, 1] select _settingsValue; - } else { - lbClear 400; - { lbAdd [400, _x]; } foreach _possibleValues; - }; - (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + _settingIndex = (lbCurSel _ctrlList); + if (_settingIndex > (count _collection)) then { + _settingIndex = count _collection - 1; }; - case (MENU_TAB_COLORS): { - _currentColor = _setting select 8; - { - sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; - } forEach [410, 411, 412, 413]; + + if (_settingIndex < 0) then { + _settingIndex = 0; + }; + _setting = _collection select _settingIndex; + + _entryName = _setting select 0; + _localizedName = _setting select 3; + _localizedDescription = _setting select 4; + + if (_localizedName == "") then {_localizedName = _entryName;}; + (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; + (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; + (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + + switch (GVAR(optionMenu_openTab)) do { + case (MENU_TAB_OPTIONS): { + _possibleValues = _setting select 5; + _settingsValue = _setting select 8; + + // Created disable/enable options for bools + if ((_setting select 1) == "BOOL") then { + lbClear 400; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Disabled")]; + lbAdd [400, (localize "STR_ACE_OptionsMenu_Enabled")]; + _settingsValue = [0, 1] select _settingsValue; + } else { + lbClear 400; + { lbAdd [400, _x]; } foreach _possibleValues; + }; + (_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue; + }; + case (MENU_TAB_COLORS): { + _currentColor = _setting select 8; + { + sliderSetPosition [_x, (255 * (_currentColor select _forEachIndex))]; + } forEach [410, 411, 412, 413]; + }; }; - }; } else { //no settings in list: - lbClear 400; - (_settingsMenu displayCtrl 250) ctrlSetText _localizedName; - (_settingsMenu displayCtrl 251) ctrlSetText _localizedDescription; - (_settingsMenu displayCtrl 300) ctrlSetText _entryName; + lbClear 400; + (_settingsMenu displayCtrl 250) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 251) ctrlSetText "No settings available"; + (_settingsMenu displayCtrl 300) ctrlSetText "No settings available"; }; diff --git a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf index 73a6d3de3b..0138b9e87d 100644 --- a/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf +++ b/addons/optionsmenu/functions/fnc_settingsMenuUpdateList.sqf @@ -1,12 +1,19 @@ -/** -* fnc_settingsMenuUpdateList.sqf -* @Descr: N/A -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: false -*/ +/* + * Author: Glowbal + * Updates the setting when the client has selected a new value. Saves to profilenamespace. + * + * Arguments: + * 0: Update the keylist as well + * + * Return Value: + * None + * + * Example: + * [false] call ACE_optionsmenu_fnc_settingsMenuUpdateList + * + * Public: No + */ + #include "script_component.hpp" private ["_settingsMenu", "_ctrlList", "_settingsText", "_color", "_settingsColor", "_updateKeyView"]; @@ -19,35 +26,35 @@ _ctrlList = _settingsMenu displayCtrl 200; lbclear _ctrlList; switch (GVAR(optionMenu_openTab)) do { -case (MENU_TAB_OPTIONS): { + case (MENU_TAB_OPTIONS): { + { + _ctrlList lbadd (_x select 3); + + _settingsValue = _x select 8; + + // Created disable/enable options for bools + _settingsText = if ((_x select 1) == "BOOL") then { + [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; + } else { + (_x select 5) select _settingsValue; + }; + + _ctrlList lbadd (_settingsText); + }foreach GVAR(clientSideOptions); + }; + case (MENU_TAB_COLORS): { { - _ctrlList lbadd (_x select 3); - - _settingsValue = _x select 8; - - // Created disable/enable options for bools - _settingsText = if ((_x select 1) == "BOOL") then { - [(localize "STR_ACE_OptionsMenu_Disabled"), (localize "STR_ACE_OptionsMenu_Enabled")] select _settingsValue; - } else { - (_x select 5) select _settingsValue; - }; - - _ctrlList lbadd (_settingsText); - }foreach GVAR(clientSideOptions); - }; -case (MENU_TAB_COLORS): { - { - _color = +(_x select 8); - { - _color set [_forEachIndex, ((round (_x * 100))/100)]; - } forEach _color; - _settingsColor = str _color; - _ctrlList lbadd (_x select 3); - _ctrlList lbadd (_settingsColor); - _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; - }foreach GVAR(clientSideColors); - }; + _color = +(_x select 8); + { + _color set [_forEachIndex, ((round (_x * 100))/100)]; + } forEach _color; + _settingsColor = str _color; + _ctrlList lbadd (_x select 3); + _ctrlList lbadd (_settingsColor); + _ctrlList lnbSetColor [[_forEachIndex, 1], (_x select 8)]; + }foreach GVAR(clientSideColors); + }; }; if (_updateKeyView) then { - [] call FUNC(settingsMenuUpdateKeyView); + [] call FUNC(settingsMenuUpdateKeyView); }; diff --git a/addons/optionsmenu/functions/fnc_updateSetting.sqf b/addons/optionsmenu/functions/fnc_updateSetting.sqf index e4a9917f25..bc5969d54c 100644 --- a/addons/optionsmenu/functions/fnc_updateSetting.sqf +++ b/addons/optionsmenu/functions/fnc_updateSetting.sqf @@ -1,12 +1,21 @@ -/** -* fnc_updateSetting.sqf -* @Descr: -* @Author: Glowbal -* -* @Arguments: [] -* @Return: -* @PublicAPI: true -*/ +/* + * Author: Glowbal + * Updates the setting when the client has selected a new value. Saves to profilenamespace and calls setSetting. + * + * Arguments: + * 0: The Tab Open + * 1: The setting's name + * 2: The new value either an index or a color OR + * + * Return Value: + * None + * + * Example: + * [MENU_TAB_COLORS, "ace_fireTruckColor", [1,0,0,1]] call ACE_optionsmenu_fnc_updateSetting + * + * Public: No + */ + #include "script_component.hpp" private ["_changed"]; diff --git a/addons/optionsmenu/gui/settingsMenu.hpp b/addons/optionsmenu/gui/settingsMenu.hpp index 8d99a591d5..995c7850a5 100644 --- a/addons/optionsmenu/gui/settingsMenu.hpp +++ b/addons/optionsmenu/gui/settingsMenu.hpp @@ -4,7 +4,7 @@ class ACE_settingsMenu { onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', _this select 0)]; [] call FUNC(onSettingsMenuOpen);); onUnload = QUOTE(uiNamespace setVariable [ARR_2('ACE_settingsMenu', nil)]; saveProfileNamespace;); - #define SIZEX ((0.70 * safezoneW) max 1.0) + #define SIZEX (((safezoneW / safezoneH) min 1.2)) #define SIZEY (SIZEX / 1.2) #define UNITX (SIZEX / 40) #define UNITY (SIZEY / 25) @@ -42,6 +42,10 @@ class ACE_settingsMenu { x = 26.1 * UNITX + OFFSETX; w = 12.9 * UNITX; }; + class RightBackgroundHeader: RightBackground { + h = 1.4 * UNITY; + colorBackground[] = {0,0,0,1}; + }; }; class controls { @@ -85,7 +89,7 @@ class ACE_settingsMenu { colorBackgroundFocused[] = {1,1,1,1}; colorBackground[] = {1,1,1,1}; colorbackground2[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,0.8}; + colorDisabled[] = {1,1,1,1}; colorFocused[] = {0,0,0,1}; periodFocus = 1; periodOver = 1; @@ -99,13 +103,13 @@ class ACE_settingsMenu { }; class selectionAction_3: selectionAction_1 { idc = 1002; - text = "---"; + text = ""; x = 20 * UNITX + OFFSETX; action = ""; }; class selectionAction_4: selectionAction_1 { idc = 1003; - text = "---"; + text = ""; x = 29.5 * UNITX + OFFSETX; action = ""; }; @@ -115,7 +119,7 @@ class ACE_settingsMenu { y = 5.5 * UNITY + OFFSETY; w = 23 * UNITX; h = 15 * UNITY; - SizeEx = (UNITY * 0.7); + SizeEx = (UNITY * 0.8); colorBackground[] = {0, 0, 0, 0.9}; colorSelectBackground[] = {0, 0, 0, 0.9}; columns[] = {0.0, 0.6}; @@ -128,7 +132,7 @@ class ACE_settingsMenu { w = 11 * UNITX; h = 1 * UNITY; text = ""; - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY *1); }; class labelKey: ACE_gui_staticBase { //Variable Name idc = 300; @@ -137,13 +141,13 @@ class ACE_settingsMenu { w = 11 * UNITX; h = 1 * UNITY; text = ""; - SizeEx = (UNITY * 0.60); + SizeEx = (UNITY * 0.65); }; class Label2: labelKey { idc = 301; y = 7.3 * UNITY + OFFSETY; text = "$STR_ACE_OptionsMenu_Setting"; - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY * 1); }; class comboBox1: ACE_gui_comboBoxBase { idc = 400; @@ -152,7 +156,7 @@ class ACE_settingsMenu { w = 7 * UNITX; h = 1 * UNITY; onLBSelChanged = QUOTE( call FUNC(onListBoxSettingsChanged)); - SizeEx = (UNITY * 0.75); + SizeEx = (UNITY * 0.9); }; class sliderBar1: RscXSliderH { idc = 410; @@ -191,15 +195,16 @@ class ACE_settingsMenu { text = ""; style = ST_LEFT + ST_MULTI; lineSpacing = 1; - SizeEx = (UNITY * 0.60); + SizeEx = (UNITY * 0.8); }; class actionClose: ACE_gui_buttonBase { idc = 10; text = "$STR_DISP_CLOSE"; x = 1 * UNITX + OFFSETX; y = 22.3 * UNITY + OFFSETY; - w = 6 * UNITX; + w = 7.5 * UNITX; h = 1 * UNITY; + style = ST_LEFT; animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)"; animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)"; animTextureOver = "#(argb,8,8,3)color(1,1,1,1)"; @@ -217,17 +222,10 @@ class ACE_settingsMenu { periodOver = 1; action = "closedialog 0;"; }; - class action_animation: actionClose { - idc = 1100; - text = "$STR_ACE_OptionsMenu_FixAnimation"; - x = 7.5 * UNITX + OFFSETX; - // action = "if ([player] call ACE_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call ACE_fnc_broadcastAnim; };"; - action = "hint 'todo???'"; - }; class action_reset: actionClose { idc = 1100; text = "$STR_ACE_OptionsMenu_ResetAll"; - x = 14 * (SIZEX / 40) + OFFSETX; + x = 26.1 * (SIZEX / 40) + OFFSETX; action = QUOTE([] call FUNC(resetSettings)); }; }; diff --git a/addons/overheating/XEH_postInit.sqf b/addons/overheating/XEH_postInit.sqf index a1b3dec206..57b02b101e 100644 --- a/addons/overheating/XEH_postInit.sqf +++ b/addons/overheating/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(unjamWeapon), localize "STR_ACE_Overheating_UnjamWeapon", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) && {currentWeapon ACE_player in (ACE_player getVariable [QGVAR(jammedWeapons), []])} diff --git a/addons/overpressure/CfgEventHandlers.hpp b/addons/overpressure/CfgEventHandlers.hpp index 40c3b32a57..fa70cab5ea 100644 --- a/addons/overpressure/CfgEventHandlers.hpp +++ b/addons/overpressure/CfgEventHandlers.hpp @@ -43,4 +43,9 @@ class Extended_FiredBIS_EventHandlers { firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)}); }; }; + class StaticWeapons { + class ADDON { + firedBIS = QUOTE(if (local (_this select 0) && {getNumber (configfile >> 'CfgWeapons' >> _this select 1 >> QUOTE(QGVAR(Damage))) > 0}) then {_this call DFUNC(fireOverpressureZone)}); + }; + }; }; diff --git a/addons/parachute/XEH_postInit.sqf b/addons/parachute/XEH_postInit.sqf index c80f093209..35efab12a9 100644 --- a/addons/parachute/XEH_postInit.sqf +++ b/addons/parachute/XEH_postInit.sqf @@ -19,8 +19,7 @@ if (!hasInterface) exitWith {}; ["ACE3", QGVAR(showAltimeter), localize "STR_ACE_Parachute_showAltimeter", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; if (!('ACE_Altimeter' in assignedItems ace_player)) exitWith {false}; if (!(missionNamespace getVariable [QGVAR(AltimeterActive), false])) then { [ace_player] call FUNC(showAltimeter); diff --git a/addons/parachute/functions/fnc_showAltimeter.sqf b/addons/parachute/functions/fnc_showAltimeter.sqf index 1b3edc26f5..8e3c3d83e3 100644 --- a/addons/parachute/functions/fnc_showAltimeter.sqf +++ b/addons/parachute/functions/fnc_showAltimeter.sqf @@ -43,4 +43,4 @@ GVAR(AltimeterActive) = true; (_this select 0) set [2, _height]; (_this select 0) set [3, _curTime]; -}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameEventHandler); +}, 0.2, [uiNamespace getVariable ["ACE_Altimeter", displayNull], _unit,floor ((getPosASL _unit) select 2), time]] call CALLSTACK(cba_fnc_addPerFrameHandler); diff --git a/addons/realisticnames/CfgMagazines.hpp b/addons/realisticnames/CfgMagazines.hpp new file mode 100644 index 0000000000..cf555c9603 --- /dev/null +++ b/addons/realisticnames/CfgMagazines.hpp @@ -0,0 +1,419 @@ + +class CfgMagazines { + class VehicleMagazine; + class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { + displayNameShort = "30mm HEI"; + }; + + class 7Rnd_Rocket_04_HE_F: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F { + displayNameShort = "70mm AP"; + }; + + class 24Rnd_PG_missiles: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + class 12Rnd_PG_missiles: 24Rnd_PG_missiles { + displayNameShort = "70mm HE"; + }; + + class 2000Rnd_65x39_Belt; + class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt { + displayNameShort = "7.62mm"; + }; + class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt { + displayNameShort = "7.62mm"; + }; + + class 500Rnd_127x99_mag: VehicleMagazine { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Green: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Red: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 500Rnd_127x99_mag_Tracer_Yellow: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + + class 200Rnd_127x99_mag: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Green: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Red: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 200Rnd_127x99_mag_Tracer_Yellow: 200Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + + class 100Rnd_127x99_mag: 500Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Green: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Red: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + class 100Rnd_127x99_mag_Tracer_Yellow: 100Rnd_127x99_mag { + displayNameShort = "12.7mm"; + }; + + class 200Rnd_40mm_G_belt: VehicleMagazine { + displayNameShort = "40mm HE"; + }; + + class 24Rnd_missiles: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + + class 300Rnd_20mm_shells: VehicleMagazine { + displayNameShort = "20mm HE"; + }; + + class 14Rnd_80mm_rockets: VehicleMagazine { + displayNameShort = "70mm HE"; + }; + + class 250Rnd_30mm_HE_shells: VehicleMagazine { + displayNameShort = "30mm HE"; + }; + class 250Rnd_30mm_APDS_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm APDS"; + }; + + class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F { + displayNameShort = "80mm HE"; + }; + + class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F { + displayNameShort = "80mm AP"; + }; + + class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F { + displayNameShort = "30mm HEI-T"; + }; + + class 680Rnd_35mm_AA_shells: VehicleMagazine { + displayNameShort = "35mm HEI"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Red: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Green: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + class 680Rnd_35mm_AA_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells { + displayNameShort = "35mm HEI-T"; + }; + + class 32Rnd_155mm_Mo_shells: VehicleMagazine { + displayNameShort = "155mm HE"; + }; + class 6Rnd_155mm_Mo_smoke: 32Rnd_155mm_Mo_shells { + displayNameShort = "155mm Smoke"; + }; + class 6Rnd_155mm_Mo_mine: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Mines"; + }; + class 6Rnd_155mm_Mo_AT_mine: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm AT Mines"; + }; + class 2Rnd_155mm_Mo_Cluster: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Cluster"; + }; + class 2Rnd_155mm_Mo_guided: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Guided"; + }; + class 2Rnd_155mm_Mo_LG: 6Rnd_155mm_Mo_smoke { + displayNameShort = "155mm Laser Guided"; + }; + + class 12Rnd_230mm_rockets: 14Rnd_80mm_rockets { + displayName = "227mm HE Missile"; + displayNameShort = "227mm HE"; + }; + + class 30Rnd_120mm_HE_shells: VehicleMagazine { + displayNameShort = "120mm HE"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Red: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Green: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + class 30Rnd_120mm_HE_shells_Tracer_Yellow: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm HE-T"; + }; + + class 30Rnd_120mm_APFSDS_shells: 30Rnd_120mm_HE_shells { + displayNameShort = "120mm AP"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Red: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Green: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + class 30Rnd_120mm_APFSDS_shells_Tracer_Yellow: 30Rnd_120mm_APFSDS_shells { + displayNameShort = "120mm AP-T"; + }; + + class 200Rnd_762x51_Belt: VehicleMagazine { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_Red: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_Green: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_Yellow: 200Rnd_762x51_Belt {}; + class 200Rnd_762x51_Belt_T_Red: 200Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_T_Green: 200Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + class 200Rnd_762x51_Belt_T_Yellow: 200Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; + + class 2000Rnd_762x51_Belt_Red; + class 2000Rnd_762x51_Belt_T_Red: 2000Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + + class 2000Rnd_762x51_Belt_Green; + class 2000Rnd_762x51_Belt_T_Green: 2000Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + + class 2000Rnd_762x51_Belt_Yellow; + class 2000Rnd_762x51_Belt_T_Yellow: 2000Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; + + class 1000Rnd_762x51_Belt_Red; + class 1000Rnd_762x51_Belt_T_Red: 1000Rnd_762x51_Belt_Red { + displayNameShort = "7.62mm"; + }; + + class 1000Rnd_762x51_Belt_Green; + class 1000Rnd_762x51_Belt_T_Green: 1000Rnd_762x51_Belt_Green { + displayNameShort = "7.62mm"; + }; + + class 1000Rnd_762x51_Belt_Yellow; + class 1000Rnd_762x51_Belt_T_Yellow: 1000Rnd_762x51_Belt_Yellow { + displayNameShort = "7.62mm"; + }; + + class 16Rnd_120mm_HE_shells; + class 12Rnd_125mm_HE: 16Rnd_120mm_HE_shells { + displayNameShort = "125mm HE"; + }; + + class 16Rnd_120mm_HE_shells_Tracer_Red; + class 12Rnd_125mm_HE_T_Red: 16Rnd_120mm_HE_shells_Tracer_Red { + displayNameShort = "125mm HE-T"; + }; + + class 16Rnd_120mm_HE_shells_Tracer_Green; + class 12Rnd_125mm_HE_T_Green: 16Rnd_120mm_HE_shells_Tracer_Green { + displayNameShort = "125mm HE-T"; + }; + + class 16Rnd_120mm_HE_shells_Tracer_Yellow; + class 12Rnd_125mm_HE_T_Yellow: 16Rnd_120mm_HE_shells_Tracer_Yellow { + displayNameShort = "125mm HE-T"; + }; + + class 12Rnd_125mm_HEAT: 12Rnd_125mm_HE { + displayNameShort = "125mm MP"; + }; + class 12Rnd_125mm_HEAT_T_Red: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + class 12Rnd_125mm_HEAT_T_Green: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + class 12Rnd_125mm_HEAT_T_Yellow: 12Rnd_125mm_HEAT { + displayNameShort = "125mm MP-T"; + }; + + class 32Rnd_120mm_APFSDS_shells; + class 24Rnd_125mm_APFSDS: 32Rnd_120mm_APFSDS_shells { + displayNameShort = "125mm AP"; + }; + + class 32Rnd_120mm_APFSDS_shells_Tracer_Red; + class 24Rnd_125mm_APFSDS_T_Red: 32Rnd_120mm_APFSDS_shells_Tracer_Red { + displayNameShort = "125mm AP-T"; + }; + + class 32Rnd_120mm_APFSDS_shells_Tracer_Green; + class 24Rnd_125mm_APFSDS_T_Green: 32Rnd_120mm_APFSDS_shells_Tracer_Green { + displayNameShort = "125mm AP-T"; + }; + + class 32Rnd_120mm_APFSDS_shells_Tracer_Yellow; + class 24Rnd_125mm_APFSDS_T_Yellow: 32Rnd_120mm_APFSDS_shells_Tracer_Yellow { + displayNameShort = "125mm AP-T"; + }; + + class 20Rnd_105mm_HEAT_MP: 12Rnd_125mm_HEAT { + displayNameShort = "105mm MP"; + }; + class 20Rnd_105mm_HEAT_MP_T_Red: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + class 20Rnd_105mm_HEAT_MP_T_Green: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + class 20Rnd_105mm_HEAT_MP_T_Yellow: 20Rnd_105mm_HEAT_MP { + displayNameShort = "105mm MP-T"; + }; + + class 40Rnd_105mm_APFSDS: 24Rnd_125mm_APFSDS { + displayNameShort = "105mm AP"; + }; + class 40Rnd_105mm_APFSDS_T_Red: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + class 40Rnd_105mm_APFSDS_T_Green: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + class 40Rnd_105mm_APFSDS_T_Yellow: 40Rnd_105mm_APFSDS { + displayNameShort = "105mm AP-T"; + }; + + class 60Rnd_40mm_GPR_shells: VehicleMagazine { + displayNameShort = "40mm GPR"; + }; + class 60Rnd_40mm_GPR_Tracer_Red_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + class 60Rnd_40mm_GPR_Tracer_Green_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + class 60Rnd_40mm_GPR_Tracer_Yellow_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm GPR-T"; + }; + + class 40Rnd_40mm_APFSDS_shells: 60Rnd_40mm_GPR_shells { + displayNameShort = "40mm AP"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Red_shells: 40Rnd_40mm_APFSDS_shells { + displayNameShort = "40mm AP-T"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Green_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { + displayNameShort = "40mm AP-T"; + }; + class 40Rnd_40mm_APFSDS_Tracer_Yellow_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { + displayNameShort = "40mm AP-T"; + }; + + class 450Rnd_127x108_Ball: VehicleMagazine { + displayNameShort = "12.7mm"; + }; + + class 140Rnd_30mm_MP_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm MP"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Red: 140Rnd_30mm_MP_shells { + displayNameShort = "30mm MP-T"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Green: 140Rnd_30mm_MP_shells_Tracer_Red { + displayNameShort = "30mm MP-T"; + }; + class 140Rnd_30mm_MP_shells_Tracer_Yellow: 140Rnd_30mm_MP_shells_Tracer_Red { + displayNameShort = "30mm MP-T"; + }; + + class 60Rnd_30mm_APFSDS_shells: 250Rnd_30mm_HE_shells { + displayNameShort = "30mm AP"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Red: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Green: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + class 60Rnd_30mm_APFSDS_shells_Tracer_Yellow: 60Rnd_30mm_APFSDS_shells { + displayNameShort = "30mm AP-T"; + }; + + class 200Rnd_20mm_G_belt: VehicleMagazine { + displayNameShort = "20mm HE"; + }; + class 40Rnd_20mm_G_belt: 200Rnd_20mm_G_belt { + displayNameShort = "20mm HE"; + }; + + // mines + class CA_Magazine; + // http://en.wikipedia.org/wiki/M15_mine + class ATMine_Range_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_ATMine_Name"; + }; + // http://en.wikipedia.org/wiki/VS-50_mine + class APERSMine_Range_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; + }; + // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html + class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; + }; + // http://en.wikipedia.org/wiki/PMR-3_mine + class APERSTripMine_Wire_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; + }; + // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf + class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { + displayName = "$STR_ACE_RealisticNames_SLAM_Name"; + }; + + // claymore + class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_Claymore_Name"; + }; + + // satchels + class SatchelCharge_Remote_Mag: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; + }; + class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { + displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; + }; + + // hand grenades + class HandGrenade: CA_Magazine { + displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; + }; + class SmokeShell: HandGrenade { + displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; + }; + class SmokeShellBlue: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; + }; + class SmokeShellGreen: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; + }; + class SmokeShellOrange: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; + }; + class SmokeShellPurple: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; + }; + class SmokeShellRed: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; + }; + class SmokeShellYellow: SmokeShell { + displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; + }; +}; diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp new file mode 100644 index 0000000000..218e04ff09 --- /dev/null +++ b/addons/realisticnames/CfgVehicles.hpp @@ -0,0 +1,555 @@ + +class CfgVehicles { + // static weapons + class StaticMGWeapon; + class HMG_01_base_F: StaticMGWeapon { + displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; + }; + class HMG_01_A_base_F: HMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; + }; + class HMG_01_high_base_F: HMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; + }; + + class AT_01_base_F; + class B_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + class O_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + class I_static_AT_F: AT_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AT_Name"; + }; + + class AA_01_base_F; + class B_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + class O_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + class I_static_AA_F: AA_01_base_F { + displayName = "$STR_ACE_RealisticNames_static_AA_Name"; + }; + + class GMG_TriPod; + class GMG_01_base_F: GMG_TriPod { + displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; + }; + class GMG_01_A_base_F: GMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; + }; + class GMG_01_high_base_F: GMG_01_base_F { + displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; + }; + + // M-ATV + class MRAP_01_base_F; + class B_MRAP_01_F: MRAP_01_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; + }; + + class MRAP_01_gmg_base_F: MRAP_01_base_F {}; + class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; + }; + + class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; + class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; + }; + + // punisher + class MRAP_02_base_F; + class O_MRAP_02_F: MRAP_02_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; + }; + + class MRAP_02_hmg_base_F: MRAP_02_base_F {}; + class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; + }; + + class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; + class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; + }; + + // strider + class MRAP_03_base_F; + class I_MRAP_03_F: MRAP_03_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; + }; + + class MRAP_03_hmg_base_F: MRAP_03_base_F {}; + class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; + }; + + class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; + class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { + displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; + }; + + // merkava derivates + class MBT_01_base_F; + class B_MBT_01_base_F: MBT_01_base_F {}; + + class B_MBT_01_cannon_F: B_MBT_01_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; + }; + class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; + }; + + class MBT_01_arty_base_F: MBT_01_base_F {}; + class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; + + class B_MBT_01_arty_F: B_MBT_01_arty_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; + }; + + class MBT_01_mlrs_base_F: MBT_01_base_F {}; + class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; + + class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. + }; + + // T100 derivates + class MBT_02_base_F; + class O_MBT_02_base_F: MBT_02_base_F {}; + + class O_MBT_02_cannon_F: O_MBT_02_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; + }; + + class MBT_02_arty_base_F: MBT_02_base_F {}; + class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; + + class O_MBT_02_arty_F: O_MBT_02_arty_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; + }; + + // leopard sg + class I_MBT_03_base_F; + class I_MBT_03_cannon_F: I_MBT_03_base_F { + displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; + }; + + // tracked apcs + class B_APC_Tracked_01_base_F; + class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; + }; + + class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. + }; + + class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; + }; + + class O_APC_Tracked_02_base_F; + class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; + }; + + class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; + }; + + class I_APC_tracked_03_base_F; + class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { + displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; + }; + + // wheeled apcs + class B_APC_Wheeled_01_base_F; + class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; + }; + + class O_APC_Wheeled_02_base_F; + class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; + }; + + class I_APC_Wheeled_03_base_F; + class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { + displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; + }; + + // trucks + class Truck_01_base_F; + class B_Truck_01_transport_F: Truck_01_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; + }; + class B_Truck_01_covered_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; + }; + class B_Truck_01_mover_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; + }; + class B_Truck_01_box_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; + }; + class B_Truck_01_medical_F: B_Truck_01_transport_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; + }; + class B_Truck_01_ammo_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; + }; + class B_Truck_01_fuel_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; + }; + class B_Truck_01_Repair_F: B_Truck_01_mover_F { + displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; + }; + class Truck_02_transport_base_F; + class O_Truck_02_transport_F: Truck_02_transport_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + }; + class Truck_02_base_F; + class O_Truck_02_covered_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + }; + class Truck_02_Ammo_base_F; + class O_Truck_02_ammo_F: Truck_02_Ammo_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + }; + class Truck_02_fuel_base_F; + class O_Truck_02_fuel_F: Truck_02_fuel_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + }; + class Truck_02_box_base_F; + class O_Truck_02_box_F: Truck_02_box_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + }; + class Truck_02_medical_base_F; + class O_Truck_02_medical_F: Truck_02_medical_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + }; + class I_Truck_02_transport_F: Truck_02_transport_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; + }; + class I_Truck_02_covered_F: Truck_02_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; + }; + class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; + }; + class I_Truck_02_fuel_F: Truck_02_fuel_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; + }; + class I_Truck_02_box_F: Truck_02_box_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; + }; + class I_Truck_02_medical_F: Truck_02_medical_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; + }; + + class Truck_03_base_F; + class O_Truck_03_transport_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; + }; + class O_Truck_03_covered_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; + }; + class O_Truck_03_device_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; + }; + class O_Truck_03_ammo_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; + }; + class O_Truck_03_fuel_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; + }; + class O_Truck_03_repair_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; + }; + class O_Truck_03_medical_F: Truck_03_base_F { + displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; + }; + + // helicopters + class Heli_Attack_01_base_F; + class B_Heli_Attack_01_F: Heli_Attack_01_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; + }; + + class Heli_Light_01_unarmed_base_F; + class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; + }; + + class Heli_Light_01_armed_base_F; + class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; + }; + + class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; + }; + + class Heli_Transport_03_base_F; + class B_Heli_Transport_03_F: Heli_Transport_03_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; + }; + class Heli_Transport_03_unarmed_base_F; + class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; + }; + + class Heli_Light_02_base_F; + class O_Heli_Light_02_F: Heli_Light_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; + }; + class Heli_Light_02_unarmed_base_F; + class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; + }; + + class Heli_light_03_base_F; + class I_Heli_light_03_F: Heli_light_03_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; + }; + + class Heli_light_03_unarmed_base_F; + class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; + }; + + class Heli_Transport_02_base_F; + class I_Heli_Transport_02_F: Heli_Transport_02_base_F { + displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; + }; + + // planes + class Plane_CAS_01_base_F; + class B_Plane_CAS_01_F: Plane_CAS_01_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; + }; + + class Plane_CAS_02_base_F; + class O_Plane_CAS_02_F: Plane_CAS_02_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; + }; + + class Plane_Fighter_03_base_F; + class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { + displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; + }; + + class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { + displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; + }; + + // uavs + class UAV_02_base_F; + class B_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + class O_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + class I_UAV_02_F: UAV_02_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; + }; + + class UAV_02_CAS_base_F: UAV_02_base_F {}; + class B_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + class O_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + class I_UAV_02_CAS_F: UAV_02_CAS_base_F { + displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; + }; + + // pistols + class Pistol_Base_F; + class Weapon_hgun_P07_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + }; + + class Weapon_hgun_Rook40_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + }; + + class Weapon_hgun_ACPC2_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + }; + + class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + }; + + class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + }; + + class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + }; + + // rocket launchers + class Launcher_Base_F; + class Weapon_launch_NLAW_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + }; + + class Weapon_launch_RPG32_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + }; + + class Weapon_launch_Titan_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + + class Weapon_launch_Titan_short_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + + class Weapon_launch_B_Titan_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; + //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; + + class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; + + // rifles + + // MX + class Weapon_Base_F; + class Weapon_arifle_MX_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + }; + + class Weapon_arifle_MXC_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + }; + + class Weapon_arifle_MX_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + }; + + class Weapon_arifle_MX_SW_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + }; + + class Weapon_arifle_MXM_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + }; + + // Katiba + class Weapon_arifle_Katiba_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + }; + + class Weapon_arifle_Katiba_C_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + }; + + class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + }; + + // F2000 + class Weapon_arifle_Mk20_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + }; + + class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + }; + + class Weapon_arifle_Mk20C_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + }; + + class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + }; + + class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + }; + + class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + }; + + // TAR-21 + class Weapon_arifle_TRG21_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + }; + + class Weapon_arifle_TRG20_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + }; + + class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + }; + + // sub machine guns + class Weapon_SMG_01_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + }; + + class Weapon_SMG_02_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + }; + + class Weapon_hgun_PDW2000_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + }; + + class Weapon_arifle_SDAR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + }; + + // machine guns + class Weapon_LMG_Mk200_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + }; + + class Weapon_LMG_Zafir_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + }; + + // sniper rifles + class Weapon_srifle_EBR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + }; + + class Weapon_srifle_GM6_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + }; + + class Weapon_srifle_GM6_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + }; + + class Weapon_srifle_LRR_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + }; + + class Weapon_srifle_LRR_camo_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + }; + + class Weapon_srifle_DMR_01_F: Weapon_Base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + }; +}; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp new file mode 100644 index 0000000000..8e64434bd4 --- /dev/null +++ b/addons/realisticnames/CfgWeapons.hpp @@ -0,0 +1,461 @@ + +class Mode_FullAuto; + +class CfgWeapons { + // assault rifles + + // MX + class arifle_MX_Base_F; + class arifle_MX_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; + }; + class arifle_MX_Black_F: arifle_MX_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; + }; + + class arifle_MXC_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; + }; + class arifle_MXC_Black_F: arifle_MXC_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; + }; + + class arifle_MX_GL_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; + }; + class arifle_MX_GL_Black_F: arifle_MX_GL_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; + }; + + class arifle_MX_SW_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; + }; + class arifle_MX_SW_Black_F: arifle_MX_SW_F { + displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; + }; + + class arifle_MXM_F: arifle_MX_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; + }; + class arifle_MXM_Black_F: arifle_MXM_F { + displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; + }; + + // Katiba + class arifle_katiba_Base_F; + class arifle_Katiba_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; + }; + class arifle_Katiba_GL_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; + }; + class arifle_Katiba_C_F: arifle_katiba_Base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; + }; + + // SDAR + class SDAR_base_F; + class arifle_SDAR_F: SDAR_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; + }; + + // TAR-21 + class Tavor_base_F; + class arifle_TRG21_F: Tavor_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; + }; + class arifle_TRG21_GL_F: arifle_TRG21_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; + }; + class arifle_TRG20_F: Tavor_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; + }; + + // F2000 + class mk20_base_F; + class arifle_Mk20_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; + }; + class arifle_Mk20_plain_F: arifle_Mk20_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; + }; + + class arifle_Mk20C_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; + }; + class arifle_Mk20C_plain_F: arifle_Mk20C_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; + }; + + class arifle_Mk20_GL_F: mk20_base_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; + }; + class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { + displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; + }; + + // Vector + class SMG_01_Base; + class SMG_01_F: SMG_01_Base { + displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; + }; + + // Scorpion + class SMG_02_base_F; + class SMG_02_F: SMG_02_base_F { + displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; + }; + + // PDW 2000 + class pdw2000_base_F; + class hgun_pdw2000_F: pdw2000_base_F { + displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; + }; + + // pistols + class Pistol_Base_F; + class hgun_P07_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; + }; + + class hgun_Rook40_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; + }; + + class hgun_ACPC2_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; + }; + + class hgun_Pistol_heavy_01_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; + }; + + class hgun_Pistol_heavy_02_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; + }; + + class hgun_Pistol_Signal_F: Pistol_Base_F { + displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; + }; + + // machine guns + class Rifle_Long_Base_F; + class LMG_Mk200_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; + }; + + class LMG_Zafir_F: Rifle_Long_Base_F { + displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; + }; + + // sniper rifles + class EBR_base_F; + class srifle_EBR_F: EBR_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; + }; + + class LRR_base_F; + class srifle_LRR_F: LRR_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; + }; + class srifle_LRR_camo_F: srifle_LRR_F { + displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; + }; + + class GM6_base_F; + class srifle_GM6_F: GM6_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; + }; + class srifle_GM6_camo_F: srifle_GM6_F { + displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; + }; + + class DMR_01_base_F; + class srifle_DMR_01_F: DMR_01_base_F { + displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; + }; + + // launchers + class Launcher_Base_F; + class launch_RPG32_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; + }; + + class launch_Titan_base: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; + }; + class launch_Titan_short_base: launch_Titan_base { + displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; + }; + + class launch_NLAW_F: Launcher_Base_F { + displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; + }; + + // vehicle weapons + + // gatlings + class CannonCore; + class gatling_20mm: CannonCore { + //displayName = ""; + class manual: CannonCore { + //displayName = ""; + }; + }; + class Twin_Cannon_20mm: gatling_20mm { + displayName = "Plamen PL-20"; + class manual: manual { + displayName = "Plamen PL-20"; + }; + }; + + class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels + displayName = "GSh-3-30"; + class LowROF: Mode_FullAuto { + displayName = "GSh-3-30"; + }; + }; + + class Gatling_30mm_Plane_CAS_01_F: CannonCore { + displayName = "GAU-8"; + class LowROF: Mode_FullAuto { + displayName = "GAU-8"; + }; + }; + + class Cannon_30mm_Plane_CAS_02_F: CannonCore { + displayName = "GSh-301"; + class LowROF: Mode_FullAuto { + displayName = "GSh-301"; + }; + }; + + // missiles + class RocketPods; + class Missile_AA_04_Plane_CAS_01_F: RocketPods { + displayName = "AIM-9 Sidewinder"; + }; + class Missile_AA_03_Plane_CAS_02_F: Missile_AA_04_Plane_CAS_01_F { + displayName = "Wympel R-73"; + }; + + class MissileLauncher; + class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { + displayName = "AGM-65 Maverick"; + }; + class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { + displayName = "Kh-25MTP"; + }; + + // rockets + class Rocket_04_HE_Plane_CAS_01_F: RocketPods { + displayName = "Hydra 70"; + class Burst: RocketPods { + displayName = "Hydra 70"; + }; + }; + class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F { + displayName = "Hydra 70"; + }; + + class Rocket_03_HE_Plane_CAS_02_F: Rocket_04_HE_Plane_CAS_01_F { + displayName = "S-8"; + class Burst: Burst { + displayName = "S-8"; + }; + }; + class Rocket_03_AP_Plane_CAS_02_F: Rocket_04_AP_Plane_CAS_01_F { + displayName = "S-8"; + class Burst: Burst { + displayName = "S-8"; + }; + }; + + class rockets_Skyfire: RocketPods { + displayName = "Skyfire-70"; + class Burst: RocketPods { + displayName = "Skyfire-70"; + }; + }; + + // more missiles + class missiles_DAR: RocketPods { + displayName = "Hydra 70"; + class Burst: RocketPods { + displayName = "Hydra 70"; + }; + }; + + class missiles_DAGR: RocketPods { + displayName = "DAGR"; + class Burst: RocketPods { + displayName = "DAGR"; + }; + }; + + class missiles_ASRAAM: MissileLauncher { + displayName = "AIM-132 ASRAAM"; + }; + + class missiles_Zephyr: MissileLauncher { + displayName = "AIM-120A AMRAAM"; + }; + + class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on + displayName = "9K121 Vikhr"; + }; + + // bomb + class Bomb_04_Plane_CAS_01_F: RocketPods { + //displayName = ""; + }; + class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { + displayName = "FAB-250M-54"; + }; + + // machine guns + class MGunCore; + class M134_minigun: MGunCore { + displayName = "2x M134 Minigun"; + }; + + class LMG_RCWS; + class MGun; + + class LMG_Minigun: LMG_RCWS { + displayName = "M134 Minigun"; + class manual: MGun { + displayName = "M134 Minigun"; + }; + }; + + class HMG_127: LMG_RCWS { + displayName = "M2"; + class manual: MGun { + displayName = "M2"; + }; + }; + + class HMG_01: HMG_127 { + displayName = "XM312"; + }; + class HMG_M2: HMG_01 { + displayName = "M2"; + }; + + class HMG_NSVT: HMG_127 { + displayName = "NSVT"; + class manual: manual { + displayName = "NSVT"; + }; + }; + + // grenade launchers + class GMG_F; + class GMG_20mm: GMG_F { + displayName = "XM307"; + class manual: GMG_F { + displayName = "XM307"; + }; + }; + + class GMG_40mm: GMG_F { + displayName = "Mk 19"; + class manual: GMG_F { + displayName = "Mk 19"; + }; + }; + + // autocannons + class autocannon_35mm: CannonCore { + displayName = "GDF-001"; + class manual: CannonCore { + displayName = "GDF-001"; + }; + }; + + // aa missiles + class missiles_titan: MissileLauncher { + displayName = "Mini-Spike"; + }; + + // mortar + class mortar_155mm_AMOS: CannonCore { + displayName = "L/52"; + }; + + // artillery rockets + class rockets_230mm_GAT: RocketPods { + displayName = "M269"; + }; + + // tank guns + class cannon_120mm: CannonCore { + class player; + displayName = "MG251"; + }; + + class cannon_120mm_long: cannon_120mm { + displayName = "L/55"; + class player: player {}; + }; + + class cannon_105mm: cannon_120mm { + displayName = "M68"; + class player: player { + displayName = "M68"; + }; + }; + + class cannon_125mm: cannon_120mm { + displayName = "2A46"; + }; + + // coax machine guns + class LMG_coax: LMG_RCWS { + displayName = "PKT"; + }; + + class ACE_LMG_coax_MBT_01: LMG_coax { + displayName = "MAG 58"; + }; + + class ACE_LMG_coax_APC_Tracked_03: LMG_coax { + displayName = "L94A1"; + }; + + // more autocannons + class autocannon_Base_F; + class autocannon_40mm_CTWS: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + class AP: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + + class HE: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + }; + + class autocannon_30mm_CTWS: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + class AP: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + + class HE: autocannon_Base_F { + displayName = "Mk44 Bushmaster II"; + }; + }; + + class autocannon_30mm: autocannon_30mm_CTWS { + displayName = "L21A1 RARDEN"; + class AP: AP { + displayName = "L21A1 RARDEN"; + }; + + class HE: HE { + displayName = "L21A1 RARDEN"; + }; + }; +}; diff --git a/addons/realisticnames/config.cpp b/addons/realisticnames/config.cpp index e7a7984721..6a8ea59290 100644 --- a/addons/realisticnames/config.cpp +++ b/addons/realisticnames/config.cpp @@ -12,1439 +12,6 @@ class CfgPatches { }; }; -// VEHICLES -class CfgVehicles { - // static weapons - class StaticMGWeapon; - class HMG_01_base_F: StaticMGWeapon { - displayName = "$STR_ACE_RealisticNames_HMG_01_Name"; - }; - class HMG_01_A_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_A_Name"; - }; - class HMG_01_high_base_F: HMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_HMG_01_high_Name"; - }; - - class AT_01_base_F; - class B_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - class O_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - class I_static_AT_F: AT_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AT_Name"; - }; - - class AA_01_base_F; - class B_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - class O_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - class I_static_AA_F: AA_01_base_F { - displayName = "$STR_ACE_RealisticNames_static_AA_Name"; - }; - - class GMG_TriPod; - class GMG_01_base_F: GMG_TriPod { - displayName = "$STR_ACE_RealisticNames_GMG_01_Name"; - }; - class GMG_01_A_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_A_Name"; - }; - class GMG_01_high_base_F: GMG_01_base_F { - displayName = "$STR_ACE_RealisticNames_GMG_01_high_Name"; - }; - - // M-ATV - class MRAP_01_base_F; - class B_MRAP_01_F: MRAP_01_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_Name"; - }; - - class MRAP_01_gmg_base_F: MRAP_01_base_F {}; - class B_MRAP_01_gmg_F: MRAP_01_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_gmg_Name"; - }; - - class MRAP_01_hmg_base_F: MRAP_01_gmg_base_F {}; - class B_MRAP_01_hmg_F: MRAP_01_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_01_hmg_Name"; - }; - - // punisher - class MRAP_02_base_F; - class O_MRAP_02_F: MRAP_02_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_Name"; - }; - - class MRAP_02_hmg_base_F: MRAP_02_base_F {}; - class O_MRAP_02_hmg_F: MRAP_02_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_hmg_Name"; - }; - - class MRAP_02_gmg_base_F: MRAP_02_hmg_base_F {}; - class O_MRAP_02_gmg_F: MRAP_02_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_02_gmg_Name"; - }; - - // strider - class MRAP_03_base_F; - class I_MRAP_03_F: MRAP_03_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_Name"; - }; - - class MRAP_03_hmg_base_F: MRAP_03_base_F {}; - class I_MRAP_03_hmg_F: MRAP_03_hmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_hmg_Name"; - }; - - class MRAP_03_gmg_base_F: MRAP_03_hmg_base_F {}; - class I_MRAP_03_gmg_F: MRAP_03_gmg_base_F { - displayName = "$STR_ACE_RealisticNames_MRAP_03_gmg_Name"; - }; - - // merkava derivates - class MBT_01_base_F; - class B_MBT_01_base_F: MBT_01_base_F {}; - - class B_MBT_01_cannon_F: B_MBT_01_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_cannon_Name"; - }; - class B_MBT_01_TUSK_F: B_MBT_01_cannon_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_TUSK_Name"; - }; - - class MBT_01_arty_base_F: MBT_01_base_F {}; - class B_MBT_01_arty_base_F: MBT_01_arty_base_F {}; - - class B_MBT_01_arty_F: B_MBT_01_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_arty_Name"; - }; - - class MBT_01_mlrs_base_F: MBT_01_base_F {}; - class B_MBT_01_mlrs_base_F: MBT_01_mlrs_base_F {}; - - class B_MBT_01_mlrs_F: B_MBT_01_mlrs_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_01_mlrs_Name"; // Fictional name, (probably wrong) hebrew translation of storm. - }; - - // T100 derivates - class MBT_02_base_F; - class O_MBT_02_base_F: MBT_02_base_F {}; - - class O_MBT_02_cannon_F: O_MBT_02_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_cannon_Name"; - }; - - class MBT_02_arty_base_F: MBT_02_base_F {}; - class O_MBT_02_arty_base_F: MBT_02_arty_base_F {}; - - class O_MBT_02_arty_F: O_MBT_02_arty_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_02_arty_Name"; - }; - - // leopard sg - class I_MBT_03_base_F; - class I_MBT_03_cannon_F: I_MBT_03_base_F { - displayName = "$STR_ACE_RealisticNames_MBT_03_cannon_Name"; - }; - - // tracked apcs - class B_APC_Tracked_01_base_F; - class B_APC_Tracked_01_rcws_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_rcws_Name"; - }; - - class B_APC_Tracked_01_AA_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_AA_Name"; // Fictional name, (probably wrong) hebrew translation of cheetah. - }; - - class B_APC_Tracked_01_CRV_F: B_APC_Tracked_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_01_CRV_Name"; - }; - - class O_APC_Tracked_02_base_F; - class O_APC_Tracked_02_cannon_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_cannon_Name"; - }; - - class O_APC_Tracked_02_AA_F: O_APC_Tracked_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Tracked_02_AA_Name"; - }; - - class I_APC_tracked_03_base_F; - class I_APC_tracked_03_cannon_F: I_APC_tracked_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_tracked_03_cannon_Name"; - }; - - // wheeled apcs - class B_APC_Wheeled_01_base_F; - class B_APC_Wheeled_01_cannon_F: B_APC_Wheeled_01_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_cannon_Name"; - }; - - class O_APC_Wheeled_02_base_F; - class O_APC_Wheeled_02_rcws_F: O_APC_Wheeled_02_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_02_rcws_Name"; - }; - - class I_APC_Wheeled_03_base_F; - class I_APC_Wheeled_03_cannon_F: I_APC_Wheeled_03_base_F { - displayName = "$STR_ACE_RealisticNames_APC_Wheeled_03_cannon_Name"; - }; - - // trucks - class Truck_01_base_F; - class B_Truck_01_transport_F: Truck_01_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_transport_Name"; - }; - class B_Truck_01_covered_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_covered_Name"; - }; - class B_Truck_01_mover_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_mover_Name"; - }; - class B_Truck_01_box_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_box_Name"; - }; - class B_Truck_01_medical_F: B_Truck_01_transport_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_medical_Name"; - }; - class B_Truck_01_ammo_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_ammo_Name"; - }; - class B_Truck_01_fuel_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_fuel_Name"; - }; - class B_Truck_01_Repair_F: B_Truck_01_mover_F { - displayName = "$STR_ACE_RealisticNames_Truck_01_Repair_Name"; - }; - class Truck_02_transport_base_F; - class O_Truck_02_transport_F: Truck_02_transport_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; - }; - class Truck_02_base_F; - class O_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; - }; - class Truck_02_Ammo_base_F; - class O_Truck_02_ammo_F: Truck_02_Ammo_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; - }; - class Truck_02_fuel_base_F; - class O_Truck_02_fuel_F: Truck_02_fuel_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; - }; - class Truck_02_box_base_F; - class O_Truck_02_box_F: Truck_02_box_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; - }; - class Truck_02_medical_base_F; - class O_Truck_02_medical_F: Truck_02_medical_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; - }; - class I_Truck_02_transport_F: Truck_02_transport_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_transport_Name"; - }; - class I_Truck_02_covered_F: Truck_02_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_covered_Name"; - }; - class I_Truck_02_ammo_F: Truck_02_Ammo_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_ammo_Name"; - }; - class I_Truck_02_fuel_F: Truck_02_fuel_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_fuel_Name"; - }; - class I_Truck_02_box_F: Truck_02_box_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_box_Name"; - }; - class I_Truck_02_medical_F: Truck_02_medical_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_02_medical_Name"; - }; - - class Truck_03_base_F; - class O_Truck_03_transport_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_transport_Name"; - }; - class O_Truck_03_covered_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_covered_Name"; - }; - class O_Truck_03_device_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_device_Name"; - }; - class O_Truck_03_ammo_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_ammo_Name"; - }; - class O_Truck_03_fuel_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_fuel_Name"; - }; - class O_Truck_03_repair_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_repair_Name"; - }; - class O_Truck_03_medical_F: Truck_03_base_F { - displayName = "$STR_ACE_RealisticNames_Truck_03_medical_Name"; - }; - - // helicopters - class Heli_Attack_01_base_F; - class B_Heli_Attack_01_F: Heli_Attack_01_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Attack_01_Name"; - }; - - class Heli_Light_01_unarmed_base_F; - class B_Heli_Light_01_F: Heli_Light_01_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_Name"; - }; - - class Heli_Light_01_armed_base_F; - class B_Heli_Light_01_armed_F: Heli_Light_01_armed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_armed_Name"; - }; - - class Heli_Light_01_civil_base_F: Heli_Light_01_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_01_civil_Name"; - }; - - class Heli_Transport_03_base_F; - class B_Heli_Transport_03_F: Heli_Transport_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_Name"; - }; - class Heli_Transport_03_unarmed_base_F; - class B_Heli_Transport_03_unarmed_F: Heli_Transport_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_03_unarmed_Name"; - }; - - class Heli_Light_02_base_F; - class O_Heli_Light_02_F: Heli_Light_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_Name"; - }; - class Heli_Light_02_unarmed_base_F; - class O_Heli_Light_02_unarmed_F: Heli_Light_02_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Light_02_unarmed_Name"; - }; - - class Heli_light_03_base_F; - class I_Heli_light_03_F: Heli_light_03_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_Name"; - }; - - class Heli_light_03_unarmed_base_F; - class I_Heli_light_03_unarmed_F: Heli_light_03_unarmed_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_light_03_unarmed_Name"; - }; - - class Heli_Transport_02_base_F; - class I_Heli_Transport_02_F: Heli_Transport_02_base_F { - displayName = "$STR_ACE_RealisticNames_Heli_Transport_02_Name"; - }; - - // planes - class Plane_CAS_01_base_F; - class B_Plane_CAS_01_F: Plane_CAS_01_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_01_Name"; - }; - - class Plane_CAS_02_base_F; - class O_Plane_CAS_02_F: Plane_CAS_02_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_CAS_02_Name"; - }; - - class Plane_Fighter_03_base_F; - class I_Plane_Fighter_03_CAS_F: Plane_Fighter_03_base_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_CAS_Name"; - }; - - class I_Plane_Fighter_03_AA_F: I_Plane_Fighter_03_CAS_F { - displayName = "$STR_ACE_RealisticNames_Plane_Fighter_03_AA_Name"; - }; - - // uavs - class UAV_02_base_F; - class B_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - class O_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - class I_UAV_02_F: UAV_02_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_Name"; - }; - - class UAV_02_CAS_base_F: UAV_02_base_F {}; - class B_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - class O_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - class I_UAV_02_CAS_F: UAV_02_CAS_base_F { - displayName = "$STR_ACE_RealisticNames_UAV_02_CAS_Name"; - }; - - // pistols - class Pistol_Base_F; - class Weapon_hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; - }; - - class Weapon_hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; - }; - - class Weapon_hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; - }; - - class Weapon_hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; - }; - - class Weapon_hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; - }; - - class Weapon_hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; - }; - - // rocket launchers - class Launcher_Base_F; - class Weapon_launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; - }; - - class Weapon_launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; - }; - - class Weapon_launch_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - - class Weapon_launch_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - - class Weapon_launch_B_Titan_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; - //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; - - class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; - - // rifles - - // MX - class Weapon_Base_F; - class Weapon_arifle_MX_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; - }; - - class Weapon_arifle_MXC_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; - }; - - class Weapon_arifle_MX_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; - }; - - class Weapon_arifle_MX_SW_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; - }; - - class Weapon_arifle_MXM_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; - }; - - // Katiba - class Weapon_arifle_Katiba_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; - }; - - class Weapon_arifle_Katiba_C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; - }; - - class Weapon_arifle_Katiba_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; - }; - - // F2000 - class Weapon_arifle_Mk20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; - }; - - class Weapon_arifle_Mk20_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; - }; - - class Weapon_arifle_Mk20C_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; - }; - - class Weapon_arifle_Mk20C_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; - }; - - class Weapon_arifle_Mk20_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; - }; - - class Weapon_arifle_Mk20_GL_plain_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; - }; - - // TAR-21 - class Weapon_arifle_TRG21_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; - }; - - class Weapon_arifle_TRG20_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; - }; - - class Weapon_arifle_TRG21_GL_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; - }; - - // sub machine guns - class Weapon_SMG_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; - }; - - class Weapon_SMG_02_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; - }; - - class Weapon_hgun_PDW2000_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; - }; - - class Weapon_arifle_SDAR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; - }; - - // machine guns - class Weapon_LMG_Mk200_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; - }; - - class Weapon_LMG_Zafir_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; - }; - - // sniper rifles - class Weapon_srifle_EBR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; - }; - - class Weapon_srifle_GM6_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; - }; - - class Weapon_srifle_GM6_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; - }; - - class Weapon_srifle_LRR_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; - }; - - class Weapon_srifle_LRR_camo_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; - }; - - class Weapon_srifle_DMR_01_F: Weapon_Base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; - }; -}; - -// WEAPONS -class Mode_FullAuto; - -class CfgWeapons { - // assault rifles - - // MX - class arifle_MX_Base_F; - class arifle_MX_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Name"; - }; - class arifle_MX_Black_F: arifle_MX_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_Black_Name"; - }; - - class arifle_MXC_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Name"; - }; - class arifle_MXC_Black_F: arifle_MXC_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXC_Black_Name"; - }; - - class arifle_MX_GL_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Name"; - }; - class arifle_MX_GL_Black_F: arifle_MX_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_GL_Black_Name"; - }; - - class arifle_MX_SW_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Name"; - }; - class arifle_MX_SW_Black_F: arifle_MX_SW_F { - displayName = "$STR_ACE_RealisticNames_arifle_MX_SW_Black_Name"; - }; - - class arifle_MXM_F: arifle_MX_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Name"; - }; - class arifle_MXM_Black_F: arifle_MXM_F { - displayName = "$STR_ACE_RealisticNames_arifle_MXM_Black_Name"; - }; - - // Katiba - class arifle_katiba_Base_F; - class arifle_Katiba_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_Name"; - }; - class arifle_Katiba_GL_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_GL_Name"; - }; - class arifle_Katiba_C_F: arifle_katiba_Base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Katiba_C_Name"; - }; - - // SDAR - class SDAR_base_F; - class arifle_SDAR_F: SDAR_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_SDAR_Name"; - }; - - // TAR-21 - class Tavor_base_F; - class arifle_TRG21_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_Name"; - }; - class arifle_TRG21_GL_F: arifle_TRG21_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG21_GL_Name"; - }; - class arifle_TRG20_F: Tavor_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_TRG20_Name"; - }; - - // F2000 - class mk20_base_F; - class arifle_Mk20_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_Name"; - }; - class arifle_Mk20_plain_F: arifle_Mk20_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_plain_Name"; - }; - - class arifle_Mk20C_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_Name"; - }; - class arifle_Mk20C_plain_F: arifle_Mk20C_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20C_plain_Name"; - }; - - class arifle_Mk20_GL_F: mk20_base_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_Name"; - }; - class arifle_Mk20_GL_plain_F: arifle_Mk20_GL_F { - displayName = "$STR_ACE_RealisticNames_arifle_Mk20_GL_plain_Name"; - }; - - // Vector - class SMG_01_Base; - class SMG_01_F: SMG_01_Base { - displayName = "$STR_ACE_RealisticNames_SMG_01_Name"; - }; - - // Scorpion - class SMG_02_base_F; - class SMG_02_F: SMG_02_base_F { - displayName = "$STR_ACE_RealisticNames_SMG_02_Name"; - }; - - // PDW 2000 - class pdw2000_base_F; - class hgun_pdw2000_F: pdw2000_base_F { - displayName = "$STR_ACE_RealisticNames_hgun_PDW2000_Name"; - }; - - // pistols - class Pistol_Base_F; - class hgun_P07_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_P07_Name"; - }; - - class hgun_Rook40_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Rook40_Name"; - }; - - class hgun_ACPC2_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_ACPC2_Name"; - }; - - class hgun_Pistol_heavy_01_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_01_Name"; - }; - - class hgun_Pistol_heavy_02_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_heavy_02_Name"; - }; - - class hgun_Pistol_Signal_F: Pistol_Base_F { - displayName = "$STR_ACE_RealisticNames_hgun_Pistol_Signal_Name"; - }; - - // machine guns - class Rifle_Long_Base_F; - class LMG_Mk200_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Mk200_Name"; - }; - - class LMG_Zafir_F: Rifle_Long_Base_F { - displayName = "$STR_ACE_RealisticNames_LMG_Zafir_Name"; - }; - - // sniper rifles - class EBR_base_F; - class srifle_EBR_F: EBR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_EBR_Name"; - }; - - class LRR_base_F; - class srifle_LRR_F: LRR_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_Name"; - }; - class srifle_LRR_camo_F: srifle_LRR_F { - displayName = "$STR_ACE_RealisticNames_srifle_LRR_camo_Name"; - }; - - class GM6_base_F; - class srifle_GM6_F: GM6_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_Name"; - }; - class srifle_GM6_camo_F: srifle_GM6_F { - displayName = "$STR_ACE_RealisticNames_srifle_GM6_camo_Name"; - }; - - class DMR_01_base_F; - class srifle_DMR_01_F: DMR_01_base_F { - displayName = "$STR_ACE_RealisticNames_srifle_DMR_01_Name"; - }; - - // launchers - class Launcher_Base_F; - class launch_RPG32_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; - }; - - class launch_Titan_base: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; - class launch_Titan_short_base: launch_Titan_base { - displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; - - class launch_NLAW_F: Launcher_Base_F { - displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; - }; - - // vehicle weapons - - // gatlings - class CannonCore; - class gatling_20mm: CannonCore { - //displayName = ""; - class manual: CannonCore { - //displayName = ""; - }; - }; - class Twin_Cannon_20mm: gatling_20mm { - displayName = "Plamen PL-20"; - class manual: manual { - displayName = "Plamen PL-20"; - }; - }; - - class gatling_30mm: CannonCore { // This is a fictional veresion of the GSh-6-30, with 3 barrels - displayName = "GSh-3-30"; - class LowROF: Mode_FullAuto { - displayName = "GSh-3-30"; - }; - }; - - class Gatling_30mm_Plane_CAS_01_F: CannonCore { - displayName = "GAU-8"; - class LowROF: Mode_FullAuto { - displayName = "GAU-8"; - }; - }; - - class Cannon_30mm_Plane_CAS_02_F: CannonCore { - displayName = "GSh-301"; - class LowROF: Mode_FullAuto { - displayName = "GSh-301"; - }; - }; - - // missiles - class RocketPods; - class Missile_AA_04_Plane_CAS_01_F: RocketPods { - displayName = "AIM-9 Sidewinder"; - }; - class Missile_AA_03_Plane_CAS_02_F: Missile_AA_04_Plane_CAS_01_F { - displayName = "Wympel R-73"; - }; - - class MissileLauncher; - class Missile_AGM_02_Plane_CAS_01_F: MissileLauncher { - displayName = "AGM-65 Maverick"; - }; - class Missile_AGM_01_Plane_CAS_02_F: Missile_AGM_02_Plane_CAS_01_F { - displayName = "Kh-25MTP"; - }; - - // rockets - class Rocket_04_HE_Plane_CAS_01_F: RocketPods { - displayName = "Hydra 70"; - class Burst: RocketPods { - displayName = "Hydra 70"; - }; - }; - class Rocket_04_AP_Plane_CAS_01_F: Rocket_04_HE_Plane_CAS_01_F { - displayName = "Hydra 70"; - }; - - class Rocket_03_HE_Plane_CAS_02_F: Rocket_04_HE_Plane_CAS_01_F { - displayName = "S-8"; - class Burst: Burst { - displayName = "S-8"; - }; - }; - class Rocket_03_AP_Plane_CAS_02_F: Rocket_04_AP_Plane_CAS_01_F { - displayName = "S-8"; - class Burst: Burst { - displayName = "S-8"; - }; - }; - - class rockets_Skyfire: RocketPods { - displayName = "Skyfire-70"; - class Burst: RocketPods { - displayName = "Skyfire-70"; - }; - }; - - // more missiles - class missiles_DAR: RocketPods { - displayName = "Hydra 70"; - class Burst: RocketPods { - displayName = "Hydra 70"; - }; - }; - - class missiles_DAGR: RocketPods { - displayName = "DAGR"; - class Burst: RocketPods { - displayName = "DAGR"; - }; - }; - - class missiles_ASRAAM: MissileLauncher { - displayName = "AIM-132 ASRAAM"; - }; - - class missiles_Zephyr: MissileLauncher { - displayName = "AIM-120A AMRAAM"; - }; - - class missiles_SCALPEL: RocketPods { // according to zGuba, this is what it's based on - displayName = "9K121 Vikhr"; - }; - - // bomb - class Bomb_04_Plane_CAS_01_F: RocketPods { - //displayName = ""; - }; - class Bomb_03_Plane_CAS_02_F: Bomb_04_Plane_CAS_01_F { - displayName = "FAB-250M-54"; - }; - - // machine guns - class MGunCore; - class M134_minigun: MGunCore { - displayName = "2x M134 Minigun"; - }; - - class LMG_RCWS; - class MGun; - - class LMG_Minigun: LMG_RCWS { - displayName = "M134 Minigun"; - class manual: MGun { - displayName = "M134 Minigun"; - }; - }; - - class HMG_127: LMG_RCWS { - displayName = "M2"; - class manual: MGun { - displayName = "M2"; - }; - }; - - class HMG_01: HMG_127 { - displayName = "XM312"; - }; - class HMG_M2: HMG_01 { - displayName = "M2"; - }; - - class HMG_NSVT: HMG_127 { - displayName = "NSVT"; - class manual: manual { - displayName = "NSVT"; - }; - }; - - // grenade launchers - class GMG_F; - class GMG_20mm: GMG_F { - displayName = "XM307"; - class manual: GMG_F { - displayName = "XM307"; - }; - }; - - class GMG_40mm: GMG_F { - displayName = "Mk 19"; - class manual: GMG_F { - displayName = "Mk 19"; - }; - }; - - // autocannons - class autocannon_35mm: CannonCore { - displayName = "GDF-001"; - class manual: CannonCore { - displayName = "GDF-001"; - }; - }; - - // aa missiles - class missiles_titan: MissileLauncher { - displayName = "Mini-Spike"; - }; - - // mortar - class mortar_155mm_AMOS: CannonCore { - displayName = "L/52"; - }; - - // artillery rockets - class rockets_230mm_GAT: RocketPods { - displayName = "M269"; - }; - - // tank guns - class cannon_120mm: CannonCore { - class player; - displayName = "MG251"; - }; - - class cannon_120mm_long: cannon_120mm { - displayName = "L/55"; - class player: player {}; - }; - - class cannon_105mm: cannon_120mm { - displayName = "M68"; - class player: player { - displayName = "M68"; - }; - }; - - class cannon_125mm: cannon_120mm { - displayName = "2A46"; - }; - - // coax machine guns - class LMG_coax: LMG_RCWS { - displayName = "PKT"; - }; - - class ACE_LMG_coax_MBT_01: LMG_coax { - displayName = "MAG 58"; - }; - - class ACE_LMG_coax_APC_Tracked_03: LMG_coax { - displayName = "L94A1"; - }; - - // more autocannons - class autocannon_Base_F; - class autocannon_40mm_CTWS: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - class AP: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - - class HE: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - }; - - class autocannon_30mm_CTWS: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - class AP: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - - class HE: autocannon_Base_F { - displayName = "Mk44 Bushmaster II"; - }; - }; - - class autocannon_30mm: autocannon_30mm_CTWS { - displayName = "L21A1 RARDEN"; - class AP: AP { - displayName = "L21A1 RARDEN"; - }; - - class HE: HE { - displayName = "L21A1 RARDEN"; - }; - }; -}; - -class CfgMagazines { - class VehicleMagazine; - class 1000Rnd_Gatling_30mm_Plane_CAS_01_F: VehicleMagazine { - displayNameShort = "30mm HEI"; - }; - - class 7Rnd_Rocket_04_HE_F: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - class 7Rnd_Rocket_04_AP_F: 7Rnd_Rocket_04_HE_F { - displayNameShort = "70mm AP"; - }; - - class 24Rnd_PG_missiles: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - class 12Rnd_PG_missiles: 24Rnd_PG_missiles { - displayNameShort = "70mm HE"; - }; - - class 2000Rnd_65x39_Belt; - class 5000Rnd_762x51_Belt: 2000Rnd_65x39_Belt { - displayNameShort = "7.62mm"; - }; - class 5000Rnd_762x51_Yellow_Belt: 5000Rnd_762x51_Belt { - displayNameShort = "7.62mm"; - }; - - class 500Rnd_127x99_mag: VehicleMagazine { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Green: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Red: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 500Rnd_127x99_mag_Tracer_Yellow: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - - class 200Rnd_127x99_mag: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Green: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Red: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 200Rnd_127x99_mag_Tracer_Yellow: 200Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - - class 100Rnd_127x99_mag: 500Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Green: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Red: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - class 100Rnd_127x99_mag_Tracer_Yellow: 100Rnd_127x99_mag { - displayNameShort = "12.7mm"; - }; - - class 200Rnd_40mm_G_belt: VehicleMagazine { - displayNameShort = "40mm HE"; - }; - - class 24Rnd_missiles: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - - class 300Rnd_20mm_shells: VehicleMagazine { - displayNameShort = "20mm HE"; - }; - - class 14Rnd_80mm_rockets: VehicleMagazine { - displayNameShort = "70mm HE"; - }; - - class 250Rnd_30mm_HE_shells: VehicleMagazine { - displayNameShort = "30mm HE"; - }; - class 250Rnd_30mm_APDS_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm APDS"; - }; - - class 20Rnd_Rocket_03_HE_F: 7Rnd_Rocket_04_HE_F { - displayNameShort = "80mm HE"; - }; - - class 20Rnd_Rocket_03_AP_F: 7Rnd_Rocket_04_AP_F { - displayNameShort = "80mm AP"; - }; - - class 500Rnd_Cannon_30mm_Plane_CAS_02_F: 1000Rnd_Gatling_30mm_Plane_CAS_01_F { - displayNameShort = "30mm HEI-T"; - }; - - class 680Rnd_35mm_AA_shells: VehicleMagazine { - displayNameShort = "35mm HEI"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Red: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Green: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - class 680Rnd_35mm_AA_shells_Tracer_Yellow: 680Rnd_35mm_AA_shells { - displayNameShort = "35mm HEI-T"; - }; - - class 32Rnd_155mm_Mo_shells: VehicleMagazine { - displayNameShort = "155mm HE"; - }; - class 6Rnd_155mm_Mo_smoke: 32Rnd_155mm_Mo_shells { - displayNameShort = "155mm Smoke"; - }; - class 6Rnd_155mm_Mo_mine: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Mines"; - }; - class 6Rnd_155mm_Mo_AT_mine: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm AT Mines"; - }; - class 2Rnd_155mm_Mo_Cluster: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Cluster"; - }; - class 2Rnd_155mm_Mo_guided: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Guided"; - }; - class 2Rnd_155mm_Mo_LG: 6Rnd_155mm_Mo_smoke { - displayNameShort = "155mm Laser Guided"; - }; - - class 12Rnd_230mm_rockets: 14Rnd_80mm_rockets { - displayName = "227mm HE Missile"; - displayNameShort = "227mm HE"; - }; - - class 30Rnd_120mm_HE_shells: VehicleMagazine { - displayNameShort = "120mm HE"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Red: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Green: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - class 30Rnd_120mm_HE_shells_Tracer_Yellow: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm HE-T"; - }; - - class 30Rnd_120mm_APFSDS_shells: 30Rnd_120mm_HE_shells { - displayNameShort = "120mm AP"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Red: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Green: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - class 30Rnd_120mm_APFSDS_shells_Tracer_Yellow: 30Rnd_120mm_APFSDS_shells { - displayNameShort = "120mm AP-T"; - }; - - class 200Rnd_762x51_Belt: VehicleMagazine { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_Red: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_Green: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_Yellow: 200Rnd_762x51_Belt {}; - class 200Rnd_762x51_Belt_T_Red: 200Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_T_Green: 200Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - class 200Rnd_762x51_Belt_T_Yellow: 200Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; - - class 2000Rnd_762x51_Belt_Red; - class 2000Rnd_762x51_Belt_T_Red: 2000Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - - class 2000Rnd_762x51_Belt_Green; - class 2000Rnd_762x51_Belt_T_Green: 2000Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - - class 2000Rnd_762x51_Belt_Yellow; - class 2000Rnd_762x51_Belt_T_Yellow: 2000Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; - - class 1000Rnd_762x51_Belt_Red; - class 1000Rnd_762x51_Belt_T_Red: 1000Rnd_762x51_Belt_Red { - displayNameShort = "7.62mm"; - }; - - class 1000Rnd_762x51_Belt_Green; - class 1000Rnd_762x51_Belt_T_Green: 1000Rnd_762x51_Belt_Green { - displayNameShort = "7.62mm"; - }; - - class 1000Rnd_762x51_Belt_Yellow; - class 1000Rnd_762x51_Belt_T_Yellow: 1000Rnd_762x51_Belt_Yellow { - displayNameShort = "7.62mm"; - }; - - class 16Rnd_120mm_HE_shells; - class 12Rnd_125mm_HE: 16Rnd_120mm_HE_shells { - displayNameShort = "125mm HE"; - }; - - class 16Rnd_120mm_HE_shells_Tracer_Red; - class 12Rnd_125mm_HE_T_Red: 16Rnd_120mm_HE_shells_Tracer_Red { - displayNameShort = "125mm HE-T"; - }; - - class 16Rnd_120mm_HE_shells_Tracer_Green; - class 12Rnd_125mm_HE_T_Green: 16Rnd_120mm_HE_shells_Tracer_Green { - displayNameShort = "125mm HE-T"; - }; - - class 16Rnd_120mm_HE_shells_Tracer_Yellow; - class 12Rnd_125mm_HE_T_Yellow: 16Rnd_120mm_HE_shells_Tracer_Yellow { - displayNameShort = "125mm HE-T"; - }; - - class 12Rnd_125mm_HEAT: 12Rnd_125mm_HE { - displayNameShort = "125mm MP"; - }; - class 12Rnd_125mm_HEAT_T_Red: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - class 12Rnd_125mm_HEAT_T_Green: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - class 12Rnd_125mm_HEAT_T_Yellow: 12Rnd_125mm_HEAT { - displayNameShort = "125mm MP-T"; - }; - - class 32Rnd_120mm_APFSDS_shells; - class 24Rnd_125mm_APFSDS: 32Rnd_120mm_APFSDS_shells { - displayNameShort = "125mm AP"; - }; - - class 32Rnd_120mm_APFSDS_shells_Tracer_Red; - class 24Rnd_125mm_APFSDS_T_Red: 32Rnd_120mm_APFSDS_shells_Tracer_Red { - displayNameShort = "125mm AP-T"; - }; - - class 32Rnd_120mm_APFSDS_shells_Tracer_Green; - class 24Rnd_125mm_APFSDS_T_Green: 32Rnd_120mm_APFSDS_shells_Tracer_Green { - displayNameShort = "125mm AP-T"; - }; - - class 32Rnd_120mm_APFSDS_shells_Tracer_Yellow; - class 24Rnd_125mm_APFSDS_T_Yellow: 32Rnd_120mm_APFSDS_shells_Tracer_Yellow { - displayNameShort = "125mm AP-T"; - }; - - class 20Rnd_105mm_HEAT_MP: 12Rnd_125mm_HEAT { - displayNameShort = "105mm MP"; - }; - class 20Rnd_105mm_HEAT_MP_T_Red: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - class 20Rnd_105mm_HEAT_MP_T_Green: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - class 20Rnd_105mm_HEAT_MP_T_Yellow: 20Rnd_105mm_HEAT_MP { - displayNameShort = "105mm MP-T"; - }; - - class 40Rnd_105mm_APFSDS: 24Rnd_125mm_APFSDS { - displayNameShort = "105mm AP"; - }; - class 40Rnd_105mm_APFSDS_T_Red: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - class 40Rnd_105mm_APFSDS_T_Green: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - class 40Rnd_105mm_APFSDS_T_Yellow: 40Rnd_105mm_APFSDS { - displayNameShort = "105mm AP-T"; - }; - - class 60Rnd_40mm_GPR_shells: VehicleMagazine { - displayNameShort = "40mm GPR"; - }; - class 60Rnd_40mm_GPR_Tracer_Red_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - class 60Rnd_40mm_GPR_Tracer_Green_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - class 60Rnd_40mm_GPR_Tracer_Yellow_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm GPR-T"; - }; - - class 40Rnd_40mm_APFSDS_shells: 60Rnd_40mm_GPR_shells { - displayNameShort = "40mm AP"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Red_shells: 40Rnd_40mm_APFSDS_shells { - displayNameShort = "40mm AP-T"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Green_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { - displayNameShort = "40mm AP-T"; - }; - class 40Rnd_40mm_APFSDS_Tracer_Yellow_shells: 40Rnd_40mm_APFSDS_Tracer_Red_shells { - displayNameShort = "40mm AP-T"; - }; - - class 450Rnd_127x108_Ball: VehicleMagazine { - displayNameShort = "12.7mm"; - }; - - class 140Rnd_30mm_MP_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm MP"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Red: 140Rnd_30mm_MP_shells { - displayNameShort = "30mm MP-T"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Green: 140Rnd_30mm_MP_shells_Tracer_Red { - displayNameShort = "30mm MP-T"; - }; - class 140Rnd_30mm_MP_shells_Tracer_Yellow: 140Rnd_30mm_MP_shells_Tracer_Red { - displayNameShort = "30mm MP-T"; - }; - - class 60Rnd_30mm_APFSDS_shells: 250Rnd_30mm_HE_shells { - displayNameShort = "30mm AP"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Red: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Green: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - class 60Rnd_30mm_APFSDS_shells_Tracer_Yellow: 60Rnd_30mm_APFSDS_shells { - displayNameShort = "30mm AP-T"; - }; - - class 200Rnd_20mm_G_belt: VehicleMagazine { - displayNameShort = "20mm HE"; - }; - class 40Rnd_20mm_G_belt: 200Rnd_20mm_G_belt { - displayNameShort = "20mm HE"; - }; - - // mines - class CA_Magazine; - // http://en.wikipedia.org/wiki/M15_mine - class ATMine_Range_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_ATMine_Name"; - }; - // http://en.wikipedia.org/wiki/VS-50_mine - class APERSMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSMine_Name"; - }; - // https://www.buymilsurp.com/us-m26-antipersonnel-bounding-mine-p-5419.html - class APERSBoundingMine_Range_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSBoundingMine_Name"; - }; - // http://en.wikipedia.org/wiki/PMR-3_mine - class APERSTripMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_APERSTripwireMine_Name"; - }; - // the following ones can be found here: http://www.dtic.mil/dtic/tr/fulltext/u2/a567897.pdf - class SLAMDirectionalMine_Wire_Mag: ATMine_Range_Mag { - displayName = "$STR_ACE_RealisticNames_SLAM_Name"; - }; - - // claymore - class ClaymoreDirectionalMine_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_Claymore_Name"; - }; - - // satchels - class SatchelCharge_Remote_Mag: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_SatchelCharge_Name"; - }; - class DemoCharge_Remote_Mag: SatchelCharge_Remote_Mag { - displayName = "$STR_ACE_RealisticNames_DemoCharge_Name"; - }; - - // hand grenades - class HandGrenade: CA_Magazine { - displayName = "$STR_ACE_RealisticNames_HandGrenade_Name"; - }; - class SmokeShell: HandGrenade { - displayName = "$STR_ACE_RealisticNames_SmokeShell_Name"; - }; - class SmokeShellBlue: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellBlue_Name"; - }; - class SmokeShellGreen: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellGreen_Name"; - }; - class SmokeShellOrange: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellOrange_Name"; - }; - class SmokeShellPurple: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellPurple_Name"; - }; - class SmokeShellRed: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellRed_Name"; - }; - class SmokeShellYellow: SmokeShell { - displayName = "$STR_ACE_RealisticNames_SmokeShellYellow_Name"; - }; -}; +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 6ea3e01326..6751348532 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(checkAmmo), localize "STR_ACE_Reload_checkAmmo", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) || {(vehicle ACE_player) isKindOf 'StaticWeapon'}) exitWith {false}; diff --git a/addons/reload/functions/fnc_canCheckAmmo.sqf b/addons/reload/functions/fnc_canCheckAmmo.sqf index 3e83281b43..2cabe6edc2 100644 --- a/addons/reload/functions/fnc_canCheckAmmo.sqf +++ b/addons/reload/functions/fnc_canCheckAmmo.sqf @@ -13,7 +13,7 @@ EXPLODE_2_PVT(_this,_player,_target); -// Return true for static weapons if they have been fired once +// Return true for static weapons if they have been fired once, @todo 1.40 this work-around doesn't work anymore if (_target isKindOf "StaticWeapon") exitWith { (currentMagazine _target) != "" }; diff --git a/addons/reload/functions/fnc_startLinkingBelt.sqf b/addons/reload/functions/fnc_startLinkingBelt.sqf index 3b35a5a72a..d739cd8c56 100644 --- a/addons/reload/functions/fnc_startLinkingBelt.sqf +++ b/addons/reload/functions/fnc_startLinkingBelt.sqf @@ -42,7 +42,7 @@ if (_maxAmmo == 0) exitWith {}; // Condition to call each frame _condition = { EXPLODE_2_PVT((_this select 0),_player,_target); - ([_player, _target] call EFUNC(common,canInteract)) && ((_player distance _target) < 3) && ((speed _target) < 1) + ([_player, _target, []] call EFUNC(common,canInteractWith)) && ((_player distance _target) < 3) && ((speed _target) < 1) }; _onFinish = { diff --git a/addons/resting/XEH_postInit.sqf b/addons/resting/XEH_postInit.sqf index 18c3409e38..9251c7663f 100644 --- a/addons/resting/XEH_postInit.sqf +++ b/addons/resting/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(RestWeapon), localize "STR_ACE_Resting_RestWeapon", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon) && {inputAction 'reloadMagazine' == 0} && diff --git a/addons/safemode/XEH_postInit.sqf b/addons/safemode/XEH_postInit.sqf index 549195b188..9508843e25 100644 --- a/addons/safemode/XEH_postInit.sqf +++ b/addons/safemode/XEH_postInit.sqf @@ -9,8 +9,7 @@ ["ACE3", QGVAR(safeMode), localize "STR_ACE_SafeMode_SafeMode", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; diff --git a/addons/scopes/XEH_postInit.sqf b/addons/scopes/XEH_postInit.sqf index a884292416..6f8fae1a1b 100644 --- a/addons/scopes/XEH_postInit.sqf +++ b/addons/scopes/XEH_postInit.sqf @@ -36,8 +36,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustUp), localize "STR_ACE_Scopes_AdjustUp", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, 0, 0.1] call FUNC(canAdjustScope)) exitWith {false}; @@ -52,8 +51,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustDown), localize "STR_ACE_Scopes_AdjustDown", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, 0, -0.1] call FUNC(canAdjustScope)) exitWith {false}; @@ -68,8 +66,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustLeft), localize "STR_ACE_Scopes_AdjustLeft", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, -0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; @@ -84,8 +81,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(AdjustRight), localize "STR_ACE_Scopes_AdjustRight", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific [ACE_player] call FUNC(inventoryCheck); if !([ACE_player, 0.1, 0] call FUNC(canAdjustScope)) exitWith {false}; diff --git a/addons/vector/config.cpp b/addons/vector/config.cpp index 4603857506..926bfda58d 100644 --- a/addons/vector/config.cpp +++ b/addons/vector/config.cpp @@ -2,8 +2,8 @@ class CfgPatches { class ADDON { - units[] = {"AGM_Item_Vector"}; - weapons[] = {"AGM_Vector"}; + units[] = {"ACE_Item_Vector"}; + weapons[] = {"ACE_Vector"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; author[] = {"Ghost","Hamburger SV","commy2","bux578"}; diff --git a/addons/vector/initKeybinds.sqf b/addons/vector/initKeybinds.sqf index a41c13c757..1ce79d79eb 100644 --- a/addons/vector/initKeybinds.sqf +++ b/addons/vector/initKeybinds.sqf @@ -3,8 +3,7 @@ ["ACE3", QGVAR(AzimuthKey), localize "STR_ACE_Vector_AzimuthKey", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; @@ -14,19 +13,18 @@ // Statement ["azimuth"] call FUNC(onKeyDown); - true + false }, { // prevent holding down GVAR(isDownStateKey1) = false; // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement ["azimuth"] call FUNC(onKeyUp); - true + false }, [15, [false, false, false]], false, 0] call CBA_fnc_addKeybind; //Tab Key @@ -34,8 +32,7 @@ ["ACE3", QGVAR(DistanceKey), localize "STR_ACE_Vector_DistanceKey", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(currentWeapon ACE_player == "ACE_Vector" && {ACE_player == cameraOn} && {cameraView == "GUNNER"}) exitWith {false}; @@ -45,18 +42,17 @@ // Statement ["distance"] call FUNC(onKeyDown); - true + false }, { // prevent holding down GVAR(isDownStateKey2) = false; // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Statement ["distance"] call FUNC(onKeyUp); - true + false }, [19, [false, false, false]], false] call CBA_fnc_addKeybind; //R Key diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 94feb71e61..c6a6369515 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -64,7 +64,7 @@ case (_funcType == "startLockpick"): { _condition = { PARAMS_1(_args); EXPLODE_2_PVT(_args,_unit,_veh); - ([_unit] call EFUNC(common,canInteract)) && ((_unit distance _veh) < 5) && ((speed _veh) < 1) + ([_unit, objNull, []] call EFUNC(common,canInteractWith)) && ((_unit distance _veh) < 5) && ((speed _veh) < 1) }; [_vehLockpickStrenth, [_unit, _veh, "finishLockpick"], {(_this select 0) call FUNC(lockpick)}, {}, (localize "STR_ACE_Vehicle_Action_LockpickInUse"), _condition] call EFUNC(common,progressBar); }; diff --git a/addons/vehicles/XEH_postInit.sqf b/addons/vehicles/XEH_postInit.sqf index 18d9e2f580..316e539572 100644 --- a/addons/vehicles/XEH_postInit.sqf +++ b/addons/vehicles/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(speedLimiter), localize "STR_ACE_SpeedLimiter", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player == driver vehicle ACE_player && {vehicle ACE_player isKindOf 'Car' || diff --git a/addons/weaponselect/XEH_postInit.sqf b/addons/weaponselect/XEH_postInit.sqf index c268f49b3c..6160448d56 100644 --- a/addons/weaponselect/XEH_postInit.sqf +++ b/addons/weaponselect/XEH_postInit.sqf @@ -7,8 +7,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectPistol), localize "STR_ACE_WeaponSelect_SelectPistol", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -22,8 +21,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectRifle), localize "STR_ACE_WeaponSelect_SelectRifle", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -37,8 +35,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectRifleMuzzle), localize "STR_ACE_WeaponSelect_SelectRifleMuzzle", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -52,8 +49,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectLauncher), localize "STR_ACE_WeaponSelect_SelectLauncher", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -67,8 +63,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectBinocular), localize "STR_ACE_WeaponSelect_SelectBinocular", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -82,8 +77,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectGrenadeFrag), localize "STR_ACE_WeaponSelect_SelectGrenadeFrag", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -97,8 +91,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectGrenadeOther), localize "STR_ACE_WeaponSelect_SelectGrenadeOther", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -112,8 +105,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(HolsterWeapon), localize "STR_ACE_WeaponSelect_HolsterWeapon", { // Conditions: canInteract - _exceptions = [QEGVAR(interaction,isNotEscorting)]; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, ["isNotEscorting"]] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !([ACE_player] call EFUNC(common,canUseWeapon)) exitWith {false}; @@ -127,8 +119,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(EngineOn), localize "STR_ACE_WeaponSelect_EngineOn", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {!isEngineOn vehicle ACE_player}) exitWith {false}; @@ -142,8 +133,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(EngineOff), localize "STR_ACE_WeaponSelect_EngineOff", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == driver vehicle ACE_player} && {isEngineOn vehicle ACE_player}) exitWith {false}; @@ -157,8 +147,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectMainGun), localize "STR_ACE_WeaponSelect_SelectMainGun", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -172,8 +161,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectMachineGun), localize "STR_ACE_WeaponSelect_SelectMachineGun", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -187,8 +175,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(SelectMissiles), localize "STR_ACE_WeaponSelect_SelectMissiles", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player) exitWith {false}; @@ -202,8 +189,7 @@ if !(hasInterface) exitWith {}; ["ACE3", QGVAR(FireSmokeLauncher), localize "STR_ACE_WeaponSelect_FireSmokeLauncher", { // Conditions: canInteract - _exceptions = []; - if !(_exceptions call EGVAR(common,canInteract)) exitWith {false}; + if !([ACE_player, objNull, []] call EGVAR(common,canInteractWith)) exitWith {false}; // Conditions: specific if !(ACE_player != vehicle ACE_player && {ACE_player == commander vehicle ACE_player}) exitWith {false}; diff --git a/extras/logo.png b/extras/logo.png deleted file mode 100644 index bb2bb1e90c..0000000000 Binary files a/extras/logo.png and /dev/null differ diff --git a/logo_ace3_ca.paa b/logo_ace3_ca.paa new file mode 100644 index 0000000000..dbfe1ce323 Binary files /dev/null and b/logo_ace3_ca.paa differ diff --git a/mod.cpp b/mod.cpp new file mode 100644 index 0000000000..e266c8b710 --- /dev/null +++ b/mod.cpp @@ -0,0 +1,12 @@ +name = "ACE3"; +picture = "logo_ace3_ca.paa"; +actionName = "Github"; +action = "https://github.com/KoffeinFlummi/ACE3"; +description = "ACE3 - Version 3.0.0"; +logo = "logo_ace3_ca.paa"; +logoOver = "logo_ace3_ca.paa"; +tooltip = "ACE3"; +tooltipOwned = "ACE3 Owned"; +overview = "ACE3 is a joint effort by the teams behind ACE2, AGM and CSE to improve the realism and authenticity of Arma3."; +author = "ACE3 Team"; +overviewPicture = "logo_ace3_ca.paa"; \ No newline at end of file