Merge remote-tracking branch 'origin' into pl-strings

This commit is contained in:
gienkov 2015-09-29 21:56:29 +02:00
commit d88d2fe578
228 changed files with 2170 additions and 2705 deletions

View File

@ -1,3 +1,3 @@
#include "script_component.hpp"
["backpackOpened", DFUNC(backpackOpened)] call EFUNC(common,addEventHandler);
["backpackOpened", {_this call FUNC(backpackOpened)}] call EFUNC(common,addEventHandler);

View File

@ -1,18 +1,19 @@
/*
* Author: commy2
* Someone opened your backpack. Play sound and camshake. Execute locally.
*
* Someone opened your backpack. Execute locally.
*
* Argument:
* Arguments:
* 0: Who accessed your inventory? (Object)
* 1: Unit that wields the backpack (Object)
* 2: The backpack object (Object)
*
* Return value:
* None.
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_sounds", "_position"];
params ["_target", "_backpack"];
// do cam shake if the target is the player
@ -20,7 +21,8 @@ if ([_target] call EFUNC(common,isPlayer)) then {
addCamShake [4, 0.5, 5];
};
// play a rustling sound
// play a zipper sound effect
private ["_sounds", "_position"];
_sounds = [
/*"a3\sounds_f\characters\ingame\AinvPknlMstpSlayWpstDnon_medic.wss",
@ -32,8 +34,7 @@ _sounds = [
QUOTE(PATHTO_R(sounds\zip_out.wav))
];
_position = _target modelToWorldVisual (_target selectionPosition "Spine3");
_position = _position call EFUNC(common,positionToASL);
_position = AGLToASL (_target modelToWorldVisual (_target selectionPosition "Spine3"));
playSound3D [
_sounds select floor random count _sounds,

View File

@ -1,23 +1,24 @@
/*
* Author: commy2
* Check if the given backpack is an actual backpack that can store items. Parachute, static weapon packs, etc. will return false.
*
* Check if the given backpack is an actual backpack that can store items. Parachute backpacks will return false for example.
* Arguments:
* 0: Backpack <OBJECT, STRING>
*
* Argument:
* 0: A backpack (Object or String)
* Return Value:
* Boolean <BOOL>
*
* Return value:
* Boolean (Bool)
* Public: Yes
*/
#include "script_component.hpp"
private ["_config"];
params ["_backpack"];
if (typeName _backpack == "OBJECT") then {
_backpack = typeOf _backpack;
};
private "_config";
_config = configFile >> "CfgVehicles" >> _backpack;
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0}
getText (_config >> "vehicleClass") == "backpacks" && {getNumber (_config >> "maximumLoad") > 0} // return

View File

@ -1,17 +1,19 @@
/*
* Author: commy2
* Handle the open inventory event. Camshake and sound on target client.
*
* Handle the open inventory event. Display message on target client.
* Arguments:
* 0: Unit <OBJECT>
* 1: Backpack <OBJECT>
*
* Argument:
* Input from "InventoryOpened" eventhandler
*
* Return value:
* Return Value:
* false. Always open the inventory dialog. (Bool)
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit","_backpack"];
params ["_unit", "_backpack"];
// exit if the target is not a real backpack, i.e. parachute, static weapon bag etc.
if !([_backpack] call FUNC(isBackpack)) exitWith {false};

View File

@ -18,7 +18,6 @@ if (isServer) then {
}];
};
["playerVehicleChanged", {_this call FUNC(handleVehicleChanged)}] call EFUNC(common,addEventHandler);
["zeusDisplayChanged", {_this call FUNC(handleZeusDisplayChanged)}] call EFUNC(common,addEventHandler);
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["MoveInCaptive", {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);

View File

@ -23,4 +23,9 @@ params ["_unit", "_target"];
("ACE_CableTie" in (items _unit)) &&
{alive _target} &&
{!(_target getVariable [QGVAR(isHandcuffed), false])} &&
(GVAR(requireSurrender) == 0 || ((_target getVariable [QGVAR(isSurrendering), false]) || (currentWeapon _target == "" && GVAR(requireSurrender) == 2)))
{
(_target getVariable ["ACE_isUnconscious", false]) || //isUnconscious
{GVAR(requireSurrender) == 0} || //or don't require surrendering
{_target getVariable [QGVAR(isSurrendering), false]} || //or is surrendering
{(GVAR(requireSurrender) == 2) && {(currentWeapon _target) == ""}} //or "SurrenderOrNoWeapon" and no weapon
}

View File

@ -26,7 +26,7 @@ if (local _unit) then {
};
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
[_unit, false] call FUNC(setSurrender);
[_unit, false] call FUNC(setSurrendered);
};
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {

View File

@ -6,6 +6,7 @@
* 0: Item Classname <STRING>
* 1: Vehicle <OBJECT>
* 2: Amount <NUMBER> (default: 1)
* 3: Show Hint <BOOL> (default: false)
*
* Return Value:
* None
@ -18,7 +19,7 @@
#include "script_component.hpp"
private ["_position", "_item", "_i"];
params ["_itemClass", "_vehicle", ["_amount", 1]];
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
TRACE_3("params",_itemClass,_vehicle,_amount);
_position = getPos _vehicle;
@ -29,12 +30,12 @@ for "_i" from 1 to _amount do {
_item = createVehicle [_itemClass, _position, [], 0, "CAN_COLLIDE"];
// Load item or delete it if no space left
if !([_item, _vehicle] call FUNC(loadItem)) exitWith {
if !([_item, _vehicle, _showHint] call FUNC(loadItem)) exitWith {
TRACE_1("no room to load item - deleting",_item);
deleteVehicle _item;
};
TRACE_1("Item Loaded",_item);
// Invoke listenable event
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);
};

View File

@ -45,7 +45,7 @@ if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) ex
private ["_text", "_condition", "_statement", "_icon", "_action"];
_condition = {
params ["_target", "_player"];
GVAR(enable) && {locked _target < 2} && {[_player, _target, []] call EFUNC(common,canInteractWith)}
GVAR(enable) && {locked _target < 2} && {alive _target} && {[_player, _target, []] call EFUNC(common,canInteractWith)}
};
_text = localize LSTRING(openMenu);
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};

View File

@ -5,6 +5,7 @@
* Arguments:
* 0: Object <OBJECT>
* 1: Vehicle <OBJECT>
* 2: Show Hint <BOOL> (default: true)
*
* Return value:
* Object loaded <BOOL>
@ -18,7 +19,7 @@
private ["_loaded", "_space", "_itemSize"];
params ["_item", "_vehicle"];
params ["_item", "_vehicle", ["_showHint", true, [true]] ];
TRACE_2("params",_item,_vehicle);
if !([_item, _vehicle] call FUNC(canLoadItemIn)) exitWith {
@ -46,7 +47,9 @@ private ["_itemName", "_vehicleName"];
_itemName = getText (configFile >> "CfgVehicles" >> typeOf _item >> "displayName");
_vehicleName = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName");
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
if (_showHint) then {
["displayTextStructured", [[localize LSTRING(LoadedItem), _itemName, _vehicleName], 3.0]] call EFUNC(common,localEvent);
};
// Invoke listenable event
["cargoLoaded", [_item, _vehicle]] call EFUNC(common,globalEvent);

View File

@ -83,9 +83,13 @@
["setDir", {(_this select 0) setDir (_this select 1)}] call FUNC(addEventhandler);
["setFuel", {(_this select 0) setFuel (_this select 1)}] call FUNC(addEventhandler);
["setSpeaker", {(_this select 0) setSpeaker (_this select 1)}] call FUNC(addEventhandler);
["selectLeader", {(_this select 0) selectLeader (_this select 1)}] call FUNC(addEventHandler);
["assignTeam", {(_this select 0) assignTeam (_this select 1)}] call FUNC(addEventHandler);
["setVelocity", {(_this select 0) setVelocity (_this select 1)}] call FUNC(addEventHandler);
if (isServer) then {
["hideObjectGlobal", {(_this select 0) hideObjectGlobal (_this select 1)}] call FUNC(addEventHandler);
["enableSimulationGlobal", {(_this select 0) enableSimulationGlobal (_this select 1)}] call FUNC(addEventHandler);
};
@ -94,8 +98,8 @@ if (isServer) then {
//////////////////////////////////////////////////
// ACE events
"ACEg" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
"ACEc" addPublicVariableEventHandler { _this call FUNC(_handleNetEvent); };
"ACEg" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
"ACEc" addPublicVariableEventHandler {_this call FUNC(_handleNetEvent)};
// Synced ACE events
// Handle JIP scenario
@ -219,8 +223,29 @@ call FUNC(assignedItemFix);
GVAR(ScrollWheelFrame) = diag_frameno;
addMissionEventHandler ["Loaded", {call FUNC(handleScrollWheelInit)}];
call FUNC(handleScrollWheelInit);
["mainDisplayLoaded", {
call FUNC(handleScrollWheelInit);
[{
call FUNC(handleModifierKeyInit);
}, [], 0.1] call FUNC(waitAndExecute); // needs delay, otherwise doesn't work without pressing "RESTART" in editor once. Tested in 1.52RC
}] call FUNC(addEventHandler);
// add PFH to execute event that fires when the main display (46) is created
private "_fnc_initMainDisplayCheck";
_fnc_initMainDisplayCheck = {
[{
if !(isNull findDisplay 46) then {
// Raise ACE event locally
["mainDisplayLoaded", [findDisplay 46]] call FUNC(localEvent);
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
}, 0, []] call CBA_fnc_addPerFrameHandler;
};
call _fnc_initMainDisplayCheck;
// repeat this every time a savegame is loaded
addMissionEventHandler ["Loaded", _fnc_initMainDisplayCheck];
// @todo remove?
enableCamShake true;
@ -273,7 +298,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
// "playerChanged" event
_data = call FUNC(player);
if !(_data isEqualTo GVAR(OldPlayerVehicle)) then {
if !(_data isEqualTo ACE_player) then {
private "_oldPlayer";
_oldPlayer = ACE_player;
@ -375,8 +400,8 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
// @todo still needed?
[QGVAR(StateArrested), false, true, QUOTE(ADDON)] call FUNC(defineVariable);
["displayTextStructured", FUNC(displayTextStructured)] call FUNC(addEventhandler);
["displayTextPicture", FUNC(displayTextPicture)] call FUNC(addEventhandler);
["displayTextStructured", {_this call FUNC(displayTextStructured)}] call FUNC(addEventhandler);
["displayTextPicture", {_this call FUNC(displayTextPicture)}] call FUNC(addEventhandler);
["medical_onUnconscious", {
params ["_unit", "_isUnconscious"];

View File

@ -91,6 +91,9 @@ PREP(getWindDirection);
PREP(getZoom);
PREP(goKneeling);
PREP(hadamardProduct);
PREP(handleModifierKey);
PREP(handleModifierKeyUp);
PREP(handleModifierKeyInit);
PREP(handleScrollWheel);
PREP(handleScrollWheelInit);
PREP(hasItem);
@ -204,6 +207,7 @@ PREP(getReflectorsWithSelections);
PREP(getLightProperties);
PREP(getLightPropertiesWeapon);
PREP(getVehicleCrew);
PREP(getVehicleUAVCrew);
// turrets
PREP(getTurrets);

View File

@ -17,8 +17,6 @@
params ["_projectile", "_adjustDir", "_adjustUp", ["_adjustSpeed",0]];
//["CPD", [_fnc_scriptNameParent, _adjustDir, _adjustUp, _adjustSpeed], nil, false] call FUNC(log);
private ["_vdir", "_dir", "_up", "_vlat", "_vup", "_vel"];
// get old direction vector

View File

@ -92,5 +92,5 @@ if (!isServer) then {
};
if (_checkAll) then {
0 spawn COMPILE_FILE(scripts\Version\checkVersionNumber); // @todo
0 spawn COMPILE_FILE(scripts\checkVersionNumber); // @todo
};

View File

@ -14,4 +14,6 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_codeToLetter","3.5.0","-");
["", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] select ([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] find (_this select 0)) + 1

View File

@ -38,8 +38,7 @@ if (_level <= _defaultLoglevel) then {
};
diag_log _message;
// pass it onwards to the log function:
// [0, [], compile format["%1",_msg], true] call FUNC(log);
};
true

View File

@ -44,11 +44,7 @@ if (_state) then {
private ["_dlg", "_ctrl"];
_dlg = finddisplay 49;
_dlg displayAddEventHandler ["KeyDown", {
params ["", "_key"];
!(_key == 1)
}];
_dlg = findDisplay 49;
for "_index" from 100 to 2000 do {
(_dlg displayCtrl _index) ctrlEnable false;
@ -97,16 +93,17 @@ if (_state) then {
_dlg displayAddEventHandler ["KeyUp", {true}];
["ACE_DisableUserInput", "onEachFrame", {
GVAR(disableInputPFH) = [{
if (isNull (uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) && {!visibleMap && isNull findDisplay 49 && isNull findDisplay 312 && isNull findDisplay 632}) then {
["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
[GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler;
GVAR(disableInputPFH) = nil;
[true] call FUNC(disableUserInput);
};
}] call BIS_fnc_addStackedEventHandler;
}, 0, []] call CBA_fnc_addPerFrameHandler;
} else {
if ("ACE_DisableUserInput" in ([BIS_stackedEventHandlers_onEachFrame, {_this select 0}] call FUNC(map))) then {
["ACE_DisableUserInput", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
if (!isNil QGVAR(disableInputPFH)) then {
[GVAR(disableInputPFH)] call CBA_fnc_removePerFrameHandler;
GVAR(disableInputPFH) = nil;
};
(uiNamespace getVariable [QGVAR(dlgDisableMouse), displayNull]) closeDisplay 0;

View File

@ -19,14 +19,17 @@ _object = _this;
if (!local _object) exitWith {};
// save and restore hitpoints, see below why
private ["_hitPoints", "_hitPointDamages"];
private "_hitPointDamages";
_hitPointDamages = getAllHitPointsDamage _object;
_hitPoints = [_object] call FUNC(getHitpoints);
_hitPointDamages = [_hitPoints, {_object getHitPointDamage _this}] call FUNC(map);
// get correct format for objects without hitpoints
if (_hitPointDamages isEqualTo []) then {
_hitPointDamages = [[],[],[]];
};
// 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;
_object setHitIndex [_forEachIndex, _x];
} forEach (_hitPointDamages select 2);

View File

@ -14,6 +14,16 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_getHitPoints","3.5.0","getAllHitPointsDamage");
params ["_vehicle"];
(getAllHitPointsDamage _vehicle select 0) - [""]
private "_hitPointsWithSelections";
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
// get correct format on vehicles without any hitpoints
if (_hitPointsWithSelections isEqualTo []) then {
_hitPointsWithSelections = [[],[],[]];
};
(_hitPointsWithSelections select 0) - [""]

View File

@ -15,11 +15,18 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_getHitPointsWithSelections","3.5.0","getAllHitPointsDamage");
params ["_vehicle"];
private "_hitPointsWithSelections";
_hitPointsWithSelections = getAllHitPointsDamage _vehicle;
// get correct format on vehicles without any hitpoints
if (_hitPointsWithSelections isEqualTo []) then {
_hitPointsWithSelections = [[],[],[]];
};
_hitPointsWithSelections resize 2;
_hitPointsWithSelections

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Returns array of uav dummy ais.
*
* Arguments:
* 0: Vehicle <OBJECT>
*
* Return Value:
* UAV Dummy Crew <ARRAY>
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_vehicle"];
[crew _vehicle, {getText (configFile >> "CfgVehicles" >> typeOf _this >> "simulation") == "UAVPilot"}] call FUNC(filter) // return

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Handles key down event for modifier key.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public : No
*/
#include "script_component.hpp"
if (_this select 3) then {ACE_modifier = 1};
false

View File

@ -0,0 +1,16 @@
/*
* Author: commy2
* Initializes the modifier key handler.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public : No
*/
#include "script_component.hpp"
(findDisplay 46) displayAddEventHandler ["KeyDown", FUNC(handleModifierKey)];
(findDisplay 46) displayAddEventHandler ["KeyUp", FUNC(handleModifierKeyUp)];

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Handles key up event for modifier key.
*
* Arguments:
* None
*
* Return Value:
* None
*
* Public : No
*/
#include "script_component.hpp"
ACE_modifier = 0;
false

View File

@ -17,6 +17,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_inheritsFrom","3.5.0","inheritsFrom ARRAY");
params ["_configEntry", "_configMatch"];
if (configName _configEntry == _configMatch) exitWith {true};

View File

@ -14,6 +14,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_isAlive","3.5.0","alive");
params ["_unit"];
!isNull _unit && {alive _unit} // return

View File

@ -14,6 +14,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_isTurnedOut","3.5.0","isTurnedOut");
params ["_unit"];
isTurnedOut _unit // return

View File

@ -14,4 +14,6 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_letterToCode","3.5.0","-");
[-1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 30, 48, 46, 32, 18, 33, 34, 35, 23, 36, 37, 38, 50, 49, 24, 25, 16, 19, 31, 20, 22, 47, 17, 45, 44, 21] select (["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] find toUpper (_this select 0)) + 1

View File

@ -17,7 +17,7 @@
params ["_unit", "_vehicle", "_caller"];
if (!alive _unit) then {
_unit = [_unit, _caller] call FUNC(makeCopyOfBody);
// _unit = [_unit, _caller] call FUNC(makeCopyOfBody); //func does not exist
};
private "_slotsOpen";
@ -41,8 +41,7 @@ if (_slotsOpen) then {
_vehicle setVariable [QGVAR(loaded_persons), _loaded, true];
// @todo never used. Remove?
/*if !([_unit] call FUNC(isAwake)) then {
if !([_unit] call FUNC(isAwake)) then {
[{
(_this select 0) params ["_unit", "_vehicle"];
@ -60,5 +59,5 @@ if (_slotsOpen) then {
[_this select 1] call CBA_fnc_removePerFrameHandler;
}, 0.5, [_unit, _vehicle]] call CBA_fnc_addPerFrameHandler;
};*/
};
};

View File

@ -19,10 +19,10 @@ _unit setvariable ["ACE_isUnconscious", nil, true];
if (isPlayer _unit) then {
[true] call FUNC(setVolume);
[false] call FUNC(disableKeyInput);
if (["ace_medical"] call FUNC(isModLoader)) then {
[false] call EFUNC(medical,effectBlackOut);
// [false] call FUNC(disableKeyInput); //func does not exist
if (["ace_medical"] call FUNC(isModLoaded)) then {
// [false] call EFUNC(medical,effectBlackOut); //func does not exist
};
if !(isNil QGVAR(DISABLE_USER_INPUT_COLLECTION)) then {

View File

@ -14,6 +14,8 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_sortAlphabeticallyBy","3.5.0","sort");
params ["_array", "_elementN"];
private ["_elements", "_indexes", "_theElement", "_tmp", "_tempIndex", "_returnArray"];

View File

@ -14,4 +14,6 @@
*/
#include "script_component.hpp"
ACE_DEPRECATED("ace_common_fnc_uniqueElementsOnly","3.5.0","ace_common_fnc_uniqueElements");
_this call FUNC(uniqueElements)

View File

@ -73,9 +73,7 @@ _unit action ["Eject", vehicle _unit];
_unit setPosASL AGLToASL _emptyPos;
// @todo never used. Remove?
/*if !([_unit] call FUNC(isAwake)) then {
if !([_unit] call FUNC(isAwake)) then {
TRACE_1("Check if isAwake", [_unit] call FUNC(isAwake));
if (driver _unit == _unit) then {
@ -92,7 +90,7 @@ _unit action ["Eject", vehicle _unit];
};
}, [_unit, _anim], 0.5, 0] call FUNC(waitAndExecute);
};
};*/
};
}, [_unit, _emptyPos], 0.5, 0] call FUNC(waitAndExecute);
[_unit, false, GROUP_SWITCH_ID, side group _unit] call FUNC(switchToGroupSide);

View File

@ -1 +0,0 @@
#include "\z\ace\addons\common\script_component.hpp"

View File

@ -5,21 +5,25 @@
<English>DAGR</English>
<Polish>DAGR</Polish>
<Spanish>DAGR</Spanish>
<Russian>DAGR</Russian>
</Key>
<Key ID="STR_ACE_DAGR_ConfigureDAGR">
<English>Configure DAGR</English>
<Polish>Konfiguruj DAGR</Polish>
<Spanish>Configurar DAGR</Spanish>
<Russian>Настроить DAGR</Russian>
</Key>
<Key ID="STR_ACE_DAGR_ToggleDAGR">
<English>Toggle DAGR</English>
<Polish>Przełącz DAGR</Polish>
<Spanish>Mostrar DAGR</Spanish>
<Russian>Вкл./выкл. DAGR</Russian>
</Key>
<Key ID="STR_ACE_DAGR_Description">
<English>Defense Advanced GPS Receiver</English>
<Polish>Defense Advanced GPS Receiver</Polish>
<Spanish>Defense Advanced GPS Receiver</Spanish>
<Russian>Военный многофункциональный GPS-приёмник</Russian>
</Key>
</Package>
</Project>

View File

@ -7,8 +7,7 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
serverInit = QUOTE(call COMPILE_FILE(XEH_serverInit));
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -1,7 +1,14 @@
// by PabstMirror, commy2
#include "script_component.hpp"
[DFUNC(handleScrollWheel)] call EFUNC(common,addScrollWheelEventHandler);
if (isServer) then {
// release object on hard disconnection. Function is identical to killed
addMissionEventHandler ["HandleDisconnect", {_this call FUNC(handleKilled)}];
};
if (!hasInterface) exitWith {};
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
if (isNil "ACE_maxWeightDrag") then {
ACE_maxWeightDrag = 800;
@ -15,11 +22,11 @@ if (isNil "ACE_maxWeightCarry") then {
["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", DFUNC(handlePlayerChanged)] call EFUNC(common,addEventhandler);
["playerVehicleChanged", {[ACE_player, objNull] call DFUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["playerWeaponChanged", DFUNC(handlePlayerWeaponChanged)] call EFUNC(common,addEventhandler);
["playerChanged", {_this call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["playerVehicleChanged", {[ACE_player, objNull] call FUNC(handlePlayerChanged)}] call EFUNC(common,addEventhandler);
["playerWeaponChanged", {_this call FUNC(handlePlayerWeaponChanged)}] call EFUNC(common,addEventhandler);
// handle waking up dragged unit and falling unconscious while dragging
["medical_onUnconscious", DFUNC(handleUnconscious)] call EFUNC(common,addEventhandler);
["medical_onUnconscious", {_this call FUNC(handleUnconscious)}] call EFUNC(common,addEventhandler);
//@todo Captivity?

View File

@ -1,5 +0,0 @@
// by commy2
#include "script_component.hpp"
// release object on hard disconnection. Function is identical to killed
addMissionEventHandler ["HandleDisconnect", DFUNC(handleKilled)];

View File

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

View File

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

View File

@ -17,7 +17,7 @@
params ["_unit", "_target"];
// get attachTo offset and direction.
private ["_position", "_direction"];
private ["_position", "_direction", "_UAVCrew"];
_position = _target getVariable [QGVAR(carryPosition), [0, 0, 0]];
_direction = _target getVariable [QGVAR(carryDirection), 0];
@ -48,29 +48,26 @@ if (_target isKindOf "CAManBase") then {
_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];
// add drop action
_unit setVariable [QGVAR(ReleaseActionID), [
_unit, "DefaultAction",
{!isNull ((_this select 0) getVariable [QGVAR(carriedObject), objNull])},
{[_this select 0, (_this select 0) getVariable [QGVAR(carriedObject), objNull]] call FUNC(dropObject_carry)}
] call EFUNC(common,addActionEventHandler)];
if (_actionID != -1) then {
_unit removeAction _actionID;
};
_actionID = _unit addAction [
format ["<t color='#FF0000'>%1</t>", localize LSTRING(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];
// show mouse hint
[localize LSTRING(Drop), "", localize LSTRING(LowerRaise)] call EFUNC(interaction,showMouseHint);
// check everything
[FUNC(carryObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
// reset current dragging height.
GVAR(currentHeightChange) = 0;
// prevent UAVs from firing
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
if !(_UAVCrew isEqualTo []) then {
{_target deleteVehicleCrew _x} count _UAVCrew;
_target setVariable [QGVAR(isUAV), true, true];
};

View File

@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
};
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
if (!alive _target || {_unit distance _target > 10}) then {
[_unit, _target] call FUNC(dropObject_carry);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -14,9 +14,10 @@
*/
#include "script_component.hpp"
private ["_position", "_direction", "_offset", "_actionID"];
params ["_unit", "_target"];
private ["_position", "_direction", "_offset", "_UAVCrew"];
// get attachTo offset and direction.
_position = _target getVariable [QGVAR(dragPosition), [0, 0, 0]];
_direction = _target getVariable [QGVAR(dragDirection), 0];
@ -37,28 +38,26 @@ if (_target isKindOf "CAManBase") then {
_unit setVariable [QGVAR(isDragging), true, true];
_unit setVariable [QGVAR(draggedObject), _target, true];
// add scrollwheel action to release object
_actionID = _unit getVariable [QGVAR(ReleaseActionID), -1];
// add drop action
_unit setVariable [QGVAR(ReleaseActionID), [
_unit, "DefaultAction",
{!isNull ((_this select 0) getVariable [QGVAR(draggedObject), objNull])},
{[_this select 0, (_this select 0) getVariable [QGVAR(draggedObject), objNull]] call FUNC(dropObject)}
] call EFUNC(common,addActionEventHandler)];
if (_actionID != -1) then {
_unit removeAction _actionID;
};
_actionID = _unit addAction [
format ["<t color='#FF0000'>%1</t>", localize LSTRING(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];
// show mouse hint
[localize LSTRING(Drop), ""] call EFUNC(interaction,showMouseHint);
// check everything
[FUNC(dragObjectPFH), 0.5, [_unit, _target]] call CBA_fnc_addPerFrameHandler;
// reset current dragging height.
GVAR(currentHeightChange) = 0;
// prevent UAVs from firing
_UAVCrew = _target call EFUNC(common,getVehicleUAVCrew);
if !(_UAVCrew isEqualTo []) then {
{_target deleteVehicleCrew _x} count _UAVCrew;
_target setVariable [QGVAR(isUAV), true, true];
};

View File

@ -25,7 +25,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
};
// drop if the crate is destroyed OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
if (!alive _target || {_unit distance _target > 10}) then {
[_unit, _target] call FUNC(dropObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -16,8 +16,8 @@
params ["_unit", "_target"];
// remove scroll wheel action
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
// remove drop action
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
private "_inBuilding";
_inBuilding = [_unit] call FUNC(isObjectOnObject);
@ -49,6 +49,9 @@ if (_inBuilding) then {
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
};
// hide mouse hint
[] call EFUNC(interaction,hideMouseHint);
_unit setVariable [QGVAR(isDragging), false, true];
_unit setVariable [QGVAR(draggedObject), objNull, true];
@ -63,3 +66,8 @@ if !(_target isKindOf "CAManBase") then {
if (_unit getvariable ["ACE_isUnconscious", false]) then {
[_unit, "unconscious", 2, true] call EFUNC(common,doAnimation);
};
// recreate UAV crew
if (_target getVariable [QGVAR(isUAV), false]) then {
createVehicleCrew _target;
};

View File

@ -16,8 +16,8 @@
params ["_unit", "_target"];
// remove scroll wheel action
_unit removeAction (_unit getVariable [QGVAR(ReleaseActionID), -1]);
// remove drop action
[_unit, "DefaultAction", _unit getVariable [QGVAR(ReleaseActionID), -1]] call EFUNC(common,removeActionEventHandler);
private "_inBuilding";
_inBuilding = [_unit] call FUNC(isObjectOnObject);
@ -55,6 +55,9 @@ if (_inBuilding) then {
_target setPosASL (getPosASL _target vectorAdd [0, 0, 0.05]);
};
// hide mouse hint
[] call EFUNC(interaction,hideMouseHint);
_unit setVariable [QGVAR(isCarrying), false, true];
_unit setVariable [QGVAR(carriedObject), objNull, true];
@ -65,3 +68,8 @@ if !(_target isKindOf "CAManBase") then {
["fixPosition", _target, _target] call EFUNC(common,targetEvent);
["fixFloating", _target, _target] call EFUNC(common,targetEvent);
};
// recreate UAV crew
if (_target getVariable [QGVAR(isUAV), false]) then {
createVehicleCrew _target;
};

View File

@ -13,20 +13,15 @@
*/
#include "script_component.hpp"
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
params ["_scrollAmount"];
// requires modifier key to be hold down
if (missionNamespace getVariable ["ACE_Modifier", 0] == 0) exitWith {false};
private ["_unit", "_carriedItem", "_position", "_maxHeight"];
_unit = ACE_player;
// EH is always assigned. Exit and don't overwrite input if not carrying
if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {false};
// move carried item 15 cm per scroll interval
_scrollAmount = _scrollAmount * 0.15;

View File

@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isCarrying), false]) exitWith {
};
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
if (!alive _target || {_unit distance _target > 10}) then {
[_unit, _target] call FUNC(dropObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -26,7 +26,7 @@ if !(_unit getVariable [QGVAR(isDragging), false]) exitWith {
};
// same as dragObjectPFH, checks if object is deleted or dead OR (target moved away from carrier (weapon disasembled))
if ((!([_target] call EFUNC(common,isAlive))) || {(_unit distance _target) > 10}) then {
if (!alive _target || {_unit distance _target > 10}) then {
[_unit, _target] call FUNC(dropObject);
[_idPFH] call CBA_fnc_removePerFrameHandler;
};

View File

@ -49,5 +49,9 @@
<Italian>Trasporta</Italian>
<Russian>Нести</Russian>
</Key>
<Key ID="STR_ACE_Dragging_LowerRaise">
<English>Raise/Lower</English>
<German>Heben/Senken</German>
</Key>
</Package>
</Project>

View File

@ -45,7 +45,7 @@ _children = [];
format ["Explosive_%1", _forEachIndex],
format [_name + " (%1)", _itemCount select _forEachIndex],
getText(_x >> "picture"),
{_this call FUNC(setupExplosive);},
{[{_this call FUNC(setupExplosive)}, _this] call EFUNC(common,execNextFrame)},
{true},
{},
(configName _x)

View File

@ -94,16 +94,16 @@
<Russian>Отмена</Russian>
</Key>
<Key ID="STR_ACE_Explosives_ScrollAction">
<English>+ Modifier, rotates</English>
<German>+ Modifikator, drehen</German>
<Spanish>+ Modificador, girar</Spanish>
<French>+ Modificateur, tourner</French>
<Italian>+ Modificatore, rotazione</Italian>
<Czech>+ Modifikátor, otočit</Czech>
<Hungarian>+ Változtatás, forgatás</Hungarian>
<Polish>+ Modyfikator, obrót</Polish>
<Portuguese>+ Modificador, rotaciona</Portuguese>
<Russian>+ Bращать</Russian>
<English>+Ctrl rotate</English>
<German>+Strg drehen</German>
<Spanish>+Ctrl girar</Spanish>
<French>+Ctrl tourner</French>
<Italian>+Ctrl rotazione</Italian>
<Czech>+Ctrl otočit</Czech>
<Hungarian>+Ctrl forgatás</Hungarian>
<Polish>+Ctrl obrót</Polish>
<Portuguese>+Ctrl rotaciona</Portuguese>
<Russian>+Ctrl Bращать</Russian>
</Key>
<Key ID="STR_ACE_Explosives_Jammer_TurnOn">
<English>Turn On Thor III</English>

View File

@ -87,8 +87,6 @@ if (_suitCoef == 0) then {_suitCoef = 0.001};
_gBlackOut = MAXVIRTUALG / _classCoef + MAXVIRTUALG / _suitCoef - MAXVIRTUALG;
_gRedOut = MINVIRTUALG / _classCoef;
["GForces", [], {format ["_g _gBO _coef: %1, %2, %3", _average, _gBlackOut, 2 * ((1.0 - ((_average - 0.30 * _gBlackOut) / (0.70 * _gBlackOut)) ^ 2) max 0) ]}] call EFUNC(common,log);
// @todo: Sort the interaction with medical
if ((_average > _gBlackOut) and {isClass (configFile >> "CfgPatches" >> "ACE_Medical") and {!(ACE_player getVariable ["ACE_isUnconscious", false])}}) then {
[ACE_player, true, (10 + floor(random 5))] call EFUNC(medical,setUnconscious);

View File

@ -17,7 +17,7 @@
if (isNull(ace_player)) exitWith {};
GVAR(FrameEvent) set [0, !(GVAR(FrameEvent) select 0)];
if (GVAR(FrameEvent) select 0) exitWith {
if (vehicle ace_player != ace_player && {!([ace_player] call EFUNC(common,isTurnedOut))}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; };
if (vehicle ace_player != ace_player && {!isTurnedOut ACE_player}) exitWith {(GVAR(FrameEvent) select 1) set [0, false]; };
GVAR(FrameEvent) set [1, ([ace_player] call FUNC(isInRotorWash))];
};
private ["_rotorWash","_safe"];

View File

@ -19,7 +19,7 @@ if (isNull(ace_player) || {!(alive ace_player)}) exitWith {};
_fnc_underCover = {
private ["_pos", "_unit"];
_unit = (_this select 0);
if (vehicle _unit != _unit && {!([_unit] call EFUNC(common,isTurnedOut))}) exitWith {true};
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
_pos = eyePos _unit;
((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])}
};

View File

@ -1,3 +1,4 @@
class CfgAmmo {
class FlareCore;
class FlareBase: FlareCore {

View File

@ -1,19 +1,20 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class ADDON {
clientFiredBIS = QUOTE( _this call FUNC(throwGrenade) );
firedBIS = QUOTE(_this call FUNC(throwGrenade));
};
};
};

View File

@ -1,9 +1,6 @@
class CfgVehicles {
class NATO_Box_Base;
class EAST_Box_Base;
class IND_Box_Base;
class Box_NATO_Support_F;
class Box_NATO_Grenades_F: NATO_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_White,12);
@ -12,6 +9,7 @@ class CfgVehicles {
};
};
class EAST_Box_Base;
class Box_East_Grenades_F: EAST_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
@ -20,6 +18,7 @@ class CfgVehicles {
};
};
class IND_Box_Base;
class Box_IND_Grenades_F: IND_Box_Base {
class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_Yellow,12);
@ -28,6 +27,7 @@ class CfgVehicles {
};
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_HandFlare_White,12);

View File

@ -1,21 +1,26 @@
class CfgWeapons {
class GrenadeLauncher;
class Throw: GrenadeLauncher {
muzzles[] += {"ACE_HandFlare_WhiteMuzzle", "ACE_HandFlare_RedMuzzle", "ACE_HandFlare_GreenMuzzle", "ACE_HandFlare_YellowMuzzle", "ACE_M84Muzzle"};
muzzles[] += {"ACE_HandFlare_WhiteMuzzle","ACE_HandFlare_RedMuzzle","ACE_HandFlare_GreenMuzzle","ACE_HandFlare_YellowMuzzle","ACE_M84Muzzle"};
class ThrowMuzzle;
class ACE_HandFlare_WhiteMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_White"};
};
class ACE_HandFlare_RedMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Red"};
};
class ACE_HandFlare_GreenMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Green"};
};
class ACE_HandFlare_YellowMuzzle: ThrowMuzzle {
magazines[] = {"ACE_HandFlare_Yellow"};
};
class ACE_M84Muzzle: ThrowMuzzle {
magazines[] = {"ACE_M84"};
};

View File

@ -2,7 +2,7 @@
#include "script_component.hpp"
["flashbangExplosion", DFUNC(flashbangExplosionEH)] call EFUNC(common,addEventHandler);
["flashbangExplosion", {_this call FUNC(flashbangExplosionEH)}] call EFUNC(common,addEventHandler);
if (!hasInterface) exitWith {};
@ -21,4 +21,4 @@ GVAR(flashbangPPEffectCC) ppEffectForceInNVG true;
[] call FUNC(nextMode);
},
{false},
[9, [false, false, false]], false] call cba_fnc_addKeybind; //8 Key
[9, [false, false, false]], false] call CBA_fnc_addKeybind; //8 Key

View File

@ -15,13 +15,14 @@
*/
#include "script_component.hpp"
private ["_affected", "_strength", "_posGrenade", "_angleDiff", "_light", "_losCount", "_dirToUnitVector", "_eyeDir", "_eyePos"];
params ["_grenade"];
private ["_affected", "_strength", "_posGrenade", "_eyePos", "_losCount", "_eyeDir", "_dirToUnitVector", "_angleDiff", "_light"];
_affected = _grenade nearEntities ["CAManBase", 20];
{
if ((local _x) && {alive _x}) then {
if (local _x && {alive _x}) then {
_strength = 1 - ((_x distance _grenade) min 15) / 15;
@ -30,16 +31,19 @@ _affected = _grenade nearEntities ["CAManBase", 20];
if (_x != ACE_player) then {
//must be AI
[_x, true] call EFUNC(common,disableAI);
_x setSkill ((skill _x) / 50);
_x setSkill (skill _x / 50);
[{
params ["_unit"];
//Make sure we don't enable AI for unconscious units
if (!(_unit getVariable ["ace_isunconscious", false])) then {
if !(_unit getVariable ["ace_isUnconscious", false]) then {
[_unit, false] call EFUNC(common,disableAI);
};
_unit setSkill (skill _unit * 50);
}, [_x], (7 * _strength)] call EFUNC(common,waitAndExecute);
}, [_x], 7 * _strength] call EFUNC(common,waitAndExecute);
} else {
//Do effects for player
// is there line of sight to the grenade?
@ -49,7 +53,7 @@ _affected = _grenade nearEntities ["CAManBase", 20];
//Check for line of sight (check 4 points in case grenade is stuck in an object or underground)
_losCount = {
(!lineIntersects [(_posGrenade vectorAdd _x), _eyePos, _grenade, ACE_player])
!lineIntersects [_posGrenade vectorAdd _x, _eyePos, _grenade, ACE_player]
} count [[0,0,0], [0,0,0.2], [0.1, 0.1, 0.1], [-0.1, -0.1, 0.1]];
TRACE_1("Line of sight count (out of 4)",_losCount);
@ -57,9 +61,9 @@ _affected = _grenade nearEntities ["CAManBase", 20];
_strength = _strength / 10;
};
//Add ace_hearing ear ringing sound effect
if ((isClass (configFile >> "CfgPatches" >> "ACE_Hearing")) && {_strength > 0}) then {
[_x, (20 * _strength)] call EFUNC(hearing,earRinging);
// add ace_hearing ear ringing sound effect
if (isClass (configFile >> "CfgPatches" >> "ACE_Hearing") && {_strength > 0}) then {
[_x, 20 * _strength] call EFUNC(hearing,earRinging);
};
// account for people looking away by slightly
@ -68,16 +72,16 @@ _affected = _grenade nearEntities ["CAManBase", 20];
_dirToUnitVector = _eyePos vectorFromTo _posGrenade;
_angleDiff = acos (_eyeDir vectorDotProduct _dirToUnitVector);
//From 0-45deg, full effect
// from 0-45deg, full effect
if (_angleDiff > 45) then {
_strength = _strength - _strength * ((_angleDiff - 45) / 120);
};
TRACE_1("Final strength for player",_strength);
//Add ace_medical pain effect:
if ((isClass (configFile >> "CfgPatches" >> "ACE_Medical")) && {_strength > 0.1}) then {
[ACE_player, (_strength / 2)] call EFUNC(medical,adjustPainLevel);
// add ace_medical pain effect:
if (isClass (configFile >> "CfgPatches" >> "ACE_Medical") && {_strength > 0.1}) then {
[ACE_player, _strength / 2] call EFUNC(medical,adjustPainLevel);
};
// create flash to illuminate environment
@ -87,14 +91,14 @@ _affected = _grenade nearEntities ["CAManBase", 20];
_light setLightColor [1,1,1];
_light setLightDayLight true;
//Delete the light after 0.1 seconds
// delete the light after 0.1 seconds
[{
params ["_light"];
deleteVehicle _light;
}, [_light], 0.1] call EFUNC(common,waitAndExecute);
// blind player
if (_strength > 0.1 && hasInterface) then {
if (hasInterface && {_strength > 0.1}) then {
GVAR(flashbangPPEffectCC) ppEffectEnable true;
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,(0.8 + _strength) min 1,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit 0.01;
@ -102,14 +106,15 @@ _affected = _grenade nearEntities ["CAManBase", 20];
//PARTIALRECOVERY - start decreasing effect over ACE_time
[{
params ["_strength"];
GVAR(flashbangPPEffectCC) ppEffectAdjust [1,1,0,[1,1,1,0],[0,0,0,1],[0,0,0,0]];
GVAR(flashbangPPEffectCC) ppEffectCommit (10 * _strength);
}, [_strength], (7 * _strength), 0] call EFUNC(common,waitAndExecute);
}, [_strength], 7 * _strength] call EFUNC(common,waitAndExecute);
//FULLRECOVERY - end effect
[{
GVAR(flashbangPPEffectCC) ppEffectEnable false;
}, [], (17 * _strength)] call EFUNC(common,waitAndExecute);
}, [], 17 * _strength] call EFUNC(common,waitAndExecute);
};
};
};

View File

@ -14,6 +14,7 @@
* Public: No
*/
#include "script_component.hpp"
params ["_projectile"];
if (alive _projectile) then {
@ -21,5 +22,6 @@ if (alive _projectile) then {
private "_affected";
_affected = _projectile nearEntities ["CAManBase", 50];
["flashbangExplosion", _affected, [_projectile]] call EFUNC(common,targetEvent);
};

View File

@ -138,6 +138,7 @@
<German>Aktiviere Taubheit im Gefecht?</German>
<Czech>Povolit ztrátu sluchu?</Czech>
<Portuguese>Ativar surdez em combate?</Portuguese>
<Russian>Уменьшает возможность игрока слышать звуки при повреждении органов слуха</Russian>
</Key>
<Key ID="STR_ACE_Hearing_Module_Description">
<English>Controls combat deafness and ear ringing. When activated, players can be deafened when a gun is fired in their vicinity or an explosion takes place without hearing protection</English>
@ -165,4 +166,4 @@
<Spanish>Permitir a las unidades por control remoto de zeus que puedan tener daños auditivos.</Spanish>
</Key>
</Package>
</Project>
</Project>

View File

@ -1,3 +1,4 @@
class ACE_Settings {
class GVAR(minDamageToTrigger) {
//Minimum mamage needed to trigger falling down while moving. Set to -1 to disable completely.

View File

@ -1,39 +1,52 @@
// by commy2
/*
* Author: commy2
* Adds reactions to a unit that was hit. EH only runs where to unit is local. Adds screams, falling down, falling from ladders, ejecting from static weapons and camshake for players
*
* Arguments:
* 0: unit <OBJECT>
* 1: firer <OBJECT>
* 2: damage taken <NUMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_firer", "_damage"];
// exit if system is disabled
if (GVAR(minDamageToTrigger) == -1) exitWith {};
// don't fall after minor damage
if (_damage < GVAR(minDamageToTrigger)) exitWith {};
// don't fall on collision damage
if (_unit == _firer) exitWith {};
//Exit if system disabled:
if (GVAR(minDamageToTrigger) == -1) exitWith {};
// cam shake for player
// camshake for player
if (_unit == ACE_player) then {
addCamShake [3, 5, _damage + random 10];
};
// play scream sound
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
[_unit] call EFUNC(medical,playInjuredSound);
};
private "_vehicle";
_vehicle = vehicle _unit;
// handle static weapons
if (_vehicle isKindOf "StaticWeapon") exitwith {
if (_vehicle isKindOf "StaticWeapon") exitWith {
if (!alive _unit) then {
_unit action ["Eject", _vehicle];
unassignVehicle _unit;
};
};
// don't fall after minor damage
if (_damage < GVAR(minDamageToTrigger)) exitWith {};
// play sound
if (!isNil QUOTE(EFUNC(medical,playInjuredSound))) then {
[_unit] call EFUNC(medical,playInjuredSound);
};
//Don't do animations if in a vehicle (looks weird and animations never reset):
// don't do animations if in a vehicle (looks weird and animations never reset):
if (_vehicle != _unit) exitWith {};
// this checks most things, so it doesn't mess with being inside vehicles or while dragging etc.
@ -54,40 +67,52 @@ _velocity = vectorMagnitude velocity _unit;
if (_velocity < 2) exitWith {};
// get correct animation by weapon
private ["_isPlayer", "_isRunning", "_anim"];
private "_anim";
_isPlayer = [_unit] call EFUNC(common,isPlayer);
_isRunning = _velocity > 4;
call {
private "_weapon";
_weapon = currentWeapon _unit;
_anim = switch (currentWeapon _unit) do {
case (""): {"AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"};
case (primaryWeapon _unit): {
if !(_isPlayer) exitWith {"AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"};
[
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
] select floor random 4;
if (_weapon == "") exitWith {
_anim = "AmovPercMsprSnonWnonDf_AmovPpneMstpSnonWnonDnon"
};
case (handgunWeapon _unit): {
if !(_isPlayer) exitWith {"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon"};
[
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
] select floor random 4;
if (_weapon == primaryWeapon _unit) exitWith {
if ([_unit] call EFUNC(common,isPlayer)) then {
private "_isRunning";
_isRunning = _velocity > 4;
_anim = [
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
["AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon_2", "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon"] select _isRunning,
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDleft",
"AmovPercMstpSrasWrflDnon_AadjPpneMstpSrasWrflDright"
] select floor random 4;
} else {
_anim = "AmovPercMsprSlowWrfldf_AmovPpneMstpSrasWrflDnon";
};
};
default {""};
if (_weapon == handgunWeapon _unit) exitWith {
if ([_unit] call EFUNC(common,isPlayer)) then {
_anim = [
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
"AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon",
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDleft",
"AmovPercMstpSrasWpstDnon_AadjPpneMstpSrasWpstDright"
] select floor random 4;
} else {
_anim = "AmovPercMsprSlowWpstDf_AmovPpneMstpSrasWpstDnon";
};
};
_anim = "";
};
// exit if no animation for this weapon exists, i.E. binocular or rocket launcher
// exit if no animation for this weapon exists, i.e. binocular or rocket launcher
if (_anim == "") exitWith {};
// don't mess with transitions. don't fall then.
if ([_unit] call EFUNC(common,inTransitionAnim)) exitWith {};
[_unit, _anim, 2] call EFUNC(common,doAnimation);
if !([_unit] call EFUNC(common,inTransitionAnim)) then {
[_unit, _anim, 2] call EFUNC(common,doAnimation);
};

View File

@ -1,3 +1,4 @@
class ACE_Settings {
class GVAR(EnableTeamManagement) {
value = 1;

View File

@ -1,6 +1,5 @@
class ACE_ZeusActions {
// _target = curatorLogic
// curatorSelected = [objects,groups,waypoints,markers]
class ZeusUnits {
displayName = "$STR_A3_RscDisplayCurator_ModeUnits_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeUnits_ca.paa";
@ -29,12 +28,14 @@ class ACE_ZeusActions {
statement = "{_x setUnitPos 'AUTO';} forEach (curatorSelected select 0);";
};
};
class remoteControl {
displayName = "$STR_A3_CfgVehicles_ModuleRemoteControl_F";
icon = "\A3\Modules_F_Curator\Data\portraitRemoteControl_ca.paa";
statement = "_unit = objNull; { if ((side _x in [east,west,resistance,civilian]) && !(isPlayer _x)) exitWith { _unit = _x; }; } forEach (curatorSelected select 0); bis_fnc_curatorObjectPlaced_mouseOver = ['OBJECT',_unit]; (group _target) createUnit ['ModuleRemoteControl_F',[0,0,0],[],0,''];";
};
};
class ZeusGroups {
displayName = "$STR_A3_RscDisplayCurator_ModeGroups_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeGroups_ca.paa";
@ -67,6 +68,7 @@ class ACE_ZeusActions {
statement = "{ _x setBehaviour 'STEALTH'; } forEach (curatorSelected select 1);";
};
};
class speed {
displayName = "$STR_HC_Menu_Speed";
@ -86,6 +88,7 @@ class ACE_ZeusActions {
statement = "{_x setSpeedMode 'FULL';} forEach (curatorSelected select 1);";
};
};
class formation {
displayName = "$STR_Formation";
@ -136,6 +139,7 @@ class ACE_ZeusActions {
};
};
};
class ZeusWaypoints {
displayName = "Waypoints";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeRecent_ca.paa";
@ -168,6 +172,7 @@ class ACE_ZeusActions {
statement = "{ _x setWaypointBehaviour 'STEALTH'; } forEach (curatorSelected select 2);";
};
};
class speed {
displayName = "$STR_HC_Menu_Speed";
@ -187,6 +192,7 @@ class ACE_ZeusActions {
statement = "{ _x setWaypointSpeed 'FULL'; } forEach (curatorSelected select 2);";
};
};
class formation {
displayName = "$STR_Formation";
@ -237,6 +243,7 @@ class ACE_ZeusActions {
};
};
};
class ZeusMarkers {
displayName = "$STR_A3_RscDisplayCurator_ModeMarkers_tooltip";
icon = "\A3\UI_F_Curator\Data\Displays\RscDisplayCurator\modeMarkers_ca.paa";

View File

@ -1,6 +1,7 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
@ -9,3 +10,11 @@ class Extended_PostInit_EventHandlers {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};
class Extended_Respawn_EventHandlers {
class CAManBase {
class ADDON {
respawn = QUOTE((_this select 0) setVariable [ARR_3(QUOTE(QGVAR(assignedFireTeam)),(_this select 0) getVariable [ARR_2(QUOTE(QGVAR(assignedFireTeam)),'MAIN')],true)]);
};
};
};

View File

@ -1,25 +1,28 @@
class CfgVehicles {
class ACE_Module;
class ACE_ModuleInteraction: ACE_Module {
author = ECSTRING(common,ACETeam);
category = "ACE";
displayName = CSTRING(Module_DisplayName);
function = "ACE_Interaction_fnc_moduleInteraction";
scope = 2;
isGlobal = 1;
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
class Arguments {
class EnableTeamManagement {
displayName = CSTRING(EnableTeamManagement_DisplayName);
description = CSTRING(EnableTeamManagement_Description);
typeName = "BOOL";
defaultValue = 1;
};
class ACE_Module;
class ACE_ModuleInteraction: ACE_Module {
author = ECSTRING(common,ACETeam);
category = "ACE";
displayName = CSTRING(Module_DisplayName);
function = "ACE_Interaction_fnc_moduleInteraction";
scope = 2;
isGlobal = 1;
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
class Arguments {
class EnableTeamManagement {
displayName = CSTRING(EnableTeamManagement_DisplayName);
description = CSTRING(EnableTeamManagement_Description);
typeName = "BOOL";
defaultValue = 1;
};
};
class ModuleDescription {
description = CSTRING(Module_Description);
};
};
class ModuleDescription {
description = CSTRING(Module_Description);
};
};
class Man;
class CAManBase: Man {
@ -77,7 +80,6 @@ class CfgVehicles {
priority = 2.1;
hotkey = "Y";
};
class ACE_UnassignTeam {
displayName = CSTRING(LeaveTeam);
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'});
@ -98,29 +100,29 @@ class CfgVehicles {
icon = PATHTOF(UI\team\team_management_ca.paa);
hotkey = "J";
};
class ACE_GetDown {
displayName = CSTRING(GetDown);
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
statement = QUOTE([_target] call DFUNC(getDown));
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian));
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(getDown));
showDisabled = 0;
priority = 2.2;
};
class ACE_SendAway {
displayName = CSTRING(SendAway);
condition = QUOTE([_target] call DFUNC(canInteractWithCivilian));
statement = QUOTE([_target] call DFUNC(sendAway));
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canInteractWithCivilian));
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(sendAway));
showDisabled = 0;
priority = 2.0;
};
class ACE_Pardon {
displayName = CSTRING(Pardon);
condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target});
statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc));
condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canPardon));
statement = QUOTE([ARR_2(_player,_target)] call DFUNC(pardon));
showDisabled = 0;
priority = 2.5;
};
};
class ACE_Torso {
displayName = CSTRING(Torso);
selection = "spine3";
@ -165,12 +167,11 @@ class CfgVehicles {
};
class ACE_Weapon {
displayName = CSTRING(Weapon);
position = QUOTE(call FUNC(getWeaponPos));
position = QUOTE(call DFUNC(getWeaponPos));
distance = 1.50;
condition = "";
statement = "";
};
class ACE_TapShoulderRight {
displayName = CSTRING(TapShoulder);
selection = "rightshoulder";
@ -238,7 +239,6 @@ class CfgVehicles {
icon = PATHTOF(UI\team\team_yellow_ca.paa);
hotkey = "Y";
};
class ACE_LeaveTeam {
displayName = CSTRING(LeaveTeam);
condition = QUOTE(assignedTeam _player != 'MAIN');
@ -405,6 +405,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = CSTRING(Passengers);
@ -414,6 +415,7 @@ class CfgVehicles {
};
};
};
class Tank: LandVehicle {
class ACE_Actions {
class ACE_MainActions {
@ -429,6 +431,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = CSTRING(Passengers);
@ -455,6 +458,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = CSTRING(Passengers);
@ -464,6 +468,7 @@ class CfgVehicles {
};
};
};
class Plane: Air {
class ACE_Actions {
class ACE_MainActions {
@ -479,6 +484,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = CSTRING(Passengers);
@ -501,7 +507,7 @@ class CfgVehicles {
class ACE_Push {
displayName = CSTRING(Push);
distance = 6;
condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3});
condition = QUOTE(getMass _target <= 2600 && {alive _target} && {vectorMagnitude velocity _target < 3});
statement = QUOTE(_this call FUNC(push));
showDisabled = 0;
priority = -1;
@ -514,6 +520,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = CSTRING(Passengers);
@ -539,6 +546,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {
class ACE_Passengers {
displayName = CSTRING(Passengers);
@ -551,26 +559,29 @@ class CfgVehicles {
class StaticMGWeapon: StaticWeapon {};
class HMG_01_base_F: StaticMGWeapon {};
class HMG_01_high_base_F: HMG_01_base_F {
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[-0.172852,0.164063,-0.476091]";
};
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[-0.172852,0.164063,-0.476091]";
};
};
};
class AA_01_base_F: StaticMGWeapon {
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[0,0.515869,-0.200671]";
};
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[0,0.515869,-0.200671]";
};
};
};
class AT_01_base_F: StaticMGWeapon {
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[0,0.515869,-0.200671]";
};
};
class ACE_Actions: ACE_Actions {
class ACE_MainActions: ACE_MainActions {
position = "[0,0.515869,-0.200671]";
};
};
};
class thingX;
@ -581,6 +592,7 @@ class CfgVehicles {
selection = "";
distance = 2;
condition = "true";
class ACE_OpenBox {
displayName = CSTRING(OpenBox);
condition = QUOTE(alive _target);
@ -590,6 +602,7 @@ class CfgVehicles {
};
};
};
class ACE_SelfActions {};
};
@ -602,6 +615,7 @@ class CfgVehicles {
condition = "true";
};
};
class ACE_SelfActions {};
};
};

View File

@ -1,3 +1,4 @@
#define HSPACE 0.5-2.0/16/2
#define VSPACE 0.5-0.3/9/2
@ -44,13 +45,15 @@ class ACE_Interaction_Button_Base {
class RscListbox;
class IGUIBack;
class RscText;
#define X_OFFSET 0.2
class RscACE_SelectAnItem {
idd = 8854;
movingEnable = 0;
class controls {
class back:IGUIBack {
class back: IGUIBack {
x = X_OFFSET;
y = 0;
w = 0.6;
@ -66,7 +69,7 @@ class RscACE_SelectAnItem {
style = 0x02;
text = "";
};
class itemList:RscListBox {
class itemList: RscListBox {
onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick";
idc = 8866;
x = X_OFFSET + 0.005;
@ -139,18 +142,21 @@ class RscInteractionIcon: RscPicture {
w = 2*GUI_GRID_H;
h = 2*GUI_GRID_H;
};
class RscInteractionHelperIcon: RscInteractionIcon {
x = 20 * GUI_GRID_W;
y = 16 * GUI_GRID_H;
w = GUI_GRID_H;
h = GUI_GRID_H;
};
class RscInteractionText: RscText{
x = 21 * GUI_GRID_W;
y = 16 * GUI_GRID_H;
w = 8 * GUI_GRID_W;
w = 24 * GUI_GRID_W;
h = 1.5 * GUI_GRID_H;
};
class RscTitles {
class GVAR(InteractionHelper) {
idd = 9930;

View File

@ -1,37 +1,52 @@
// by commy2 and esteldunedain
#include "script_component.hpp"
ACE_Modifier = 0;
//SelectLeader Event Handler for BecomeLeader action:
[QGVAR(selectLeader), {
PARAMS_2(_group,_leader);
_group selectLeader _leader;
["pardon", {(_this select 0) addRating -rating (_this select 0)}] call EFUNC(common,addEventHandler);
["getDown", {
params ["_target"];
_target setUnitPos "DOWN";
}] call EFUNC(common,addEventHandler);
//Pushing boats from FUNC(push)
[QGVAR(pushBoat), {
params ["_boat", "_newVelocity"];
_boat setVelocity _newVelocity;
}] call EFUNC(common,addEventHandler);
["sendAway", {
params ["_unit", "_position"];
_unit setUnitPos "AUTO";
_unit doMove _position;
}] call EFUNC(common,addEventHandler);
if (!hasInterface) exitWith {};
GVAR(isOpeningDoor) = false;
[{_this call FUNC(handleScrollWheel)}] call EFUNC(common,addScrollWheelEventHandler);
["tapShoulder", {
params ["_unit", "_shoulderNum"];
if (_unit == ACE_player) then {
addCamShake [4, 0.5, 5];
};
private "_message";
_message = parseText format ([["%1 &gt;", localize LSTRING(YouWereTappedRight)], ["&lt; %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
["displayTextStructured", _message] call EFUNC(common,targetEvent);
}] call EFUNC(common,addEventHandler);
// restore global fire teams for JIP
private ["_team"];
private "_team";
{
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
} forEach allUnits;
false
} count allUnits;
// Add keybinds
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor),
{
// add keybinds
["ACE3 Common", QGVAR(openDoor), localize LSTRING(OpenDoor), {
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
@ -40,18 +55,16 @@ private ["_team"];
// Statement
call EFUNC(interaction,openDoor);
true
},
{
}, {
//Probably don't want any condidtions here, so variable never gets locked down
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]], false] call cba_fnc_addKeybind; //Key CTRL+Space
[57, [false, true, false]], false] call CBA_fnc_addKeybind; //Key CTRL+Space
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder),
{
["ACE3 Common", QGVAR(tapShoulder), localize LSTRING(TapShoulder), {
// Conditions: canInteract
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
// Conditions: specific
@ -62,24 +75,7 @@ private ["_team"];
true
},
{false},
[20, [true, false, false]], false] call cba_fnc_addKeybind;
["ACE3 Common", QGVAR(modifierKey), localize LSTRING(ModifierKey),
{
// Conditions: canInteract
//if !([ACE_player, objNull, ["isNotDragging"]] call EFUNC(common,canInteractWith)) exitWith {false}; // not needed
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
{
//Probably don't want any condidtions here, so variable never gets locked down
ACE_Modifier = 0;
false;
},
[29, [false, false, false]], false] call cba_fnc_addKeybind;
[20, [true, false, false]], false] call CBA_fnc_addKeybind;
["isNotSwimming", {!underwater (_this select 0)}] call EFUNC(common,addCanInteractWithCondition);
["isNotOnLadder", {getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> animationState (_this select 0) >> "ACE_isLadder") != 1}] call EFUNC(common,addCanInteractWithCondition);

View File

@ -2,37 +2,38 @@
ADDON = false;
// interaction menu
PREP(addPassengerActions);
PREP(addPassengersActions);
PREP(addSelectableItem);
PREP(applyButtons);
PREP(canBecomeLeader);
PREP(getWeaponPos);
PREP(moduleInteraction);
PREP(removeTag);
// scroll wheel hint
PREP(showMouseHint);
PREP(hideMouseHint);
// interaction with units
PREP(canInteractWithCivilian);
PREP(getDown);
PREP(sendAway);
PREP(canJoinGroup);
PREP(canJoinTeam);
PREP(canTapShoulder);
PREP(joinTeam);
PREP(canBecomeLeader);
PREP(doBecomeLeader);
PREP(canTapShoulder);
PREP(tapShoulder);
PREP(canPardon);
PREP(pardon);
// interaction with doors
PREP(getDoor);
PREP(getDoorAnimations);
PREP(getDown);
PREP(getSelectedButton);
PREP(getWeaponPos);
PREP(hideMenu);
PREP(hideMouseHint);
PREP(isInRange);
PREP(joinTeam);
PREP(moduleInteraction);
PREP(moveDown);
PREP(onSelectMenuDblClick);
PREP(handleScrollWheel);
PREP(openDoor);
PREP(openMenuSelectUI);
PREP(openSelectMenu);
PREP(prepareSelectMenu);
// interaction with boats
PREP(push);
PREP(removeTag);
PREP(sendAway);
PREP(showMouseHint);
PREP(sortOptionsByPriority);
PREP(tapShoulder);
ADDON = true;

View File

@ -14,6 +14,6 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "Menu_Config.hpp"
#include "RscTitles.hpp"
#include "ACE_Settings.hpp"
#include "ACE_ZeusActions.hpp"

View File

@ -1,13 +1,13 @@
/*
* Author: esteldunedain
* Mount unit actions inside passenger submenu
* Mount unit actions inside passenger submenu.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Player <OBJECT>
* 3: Parameters <ARRAY>
*
* Return value:
* Return Value:
* Children actions <ARRAY>
*
* Example:
@ -17,8 +17,8 @@
*/
#include "script_component.hpp"
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
EXPLODE_1_PVT(_parameters,_unit);
params ["", "", "_parameters"];
_parameters params ["_unit"];
private ["_varName", "_actionTrees", "_actions"];
@ -26,11 +26,13 @@ _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit];
_actionTrees = missionNamespace getVariable [_varName, []];
_actions = [];
// Mount unit MainActions menu
// Mount unit MainActions menu
{
EXPLODE_2_PVT(_x,_actionData,_children);
_actions pushBack [_actionData, _children, _unit];
} forEach ((_actionTrees select 0) select 1);
_x params ["_actionData", "_children"];
_actions pushBack [_actionData, _children, _unit];
false
} count (_actionTrees select 0 select 1);
_actions

View File

@ -1,13 +1,13 @@
/*
* Author: esteldunedain
* Create one action per passenger
* Create one action per passenger.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Player <OBJECT>
* 3: Parameters <ARRAY>
*
* Return value:
* Return Value:
* Children actions <ARRAY>
*
* Example:
@ -17,39 +17,43 @@
*/
#include "script_component.hpp"
EXPLODE_3_PVT(_this,_vehicle,_player,_parameters);
params ["_vehicle", "_player"];
private ["_actions"];
private "_actions";
_actions = [];
{
private ["_unit", "_icon"];
_unit = _x;
if ((_unit != _player) && {(getText (configFile >> "CfgVehicles" >> (typeOf _x) >> "simulation")) != "UAVPilot"}) then {
_icon = switch _unit do {
case (driver _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa) };
case (gunner _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa) };
case (commander _vehicle): { QUOTE(A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa) };
default { "" };
};
if (_unit != _player && {getText (configFile >> "CfgVehicles" >> typeOf _unit >> "simulation") != "UAVPilot"}) then {
_icon = [
"",
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_driver_ca.paa",
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_gunner_ca.paa",
"A3\ui_f\data\IGUI\RscIngameUI\RscUnitInfo\role_commander_ca.paa"
] select (([driver _vehicle, gunner _vehicle, commander _vehicle] find _unit) + 1);
if (_unit getVariable [QEGVAR(captives,isHandcuffed), false]) then {
_icon = QUOTE(PATHTOEF(captives,UI\handcuff_ca.paa));
};
_actions pushBack
_actions pushBack [
[
[
str(_unit),
[_unit, true] call EFUNC(common,getName),
_icon,
{},
{true},
{_this call FUNC(addPassengerActions);},
[_unit]
] call EFUNC(interact_menu,createAction),
[],
_unit
];
format ["%1", _unit],
[_unit, true] call EFUNC(common,getName),
_icon,
{},
{true},
{_this call FUNC(addPassengerActions)},
[_unit]
] call EFUNC(interact_menu,createAction),
[],
_unit
];
};
} forEach crew _vehicle;
false
} count crew _vehicle;
_actions

View File

@ -1,32 +0,0 @@
/*
* Author: Garth de Wet (LH)
* Adds an item to the select menu
*
* Arguments:
* 0: List container <ARRAY/NUMBER>
* 1: Display name <STRING>
* 2: Picture <STRING>
* 3: Data <STRING/CODE>
*
* Return value:
* Container <ARRAY/NUMBER>
*
* Example:
* [actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_4(_container,_displayName,_picture,_data);
if (_picture == "" || _picture == "PictureThing") then {
_picture = QUOTE(PATHTOF(UI\dot_ca.paa));
};
private ["_index"];
_index = lbAdd [_container, _displayName];
lbSetData [_container, _index, str _data];
lbSetPicture [_container, _index, _picture];
_container

View File

@ -1,66 +0,0 @@
/*
* Author: commy2
* Applies buttons
*
* Arguments:
* None
*
* Return value:
* None
*
* Example:
* call ace_interaction_fnc_applyButtons
*
* Public: No
*/
#include "script_component.hpp"
private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon", "_a", "_action", "_count"];
_object = GVAR(Target);
_actions = GVAR(Buttons);
disableSerialization;
_dlgInteractionDialog = uiNamespace getVariable QGVAR(Dialog);
/*
for "_a" from 0 to (_count - 1) do {
_action = GVAR(Buttons) select _a;
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _a);
_ctrlInteractionDialog ctrlShow true;
_ctrlInteractionDialog ctrlSetText (_action select 0);
_ctrlInteractionDialog ctrlEnable (call (_action select 2));
};
*/
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl 3;
GVAR(MainButton) = "(findDisplay 1713999) closeDisplay 1;";
if (_object isKindOf "Man") then {
_ctrlInteractionDialog ctrlSetText (if (alive _object) then {name _object} else {_object getVariable ["ACE_Name", "Unknown"]});
} else {
_ctrlInteractionDialog ctrlSetText (getText (configFile >> "CfgVehicles" >> typeOf _object >> "displayName"));
};
for "_index" from 0 to 9 do {
_ctrlInteractionDialog = _dlgInteractionDialog displayCtrl (10 + _index);
_ctrlInteractionDialog ctrlShow true;
_ctrlInteractionDialogIcon = _dlgInteractionDialog displayCtrl (20 + _index);
if (_index < _count) then {
_action = GVAR(Buttons) select _index;
_ctrlInteractionDialog ctrlSetText (_action select 0);
_ctrlInteractionDialog ctrlEnable (call (_action select 2));
_ctrlInteractionDialogIcon ctrlSetText (_action select 5);
} else {
_ctrlInteractionDialog ctrlSetText "";
_ctrlInteractionDialog ctrlEnable false;
_ctrlInteractionDialogIcon ctrlSetText "";
};
};

View File

@ -1,21 +1,20 @@
/*
* Author: PabstMirror
* Test if can Become Leader of group
* Test if can Become Leader of group.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* Able to become leader of group <BOOL>
*
* Example:
* [player, player] call ace_interaction_fnc_canBecomeLeader
* [player] call ace_interaction_fnc_canBecomeLeader
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_target,_player);
params ["_unit"];
(count (units group _player) > 1) && {leader group _player != _player}
count units group _unit > 1 && {leader group _unit != _unit}

View File

@ -1,11 +1,13 @@
/*
* Author: commy2
* Checks if the player can interact with civilian
* Checks if the unit can interact with civilian
*
* Arguments:
* 0: Target <OBJECT>
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
* 2: Target has to be on the civilian side (default: true) <BOOL>
*
* Return value:
* Return Value:
* Able to interact with civilian <BOOL>
*
* Example:
@ -15,10 +17,6 @@
*/
#include "script_component.hpp"
EXPLODE_2_PVT(_this,_unit,_isCivilian);
params ["_unit", "_target", ["_isCivilian", true]];
if (isNil "_isCivilian") then {_isCivilian = true};
alive _unit
&& [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian
//&& {count (weapons _unit) == 0}
alive _target && [side _target != side _unit, side group _target == civilian] select _isCivilian // return

View File

@ -1,12 +1,12 @@
/*
* Author: commy2
* Checks if the player can join a group
* Checks if the unit can join a group
*
* Arguments:
* 0: Player <OBJECT>
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Return Value:
* Able to join a group <BOOL>
*
* Example:
@ -16,9 +16,9 @@
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
params ["_unit", "_target"];
alive _target
&& {!(_target getVariable ["ACE_isUnconscious", false])}
&& {side group _unit == side group _target}
&& {group _unit != group _target}
&& {group _unit != group _target} // return

View File

@ -0,0 +1,20 @@
/*
* Author: commy2
* Checks if the unit can pardon the target.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
*
* Return Value:
* Unit can pardon target <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit", "_target"];
alive _target
&& {rating _target < -2000}
&& {side group _unit == side group _target}

View File

@ -1,12 +1,12 @@
/*
* Author: commy2
* Checks if the player can tap a shoulder
* Checks if the player can tap a shoulder.
*
* Arguments:
* 0: Player <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Return Value:
* Able to tap a shoulder <BOOL>
*
* Example:
@ -16,9 +16,9 @@
*/
#include "script_component.hpp"
PARAMS_2(_unit,_target);
params ["_unit", "_target"];
_target isKindOf "CAManBase" &&
{alive _target} &&
{_unit distance _target < 4} &&
{!(_target getVariable ["ACE_isUnconscious", false])}
{!(_target getVariable ["ACE_isUnconscious", false])} // return

View File

@ -1,21 +1,20 @@
/*
* Author: PabstMirror
* Become Leader of group
* Become Leader of group.
*
* Arguments:
* 0: Target <OBJECT>
* 1: Player <OBJECT>
* 0: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [player, player] call ace_interaction_fnc_doBecomeLeader
* [player] call ace_interaction_fnc_doBecomeLeader
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_target,_player);
params ["_unit"];
[QGVAR(selectLeader), (units group _player), [(group _player), _player]] call EFUNC(common,targetEvent);
["selectLeader", units group _unit, [group _unit, _unit]] call EFUNC(common,targetEvent);

View File

@ -1,11 +1,11 @@
/*
* Author: commy2
* Get door
* Find door.
*
* Arguments:
* 0: Distance <NUMBER>
*
* Return value:
* Return Value:
* House objects and door <ARRAY>
* 0: House <OBJECT>
* 1: Door Name <STRING>
@ -17,19 +17,18 @@
*/
#include "script_component.hpp"
PARAMS_1(_distance);
params ["_distance"];
private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"];
private ["_position0", "_position1", "_intersections", "_house", "_door"];
_position0 = positionCameraToWorld [0, 0, 0];
_position1 = positionCameraToWorld [0, 0, _distance];
_intersections = lineIntersectsWith [ATLToASL _position0, ATLToASL _position1, objNull, objNull, true];
_intersections = lineIntersectsSurfaces [AGLToASL _position0, AGLToASL _position1, cameraOn, objNull, true, 1, "GEOM"];
_count = count _intersections;
if (_count == 0) exitWith {[objNull, ""]};
if (_intersections isEqualTo []) exitWith {[objNull, ""]};
_house = _intersections select (_count - 1);
_house = _intersections select 0 select 2;
// shithouse is bugged
if (typeOf _house == "") exitWith {[objNull, ""]};
@ -37,6 +36,7 @@ if (typeOf _house == "") exitWith {[objNull, ""]};
_intersections = [_house, "GEOM"] intersect [_position0, _position1];
_door = _intersections select 0 select 0;
if (isNil "_door") exitWith {[_house, ""]};
[_house, _door]

View File

@ -1,12 +1,12 @@
/*
* Author: commy2
* Get door animations
* Get door animations. @todo rewrite for better custom building support
*
* Arguments:
* 0: House <OBJECT>
* 1: Door <STRING>
*
* Return value:
* Return Value:
* Animation and Locked variable <ARRAY>
* 0: Animation <STRING>
* 1: Locked variable <STRING>
@ -18,7 +18,7 @@
*/
#include "script_component.hpp"
PARAMS_2(_house,_door);
params ["_house", "_door"];
private ["_index", "_animations", "_lockedVariable"];

View File

@ -1,38 +1,33 @@
/*
* Author: KoffeinFlummi
* Forces a civilian to the ground (with a chance of failure)
* Author: KoffeinFlummi, commy2
* Forces a civilian to the ground with a chance of failure.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Target <OBJECT>
*
* Return value:
* Return Value:
* None
*
* Example:
* [target] call ace_interaction_fnc_getDown
* [civillian] call ace_interaction_fnc_getDown
*
* Public: No
*/
#include "script_component.hpp"
#define RADIUS 10
#define SEND_RADIUS 10
PARAMS_1(_unit);
params ["_unit", "_target"];
private ["_chance", "_x"];
_unit playActionNow "GestureGo";
ACE_player playActionNow "GestureGo"; // put something else here.
if (count (weapons ACE_player) > 0) then {
_chance = 0.8;
} else {
_chance = 0.5;
};
private "_chance";
_chance = [0.5, 0.8] select (count weapons _unit > 0);
{
if (count (weapons _unit) == 0 and random 1 < _chance) then {
[-2, {
_this setUnitPos "DOWN";
}, _x] call CBA_fnc_globalExecute;
};
} forEach (_unit nearEntities ["Civilian", RADIUS]);
if (count weapons _x == 0 && {random 1 < _chance}) then {
["getDown", [_x], [_x]] call EFUNC(common,targetEvent);
};
false
} count (_target nearEntities ["Civilian", SEND_RADIUS]);

View File

@ -1,38 +0,0 @@
/*
* Author: commy2
* Get selected button
*
* Arguments:
* None
*
* Return value:
* Angle <NUMBER>
*
* Example:
* call ace_interaction_fnc_getSelectedButton
*
* Public: No
*/
#include "script_component.hpp"
#define MIN_DISTANCE 0.0065
private ["_position", "_distance", "_angle"];
_position = uiNamespace getVariable [QGVAR(CursorPosition), [0.5, 0.5, 0]];
_position = [((_position select 1) - 0.5) / safezoneH, ((_position select 2) - 0.5) / safezoneW, 0];
_distance = [0, 0, 0] vectorDistanceSqr _position;
// is in center
if (_distance < MIN_DISTANCE) exitWith {-1};
_angle = (_position select 0) atan2 (_position select 1);
// rotate circle
_angle = 180 - _angle + 360 / 10 / 2;
if (_angle < 0) then {_angle = _angle + 360};
_angle = floor (_angle / 360 * 10);
if (_angle == 10) then {0} else {_angle}

View File

@ -0,0 +1,23 @@
/*
* Author: commy2
* Handles incremental door opening
*
* Arguments:
* 0: scroll amount <NUMBER>
*
* Return Value:
* handled <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_scroll"];
if !(GVAR(isOpeningDoor)) exitWith {false};
GVAR(doorTargetPhase) = ((GVAR(doorTargetPhase) + (_scroll / (1.2 * 12))) max 0) min 1;
GVAR(usedScrollWheel) = true;
true

View File

@ -1,22 +0,0 @@
/*
* Author: Garth de Wet (LH)
* Closes the Interaction menu
*
* Arguments:
* None
*
* Return value:
* None
*
* Example:
* call ace_interaction_fnc_hideMenu
*
* Public: No
*/
#include "script_component.hpp"
closeDialog 0;
(findDisplay 1713999) closeDisplay 1;
(uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0;
GVAR(MainButton) = nil;
call FUNC(hideMouseHint);

View File

@ -15,7 +15,8 @@
*/
#include "script_component.hpp"
if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{};
if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith {};
(QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"];
showHUD true;

View File

@ -1,53 +0,0 @@
/*
* Author: commy2
* Check if the vehicle is in range of the player.
*
* Arguments:
* 0: Vehicle <OBJECT>
* 1: Distance in meters <NUMBER>
*
* Return value:
* Vehicle in range of player <BOOL>
*
* Example:
* [target, 5] call ace_interaction_fnc_isInRange
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_vehicle,_distance);
private ["_player", "_position0", "_position1"];
_player = ACE_player;
if (_vehicle isKindOf "Man") exitWith {_player distance _vehicle < _distance};
private ["_position0", "_position1"];//, "_direction"];
_position0 = getPosASL _player;
_position1 = getPosASL _vehicle;
/*
_direction = _position1 vectorDiff _position0;
_direction = _direction vectorMultiply (_distance / (vectorMagnitude _direction));
_position0 = eyePos _player;
_position1 = _position0 vectorAdd _direction;
_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}
*/
_position0 = ATLToASL positionCameraToWorld [0, 0, 0];
_position0 set [2, (_position0 select 2) - (getTerrainHeightASL _position0 min 0)];
_position1 = ATLToASL positionCameraToWorld [0, 0, _distance];
_position1 set [2, (_position1 select 2) - (getTerrainHeightASL _position1 min 0)];
if (_vehicle in lineIntersectsWith [_position0, _position1] || {_player distance _vehicle < _distance}) then {
true
} else {
["Not in Range"] call FUNC(addToTooltip);
false
}

View File

@ -1,35 +1,39 @@
/*
* Author: commy2
* Assigns a unit to the team
* Unit joins a fire team.
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Team <STRING>
*
* Return value:
* Return Value:
* None
*
* Example:
* [target, "YELLOW"] call ace_interaction_fnc_joinTeam
* [player, "YELLOW"] call ace_interaction_fnc_joinTeam
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_team);
private ["_message"];
params ["_unit", "_team"];
// make sure correct team is set on JIP
_unit setVariable [QGVAR(assignedFireTeam), _team, true];
[_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc);
// join fire team on every machine in that group
["assignTeam", units group _unit, [_unit, _team]] call EFUNC(common,targetEvent);
// display message
if (_unit == ACE_player) then {
_message = if (_team == "MAIN") then {
localize LSTRING(LeftTeam);
private "_message";
if (_team == "MAIN") then {
_message = localize LSTRING(LeftTeam);
} else {
_team = localize format [LSTRING(Team%1), _team];
format [localize LSTRING(JoinedTeam), _team];
_message = format [localize LSTRING(JoinedTeam), _team];
};
[_message] call EFUNC(common,displayTextStructured);
["displayTextStructured", _message] call EFUNC(common,localEvent);
};

View File

@ -1,13 +1,13 @@
/*
* Author: bux578
* Initializes the Interaction module
* Initializes the Interaction module.
*
* Arguments:
* 0: Logic <NUMBER>
* 1: ???
* 1: Units <ARRAY>
* 2: Activation State <BOOL>
*
* Return value:
* Return Value:
* None
*
* Example:
@ -17,10 +17,7 @@
*/
#include "script_component.hpp"
private ["_logic", "_activated"];
_logic = _this select 0;
_activated = _this select 2;
params ["_logic", "", "_activated"];
if !(_activated) exitWith {};

View File

@ -1,67 +0,0 @@
/*
* Author: Garth de Wet (LH)
* Scrolls through the list down or up
*
* Arguments:
* 0: Amount <NUMBER>
*
* Return value:
* None
*
* Example:
* [2] call ace_interaction_fnc_moveDown
*
* Public: No
*/
#include "script_component.hpp"
private ["_count", "_player", "_vehicle", "_dlgInteractionDialog", "_top", "_i", "", "_ctrl", "_index", "_action", "_color", "_current", "_infoText", "_target"];
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})
if (isNil QGVAR(MainButton)) exitWith{};
if (isNil QGVAR(Buttons)) exitWith{};
_count = (count GVAR(Buttons))- 1;
GVAR(SelectedButton) = CLAMP(GVAR(SelectedButton) + _this, 0, _count);
_target = GVAR(Target);
_player = ACE_player;
_vehicle = vehicle _player;
disableSerialization;
_dlgInteractionDialog = uiNamespace getVariable QGVAR(Flow_Display);
_top = GVAR(SelectedButton) - 2;
_i = 0;
while {_i <= 4} do {
_index =_i + _top;
_ctrl = _dlgInteractionDialog displayCtrl (1200 + _i);
if (_index >= 0 && {_index <= _count}) then {
_action = GVAR(Buttons) select _index;
_ctrl ctrlShow true;
_ctrl ctrlSetText (_action select 5);
_color = [1,1,1,1];
if !([_target, _player] call (_action select 2)) then {
_color = [0.3,0.3,0.3,0.8];
};
if (_i == 0 || _i == 4) then {
_color set [3, 0.5];
};
if (_i == 1 || _i == 3) then {
_color set [3, 0.75];
};
_ctrl ctrlSetTextColor _color;
}else{
_ctrl ctrlShow false;
};
_i = _i + 1;
};
_ctrl = _dlgInteractionDialog displayCtrl 1000;
_ctrl ctrlSetText ((GVAR(Buttons) select GVAR(SelectedButton)) select 0);
_ctrl = _dlgInteractionDialog displayCtrl 1100;
_current = (GVAR(Buttons) select GVAR(SelectedButton));
_infoText = "";
if !([_target, _player] call (_current select 2)) then {
_infoText = "Unavailable";
};
_ctrl ctrlSetText _infoText;
_ctrl ctrlShow (_infoText != "");

View File

@ -1,44 +0,0 @@
/*
* Author: commy2
* On button up
*
* Arguments:
* None
*
* Return value:
* None
*
* Example:
* call ace_interaction_fnc_onButtonUp
*
* Public: No
*/
#include "script_component.hpp"
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"];
_player = ACE_player;
_vehicle = vehicle _player;
_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
_count = count GVAR(Buttons);
_index = call FUNC(getSelectedButton);
_action = if (_index != -1 && {_index < _count}) then {
GVAR(Buttons) select _index
} else {
["", {}, {false}, 0, [], "", "", {false}, [], 0]
};
(findDisplay 1713999) closeDisplay 1;
closeDialog 0;
_statement = _action select 1;
_condition = _action select 2;
_conditionShow = _action select 7;
_distance = _action select 9;
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {
[_target, _player] call _statement;
};

View File

@ -1,57 +0,0 @@
/*
* Author: commy2
* On click
*
* Arguments:
* Index <NUMBER>
*
* Return value:
* None
*
* Example:
* 5 call ace_interaction_fnc_onClick
*
* Public: No
*/
#include "script_component.hpp"
private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_distance"];
_player = ACE_player;
_vehicle = vehicle _player;
_target = [GVAR(Target), _player] select (GVAR(MenuType) % 2 == 1);
_count = count GVAR(Buttons);
_index = _this;
_action = if (_index != -1 && {_index < _count}) then {
GVAR(Buttons) select _index
} else {
["", {}, {false}, 0, [], "", "", {false}, [], 0]
};
_subMenu = _action select 4;
// back
if (_index == -1) exitWith {
call GVAR(MainButton);
};
if (count _subMenu < 2) then {
(findDisplay 1713999) closeDisplay 1;
closeDialog 0;
_statement = _action select 1;
_condition = _action select 2;
_conditionShow = _action select 7;
_distance = _action select 9;
if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then {
[_target, _player] call _statement;
};
} else {
if (_subMenu select 1 < 1) then {
[_subMenu select 0] call FUNC(openSubMenu);
} else {
[_subMenu select 0] call FUNC(openSubMenuSelf);
};
};

View File

@ -1,18 +0,0 @@
/*
* Author: CorruptedHeart, commy2
* On select menu double click
*
* Arguments:
* None
*
* Return value:
* None
*
* Example:
* call ace_interaction_fnc_onSelectMenuDblClick
*
* Public: No
*/
#include "script_component.hpp"
call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept);

View File

@ -1,12 +1,12 @@
/*
* Author: commy2
* Opens door
* Open door.
*
* Arguments:
* 0: House <OBJECT>
* 1: Door <STRING>
*
* Return value:
* Return Value:
* None
*
* Example:
@ -16,56 +16,56 @@
*/
#include "script_component.hpp"
private ["_info", "_phase", "_position", "_time", "_usedMouseWheel", "_getDoorAnimations"];
private "_info";
_info = [MACRO_DOOR_REACH_DISTANCE] call FUNC(getDoor);
EXPLODE_2_PVT(_info,_house,_door);
_info params ["_house", "_door"];
if (isNull _house) exitWith {};
private "_getDoorAnimations";
_getDoorAnimations = [_house, _door] call FUNC(getDoorAnimations);
EXPLODE_2_PVT(_getDoorAnimations,_animations,_lockedVariable);
_getDoorAnimations params ["_animations", "_lockedVariable"];
if (count _animations == 0) exitWith {};
if (_animations isEqualTo []) exitWith {};
if (_house animationPhase (_animations select 0) <= 0 && {_house getVariable [_lockedVariable select 0, 0] == 1}) exitWith {
_lockedVariable set [0, _house];
_lockedVariable spawn compile preprocessFileLineNumbers "\A3\Structures_F\scripts\LockedDoor_open.sqf";
_lockedVariable call BIS_fnc_LockedDoorOpen;
};
playSound "ACE_Sound_Click"; // @todo replace with smth. more fitting
GVAR(doorTargetPhase) = _house animationPhase (_animations select 0);
GVAR(isOpeningDoor) = true;
playSound "ACE_Sound_Click"; //@todo replace with smth. more fitting
GVAR(usedScrollWheel) = false;
[_house, _animations] spawn {
private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"];
_house = _this select 0;
_animations = _this select 1;
[{
(_this select 0) params ["_house", "_animations", "_position", "_time", "_frame"];
_phase = _house animationPhase (_animations select 0);
_position = getPosASL ACE_player;
if !(GVAR(isOpeningDoor)) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
_time = ACE_time + 0.2;
_usedMouseWheel = false;
waitUntil {
if (inputAction "PrevAction" > 0 || {inputAction "NextAction" > 0}) then {
_usedMouseWheel = true;
// didn't use incremental opening. Just do animation normally.
if !(GVAR(usedScrollWheel)) then {
private "_phase";
_phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5);
{_house animate [_x, _phase]; false} count _animations;
};
_phase = _phase + (inputAction "PrevAction" / 12) min 1;
_phase = _phase - (inputAction "NextAction" / 12) max 0;
{_house animate [_x, _phase]} forEach _animations;
!GVAR(isOpeningDoor) || {getPosASL ACE_player distance _position > 1}
};
if (!_usedMouseWheel && {ACE_time < _time} && {[ACE_player, objNull, []] call EFUNC(common,canInteractWith)}) then {
_phase = [0, 1] select (_house animationPhase (_animations select 0) < 0.5);
{_house animate [_x, _phase]} forEach _animations;
// check if player moved too far away
if (getPosASL ACE_player distance _position > 1) exitWith {
GVAR(isOpeningDoor) = false;
};
GVAR(isOpeningDoor) = false;
};
// this allows for holding the door in it's current state.
if (ACE_time > _time && {diag_frameno > _frame}) then {
GVAR(usedScrollWheel) = true;
};
// do incremental door opening
{_house animate [_x, GVAR(doorTargetPhase)]; false} count _animations;
}, 0.1, [_house, _animations, getPosASL ACE_player, ACE_time + 0.2, diag_frameno + 2]] call CBA_fnc_addPerFrameHandler;

View File

@ -1,57 +0,0 @@
/*
* Author: commy2
* Opens menu select UI
*
* Arguments:
* 0: Unit <OBJECT>
* 1: Vehicle <OBJECT>
*
* Return value:
* None
*
* Example:
* [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_2(_unit,_vehicle);
private ["_cargo", "_actions"];
// Allow interaction with all cargo slots and all FFV slots
_cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew);
// You can only interact if you are in cargo or FFV yourself. exit otherwise
if !(_unit in _cargo) exitWith {};
GVAR(InteractionMenu_Crew) = _cargo;
// Prepare: add header and "OK" button to select menu
_actions = [localize LSTRING(InteractionMenu), localize LSTRING(Interact)] call FUNC(prepareSelectMenu);
// Prepare: add all cargo units as options to select menu
{
if (_x != _unit) then {
_actions = [
_actions,
[_x] call EFUNC(common,getName),
QUOTE(PATHTOF(UI\dot_ca.paa)),
_forEachIndex
] call FUNC(addSelectableItem);
};
} forEach _cargo;
// Open select menu
[
_actions,
{
call FUNC(hideMenu);
[0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu);
GVAR(InteractionMenu_Crew) = nil;
},
{
call FUNC(hideMenu);
}
] call FUNC(openSelectMenu);

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