mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into captivesFixes
This commit is contained in:
commit
9f15cfb650
79
addons/apl/data/Jezek_kov.rvmat
Normal file
79
addons/apl/data/Jezek_kov.rvmat
Normal file
@ -0,0 +1,79 @@
|
||||
ambient[]={1.000000,1.000000,1.000000,1.000000};
|
||||
diffuse[]={1.000000,1.000000,1.000000,1.000000};
|
||||
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
|
||||
emmisive[]={0.000000,0.000000,0.000000,1.000000};
|
||||
specular[]={1.000000,1.000000,1.000000,1.000000};
|
||||
specularPower=83.900002;
|
||||
PixelShaderID="Super";
|
||||
VertexShaderID="Super";
|
||||
class Stage1 {
|
||||
texture="z\ace\addons\apl\data\jezek_texture_NOHQ.tga";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage2 {
|
||||
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage3 {
|
||||
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage4 {
|
||||
texture="#(argb,8,8,3)color(1,1,1,1,AS)";
|
||||
uvSource="tex";
|
||||
class uvTransform
|
||||
{
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage5 {
|
||||
texture="z\ace\addons\apl\data\jezek_texture_SMDI.tga";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage6 {
|
||||
texture="#(ai,32,128,1)fresnel(1.85,0.64)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage7 {
|
||||
texture="a3\data_f\env_land_co.paa";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
BIN
addons/apl/data/barbwire_a_co.paa
Normal file
BIN
addons/apl/data/barbwire_a_co.paa
Normal file
Binary file not shown.
BIN
addons/apl/data/barbwire_a_nohq.paa
Normal file
BIN
addons/apl/data/barbwire_a_nohq.paa
Normal file
Binary file not shown.
78
addons/apl/data/barbwire_a_ns.rvmat
Normal file
78
addons/apl/data/barbwire_a_ns.rvmat
Normal file
@ -0,0 +1,78 @@
|
||||
ambient[]={1.000000,1.000000,1.000000,1.000000};
|
||||
diffuse[]={1.000000,1.000000,1.000000,1.000000};
|
||||
forcedDiffuse[]={0.000000,0.000000,0.000000,0.000000};
|
||||
emmisive[]={0.000000,0.000000,0.000000,1.000000};
|
||||
specular[]={1.000000,1.000000,1.000000,0.000000};
|
||||
specularPower=16.000000;
|
||||
PixelShaderID="Super";
|
||||
VertexShaderID="Super";
|
||||
class Stage1 {
|
||||
texture="z\ace\addons\apl\data\BarbWire_A_NOHQ.tga";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage2 {
|
||||
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage3 {
|
||||
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage4 {
|
||||
texture="#(argb,8,8,3)color(1,1,1,1,AS)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage5 {
|
||||
texture="#(argb,8,8,3)color(0,0,1,1,SMDI)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage6 {
|
||||
texture="#(ai,32,128,1)fresnel(0.01,0.01)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
||||
class Stage7 {
|
||||
texture="#(argb,8,8,3)color(0,0,0,1,CO)";
|
||||
uvSource="tex";
|
||||
class uvTransform {
|
||||
aside[]={1.000000,0.000000,0.000000};
|
||||
up[]={0.000000,1.000000,0.000000};
|
||||
dir[]={0.000000,0.000000,0.000000};
|
||||
pos[]={0.000000,0.000000,0.000000};
|
||||
};
|
||||
};
|
10
addons/apl/data/glass_House.bisurf
Normal file
10
addons/apl/data/glass_House.bisurf
Normal file
@ -0,0 +1,10 @@
|
||||
Density=2400;
|
||||
rough=0;
|
||||
dust=0;
|
||||
bulletPenetrability=50;
|
||||
soundEnviron=Empty;
|
||||
isWater=false;
|
||||
friction=0.1;
|
||||
restitution=0.1;
|
||||
impact = Hit_Glass;
|
||||
soundHit = glass;
|
Binary file not shown.
BIN
addons/apl/data/jezek_texture_co.paa
Normal file
BIN
addons/apl/data/jezek_texture_co.paa
Normal file
Binary file not shown.
BIN
addons/apl/data/jezek_texture_nohq.paa
Normal file
BIN
addons/apl/data/jezek_texture_nohq.paa
Normal file
Binary file not shown.
BIN
addons/apl/data/jezek_texture_smdi.paa
Normal file
BIN
addons/apl/data/jezek_texture_smdi.paa
Normal file
Binary file not shown.
10
addons/apl/data/plastic.bisurf
Normal file
10
addons/apl/data/plastic.bisurf
Normal file
@ -0,0 +1,10 @@
|
||||
Density=1380;
|
||||
rough=0.1;
|
||||
dust=0;
|
||||
bulletPenetrability=150;
|
||||
soundEnviron=Empty;
|
||||
isWater=false;
|
||||
friction=0.7;
|
||||
restitution=0.3;
|
||||
impact = default_Mat;
|
||||
soundHit = plastic;
|
Binary file not shown.
@ -1,7 +1,7 @@
|
||||
["ACE3 Equipment", QGVAR(ATragMXDialogKey), localize LSTRING(ATragMXDialogKey),
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if (GVAR(active)) exitWith {
|
||||
closeDialog 0;
|
||||
false
|
||||
|
@ -3,6 +3,27 @@
|
||||
|
||||
//IGNORE_PRIVATE_WARNING("_handleNetEvent", "_handleRequestAllSyncedEvents", "_handleRequestSyncedEvent", "_handleSyncedEvent");
|
||||
|
||||
//Singe PFEH to handle execNextFrame and waitAndExec:
|
||||
[{
|
||||
private ["_entry"];
|
||||
|
||||
//Handle the waitAndExec array:
|
||||
while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do {
|
||||
_entry = GVAR(waitAndExecArray) deleteAt 0;
|
||||
(_entry select 2) call (_entry select 1);
|
||||
};
|
||||
|
||||
//Handle the execNextFrame array:
|
||||
{
|
||||
(_x select 0) call (_x select 1);
|
||||
} forEach GVAR(nextFrameBufferA);
|
||||
//Swap double-buffer:
|
||||
GVAR(nextFrameBufferA) = GVAR(nextFrameBufferB);
|
||||
GVAR(nextFrameBufferB) = [];
|
||||
GVAR(nextFrameNo) = diag_frameno + 1;
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
|
||||
// Listens for global "SettingChanged" events, to update the force status locally
|
||||
["SettingChanged", {
|
||||
PARAMS_2(_name,_value);
|
||||
|
@ -287,7 +287,12 @@ PREP(_handleRequestSyncedEvent);
|
||||
PREP(_handleRequestAllSyncedEvents);
|
||||
|
||||
GVAR(syncedEvents) = HASH_CREATE;
|
||||
|
||||
//GVARS for execNextFrame and waitAndExec
|
||||
GVAR(waitAndExecArray) = [];
|
||||
GVAR(nextFrameNo) = diag_frameno;
|
||||
GVAR(nextFrameBufferA) = [];
|
||||
GVAR(nextFrameBufferB) = [];
|
||||
|
||||
// @TODO: Generic local-managed global-synced objects (createVehicleLocal)
|
||||
|
||||
|
@ -14,21 +14,8 @@
|
||||
|
||||
PARAMS_2(_func,_params);
|
||||
|
||||
[
|
||||
{
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_2_PVT(_params,_delayedExecParams,_startFrame);
|
||||
EXPLODE_2_PVT(_delayedExecParams,_func,_funcParams);
|
||||
|
||||
// Exit if we are still on the same frame
|
||||
if (diag_frameno == _startFrame) exitWith {};
|
||||
|
||||
// Remove the PFH
|
||||
[_pfhId] call cba_fnc_removePerFrameHandler;
|
||||
|
||||
// Execute the function
|
||||
_funcParams call _func;
|
||||
},
|
||||
0,
|
||||
[_this, diag_frameno]
|
||||
] call CBA_fnc_addPerFrameHandler
|
||||
if (diag_frameno != GVAR(nextFrameNo)) then {
|
||||
GVAR(nextFrameBufferA) pushBack [_params, _func];
|
||||
} else {
|
||||
GVAR(nextFrameBufferB) pushBack [_params, _func];
|
||||
};
|
||||
|
@ -22,16 +22,3 @@ PARAMS_3(_func,_params,_delay);
|
||||
|
||||
GVAR(waitAndExecArray) pushBack [(ACE_time + _delay), _func, _params];
|
||||
GVAR(waitAndExecArray) sort true;
|
||||
|
||||
if ((count GVAR(waitAndExecArray)) == 1) then {
|
||||
[{
|
||||
while {((count GVAR(waitAndExecArray)) > 0) && {((GVAR(waitAndExecArray) select 0) select 0) <= ACE_Time}} do {
|
||||
private ["_entry"];
|
||||
_entry = GVAR(waitAndExecArray) deleteAt 0;
|
||||
(_entry select 2) call (_entry select 1);
|
||||
};
|
||||
if ((count GVAR(waitAndExecArray)) == 0) then {
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
1
addons/concertina_wire/$PBOPREFIX$
Normal file
1
addons/concertina_wire/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\concertina_wire
|
44
addons/concertina_wire/CfgEventHandlers.hpp
Normal file
44
addons/concertina_wire/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Killed_EventHandlers {
|
||||
// TODO: Probably needs handledamage eh for better tracking what killed the wire
|
||||
// Also disallow wire becoming destroyed by small explosives e.g. 40mm
|
||||
class ACE_ConcertinaWire {
|
||||
class ADDON {
|
||||
killed = QUOTE(call FUNC(handleKilled));
|
||||
};
|
||||
};
|
||||
class Land_Razorwire_F {
|
||||
class ADDON {
|
||||
killed = QUOTE(call FUNC(handleKilled));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_Init_EventHandlers {
|
||||
class ACE_ConcertinaWireCoil {
|
||||
class ADDON {
|
||||
init = QUOTE(_this call DEFUNC(dragging,initObject));
|
||||
};
|
||||
};
|
||||
class ACE_ConcertinaWire {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_init));
|
||||
};
|
||||
};
|
||||
class Land_Razorwire_F {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_init));
|
||||
};
|
||||
};
|
||||
};
|
139
addons/concertina_wire/CfgVehicles.hpp
Normal file
139
addons/concertina_wire/CfgVehicles.hpp
Normal file
@ -0,0 +1,139 @@
|
||||
|
||||
class CfgVehicles {
|
||||
class Fence;
|
||||
class thingX;
|
||||
class NonStrategic;
|
||||
|
||||
class ACE_ConcertinaWireNoGeo: Fence {
|
||||
XEH_ENABLED;
|
||||
scope = 1;
|
||||
displayName = "";
|
||||
model = PATHTOF(data\ACE_ConcertinaWireNoGeo.p3d);
|
||||
destrType = "DestructTent";
|
||||
accuracy = 0.3;
|
||||
mapSize = 2.8;
|
||||
animated = 1;
|
||||
autocenter = 0;
|
||||
armor = 200;
|
||||
class AnimationSources {
|
||||
class fix1 {
|
||||
source = "user";
|
||||
animPeriod = 1e-007;
|
||||
initPhase = 0;
|
||||
};
|
||||
class fix2: fix1 {};
|
||||
class fix3: fix1 {};
|
||||
class fix4: fix1 {};
|
||||
class rotate {
|
||||
source = "user";
|
||||
animPeriod = 1e-007;
|
||||
};
|
||||
class wire_2 {
|
||||
source = "user";
|
||||
animPeriod = 1e-007;
|
||||
};
|
||||
class wire_3: wire_2{};
|
||||
class wire_4: wire_2{};
|
||||
class wire_5: wire_2{};
|
||||
class wire_6: wire_2{};
|
||||
class wire_7: wire_2{};
|
||||
class wire_8: wire_2{};
|
||||
class wire_9: wire_2{};
|
||||
class wire_10: wire_2{};
|
||||
class wire_11: wire_2{};
|
||||
class wire_12: wire_2{};
|
||||
class wire_13: wire_2{};
|
||||
class wire_14: wire_2{};
|
||||
class wire_15: wire_2{};
|
||||
class wire_16: wire_2{};
|
||||
class wire_17: wire_2{};
|
||||
class wire_18: wire_2{};
|
||||
|
||||
class wire_2_1: wire_2 {
|
||||
animPeriod = 8;
|
||||
};
|
||||
class wire_3_1: wire_2_1 {};
|
||||
class wire_4_1: wire_2_1 {};
|
||||
class wire_5_1: wire_2_1 {};
|
||||
class wire_6_1: wire_2_1 {};
|
||||
class wire_7_1: wire_2_1 {};
|
||||
class wire_8_1: wire_2_1 {};
|
||||
class wire_9_1: wire_2_1 {};
|
||||
class wire_10_1: wire_2_1 {};
|
||||
class wire_11_1: wire_2_1 {};
|
||||
class wire_12_1: wire_2_1 {};
|
||||
class wire_13_1: wire_2_1 {};
|
||||
class wire_14_1: wire_2_1 {};
|
||||
class wire_15_1: wire_2_1 {};
|
||||
class wire_16_1: wire_2_1 {};
|
||||
class wire_17_1: wire_2_1 {};
|
||||
class wire_18_1: wire_2_1 {};
|
||||
};
|
||||
};
|
||||
class ACE_ConcertinaWire: ACE_ConcertinaWireNoGeo {
|
||||
scope = 2;
|
||||
displayName = $STR_ACE_CONCERTINA_WIRE;
|
||||
model = PATHTOF(data\ACE_ConcertinaWire.p3d);
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "";
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
class ACE_Dismount {
|
||||
selection = "";
|
||||
displayName = "$STR_ACE_UNROLLWIRE";
|
||||
distance = 5;
|
||||
condition = "true";
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(dismount));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ACE_ConcertinaWireCoil: thingX {
|
||||
XEH_ENABLED;
|
||||
scope = 2;
|
||||
displayName = $STR_ACE_CONCERTINA_WIRECOIL;
|
||||
model = PATHTOF(data\ACE_ConcertinaWireCoil.p3d);
|
||||
mapsize = 0.5;
|
||||
animated = 0;
|
||||
nameSound = "fence";
|
||||
typicalCargo[] = {};
|
||||
transportAmmo = 0;
|
||||
transportRepair = 0;
|
||||
transportFuel = 0;
|
||||
cost = 0;
|
||||
armor = 1000;
|
||||
destrType = "DestructNo";
|
||||
accuracy = 1000;
|
||||
autocenter = 0;
|
||||
EGVAR(dragging,canDrag) = 1;
|
||||
EGVAR(dragging,dragPosition[]) = {0,0.5,0.5};
|
||||
EGVAR(dragging,dragDirection) = 0;
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "";
|
||||
distance = 4;
|
||||
condition = "true";
|
||||
class ACE_Deploy {
|
||||
selection = "";
|
||||
displayName = "$STR_ACE_ROLLWIRE";
|
||||
distance = 4;
|
||||
condition = "true";
|
||||
statement = QUOTE([ARR_2(_target,_player)] call FUNC(deploy));
|
||||
showDisabled = 0;
|
||||
exceptions[] = {};
|
||||
priority = 5;
|
||||
icon = PATHTOF(UI\icon_sandbag_ca.paa);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Land_Razorwire_F: NonStrategic {
|
||||
XEH_ENABLED;
|
||||
};
|
||||
};
|
10
addons/concertina_wire/README.md
Normal file
10
addons/concertina_wire/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
ace_concertina_wire
|
||||
===============
|
||||
|
||||
Adds concertina wire.
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [Ruthberg] (http://github.com/Ulteq)
|
BIN
addons/concertina_wire/UI/icon_sandbag_ca.paa
Normal file
BIN
addons/concertina_wire/UI/icon_sandbag_ca.paa
Normal file
Binary file not shown.
4
addons/concertina_wire/XEH_init.sqf
Normal file
4
addons/concertina_wire/XEH_init.sqf
Normal file
@ -0,0 +1,4 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_wire);
|
||||
_wire addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];
|
11
addons/concertina_wire/XEH_postInit.sqf
Normal file
11
addons/concertina_wire/XEH_postInit.sqf
Normal file
@ -0,0 +1,11 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(placer) = objNull;
|
||||
GVAR(deployPFH) = -1;
|
||||
|
||||
// Deploy concertina wire if interact menu is opened
|
||||
["interactMenuOpened", {
|
||||
if (GVAR(deployPFH) != -1) then {
|
||||
GVAR(placer) setVariable [QGVAR(wireDeployed), true];
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
11
addons/concertina_wire/XEH_preInit.sqf
Normal file
11
addons/concertina_wire/XEH_preInit.sqf
Normal file
@ -0,0 +1,11 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(deploy);
|
||||
PREP(dismount);
|
||||
PREP(dismountSuccess);
|
||||
PREP(handleDamage);
|
||||
PREP(handleKilled);
|
||||
|
||||
ADDON = true;
|
15
addons/concertina_wire/config.cpp
Normal file
15
addons/concertina_wire/config.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {"ACE_ConcertinaWire", "ACE_ConcertinaWireNoGeo", "ACE_ConcertinaWireCoil"};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_apl", "ace_interaction"};
|
||||
author[] = {"Rocko", "Ruthberg"};
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
BIN
addons/concertina_wire/data/ACE_ConcertinaWire.p3d
Normal file
BIN
addons/concertina_wire/data/ACE_ConcertinaWire.p3d
Normal file
Binary file not shown.
BIN
addons/concertina_wire/data/ACE_ConcertinaWireCoil.p3d
Normal file
BIN
addons/concertina_wire/data/ACE_ConcertinaWireCoil.p3d
Normal file
Binary file not shown.
BIN
addons/concertina_wire/data/ACE_ConcertinaWireNoGeo.p3d
Normal file
BIN
addons/concertina_wire/data/ACE_ConcertinaWireNoGeo.p3d
Normal file
Binary file not shown.
290
addons/concertina_wire/data/model.cfg
Normal file
290
addons/concertina_wire/data/model.cfg
Normal file
@ -0,0 +1,290 @@
|
||||
class CfgSkeletons {
|
||||
class Default {
|
||||
isDiscrete = 1;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] = {};
|
||||
};
|
||||
class ACE_SB_Skeleton: Default {};
|
||||
class ACE_ConcertinaSkeleton {
|
||||
isDiscrete = 0;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] = {
|
||||
"1","",
|
||||
"2","1",
|
||||
"3","2",
|
||||
"4","3",
|
||||
"5","4",
|
||||
"6","5",
|
||||
"7","6",
|
||||
"8","7",
|
||||
"9","8",
|
||||
"10","9",
|
||||
"11","10",
|
||||
"12","11",
|
||||
"13","12",
|
||||
"14","13",
|
||||
"15","14",
|
||||
"16","15",
|
||||
"17","16",
|
||||
"18","17",
|
||||
"fix1","",
|
||||
"fix2","",
|
||||
"fix3","",
|
||||
"fix4",""
|
||||
};
|
||||
};
|
||||
class ace_tacticalladder_skeleton: Default {
|
||||
isDiscrete = 0;
|
||||
skeletonInherit = "";
|
||||
skeletonBones[] = {
|
||||
"base","",
|
||||
"1","base",
|
||||
"2","1",
|
||||
"3","2",
|
||||
"4","3",
|
||||
"5","4",
|
||||
"6","5",
|
||||
"7","6",
|
||||
"8","7",
|
||||
"9","8",
|
||||
"10","9",
|
||||
"11","10",
|
||||
"step","11"
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class CfgModels {
|
||||
class Default {
|
||||
sectionsInherit="";
|
||||
sections[] = {""};
|
||||
skeletonName = "";
|
||||
};
|
||||
class ace_sandbag_build {
|
||||
sectionsInherit = "Default";
|
||||
sections[] = {"zbytek"};
|
||||
skeletonName = "ACE_SB_Skeleton";
|
||||
};
|
||||
class ACE_ConcertinaWire {
|
||||
skeletonName = "ACE_ConcertinaSkeleton";
|
||||
sections[] = {};
|
||||
sectionsInherit = "";
|
||||
class Animations {
|
||||
class fix1 {
|
||||
type="hide";
|
||||
source="user";
|
||||
selection="fix1";
|
||||
minValue = 0;
|
||||
maxValue = 1;
|
||||
minPhase = 0;
|
||||
maxPhase = 1;
|
||||
hideValue = 1;
|
||||
};
|
||||
class fix2: fix1 {
|
||||
selection="fix2";
|
||||
};
|
||||
class fix3: fix1 {
|
||||
selection="fix3";
|
||||
};
|
||||
class fix4: fix1 {
|
||||
selection="fix4";
|
||||
};
|
||||
class rotate {
|
||||
type = "rotation";
|
||||
source = "";
|
||||
sourceAddress = "loop";
|
||||
selection = "1";
|
||||
axis = "rotate_axis";
|
||||
minValue = 0;
|
||||
maxValue = 360;
|
||||
|
||||
angle0="rad -360";
|
||||
angle1="rad +360";
|
||||
};
|
||||
class wire_2 {
|
||||
type = "translation";
|
||||
source = "";
|
||||
selection = "2";
|
||||
axis = "2_axis";
|
||||
animPeriod = 0;
|
||||
minValue = 0;
|
||||
maxValue = 1;
|
||||
minPhase = 0;
|
||||
maxPhase = 1;
|
||||
offset0 = 0;
|
||||
offset1 = -1;
|
||||
};
|
||||
class wire_3: wire_2 {
|
||||
selection = "3"; axis = "3_axis";
|
||||
};
|
||||
class wire_4: wire_2 {
|
||||
selection = "4"; axis = "4_axis";
|
||||
};
|
||||
class wire_5: wire_2 {
|
||||
selection = "5"; axis = "5_axis";
|
||||
};
|
||||
class wire_6: wire_2 {
|
||||
selection = "6"; axis = "6_axis";
|
||||
};
|
||||
class wire_7: wire_2 {
|
||||
selection = "7"; axis = "7_axis";
|
||||
};
|
||||
class wire_8: wire_2 {
|
||||
selection = "8"; axis = "8_axis";
|
||||
};
|
||||
class wire_9: wire_2 {
|
||||
selection = "9"; axis = "9_axis";
|
||||
};
|
||||
class wire_10: wire_2 {
|
||||
selection = "10"; axis = "10_axis";
|
||||
};
|
||||
class wire_11: wire_2 {
|
||||
selection = "11"; axis = "11_axis";
|
||||
};
|
||||
class wire_12: wire_2 {
|
||||
selection = "12"; axis = "12_axis";
|
||||
};
|
||||
class wire_13: wire_2 {
|
||||
selection = "13"; axis = "13_axis";
|
||||
};
|
||||
class wire_14: wire_2 {
|
||||
selection = "14"; axis = "14_axis";
|
||||
};
|
||||
class wire_15: wire_2 {
|
||||
selection = "15"; axis = "15_axis";
|
||||
};
|
||||
class wire_16: wire_2 {
|
||||
selection = "16"; axis = "16_axis";
|
||||
};
|
||||
class wire_17: wire_2 {
|
||||
selection = "17"; axis = "17_axis";
|
||||
};
|
||||
class wire_18: wire_2 {
|
||||
selection = "18"; axis = "18_axis";
|
||||
};
|
||||
class wire_2_1: wire_2 {
|
||||
selection = "2";axis = "2_axis";offset1 = -1;
|
||||
};
|
||||
class wire_3_1: wire_2_1 {
|
||||
selection = "3"; axis = "3_axis";
|
||||
};
|
||||
class wire_4_1: wire_2_1 {
|
||||
selection = "4"; axis = "4_axis";
|
||||
};
|
||||
class wire_5_1: wire_2_1 {
|
||||
selection = "5"; axis = "5_axis";
|
||||
};
|
||||
class wire_6_1: wire_2_1 {
|
||||
selection = "6"; axis = "6_axis";
|
||||
};
|
||||
class wire_7_1: wire_2_1 {
|
||||
selection = "7"; axis = "7_axis";
|
||||
};
|
||||
class wire_8_1: wire_2_1 {
|
||||
selection = "8"; axis = "8_axis";
|
||||
};
|
||||
class wire_9_1: wire_2_1 {
|
||||
selection = "9"; axis = "9_axis";
|
||||
};
|
||||
class wire_10_1: wire_2_1 {
|
||||
selection = "10"; axis = "10_axis";
|
||||
};
|
||||
class wire_11_1: wire_2_1 {
|
||||
selection = "11"; axis = "11_axis";
|
||||
};
|
||||
class wire_12_1: wire_2_1 {
|
||||
selection = "12"; axis = "12_axis";
|
||||
};
|
||||
class wire_13_1: wire_2_1 {
|
||||
selection = "13"; axis = "13_axis";
|
||||
};
|
||||
class wire_14_1: wire_2_1 {
|
||||
selection = "14"; axis = "14_axis";
|
||||
};
|
||||
class wire_15_1: wire_2_1 {
|
||||
selection = "15"; axis = "15_axis";
|
||||
};
|
||||
class wire_16_1: wire_2_1 {
|
||||
selection = "16"; axis = "16_axis";
|
||||
};
|
||||
class wire_17_1: wire_2_1 {
|
||||
selection = "17"; axis = "17_axis";
|
||||
};
|
||||
class wire_18_1: wire_2_1 {
|
||||
selection = "18"; axis = "18_axis";
|
||||
};
|
||||
};
|
||||
};
|
||||
class ACE_ConcertinaWireNoGeo: ACE_ConcertinaWire {};
|
||||
class ace_tacticalladder {
|
||||
skeletonName = "ace_tacticalladder_skeleton";
|
||||
sections[] = { "roadway" };
|
||||
sectionsInherit = "";
|
||||
class Animations {
|
||||
class rotate {
|
||||
type = "rotation";
|
||||
source = "";
|
||||
sourceAddress = "clamp";
|
||||
selection = "base";
|
||||
axis = "axis_rotate";
|
||||
minValue = 0;
|
||||
maxValue = 90;
|
||||
angle0="rad 0";
|
||||
angle1="rad +90";
|
||||
};
|
||||
class extract_1 {
|
||||
type = "translation";
|
||||
source = "";
|
||||
selection = "1";
|
||||
axis = "axis_1";
|
||||
animPeriod = 0;
|
||||
minValue = 0;
|
||||
maxValue = 1;
|
||||
minPhase = 0;
|
||||
maxPhase = 1;
|
||||
offset0 = 0;
|
||||
offset1 = 0.82;
|
||||
};
|
||||
class extract_2: extract_1 {
|
||||
selection = "2";
|
||||
axis = "axis_2";
|
||||
};
|
||||
class extract_3: extract_1 {
|
||||
selection = "3";
|
||||
axis = "axis_3";
|
||||
};
|
||||
class extract_4: extract_1 {
|
||||
selection = "4";
|
||||
axis = "axis_4";
|
||||
};
|
||||
class extract_5: extract_1 {
|
||||
selection = "5";
|
||||
axis = "axis_5";
|
||||
};
|
||||
class extract_6: extract_1 {
|
||||
selection = "6";
|
||||
axis = "axis_6";
|
||||
};
|
||||
class extract_7: extract_1 {
|
||||
selection = "7";
|
||||
axis = "axis_7";
|
||||
};
|
||||
class extract_8: extract_1 {
|
||||
selection = "8";
|
||||
axis = "axis_8";
|
||||
};
|
||||
class extract_9: extract_1 {
|
||||
selection = "9";
|
||||
axis = "axis_9";
|
||||
};
|
||||
class extract_10: extract_1 {
|
||||
selection = "10";
|
||||
axis = "axis_10";
|
||||
};
|
||||
class extract_11: extract_1 {
|
||||
selection = "11";
|
||||
axis = "axis_11";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
84
addons/concertina_wire/functions/fnc_deploy.sqf
Normal file
84
addons/concertina_wire/functions/fnc_deploy.sqf
Normal file
@ -0,0 +1,84 @@
|
||||
/*
|
||||
* Author: Rocko, Ruthberg
|
||||
*
|
||||
* Deploys the concertina wire
|
||||
*
|
||||
* Arguments:
|
||||
* 0: wire coil <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_wirecoil,_unit);
|
||||
|
||||
private ["_wireNoGeo", "_dir", "_pos", "_wireNoGeoPos"];
|
||||
|
||||
_wireNoGeo = "ACE_ConcertinaWireNoGeo" createVehicle [0,0,0];
|
||||
{
|
||||
_wireNoGeo animate [_x, 1];
|
||||
} foreach WIRE_FAST;
|
||||
|
||||
GVAR(placer) = _unit;
|
||||
_dir = getDir _unit;
|
||||
_pos = getPosASL _unit;
|
||||
_wireNoGeoPos = _pos vectorAdd [1.1 * sin(_dir), 1.1 * cos(_dir), 0];
|
||||
|
||||
_wireNoGeo setDir _dir;
|
||||
_wireNoGeo setPosASL _wireNoGeoPos;
|
||||
|
||||
deleteVehicle _wirecoil;
|
||||
|
||||
_unit setVariable [QGVAR(wireDeployed), false];
|
||||
|
||||
GVAR(deployPFH) = [{
|
||||
EXPLODE_4_PVT(_this select 0,_wireNoGeo,_wireNoGeoPos,_unit,_action);
|
||||
|
||||
private ["_range", "_posStart", "_posEnd", "_dirVect", "_dir", "_anim", "_wire"];
|
||||
_posStart = (_wireNoGeo modelToWorldVisual (_wireNoGeo selectionPosition "start")) call EFUNC(common,positionToASL);
|
||||
_posEnd = (getPosASL _unit) vectorAdd (vectorDir _unit);
|
||||
_dirVect = _posStart vectorDiff _posEnd;
|
||||
_dir = _dirVect call CBA_fnc_vectDir;
|
||||
_range = vectorMagnitude _dirVect;
|
||||
_anim = 0 max (1 - (_range / 12));
|
||||
|
||||
if (!(alive _unit) || _range >= 12 || (_unit getVariable [QGVAR(wireDeployed), false])) exitWith {
|
||||
_wire = "ACE_ConcertinaWire" createvehicle [0, 0, 0];
|
||||
{
|
||||
_wire animate [_x, _anim];
|
||||
} foreach WIRE_FAST;
|
||||
|
||||
[{
|
||||
EXPLODE_5_PVT(_this select 0,_wireNoGeo,_wire,_anim,_dir,_wireNoGeoPos);
|
||||
if (_wire animationPhase "wire_2" == _anim) then {
|
||||
deleteVehicle _wireNoGeo;
|
||||
_wire setDir _dir;
|
||||
_wire setPosASL _wireNoGeoPos;
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, [_wireNoGeo, _wire, _anim, _dir, _wireNoGeoPos]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[_unit, "DefaultAction", _unit getVariable [QGVAR(Deploy), -1]] call EFUNC(Common,removeActionEventHandler);
|
||||
call EFUNC(interaction,hideMouseHint);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_wireNoGeo setDir _dir;
|
||||
{
|
||||
_wireNoGeo animate [_x, _anim];
|
||||
} foreach WIRE_FAST;
|
||||
}, 0, [_wireNoGeo, _wireNoGeoPos, _unit, _action]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
[localize "STR_ACE_ROLLWIRE", "", ""] call EFUNC(interaction,showMouseHint);
|
||||
|
||||
GVAR(placer) setVariable [QGVAR(Deploy),
|
||||
[GVAR(placer), "DefaultAction",
|
||||
{GVAR(deployPFH) != -1},
|
||||
{GVAR(placer) setVariable [QGVAR(wireDeployed), true]}
|
||||
] call EFUNC(common,AddActionEventHandler)];
|
41
addons/concertina_wire/functions/fnc_dismount.sqf
Normal file
41
addons/concertina_wire/functions/fnc_dismount.sqf
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
* Start dismounting the concertina wire
|
||||
*
|
||||
* Arguments:
|
||||
* 0: wire <OBJECT>
|
||||
* 1: unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
// If the cursorMenu is open, the loading bar will fail. If we execute the function one frame later, it will work fine
|
||||
if (uiNamespace getVariable [QEGVAR(interact_menu,cursorMenuOpened),false]) exitwith {
|
||||
[{
|
||||
_this call FUNC(dismount);
|
||||
}, _this] call EFUNC(common,execNextFrame);
|
||||
};
|
||||
|
||||
PARAMS_2(_wire,_unit);
|
||||
|
||||
private ["_config", "_delay"];
|
||||
_config = (configFile >> "CfgVehicles" >> typeOf _unit);
|
||||
_delay = if (getNumber(_config >> "engineer") == 1 || getNumber(_config >> "canDeactivateMines") == 1) then {60} else {120};
|
||||
|
||||
// TODO: Animation?
|
||||
|
||||
[
|
||||
_delay,
|
||||
[_wire],
|
||||
{(_this select 0) call FUNC(dismountSuccess)},
|
||||
{},
|
||||
localize "STR_ACE_UNROLLWIRE",
|
||||
{true},
|
||||
["isnotinside"]
|
||||
] call EFUNC(common,progressBar);
|
42
addons/concertina_wire/functions/fnc_dismountSuccess.sqf
Normal file
42
addons/concertina_wire/functions/fnc_dismountSuccess.sqf
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Author: Rocko, Ruthberg
|
||||
*
|
||||
* Dismounts the concertina wire
|
||||
*
|
||||
* Arguments:
|
||||
* 0: wire <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_wire);
|
||||
|
||||
{
|
||||
_wire animate [_x, 1];
|
||||
} foreach WIRE_FAST;
|
||||
|
||||
[{
|
||||
EXPLODE_1_PVT(_this select 0,_wire);
|
||||
|
||||
if (_wire animationPhase "wire_2" == 1) then {
|
||||
private ["_dir", "_pos", "_wirecoil"];
|
||||
|
||||
_dir = getDir _wire;
|
||||
_pos = getPosASL _wire;
|
||||
|
||||
_wirecoil = "ACE_ConcertinaWireCoil" createvehicle [0, 0, 0];
|
||||
|
||||
deleteVehicle _wire;
|
||||
|
||||
_wirecoil setDir _dir;
|
||||
_wirecoil setPosASL _pos;
|
||||
_wirecoil setVelocity [0, 0, 0];
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
}, 0, [_wire]] call CBA_fnc_addPerFrameHandler;
|
29
addons/concertina_wire/functions/fnc_handleDamage.sqf
Normal file
29
addons/concertina_wire/functions/fnc_handleDamage.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
* Handles wire damage
|
||||
*
|
||||
* Arguments:
|
||||
* 0: wire <OBJECT>
|
||||
* 1: selectionName <STRING>
|
||||
* 2: damage <NUMBER>
|
||||
* 3: source <OBJECT>
|
||||
* 4: projectile <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_5(_wire,_selectionName,_damage,_source,_projectile);
|
||||
|
||||
if (_damage < 0.5) exitWith { 0 };
|
||||
|
||||
if (!(isNull _source)) then {
|
||||
_wire setVariable [QGVAR(lastDamager), _source];
|
||||
};
|
||||
|
||||
_damage
|
135
addons/concertina_wire/functions/fnc_handleKilled.sqf
Normal file
135
addons/concertina_wire/functions/fnc_handleKilled.sqf
Normal file
@ -0,0 +1,135 @@
|
||||
/*
|
||||
* Author: Rocko
|
||||
*
|
||||
* Handles wire and vehicle damage
|
||||
*
|
||||
* Arguments:
|
||||
* 0: wire <OBJECT>
|
||||
* 1: killer (vehicle) <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_wire,_killer);
|
||||
|
||||
if (isNull _killer) then {
|
||||
_killer = _wire getVariable ["ace_concertina_wire_lastDamager", objNull];
|
||||
if (isNull _killer) then {
|
||||
_killer = nearestObject [_wire, "car"];
|
||||
};
|
||||
};
|
||||
if (isNull _killer || {_killer == _wire} || {_killer == gunner (vehicle _killer)}) exitWith {};
|
||||
|
||||
private ["_type", "_mode", "_distance", "_anim", "_parts", "_selectionPart", "_selection", "_pos_w", "_dir_w", "_vehicle"];
|
||||
_type = typeOf _wire;
|
||||
_mode = switch (_type) do {
|
||||
case "ACE_ConcertinaWire": { 0 };
|
||||
case "Land_Razorwire_F": { 1 };
|
||||
default { -1 };
|
||||
};
|
||||
|
||||
if (_mode == -1) exitWith {};
|
||||
|
||||
// _mode = 0 = Single Coil
|
||||
// _mode = 1 = Triple Coil
|
||||
|
||||
// --------------------------------
|
||||
// L M R
|
||||
// 4.54929 (4)
|
||||
// 6.13564 (6)
|
||||
//9.78744 (10)
|
||||
|
||||
_distance = _wire distance _killer;
|
||||
if (_distance > 14 || {_distance < 2}) exitWith {}; // Fix if shooting wire
|
||||
|
||||
_type = typeOf _wire;
|
||||
_anim = _wire animationPhase "wire_2";
|
||||
_pos_w = getPos _wire;
|
||||
_dir_w = getDir _wire;
|
||||
_vehicle = vehicle _killer;
|
||||
|
||||
if (_mode == 0) then {
|
||||
private ["_x", "_y", "_found", "_wireCheckPosAr", "_no"];
|
||||
_x = _pos_w select 0;
|
||||
_y = _pos_w select 1;
|
||||
// Check if two Single coils are placed next to each other (i.e playes have built a big wire obstacle)
|
||||
_wireCheckPosAr = [
|
||||
[_x + (sin (_dir_w+90) * 1.5),_y + (cos (_dir_w+90) * 1.5)],
|
||||
[(_x-(sin _dir_w)) + (sin (_dir_w+90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w+90) * 1.5)],
|
||||
[_x + (sin (_dir_w-90) * 1.5),_y + (cos (_dir_w-90) * 1.5)],
|
||||
[(_x-(sin _dir_w)) + (sin (_dir_w-90) * 1.5),(_y-(cos _dir_w)) + (cos (_dir_w-90) * 1.5)]
|
||||
];
|
||||
{
|
||||
_found = false;
|
||||
_no = nearestObjects [_x, [typeOf _wire], 3]; //diag_log _no; diag_log ".....";
|
||||
_no = _no - [_wire]; //diag_log _no;
|
||||
if (count _no > 0) exitWith {
|
||||
_found = true; //diag_log "found";
|
||||
};
|
||||
} foreach _wireCheckPosAr;
|
||||
// Double coil found!
|
||||
if (_found) then {
|
||||
_mode = 1;
|
||||
} else {
|
||||
// Randomly make a single coil also catch tanks, if speed is high
|
||||
if (_vehicle isKindOf "Tank" && {20 > random 100} && {speed _vehicle > 30}) then {
|
||||
_mode = 1;
|
||||
} else {
|
||||
if !(_vehicle isKindOf "Tank") then {
|
||||
_mode = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (_mode == 1) then {
|
||||
switch (true) do {
|
||||
case (_vehicle isKindOf "Tank"): {
|
||||
_parts = ["ltrack","rtrack"];
|
||||
};
|
||||
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
|
||||
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
switch (true) do {
|
||||
case (_vehicle isKindOf "Wheeled_APC" || {_vehicle isKindOf "Car"}): {
|
||||
_parts = ["lfwheel","lf2wheel","lmwheel","lbwheel","rfwheel","rf2wheel","rmwheel","rbwheel"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (canMove _vehicle) then {
|
||||
{
|
||||
_selectionPart = "hit" + _x;
|
||||
if (isText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name")) then {
|
||||
_selection = getText(configFile >> "CfgVehicles" >> typeOf _vehicle >> "hitpoints" >> _selectionPart >> "name");
|
||||
// TODO: Only the tires that have touched the wire should burst.
|
||||
_vehicle setHit [_selection, 1];
|
||||
};
|
||||
} forEach _parts;
|
||||
};
|
||||
|
||||
if (_mode == 1) then {
|
||||
if (_vehicle isKindOf "StaticWeapon") exitWith {};
|
||||
[{
|
||||
PARAMS_2(_vehicle,_wire);
|
||||
|
||||
_vehicle setVelocity ((velocity _vehicle) vectorMultiply 0.75);
|
||||
|
||||
private ["_vPos", "_vDir"];
|
||||
// Set vehicle back in front of wire, since the wire will make the vehicle jump, and a wire with no geometry lod is undestructible and not recognizeable
|
||||
_vPos = getPosASL _vehicle;
|
||||
_vDir = getDir _vehicle;
|
||||
_vehicle setPosASL (_vPos vectorAdd [-0.35 * sin(_vDir), -0.35 * cos(_vDir), 0]);
|
||||
// TODO: Needs to be placed in safe distance to wire, so we do not constantly re-spawn new wires
|
||||
}, [_vehicle, _wire], 0.1, 0] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
|
||||
//TODO: Create broken geoless wire (two version)
|
||||
//TODO: Make wire remains stop vehicles
|
1
addons/concertina_wire/functions/script_component.hpp
Normal file
1
addons/concertina_wire/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\concertina_wire\script_component.hpp"
|
15
addons/concertina_wire/script_component.hpp
Normal file
15
addons/concertina_wire/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT concertina_wire
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_CONCERTINA_WIRE
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_CONCERTINA_WIRE
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_CONCERTINA_WIRE
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define WIRE_FAST ["wire_2","wire_3","wire_4","wire_5","wire_6","wire_7","wire_8","wire_9","wire_10","wire_11","wire_12","wire_13","wire_14","wire_15","wire_16","wire_17","wire_18"]
|
||||
#define WIRE_SLOW ["wire_2_1","wire_3_1","wire_4_1","wire_5_1","wire_6_1","wire_7_1","wire_8_1","wire_9_1","wire_10_1","wire_11_1","wire_12_1","wire_13_1","wire_14_1","wire_15_1","wire_16_1","wire_17_1","wire_18_1"]
|
49
addons/concertina_wire/stringtable.xml
Normal file
49
addons/concertina_wire/stringtable.xml
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="concertina_wire">
|
||||
<Key ID="STR_ACE_CONCERTINA_WIRE">
|
||||
<English>Concertina Wire</English>
|
||||
<German>NATO-Draht</German>
|
||||
<Russian>Проволочная спираль</Russian>
|
||||
<Polish>Drut kolczasty</Polish>
|
||||
<Spanish>Concertina wire</Spanish>
|
||||
<French>Concertina wire</French>
|
||||
<Czech>Ostnatý drát</Czech>
|
||||
<Italian>Concertina wire</Italian>
|
||||
<Hungarian>Concertina wire</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_CONCERTINA_WIRECOIL">
|
||||
<English>Concertina Wire Coil</English>
|
||||
<German>NATO-Draht Rolle</German>
|
||||
<Russian>Проволочная спираль (моток)</Russian>
|
||||
<Polish>Zwój drutu kolczastego</Polish>
|
||||
<Spanish>Concertina wire coil</Spanish>
|
||||
<French>Concertina wire coil</French>
|
||||
<Czech>Smyčka ostnatého drátu</Czech>
|
||||
<Italian>Concertina wire coil</Italian>
|
||||
<Hungarian>Concertina wire coil</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_UNROLLWIRE">
|
||||
<English>Dismount Concertina Wire</English>
|
||||
<German>NATO-Draht abbauen</German>
|
||||
<Russian>Демонтировать проволочную спираль</Russian>
|
||||
<Polish>Zwiń drut kolczasty</Polish>
|
||||
<Spanish>Dismount Concertina wire</Spanish>
|
||||
<French>Dismount Concertina wire</French>
|
||||
<Czech>Svinout ostnatý drát</Czech>
|
||||
<Italian>Dismount Concertina wire</Italian>
|
||||
<Hungarian>Dismount Concertina wire</Hungarian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_ROLLWIRE">
|
||||
<English>Deploy Concertina Wire</English>
|
||||
<German>NATO-Draht verlegen</German>
|
||||
<Russian>Монтировать проволочную спираль</Russian>
|
||||
<Polish>Rozwiń drut kolczasty</Polish>
|
||||
<Spanish>Deploy Concertina wire</Spanish>
|
||||
<French>Deploy Concertina wire</French>
|
||||
<Czech>Rozvinout ostnatý drát</Czech>
|
||||
<Italian>Deploy Concertina wire</Italian>
|
||||
<Hungarian>Deploy Concertina wire</Hungarian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
1
addons/dagr/$PBOPREFIX$
Normal file
1
addons/dagr/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\dagr
|
11
addons/dagr/CfgEventHandlers.hpp
Normal file
11
addons/dagr/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,11 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE( call COMPILE_FILE(XEH_postInit) );
|
||||
};
|
||||
};
|
49
addons/dagr/CfgVehicles.hpp
Normal file
49
addons/dagr/CfgVehicles.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
class CfgVehicles {
|
||||
class Man;
|
||||
class CAManBase: Man {
|
||||
class ACE_SelfActions {
|
||||
class ACE_Equipment {
|
||||
class GVAR(menu) {
|
||||
displayName = "Configure DAGR";
|
||||
condition = QUOTE([ARR_2(_player,'ACE_DAGR')] call EFUNC(common,hasItem));
|
||||
statement = QUOTE(call FUNC(menuInit));
|
||||
showDisabled = 0;
|
||||
priority = 0.1;
|
||||
icon = QUOTE(PATHTOF(UI\DAGR_Icon.paa));
|
||||
exceptions[] = {"isNotInside"};
|
||||
class GVAR(toggle) {
|
||||
displayName = "Toggle DAGR";
|
||||
condition = QUOTE([ARR_2(_player,'ACE_DAGR')] call EFUNC(common,hasItem));
|
||||
statement = QUOTE(call FUNC(toggleOverlay));
|
||||
showDisabled = 0;
|
||||
priority = 0.2;
|
||||
icon = QUOTE(PATHTOF(UI\DAGR_Icon.paa));
|
||||
exceptions[] = {"notOnMap", "isNotInside"};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Item_Base_F;
|
||||
class ACE_Item_DAGR: Item_Base_F {
|
||||
author[] = {"Rosuto", "Ruthberg"};
|
||||
scope = 2;
|
||||
scopeCurator = 2;
|
||||
displayName = "DAGR";
|
||||
vehicleClass = "Items";
|
||||
class TransportItems {
|
||||
class ACE_DAGR {
|
||||
name = "ACE_DAGR";
|
||||
count = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
class TransportItems {
|
||||
MACRO_ADDITEM(ACE_DAGR,6);
|
||||
};
|
||||
};
|
||||
};
|
19
addons/dagr/CfgWeapons.hpp
Normal file
19
addons/dagr/CfgWeapons.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
class CfgWeapons {
|
||||
class ACE_ItemCore;
|
||||
class InventoryItem_Base_F;
|
||||
|
||||
class ACE_DAGR: ACE_ItemCore {
|
||||
author[] = {$STR_ACE_Common_ACETeam, "Ruthberg"};
|
||||
scope = 2;
|
||||
displayName = "DAGR";
|
||||
descriptionShort = "";
|
||||
picture = PATHTOF(UI\DAGR_Icon.paa);
|
||||
icon = "iconObject_circle";
|
||||
mapSize = 0.034;
|
||||
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 10;
|
||||
};
|
||||
};
|
||||
};
|
424
addons/dagr/Dialog.hpp
Normal file
424
addons/dagr/Dialog.hpp
Normal file
@ -0,0 +1,424 @@
|
||||
// Control types
|
||||
#define CT_STATIC 0
|
||||
#define CT_BUTTON 1
|
||||
#define CT_EDIT 2
|
||||
#define CT_SLIDER 3
|
||||
#define CT_COMBO 4
|
||||
#define CT_LISTBOX 5
|
||||
#define CT_TOOLBOX 6
|
||||
#define CT_CHECKBOXES 7
|
||||
#define CT_PROGRESS 8
|
||||
#define CT_HTML 9
|
||||
#define CT_STATIC_SKEW 10
|
||||
#define CT_ACTIVETEXT 11
|
||||
#define CT_TREE 12
|
||||
#define CT_STRUCTURED_TEXT 13
|
||||
#define CT_CONTEXT_MENU 14
|
||||
#define CT_CONTROLS_GROUP 15
|
||||
#define CT_SHORTCUT_BUTTON 16 // Arma 2 - textured button
|
||||
|
||||
#define CT_XKEYDESC 40
|
||||
#define CT_XBUTTON 41
|
||||
#define CT_XLISTBOX 42
|
||||
#define CT_XSLIDER 43
|
||||
#define CT_XCOMBO 44
|
||||
#define CT_ANIMATED_TEXTURE 45
|
||||
#define CT_OBJECT 80
|
||||
#define CT_OBJECT_ZOOM 81
|
||||
#define CT_OBJECT_CONTAINER 82
|
||||
#define CT_OBJECT_CONT_ANIM 83
|
||||
#define CT_LINEBREAK 98
|
||||
#define CT_USER 99
|
||||
#define CT_MAP 100
|
||||
#define CT_MAP_MAIN 101
|
||||
#define CT_List_N_Box 102 // Arma 2 - N columns list box
|
||||
|
||||
|
||||
// Static styles
|
||||
#define ST_POS 0x0F
|
||||
#define ST_HPOS 0x03
|
||||
#define ST_VPOS 0x0C
|
||||
#define ST_LEFT 0x00
|
||||
#define ST_RIGHT 0x01
|
||||
#define ST_CENTER 0x02
|
||||
#define ST_DOWN 0x04
|
||||
#define ST_UP 0x08
|
||||
#define ST_VCENTER 0x0c
|
||||
#define ST_TYPE 0xF0
|
||||
#define ST_SINGLE 0
|
||||
#define ST_MULTI 16
|
||||
#define ST_TITLE_BAR 32
|
||||
#define ST_PICTURE 48
|
||||
#define ST_FRAME 64
|
||||
#define ST_BACKGROUND 80
|
||||
#define ST_GROUP_BOX 96
|
||||
#define ST_GROUP_BOX2 112
|
||||
#define ST_HUD_BACKGROUND 128
|
||||
#define ST_TILE_PICTURE 144
|
||||
#define ST_WITH_RECT 160
|
||||
#define ST_LINE 176
|
||||
#define ST_SHADOW 0x100
|
||||
#define ST_NO_RECT 0x200
|
||||
#define ST_KEEP_ASPECT_RATIO 0x800
|
||||
#define ST_TITLE ST_TITLE_BAR + ST_CENTER
|
||||
|
||||
// Slider styles
|
||||
#define SL_DIR 0x400
|
||||
#define SL_VERT 0
|
||||
#define SL_HORZ 0x400
|
||||
#define SL_TEXTURES 0x10
|
||||
|
||||
// Listbox styles
|
||||
#define LB_TEXTURES 0x10
|
||||
#define LB_MULTI 0x20
|
||||
#define FontM "PuristaMedium"
|
||||
|
||||
class RscText;
|
||||
|
||||
class DAGR_Button {
|
||||
idc = -1;
|
||||
type = CT_BUTTON;
|
||||
style = ST_LEFT;
|
||||
font = "PuristaMedium";
|
||||
sizeEx = 0.02;
|
||||
colorText[] = { 0, 1, 0, 1 };
|
||||
colorFocused[] = { 0, 0, 0, 0 }; // border color for focused state
|
||||
colorDisabled[] = { 0, 0, 0, 0 }; // text color for disabled state
|
||||
colorBackground[] = { 0, 0, 0, 0 };
|
||||
colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // background color for disabled state
|
||||
colorBackgroundActive[] = { 0, 0, 0, 0 }; // background color for active state
|
||||
offsetX = 0;
|
||||
offsetY = 0;
|
||||
offsetPressedX = 0;
|
||||
offsetPressedY = 0;
|
||||
colorShadow[] = { 0, 0, 0, 0 };
|
||||
colorBorder[] = { 0, 0, 0, 0 };
|
||||
borderSize = 0;
|
||||
soundEnter[] = { "", 0, 1 }; // no sound
|
||||
soundPush[] = { "", 0, 1 };
|
||||
soundClick[] = { "", 0, 1 }; // no sound
|
||||
soundEscape[] = { "", 0, 1 }; // no sound
|
||||
x = 0.5;
|
||||
y = 0.5;
|
||||
w = 0.07;
|
||||
h = 0.05;
|
||||
text = "";
|
||||
action = "";
|
||||
};
|
||||
class DAGR_Menu_Pic {
|
||||
type = 0;
|
||||
idc = -1;
|
||||
style = 48;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0.7;
|
||||
h = 1.4;
|
||||
text = "";
|
||||
colorBackground[] = {};
|
||||
colorText[] = {};
|
||||
font = "PuristaMedium";
|
||||
sizeEx = 0.04;
|
||||
waitForLoad = 0;
|
||||
};
|
||||
|
||||
class DAGR_Menu_Text {
|
||||
type = 0;
|
||||
idc = -1;
|
||||
style = 0x00;
|
||||
x = 0.5;
|
||||
y = 0.5;
|
||||
w = 0.15;
|
||||
h = 0.15;
|
||||
colorBackground[] = { 0, 0, 0, 0 };
|
||||
colorText[] = { 0.239, 0.216, 0.153, 1 };
|
||||
font = "PuristaMedium";
|
||||
sizeEx = 0.03;
|
||||
waitForLoad = 0;
|
||||
text = "";
|
||||
};
|
||||
|
||||
class DAGR_Menu {
|
||||
idd = 266860;
|
||||
movingEnable = false;
|
||||
duration = 100000;
|
||||
fadein = 0;
|
||||
fadeout = 0;
|
||||
name = "Dagr_Menu";
|
||||
onLoad = "uiNamespace setVariable ['DAGR_Menu', _this select 0]";
|
||||
onUnload = QUOTE(GVAR(PWR) = true); // Simulate pressing the power button
|
||||
controls[] = {"DAGR_MENU_UI", "DAGR_PWR_Button", "DAGR_UP_Button", "DAGR_DOWN_Button", "DAGR_LEFT_Button", "DAGR_RIGHT_Button", "DAGR_NEXT_Button",
|
||||
"DAGR_SEL_Button", "DAGR_MENU_Button", "DAGR_F1_Button", "DAGR_F2_Button", "DAGR_F3_Button", "DAGR_F1_Text", "DAGR_F2_Text", "DAGR_F3_Text", "DAGR_MENU_OPTION0",
|
||||
"DAGR_MENU_OPTION1", "DAGR_MENU_OPTION2", "DAGR_MENU_OPTION3", "DAGR_MENU_OPTION4", "DAGR_MENU_SELECTION0", "DAGR_MENU_SELECTION1", "DAGR_MENU_SELECTION2",
|
||||
"DAGR_MENU_SELECTION3", "DAGR_MENU_SELECTION4", "DAGR_MENU_Main_Text", "DAGR_MENU_PSELECTION1", "DAGR_MENU_PSELECTION2", "DAGR_MENU_PSELECTION3",
|
||||
"DAGR_MENU_PSELECTION4", "DAGR_MENU_PSELECTION5", "DAGR_MENU_PSELECTION6","DAGR_MENU_PSELECTION7", "DAGR_MENU_PSELECTION8"};
|
||||
|
||||
class DAGR_MENU_UI : DAGR_Menu_Pic {
|
||||
idc = 266861;
|
||||
x = 0.175;
|
||||
y = -0.173;
|
||||
text = QUOTE(PATHTOF(UI\dagr_menu.paa));
|
||||
sizeEx = 0.1;
|
||||
};
|
||||
|
||||
class DAGR_PWR_Button : DAGR_Button {
|
||||
idc = 266863;
|
||||
action = QUOTE(GVAR(PWR) = true);
|
||||
x = 0.40;
|
||||
y = 0.65;
|
||||
};
|
||||
|
||||
class DAGR_UP_Button : DAGR_Button {
|
||||
idc = 266864;
|
||||
action = QUOTE(GVAR(UP) = true);
|
||||
x = 0.50;
|
||||
y = 0.675;
|
||||
};
|
||||
|
||||
class DAGR_DOWN_Button : DAGR_Button {
|
||||
idc = 266865;
|
||||
action = QUOTE(GVAR(DOWN) = true);
|
||||
x = 0.50;
|
||||
y = 0.81;
|
||||
};
|
||||
|
||||
class DAGR_LEFT_Button : DAGR_Button {
|
||||
idc = 266866;
|
||||
action = QUOTE(GVAR(LEFT) = true);
|
||||
x = 0.40;
|
||||
y = 0.735;
|
||||
w = 0.05;
|
||||
h = 0.07;
|
||||
};
|
||||
|
||||
class DAGR_RIGHT_Button : DAGR_Button {
|
||||
idc = 266867;
|
||||
action = QUOTE(GVAR(RIGHT) = true);
|
||||
x = 0.62;
|
||||
y = 0.735;
|
||||
w = 0.05;
|
||||
h = 0.07;
|
||||
};
|
||||
|
||||
class DAGR_NEXT_Button : DAGR_Button {
|
||||
idc = 266868;
|
||||
action = QUOTE(DAGR_NEXT = true);
|
||||
x = 0.60;
|
||||
y = 0.65;
|
||||
};
|
||||
|
||||
class DAGR_SEL_Button : DAGR_Button {
|
||||
idc = 266869;
|
||||
action = QUOTE(GVAR(SEL) = true);
|
||||
x = 0.54;
|
||||
y = 0.735;
|
||||
w = 0.06;
|
||||
h = 0.06;
|
||||
};
|
||||
|
||||
class DAGR_MENU_Button : DAGR_Button {
|
||||
idc = 266870;
|
||||
action = QUOTE(GVAR(MENU_B) = true);
|
||||
x = 0.46;
|
||||
y = 0.735;
|
||||
w = 0.06;
|
||||
h = 0.06;
|
||||
};
|
||||
|
||||
class DAGR_F1_Button : DAGR_Button {
|
||||
idc = 266871;
|
||||
action = QUOTE(GVAR(F1) = true);
|
||||
x = 0.40;
|
||||
y = 0.575;
|
||||
};
|
||||
|
||||
class DAGR_F2_Button : DAGR_Button {
|
||||
idc = 266872;
|
||||
action = QUOTE(GVAR(F2) = true);
|
||||
x = 0.495;
|
||||
y = 0.575;
|
||||
};
|
||||
|
||||
class DAGR_F3_Button : DAGR_Button {
|
||||
idc = 266873;
|
||||
action = QUOTE(GVAR(F3) = true);
|
||||
x = 0.59;
|
||||
y = 0.575;
|
||||
};
|
||||
|
||||
class DAGR_F1_Text : DAGR_Menu_Text {
|
||||
idc = 266874;
|
||||
x = 0.388;
|
||||
y = 0.38;
|
||||
text = "";
|
||||
};
|
||||
|
||||
class DAGR_F2_Text : DAGR_Menu_Text {
|
||||
idc = 266875;
|
||||
x = 0.506;
|
||||
y = 0.38;
|
||||
};
|
||||
|
||||
class DAGR_F3_Text : DAGR_Menu_Text {
|
||||
idc = 266876;
|
||||
x = 0.612;
|
||||
y = 0.38;
|
||||
};
|
||||
|
||||
class DAGR_MENU_OPTION0 : DAGR_Menu_Text {
|
||||
idc = 2668777;
|
||||
style = 0x02;
|
||||
sizeEx = 0.035;
|
||||
x = 0.43;
|
||||
y = 0.19;
|
||||
};
|
||||
|
||||
class DAGR_MENU_OPTION1 : DAGR_Menu_Text {
|
||||
idc = 2668778;
|
||||
style = 0x02;
|
||||
sizeEx = 0.035;
|
||||
x = 0.43;
|
||||
y = 0.225;
|
||||
};
|
||||
|
||||
class DAGR_MENU_OPTION2 : DAGR_Menu_Text {
|
||||
idc = 2668779;
|
||||
style = 0x02;
|
||||
sizeEx = 0.035;
|
||||
x = 0.43;
|
||||
y = 0.26;
|
||||
};
|
||||
|
||||
class DAGR_MENU_OPTION3 : DAGR_Menu_Text {
|
||||
idc = 2668780;
|
||||
style = 0x02;
|
||||
sizeEx = 0.035;
|
||||
x = 0.43;
|
||||
y = 0.295;
|
||||
};
|
||||
|
||||
class DAGR_MENU_OPTION4 : DAGR_Menu_Text {
|
||||
idc = 2668781;
|
||||
style = 0x02;
|
||||
sizeEx = 0.035;
|
||||
x = 0.43;
|
||||
y = 0.33;
|
||||
};
|
||||
class DAGR_MENU_SELECTION0 : DAGR_Menu_Pic {
|
||||
idc = 2668783;
|
||||
x = 0.42;
|
||||
y = 0.246;
|
||||
w = 0.17;
|
||||
h = 0.035;
|
||||
sizeEx = 0.05;
|
||||
};
|
||||
|
||||
class DAGR_MENU_SELECTION1 : DAGR_Menu_Pic {
|
||||
idc = 2668784;
|
||||
x = 0.42;
|
||||
y = 0.281;
|
||||
w = 0.17;
|
||||
h = 0.035;
|
||||
sizeEx = 0.05;
|
||||
};
|
||||
|
||||
class DAGR_MENU_SELECTION2 : DAGR_Menu_Pic {
|
||||
idc = 2668785;
|
||||
x = 0.42;
|
||||
y = 0.316;
|
||||
w = 0.17;
|
||||
h = 0.035;
|
||||
sizeEx = 0.05;
|
||||
};
|
||||
|
||||
class DAGR_MENU_SELECTION3 : DAGR_Menu_Pic {
|
||||
idc = 2668786;
|
||||
x = 0.42;
|
||||
y = 0.351;
|
||||
w = 0.17;
|
||||
h = 0.035;
|
||||
sizeEx = 0.05;
|
||||
};
|
||||
|
||||
class DAGR_MENU_SELECTION4 : DAGR_Menu_Pic {
|
||||
idc = 2668787;
|
||||
x = 0.42;
|
||||
y = 0.386;
|
||||
w = 0.17;
|
||||
h = 0.035;
|
||||
sizeEx = 0.05;
|
||||
};
|
||||
|
||||
class DAGR_MENU_Main_Text : DAGR_Menu_Text {
|
||||
idc = 2668782;
|
||||
style = ST_CENTER;
|
||||
x = 0.38;
|
||||
y = 0.32;
|
||||
w = 0.25;
|
||||
h = 0.035;
|
||||
sizeEx = 0.04;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION1 : DAGR_Menu_Pic {
|
||||
idc = 2668788;
|
||||
x = 0.451;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION2 : DAGR_Menu_Pic {
|
||||
idc = 2668789;
|
||||
x = 0.465;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION3 : DAGR_Menu_Pic {
|
||||
idc = 2668790;
|
||||
x = 0.479;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION4 : DAGR_Menu_Pic {
|
||||
idc = 2668791;
|
||||
x = 0.493;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION5 : DAGR_Menu_Pic {
|
||||
idc = 2668792;
|
||||
x = 0.507;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION6 : DAGR_Menu_Pic {
|
||||
idc = 2668793;
|
||||
x = 0.521;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION7 : DAGR_Menu_Pic {
|
||||
idc = 2668794;
|
||||
x = 0.535;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
|
||||
class DAGR_MENU_PSELECTION8 : DAGR_Menu_Pic {
|
||||
idc = 2668795;
|
||||
x = 0.549;
|
||||
y = 0.352;
|
||||
w = 0.01;
|
||||
h = 0.003;
|
||||
};
|
||||
};
|
10
addons/dagr/README.md
Normal file
10
addons/dagr/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
ace_dagr
|
||||
===============
|
||||
|
||||
Defense Advanced GPS Receiver
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [Ruthberg] (http://github.com/Ulteq)
|
95
addons/dagr/RscTitles.hpp
Normal file
95
addons/dagr/RscTitles.hpp
Normal file
@ -0,0 +1,95 @@
|
||||
class RscTitles {
|
||||
class DAGR_Text {
|
||||
type = 0;
|
||||
idc = -1;
|
||||
style = 0x01;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0.15;
|
||||
h = 0.050;
|
||||
text = "";
|
||||
colorBackground[] = { 0, 0, 0, 0 };
|
||||
colorText[] = { 0.239, 0.216, 0.153, 1 };
|
||||
font = "PuristaMedium";
|
||||
sizeEx = 0.04;
|
||||
waitForLoad = 0;
|
||||
};
|
||||
class DAGR_Pic {
|
||||
type = 0;
|
||||
idc = -1;
|
||||
style = 48;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0.50;
|
||||
h = 0.50;
|
||||
text = "";
|
||||
colorBackground[] = {};
|
||||
colorText[] = {};
|
||||
font = "PuristaMedium";
|
||||
sizeEx = 0.02;
|
||||
waitForLoad = 0;
|
||||
};
|
||||
|
||||
class DAGR_Display {
|
||||
idd = 266850;
|
||||
movingEnable = false;
|
||||
duration = 100000;
|
||||
fadein = 0;
|
||||
fadeout = 0;
|
||||
name = "Dagr_Display";
|
||||
onLoad="uiNamespace setVariable ['DAGR_Display', _this select 0]";
|
||||
controls[] = {"DAGR_UI", "DAGR_Grid", "DAGR_Speed", "DAGR_Elevation", "DAGR_Heading", "DAGR_Time", "DAGR_WP", "DAGR_Bearing", "DAGR_DIST"};
|
||||
|
||||
class DAGR_UI : DAGR_Pic {
|
||||
idc = 266856;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.45";
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.47";
|
||||
};
|
||||
|
||||
class DAGR_Grid : DAGR_Text {
|
||||
idc = 266851;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.370";// 0.830
|
||||
y = "(SafeZoneH + SafeZoneY)- 0.250";// 0.845
|
||||
w = 0.25;
|
||||
h = 0.06;
|
||||
sizeEx = 0.07;
|
||||
};
|
||||
class DAGR_Speed : DAGR_Text {
|
||||
idc = 266852;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.388"; //0.812
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
|
||||
};
|
||||
class DAGR_Elevation : DAGR_Text {
|
||||
idc = 266853;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.270"; //0.930
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
|
||||
};
|
||||
class DAGR_Heading : DAGR_Text {
|
||||
idc = 266854;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.1294"; //0.9656
|
||||
};
|
||||
class DAGR_Time : DAGR_Text {
|
||||
idc = 266855;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.275"; //0.925
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965
|
||||
};
|
||||
|
||||
class DAGR_WP : DAGR_Text {
|
||||
idc = 266857;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.235"; //0.965
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
|
||||
};
|
||||
|
||||
class DAGR_Bearing : DAGR_Text {
|
||||
idc = 266858;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
|
||||
};
|
||||
class DAGR_DIST : DAGR_Text {
|
||||
idc = 266859;
|
||||
x = "(SafeZoneW + SafeZoneX) - 0.265"; //0.935
|
||||
y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965
|
||||
};
|
||||
};
|
||||
};
|
BIN
addons/dagr/UI/DAGR_Button.paa
Normal file
BIN
addons/dagr/UI/DAGR_Button.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_GPS.paa
Normal file
BIN
addons/dagr/UI/DAGR_GPS.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_GPS_SHOW.paa
Normal file
BIN
addons/dagr/UI/DAGR_GPS_SHOW.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_Icon.paa
Normal file
BIN
addons/dagr/UI/DAGR_Icon.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_MENU.paa
Normal file
BIN
addons/dagr/UI/DAGR_MENU.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_PSelection.paa
Normal file
BIN
addons/dagr/UI/DAGR_PSelection.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_Selection.paa
Normal file
BIN
addons/dagr/UI/DAGR_Selection.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_Vector.paa
Normal file
BIN
addons/dagr/UI/DAGR_Vector.paa
Normal file
Binary file not shown.
BIN
addons/dagr/UI/DAGR_WP.paa
Normal file
BIN
addons/dagr/UI/DAGR_WP.paa
Normal file
Binary file not shown.
31
addons/dagr/XEH_postInit.sqf
Normal file
31
addons/dagr/XEH_postInit.sqf
Normal file
@ -0,0 +1,31 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
#include "initKeybinds.sqf"
|
||||
|
||||
GVAR(outputPFH) = -1;
|
||||
|
||||
GVAR(run) = false;
|
||||
GVAR(hidden) = true;
|
||||
GVAR(menuRun) = false;
|
||||
GVAR(useDegrees) = true;
|
||||
GVAR(updateInterval) = 0.5;
|
||||
|
||||
GVAR(numWaypoints) = 0;
|
||||
GVAR(wpString0) = "";
|
||||
GVAR(wpString1) = "";
|
||||
GVAR(wpString2) = "";
|
||||
GVAR(wpString3) = "";
|
||||
GVAR(wpString4) = "";
|
||||
GVAR(wp0) = 0;
|
||||
GVAR(wp1) = 0;
|
||||
GVAR(wp2) = 0;
|
||||
GVAR(wp3) = 0;
|
||||
GVAR(wp4) = 0;
|
||||
|
||||
GVAR(displaySelection) = "DATA";
|
||||
|
||||
GVAR(vectorConnected) = false;
|
||||
GVAR(noVectorData) = true;
|
||||
GVAR(vectorGrid) = "00000000";
|
||||
|
||||
["RangerfinderData", {_this call FUNC(handleRangeFinderData)}] call EFUNC(common,addEventHandler);
|
12
addons/dagr/XEH_preInit.sqf
Normal file
12
addons/dagr/XEH_preInit.sqf
Normal file
@ -0,0 +1,12 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(handleRangeFinderData);
|
||||
PREP(menuInit);
|
||||
PREP(outputData);
|
||||
PREP(outputVector);
|
||||
PREP(outputWP);
|
||||
PREP(toggleOverlay);
|
||||
|
||||
ADDON = true;
|
18
addons/dagr/config.cpp
Normal file
18
addons/dagr/config.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {"ACE_Item_DAGR"};
|
||||
weapons[] = {"ACE_DAGR"};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_weather"};
|
||||
author[] = {"Rosuto", "Ruthberg"};
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "Dialog.hpp"
|
||||
#include "RscTitles.hpp"
|
30
addons/dagr/functions/fnc_handleRangeFinderData.sqf
Normal file
30
addons/dagr/functions/fnc_handleRangeFinderData.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Author: Rosuto, Ruthberg
|
||||
* Handles incoming data packets from the Vectronix Vector LRF
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Slope distance (Meters) <NUMBER>
|
||||
* 1: Azimuth (Degrees) <NUMBER>
|
||||
* 2: Inclination (Degrees) <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [1000, 45, 1] call ace_dagr_fnc_handleRangeFinderData
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define EMP_RF_ACC 5 // Rangefinder Accuracy
|
||||
|
||||
PARAMS_3(_slopeDistance,_azimuth,_inclination);
|
||||
|
||||
if (GVAR(vectorConnected)) then {
|
||||
GVAR(LAZPOS) = (eyePos player) vectorAdd ([_slopeDistance, _azimuth, _inclination] call CBA_fnc_polar2vect);
|
||||
GVAR(LAZDIST) = _slopeDistance * cos(_inclination);
|
||||
GVAR(LAZDIST) = floor (GVAR(LAZDIST) / EMP_RF_ACC) * EMP_RF_ACC;
|
||||
GVAR(LAZHEADING) = _azimuth;
|
||||
GVAR(noVectorData) = false;
|
||||
};
|
607
addons/dagr/functions/fnc_menuInit.sqf
Normal file
607
addons/dagr/functions/fnc_menuInit.sqf
Normal file
@ -0,0 +1,607 @@
|
||||
/*
|
||||
* Author: Rosuto, Ruthberg
|
||||
* Creates the DAGR menu dialog
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define __dsp (uiNamespace getVariable "DAGR_MENU")
|
||||
#define __F1 266874
|
||||
#define __F2 266875
|
||||
#define __F3 266876
|
||||
#define __Option0 2668777
|
||||
#define __Option1 2668778
|
||||
#define __Option2 2668779
|
||||
#define __Option3 2668780
|
||||
#define __Option4 2668781
|
||||
#define __Selection0 2668783
|
||||
#define __Selection1 2668784
|
||||
#define __Selection2 2668785
|
||||
#define __Selection3 2668786
|
||||
#define __Selection4 2668787
|
||||
#define __mainText 2668782
|
||||
#define __PSelection1 2668788
|
||||
#define __PSelection2 2668789
|
||||
#define __PSelection3 2668790
|
||||
#define __PSelection4 2668791
|
||||
#define __PSelection5 2668792
|
||||
#define __PSelection6 2668793
|
||||
#define __PSelection7 2668794
|
||||
#define __PSelection8 2668795
|
||||
|
||||
135471 cutText ["", "PLAIN"];
|
||||
closeDialog 0;
|
||||
createDialog "DAGR_MENU";
|
||||
|
||||
GVAR(menu) = "main";
|
||||
GVAR(selection) = 0;
|
||||
GVAR(numSelections) = 5;
|
||||
GVAR(tmpUpdateRate) = GVAR(updateInterval);
|
||||
GVAR(edit) = false;
|
||||
GVAR(add) = false;
|
||||
GVAR(pointer) = 0;
|
||||
GVAR(digit1) = 0;
|
||||
GVAR(digit2) = 0;
|
||||
GVAR(digit3) = 0;
|
||||
GVAR(digit4) = 0;
|
||||
GVAR(digit5) = 0;
|
||||
GVAR(digit6) = 0;
|
||||
GVAR(digit7) = 0;
|
||||
GVAR(digit8) = 0;
|
||||
|
||||
GVAR(busy) = false;
|
||||
GVAR(busyTimer) = 0;
|
||||
|
||||
GVAR(showNoWaypointsFound) = false;
|
||||
GVAR(showInfoUpdatin) = false;
|
||||
GVAR(showDeleting) = false;
|
||||
GVAR(showOutOfSpace) = false;
|
||||
|
||||
GVAR(PWR) = false;
|
||||
GVAR(menuRun) = true;
|
||||
[{
|
||||
if (!dialog || GVAR(PWR)) exitWith {
|
||||
closeDialog 266860;
|
||||
GVAR(menuRun) = false;
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
if (GVAR(MENU_B)) then {
|
||||
GVAR(menu) = "main";
|
||||
GVAR(selection) = 0;
|
||||
GVAR(numSelections) = 5;
|
||||
};
|
||||
|
||||
if (!GVAR(add) && !GVAR(edit)) then {
|
||||
if (GVAR(DOWN)) then {
|
||||
GVAR(selection) = (GVAR(numSelections) + GVAR(selection) + 1);
|
||||
};
|
||||
if (GVAR(UP)) then {
|
||||
GVAR(selection) = (GVAR(numSelections) + GVAR(selection) - 1);
|
||||
};
|
||||
GVAR(selection) = if (GVAR(numSelections) > 0) then { GVAR(selection) % GVAR(numSelections) } else { 0 };
|
||||
};
|
||||
|
||||
if (GVAR(LEFT)) then {
|
||||
GVAR(pointer) = (8 + GVAR(pointer) - 1);
|
||||
};
|
||||
if (GVAR(RIGHT)) then {
|
||||
GVAR(pointer) = (8 + GVAR(pointer) + 1);
|
||||
};
|
||||
GVAR(pointer) = GVAR(pointer) % 8;
|
||||
|
||||
(__dsp displayCtrl __PSelection1) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection2) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection3) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection4) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection5) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection6) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection7) ctrlSetText "";
|
||||
(__dsp displayCtrl __PSelection8) ctrlSetText "";
|
||||
|
||||
(__dsp displayCtrl __Selection0) ctrlSetText "";
|
||||
(__dsp displayCtrl __Selection1) ctrlSetText "";
|
||||
(__dsp displayCtrl __Selection2) ctrlSetText "";
|
||||
(__dsp displayCtrl __Selection3) ctrlSetText "";
|
||||
(__dsp displayCtrl __Selection4) ctrlSetText "";
|
||||
|
||||
(__dsp displayCtrl __F1) ctrlSetText "";
|
||||
(__dsp displayCtrl __F2) ctrlSetText "";
|
||||
(__dsp displayCtrl __F3) ctrlSetText "";
|
||||
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "";
|
||||
(__dsp displayCtrl __Option0) ctrlSetText "";
|
||||
(__dsp displayCtrl __Option1) ctrlSetText "";
|
||||
(__dsp displayCtrl __Option2) ctrlSetText "";
|
||||
(__dsp displayCtrl __Option3) ctrlSetText "";
|
||||
(__dsp displayCtrl __Option4) ctrlSetText "";
|
||||
|
||||
switch (GVAR(menu)) do {
|
||||
case "main": {
|
||||
if (GVAR(SEL)) then {
|
||||
switch (GVAR(selection)) do {
|
||||
case 0: {
|
||||
GVAR(displaySelection) = "DATA";
|
||||
GVAR(vectorConnected) = false;
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Acquiring Data.";
|
||||
if (ACE_time - GVAR(busyTimer) > 0.5) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Acquiring Data..";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.0) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Acquiring Data...";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.5) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Position Acquired";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 3.0) then {
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
case 1: {
|
||||
if (GVAR(numWaypoints) < 1) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "No Waypoints Found";
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(showNoWaypointsFound) = true;
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
} else {
|
||||
GVAR(menu) = "goto_wp"; GVAR(numSelections) = GVAR(numWaypoints); GVAR(selection) = 0;
|
||||
};
|
||||
};
|
||||
case 2: { GVAR(menu) = "wp_list"; GVAR(numSelections) = GVAR(numWaypoints); GVAR(selection) = 0 };
|
||||
case 3: { GVAR(menu) = "connect"; GVAR(numSelections) = 1; };
|
||||
case 4: { GVAR(menu) = "options"; GVAR(numSelections) = 2; };
|
||||
};
|
||||
};
|
||||
if (GVAR(busy) && GVAR(showNoWaypointsFound)) then {
|
||||
if (ACE_time - GVAR(busyTimer) > 2) then {
|
||||
GVAR(showNoWaypointsFound) = false;
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
if (!GVAR(busy)) then {
|
||||
(__dsp displayCtrl __Option0) ctrlSetText "DATA VIEW";
|
||||
(__dsp displayCtrl __Option1) ctrlSetText "GOTO WP";
|
||||
(__dsp displayCtrl __Option2) ctrlSetText "WP LIST";
|
||||
(__dsp displayCtrl __Option3) ctrlSetText "CONNECT TO";
|
||||
(__dsp displayCtrl __Option4) ctrlSetText "OPTIONS";
|
||||
(__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa));
|
||||
};
|
||||
};
|
||||
case "goto_wp": {
|
||||
if (!GVAR(busy)) then {
|
||||
(__dsp displayCtrl __Option0) ctrlSetText GVAR(wpString0);
|
||||
(__dsp displayCtrl __Option1) ctrlSetText GVAR(wpString1);
|
||||
(__dsp displayCtrl __Option2) ctrlSetText GVAR(wpString2);
|
||||
(__dsp displayCtrl __Option3) ctrlSetText GVAR(wpString3);
|
||||
(__dsp displayCtrl __Option4) ctrlSetText GVAR(wpString4);
|
||||
if (GVAR(numSelections) > 0) then {
|
||||
(__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa));
|
||||
};
|
||||
};
|
||||
if (GVAR(SEL)) then {
|
||||
GVAR(vectorConnected) = false;
|
||||
GVAR(displaySelection) = "WP";
|
||||
switch (GVAR(selection)) do {
|
||||
case 0: { DAGR_WP_INFO = GVAR(wp0); };
|
||||
case 1: { DAGR_WP_INFO = GVAR(wp1); };
|
||||
case 2: { DAGR_WP_INFO = GVAR(wp2); };
|
||||
case 3: { DAGR_WP_INFO = GVAR(wp3); };
|
||||
case 4: { DAGR_WP_INFO = GVAR(wp4); };
|
||||
};
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(showInfoUpdating) = true;
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
};
|
||||
if (GVAR(busy) && GVAR(showInfoUpdating)) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Info Update.";
|
||||
if (ACE_time - GVAR(busyTimer) > 1) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Info Update..";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.2) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Info Update...";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.4) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Info Updated";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 2.9) then {
|
||||
GVAR(showInfoUpdating) = false;
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
case "wp_list": {
|
||||
if (!GVAR(add) && !GVAR(edit)) then {
|
||||
if (!GVAR(busy)) then {
|
||||
(__dsp displayCtrl __Option0) ctrlSetText GVAR(wpString0);
|
||||
(__dsp displayCtrl __Option1) ctrlSetText GVAR(wpString1);
|
||||
(__dsp displayCtrl __Option2) ctrlSetText GVAR(wpString2);
|
||||
(__dsp displayCtrl __Option3) ctrlSetText GVAR(wpString3);
|
||||
(__dsp displayCtrl __Option4) ctrlSetText GVAR(wpString4);
|
||||
(__dsp displayCtrl __F1) ctrlSetText "Add";
|
||||
(__dsp displayCtrl __F2) ctrlSetText "Edit";
|
||||
(__dsp displayCtrl __F3) ctrlSetText "Delete";
|
||||
if (GVAR(numSelections) > 0) then {
|
||||
(__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa));
|
||||
};
|
||||
};
|
||||
if (GVAR(F3) && GVAR(numWaypoints) > 0) then {
|
||||
if (!GVAR(busy)) then {
|
||||
switch (GVAR(selection)) do {
|
||||
case 0: {
|
||||
GVAR(wpString0) = GVAR(wpString1);
|
||||
GVAR(wp0) = GVAR(wp1);
|
||||
GVAR(wpString1) = GVAR(wpString2);
|
||||
GVAR(wp1) = GVAR(wp2);
|
||||
GVAR(wpString2) = GVAR(wpString3);
|
||||
GVAR(wp2) = GVAR(wp3);
|
||||
GVAR(wpString3) = GVAR(wpString4);
|
||||
GVAR(wp3) = GVAR(wp4);
|
||||
GVAR(wpString4) = "";
|
||||
GVAR(wp4) = "";
|
||||
};
|
||||
case 1: {
|
||||
GVAR(wpString1) = GVAR(wpString2);
|
||||
GVAR(wp1) = GVAR(wp2);
|
||||
GVAR(wpString2) = GVAR(wpString3);
|
||||
GVAR(wp2) = GVAR(wp3);
|
||||
GVAR(wpString3) = GVAR(wpString4);
|
||||
GVAR(wp3) = GVAR(wp4);
|
||||
GVAR(wpString4) = "";
|
||||
GVAR(wp4) = "";
|
||||
};
|
||||
case 2: {
|
||||
GVAR(wpString2) = GVAR(wpString3);
|
||||
GVAR(wp2) = GVAR(wp3);
|
||||
GVAR(wpString3) = GVAR(wpString4);
|
||||
GVAR(wp3) = GVAR(wp4);
|
||||
GVAR(wpString4) = "";
|
||||
GVAR(wp4) = "";
|
||||
};
|
||||
case 3: {
|
||||
GVAR(wpString3) = GVAR(wpString4);
|
||||
GVAR(wp3) = GVAR(wp4);
|
||||
GVAR(wpString4) = "";
|
||||
GVAR(wp4) = "";
|
||||
};
|
||||
case 4: {
|
||||
GVAR(wpString4) = "";
|
||||
GVAR(wp4) = "";
|
||||
};
|
||||
};
|
||||
GVAR(numWaypoints) = GVAR(numWaypoints) - 1;
|
||||
GVAR(numSelections) = GVAR(numWaypoints);
|
||||
GVAR(showDeleting) = true;
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
};
|
||||
if (GVAR(busy) && GVAR(showDeleting)) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Deleting.";
|
||||
if (ACE_time - GVAR(busyTimer) > 1) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Deleting..";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.2) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Deleting...";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.4) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Waypoint Deleted";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 2.9) then {
|
||||
GVAR(showDeleting) = false;
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
if (GVAR(F1)) then {
|
||||
if (GVAR(numWaypoints) == 5) then {
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(showOutOfSpace) = true;
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
} else {
|
||||
GVAR(digit1) = 0;
|
||||
GVAR(digit2) = 0;
|
||||
GVAR(digit3) = 0;
|
||||
GVAR(digit4) = 0;
|
||||
GVAR(digit5) = 0;
|
||||
GVAR(digit6) = 0;
|
||||
GVAR(digit7) = 0;
|
||||
GVAR(digit8) = 0;
|
||||
GVAR(pointer) = 0;
|
||||
GVAR(add) = true;
|
||||
};
|
||||
};
|
||||
if (GVAR(busy) && GVAR(showOutOfSpace)) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Out of Space";
|
||||
if (ACE_time - GVAR(busyTimer) > 2.5) then {
|
||||
GVAR(showOutOfSpace) = false;
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
if (GVAR(F2) && GVAR(numWaypoints) > 0) then {
|
||||
GVAR(pointer) = 0;
|
||||
GVAR(edit) = true;
|
||||
GVAR(add) = false;
|
||||
switch (GVAR(selection)) do {
|
||||
case 0: {
|
||||
GVAR(digit1) = floor (GVAR(wp0) / 10000000);
|
||||
GVAR(digit2) = floor (GVAR(wp0) / 1000000 - GVAR(digit1) *10);
|
||||
GVAR(digit3) = floor (GVAR(wp0) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100);
|
||||
GVAR(digit4) = floor (GVAR(wp0) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000);
|
||||
GVAR(digit5) = floor (GVAR(wp0) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000);
|
||||
GVAR(digit6) = floor (GVAR(wp0) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000);
|
||||
GVAR(digit7) = floor (GVAR(wp0) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000);
|
||||
GVAR(digit8) = floor (GVAR(wp0) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000);
|
||||
};
|
||||
case 1: {
|
||||
GVAR(digit1) = floor (GVAR(wp1) / 10000000);
|
||||
GVAR(digit2) = floor (GVAR(wp1) / 1000000 - GVAR(digit1) *10);
|
||||
GVAR(digit3) = floor (GVAR(wp1) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100);
|
||||
GVAR(digit4) = floor (GVAR(wp1) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000);
|
||||
GVAR(digit5) = floor (GVAR(wp1) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000);
|
||||
GVAR(digit6) = floor (GVAR(wp1) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000);
|
||||
GVAR(digit7) = floor (GVAR(wp1) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000);
|
||||
GVAR(digit8) = floor (GVAR(wp1) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000);
|
||||
};
|
||||
case 2: {
|
||||
GVAR(digit1) = floor (GVAR(wp2) / 10000000);
|
||||
GVAR(digit2) = floor (GVAR(wp2) / 1000000 - GVAR(digit1) *10);
|
||||
GVAR(digit3) = floor (GVAR(wp2) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100);
|
||||
GVAR(digit4) = floor (GVAR(wp2) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000);
|
||||
GVAR(digit5) = floor (GVAR(wp2) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000);
|
||||
GVAR(digit6) = floor (GVAR(wp2) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000);
|
||||
GVAR(digit7) = floor (GVAR(wp2) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000);
|
||||
GVAR(digit8) = floor (GVAR(wp2) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000);
|
||||
};
|
||||
case 3: {
|
||||
GVAR(digit1) = floor (GVAR(wp3) / 10000000);
|
||||
GVAR(digit2) = floor (GVAR(wp3) / 1000000 - GVAR(digit1) *10);
|
||||
GVAR(digit3) = floor (GVAR(wp3) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100);
|
||||
GVAR(digit4) = floor (GVAR(wp3) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000);
|
||||
GVAR(digit5) = floor (GVAR(wp3) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000);
|
||||
GVAR(digit6) = floor (GVAR(wp3) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000);
|
||||
GVAR(digit7) = floor (GVAR(wp3) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000);
|
||||
GVAR(digit8) = floor (GVAR(wp3) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000);
|
||||
};
|
||||
case 4: {
|
||||
GVAR(digit1) = floor (GVAR(wp4) / 10000000);
|
||||
GVAR(digit2) = floor (GVAR(wp4) / 1000000 - GVAR(digit1) *10);
|
||||
GVAR(digit3) = floor (GVAR(wp4) / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100);
|
||||
GVAR(digit4) = floor (GVAR(wp4) / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000);
|
||||
GVAR(digit5) = floor (GVAR(wp4) / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000);
|
||||
GVAR(digit6) = floor (GVAR(wp4) / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000);
|
||||
GVAR(digit7) = floor (GVAR(wp4) / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000);
|
||||
GVAR(digit8) = floor (GVAR(wp4) - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000);
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
if (!GVAR(busy)) then {
|
||||
(__dsp displayCtrl __F1) ctrlSetText "Save";
|
||||
(__dsp displayCtrl __F2) ctrlSetText "Vector";
|
||||
(__dsp displayCtrl __F3) ctrlSetText "Cancel";
|
||||
GVAR(output) = str GVAR(digit1) + str GVAR(digit2) + str GVAR(digit3) + str GVAR(digit4) + str GVAR(digit5) + str GVAR(digit6) + str GVAR(digit7) + str GVAR(digit8);
|
||||
(__dsp displayCtrl __mainText) ctrlSetText GVAR(output);
|
||||
(__dsp displayCtrl __PSelection1 + GVAR(pointer)) ctrlSetText QUOTE(PATHTOF(UI\DAGR_PSelection.paa));
|
||||
};
|
||||
if (GVAR(F1)) then {
|
||||
if (!GVAR(busy)) then {
|
||||
if (GVAR(add)) then {
|
||||
switch (GVAR(numWaypoints)) do {
|
||||
case 0: { GVAR(wpString0) = GVAR(output); GVAR(wp0) = parseNumber GVAR(output); };
|
||||
case 1: { GVAR(wpString1) = GVAR(output); GVAR(wp1) = parseNumber GVAR(output); };
|
||||
case 2: { GVAR(wpString2) = GVAR(output); GVAR(wp2) = parseNumber GVAR(output); };
|
||||
case 3: { GVAR(wpString3) = GVAR(output); GVAR(wp3) = parseNumber GVAR(output); };
|
||||
case 4: { GVAR(wpString4) = GVAR(output); GVAR(wp4) = parseNumber GVAR(output); };
|
||||
};
|
||||
GVAR(numWaypoints) = GVAR(numWaypoints) + 1;
|
||||
GVAR(numSelections) = GVAR(numWaypoints);
|
||||
GVAR(selection) = 0;
|
||||
};
|
||||
if (GVAR(edit)) then {
|
||||
switch (GVAR(selection)) do {
|
||||
case 0: { GVAR(wpString0) = GVAR(output); GVAR(wp0) = parseNumber GVAR(output); };
|
||||
case 1: { GVAR(wpString1) = GVAR(output); GVAR(wp1) = parseNumber GVAR(output); };
|
||||
case 2: { GVAR(wpString2) = GVAR(output); GVAR(wp2) = parseNumber GVAR(output); };
|
||||
case 3: { GVAR(wpString3) = GVAR(output); GVAR(wp3) = parseNumber GVAR(output); };
|
||||
case 4: { GVAR(wpString4) = GVAR(output); GVAR(wp4) = parseNumber GVAR(output); };
|
||||
};
|
||||
};
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
(__dsp displayCtrl __F1) ctrlSetText "";
|
||||
(__dsp displayCtrl __F2) ctrlSetText "";
|
||||
(__dsp displayCtrl __F3) ctrlSetText "";
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Saving.";
|
||||
if (ACE_time - GVAR(busyTimer) > 1) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Saving..";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.2) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Saving...";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 1.4) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Waypoint Saved";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 2.9) then {
|
||||
GVAR(edit) = false;
|
||||
GVAR(add) = false;
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
if (GVAR(F2)) then {
|
||||
private ["_grid", "_gridVector"];
|
||||
_grid = toArray GVAR(vectorGrid);
|
||||
_grid deleteAt 4;
|
||||
_grid = toString _grid;
|
||||
_gridVector = parseNumber _grid;
|
||||
GVAR(digit1) = floor(_gridVector / 10000000);
|
||||
GVAR(digit2) = floor(_gridVector / 1000000 - GVAR(digit1) *10);
|
||||
GVAR(digit3) = floor(_gridVector / 100000 - GVAR(digit2) * 10 - GVAR(digit1) * 100);
|
||||
GVAR(digit4) = floor(_gridVector / 10000 - GVAR(digit3) * 10 - GVAR(digit2) * 100 - GVAR(digit1) * 1000);
|
||||
GVAR(digit5) = floor(_gridVector / 1000 - GVAR(digit4) * 10 - GVAR(digit3) * 100 - GVAR(digit2) * 1000 - GVAR(digit1) * 10000);
|
||||
GVAR(digit6) = floor(_gridVector / 100 - GVAR(digit5) * 10 - GVAR(digit4) * 100 - GVAR(digit3) * 1000 - GVAR(digit2) * 10000 - GVAR(digit1) * 100000);
|
||||
GVAR(digit7) = floor(_gridVector / 10- GVAR(digit6) * 10 - GVAR(digit5) * 100 - GVAR(digit4) * 1000 - GVAR(digit3) * 10000 - GVAR(digit2) * 100000 - GVAR(digit1) * 1000000);
|
||||
GVAR(digit8) = floor(_gridVector - GVAR(digit7) * 10 - GVAR(digit6) * 100 - GVAR(digit5) * 1000 - GVAR(digit4) * 10000 - GVAR(digit3) * 100000 - GVAR(digit2) * 1000000 - GVAR(digit1) * 10000000);
|
||||
};
|
||||
if (GVAR(F3)) then {
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
} else {
|
||||
(__dsp displayCtrl __F1) ctrlSetText "Save";
|
||||
(__dsp displayCtrl __F2) ctrlSetText "Vector";
|
||||
(__dsp displayCtrl __F3) ctrlSetText "Cancel";
|
||||
GVAR(output) = str GVAR(digit1) + str GVAR(digit2) + str GVAR(digit3) + str GVAR(digit4) + str GVAR(digit5) + str GVAR(digit6) + str GVAR(digit7) + str GVAR(digit8);
|
||||
(__dsp displayCtrl __mainText) ctrlSetText GVAR(output);
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 0.1) then {
|
||||
GVAR(add) = false;
|
||||
GVAR(edit) = false;
|
||||
GVAR(busy) = false;
|
||||
};
|
||||
};
|
||||
if (GVAR(UP)) then {
|
||||
switch (GVAR(pointer) + 1) do {
|
||||
case 1: { GVAR(digit1) = (10 + GVAR(digit1) + 1) % 10 };
|
||||
case 2: { GVAR(digit2) = (10 + GVAR(digit2) + 1) % 10 };
|
||||
case 3: { GVAR(digit3) = (10 + GVAR(digit3) + 1) % 10 };
|
||||
case 4: { GVAR(digit4) = (10 + GVAR(digit4) + 1) % 10 };
|
||||
case 5: { GVAR(digit5) = (10 + GVAR(digit5) + 1) % 10 };
|
||||
case 6: { GVAR(digit6) = (10 + GVAR(digit6) + 1) % 10 };
|
||||
case 7: { GVAR(digit7) = (10 + GVAR(digit7) + 1) % 10 };
|
||||
case 8: { GVAR(digit8) = (10 + GVAR(digit8) + 1) % 10 };
|
||||
};
|
||||
};
|
||||
if (GVAR(DOWN)) then {
|
||||
switch (GVAR(pointer) + 1) do {
|
||||
case 1: { GVAR(digit1) = (10 + GVAR(digit1) - 1) % 10 };
|
||||
case 2: { GVAR(digit2) = (10 + GVAR(digit2) - 1) % 10 };
|
||||
case 3: { GVAR(digit3) = (10 + GVAR(digit3) - 1) % 10 };
|
||||
case 4: { GVAR(digit4) = (10 + GVAR(digit4) - 1) % 10 };
|
||||
case 5: { GVAR(digit5) = (10 + GVAR(digit5) - 1) % 10 };
|
||||
case 6: { GVAR(digit6) = (10 + GVAR(digit6) - 1) % 10 };
|
||||
case 7: { GVAR(digit7) = (10 + GVAR(digit7) - 1) % 10 };
|
||||
case 8: { GVAR(digit8) = (10 + GVAR(digit8) - 1) % 10 };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
case "connect": {
|
||||
if (!GVAR(busy)) then {
|
||||
(__dsp displayCtrl __Option0) ctrlSetText "Vector 21";
|
||||
(__dsp displayCtrl __Selection0) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa));
|
||||
};
|
||||
if (GVAR(SEL)) then {
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Connecting.";
|
||||
if (ACE_time - GVAR(busyTimer) > 0.2) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Connecting..";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 0.4) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Connecting...";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 0.6) then {
|
||||
if (ACE_player hasWeapon "ACE_Vector") then {
|
||||
GVAR(displaySelection) = "VECTOR";
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Vector Connected";
|
||||
GVAR(vectorConnected) = true;
|
||||
} else {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "No Device Found";
|
||||
GVAR(vectorConnected) = false;
|
||||
};
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 3.1) then {
|
||||
GVAR(busy) = false;
|
||||
if (GVAR(vectorConnected)) then {
|
||||
GVAR(menu) = "main"; GVAR(numSelections) = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
case "options": {
|
||||
(__dsp displayCtrl __Option0) ctrlSetText "Signal Delay";
|
||||
(__dsp displayCtrl __Option1) ctrlSetText (if (GVAR(useDegrees)) then { "Direction: Deg" } else { "Direction: MIL" });
|
||||
(__dsp displayCtrl (__Selection0 + GVAR(selection))) ctrlSetText QUOTE(PATHTOF(UI\DAGR_Selection.paa));
|
||||
if (GVAR(SEL)) then {
|
||||
GVAR(vectorConnected) = false;
|
||||
switch (GVAR(selection)) do {
|
||||
case 0: { GVAR(menu) = "update_rate"; GVAR(numSelections) = 1; GVAR(tmpUpdateRate) = GVAR(updateInterval); };
|
||||
case 1: { GVAR(useDegrees) = !GVAR(useDegrees); };
|
||||
};
|
||||
}
|
||||
};
|
||||
case "update_rate": {
|
||||
if (GVAR(F1)) then {
|
||||
GVAR(updateInterval) = GVAR(tmpUpdateRate);
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(busy) = true;
|
||||
GVAR(busyTimer) = ACE_time;
|
||||
};
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Updating.";
|
||||
if (ACE_time - GVAR(busyTimer) > 0.2) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Updating..";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 0.4) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Updating...";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 0.6) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText "Update Success";
|
||||
};
|
||||
if (ACE_time - GVAR(busyTimer) > 2.1) then {
|
||||
GVAR(busy) = false;
|
||||
GVAR(menu) = "options"; GVAR(numSelections) = 2;
|
||||
};
|
||||
};
|
||||
if (GVAR(F3)) then {
|
||||
GVAR(menu) = "options"; GVAR(numSelections) = 2;
|
||||
};
|
||||
if (GVAR(DOWN)) then {
|
||||
GVAR(tmpUpdateRate) = GVAR(tmpUpdateRate) - 0.1;
|
||||
};
|
||||
if (GVAR(UP)) then {
|
||||
GVAR(tmpUpdateRate) = GVAR(tmpUpdateRate) + 0.1;
|
||||
};
|
||||
GVAR(tmpUpdateRate) = 0.1 max GVAR(tmpUpdateRate) min 2.0;
|
||||
if (!GVAR(busy)) then {
|
||||
(__dsp displayCtrl __mainText) ctrlSetText (Str(GVAR(tmpUpdateRate) * 1000) + "ms");
|
||||
(__dsp displayCtrl __F1) ctrlSetText "Save";
|
||||
(__dsp displayCtrl __F3) ctrlSetText "Cancel";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if (!GVAR(busy)) then {
|
||||
GVAR(F3) = false;
|
||||
GVAR(F2) = false;
|
||||
GVAR(F1) = false;
|
||||
GVAR(MENU_B) = false;
|
||||
GVAR(SEL) = false;
|
||||
DAGR_NEXT = false;
|
||||
GVAR(RIGHT) = false;
|
||||
GVAR(LEFT) = false;
|
||||
GVAR(UP) = false;
|
||||
GVAR(DOWN) = false;
|
||||
GVAR(PWR) = false;
|
||||
};
|
||||
}, 0, []] call CBA_fnc_addPerFrameHandler;
|
120
addons/dagr/functions/fnc_outputData.sqf
Normal file
120
addons/dagr/functions/fnc_outputData.sqf
Normal file
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* Author: Rosuto
|
||||
* DAGR data output loop
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
135471 cutRsc ["DAGR_DISPLAY", "plain down"];
|
||||
|
||||
#define __display (uiNameSpace getVariable "DAGR_DISPLAY")
|
||||
|
||||
#define __gridControl (__display displayCtrl 266851)
|
||||
#define __speedControl (__display displayCtrl 266852)
|
||||
#define __elevationControl (__display displayCtrl 266853)
|
||||
#define __headingControl (__display displayCtrl 266854)
|
||||
#define __timeControl (__display displayCtrl 266855)
|
||||
#define __background (__display displayCtrl 266856)
|
||||
|
||||
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_gps.paa));
|
||||
|
||||
if (GVAR(outputPFH) != -1) exitWith {};
|
||||
|
||||
GVAR(outputPFH) = [{
|
||||
private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xgrid", "_ygrid", "_xcoord", "_ycoord", "_speed", "_dagrHeading", "_dagrGrid", "_dagrElevation", "_dagrSpeed", "_dagrTime", "_elevation"];
|
||||
|
||||
// Abort Condition
|
||||
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
||||
GVAR(outputPFH) = -1;
|
||||
135471 cutText ["", "PLAIN"];
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// GRID
|
||||
_pos = getPosASL ACE_player;
|
||||
|
||||
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
|
||||
_gridConfig = (configFile >> "CfgWorlds" >> worldName >> "Grid");
|
||||
_offsetX = getNumber (_gridConfig >> "offsetX");
|
||||
_offsetY = getNumber (_gridConfig >> "offsetY");
|
||||
_stepX = getNumber (_gridConfig >> "Zoom1" >> "stepX");
|
||||
_stepY = getNumber (_gridConfig >> "Zoom1" >> "stepY");
|
||||
|
||||
if (_stepY >= 0) then {
|
||||
_pos set [1, (_mapSize - 100) - (_pos select 1) - _offsetY];
|
||||
};
|
||||
|
||||
// Incase grids go neg due to 99-00 boundry
|
||||
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];};
|
||||
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];};
|
||||
|
||||
_xGrid = toArray Str(round(_pos select 0));
|
||||
while {count _xGrid < 5} do {
|
||||
_xGrid = [48] + _xGrid;
|
||||
};
|
||||
_xGrid resize 4;
|
||||
_xGrid = toString _xGrid;
|
||||
_xGrid = parseNumber _xGrid;
|
||||
|
||||
_yGrid = toArray Str(round(_pos select 1));
|
||||
while {count _yGrid < 5} do {
|
||||
_yGrid = [48] + _yGrid;
|
||||
};
|
||||
_yGrid resize 4;
|
||||
_yGrid = toString _yGrid;
|
||||
_yGrid = parseNumber _yGrid;
|
||||
|
||||
_xCoord = switch true do {
|
||||
case (_xGrid >= 1000): { "" + Str(_xGrid) };
|
||||
case (_xGrid >= 100): { "0" + Str(_xGrid) };
|
||||
case (_xGrid >= 10): { "00" + Str(_xGrid) };
|
||||
default { "000" + Str(_xGrid) };
|
||||
};
|
||||
|
||||
_yCoord = switch true do {
|
||||
case (_yGrid >= 1000): { "" + Str(_yGrid) };
|
||||
case (_yGrid >= 100): { "0" + Str(_yGrid) };
|
||||
case (_yGrid >= 10): { "00" + Str(_yGrid) };
|
||||
default { "000" + Str(_yGrid) };
|
||||
};
|
||||
|
||||
_dagrGrid = _xcoord + " " + _ycoord;
|
||||
|
||||
// SPEED
|
||||
_speed = speed (vehicle ACE_player);
|
||||
_speed = floor (_speed * 10) / 10;
|
||||
_speed = abs(_speed);
|
||||
_dagrspeed = str _speed + "kph";
|
||||
|
||||
// Elevation
|
||||
_elevation = getPosASL ACE_player;
|
||||
_elevation = floor ((_elevation select 2) + EGVAR(weather,altitude));
|
||||
_dagrElevation = str _elevation + "m";
|
||||
|
||||
// Heading
|
||||
_dagrHeading = if (!GVAR(useDegrees)) then {
|
||||
floor (DEG_TO_MIL(direction (vehicle ACE_player)))
|
||||
} else {
|
||||
floor (direction (vehicle ACE_player))
|
||||
};
|
||||
|
||||
// Time
|
||||
_dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
||||
|
||||
// Output
|
||||
__gridControl ctrlSetText format ["%1", _dagrGrid];
|
||||
__speedControl ctrlSetText format ["%1", _dagrSpeed];
|
||||
__elevationControl ctrlSetText format ["%1", _dagrElevation];
|
||||
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1 °", _dagrHeading] });
|
||||
__timeControl ctrlSetText format ["%1", _dagrTime];
|
||||
|
||||
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;
|
98
addons/dagr/functions/fnc_outputVector.sqf
Normal file
98
addons/dagr/functions/fnc_outputVector.sqf
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Author: Rosuto
|
||||
* DAGR vector output loop
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_pos", "_xGrid", "_yGrid", "_dagrGrid", "_bearing", "_dagrDist", "_dagrElevation", "_dagrTime", "_elevation", "_xCoord", "_yCoord"];
|
||||
|
||||
135471 cutRsc ["DAGR_DISPLAY", "plain down"];
|
||||
|
||||
#define __display (uiNameSpace getVariable "DAGR_DISPLAY")
|
||||
|
||||
#define __gridControl (__display displayCtrl 266851)
|
||||
#define __speedControl (__display displayCtrl 266858)
|
||||
#define __elevationControl (__display displayCtrl 266853)
|
||||
#define __headingControl (__display displayCtrl 266854)
|
||||
#define __timeControl (__display displayCtrl 266855)
|
||||
#define __background (__display displayCtrl 266856)
|
||||
|
||||
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_vector.paa));
|
||||
|
||||
if (GVAR(noVectorData)) exitwith {};
|
||||
|
||||
_pos = [GVAR(LAZPOS) select 0, GVAR(LAZPOS) select 1];
|
||||
|
||||
// Incase grids go neg due to 99-00 boundry
|
||||
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];};
|
||||
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];};
|
||||
|
||||
// Find laser position
|
||||
_xGrid = toArray Str(round(_pos select 0));
|
||||
|
||||
while {count _xGrid < 5} do {
|
||||
_xGrid = [48] + _xGrid;
|
||||
};
|
||||
_xGrid resize 4;
|
||||
_xGrid = toString _xGrid;
|
||||
_xGrid = parseNumber _xGrid;
|
||||
|
||||
_yGrid = toArray Str(round(_pos select 1));
|
||||
while {count _yGrid < 5} do {
|
||||
_yGrid = [48] + _yGrid;
|
||||
};
|
||||
_yGrid resize 4;
|
||||
_yGrid = toString _yGrid;
|
||||
_yGrid = parseNumber _yGrid;
|
||||
|
||||
_xCoord = switch true do {
|
||||
case (_xGrid >= 1000): { "" + Str(_xGrid) };
|
||||
case (_xGrid >= 100): { "0" + Str(_xGrid) };
|
||||
case (_xGrid >= 10): { "00" + Str(_xGrid) };
|
||||
default { "000" + Str(_xGrid) };
|
||||
};
|
||||
|
||||
_yCoord = switch true do {
|
||||
case (_yGrid >= 1000): { "" + Str(_yGrid) };
|
||||
case (_yGrid >= 100): { "0" + Str(_yGrid) };
|
||||
case (_yGrid >= 10): { "00" + Str(_yGrid) };
|
||||
default { "000" + Str(_yGrid) };
|
||||
};
|
||||
|
||||
_dagrGrid = _xCoord + " " + _yCoord;
|
||||
|
||||
// Find target elevation
|
||||
_elevation = floor ((GVAR(LAZPOS) select 2) + EGVAR(weather,altitude));
|
||||
_dagrElevation = str _elevation + "m";
|
||||
|
||||
// Time
|
||||
_dagrTime = [daytime, "HH:MM"] call bis_fnc_timeToString;
|
||||
|
||||
// Bearing
|
||||
_bearing = GVAR(LAZHEADING);
|
||||
if (_bearing >= 360) then {_bearing = _bearing - 360;};
|
||||
if (!GVAR(useDegrees)) then {_bearing = DEG_TO_MIL(_bearing)};
|
||||
_bearing = floor (_bearing);
|
||||
|
||||
// Distance
|
||||
_dagrDist = str GVAR(LAZDIST) + "m";
|
||||
|
||||
// Put grid into variable so DAGR menu can access it
|
||||
GVAR(vectorGrid) = _dagrGrid;
|
||||
|
||||
// OUTPUT
|
||||
__gridControl ctrlSetText format ["%1", _dagrGrid];
|
||||
__speedControl ctrlSetText format ["%1", _dagrDist];
|
||||
__elevationControl ctrlSetText format ["%1", _dagrElevation];
|
||||
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _bearing] } else { format ["%1°", _bearing] });
|
||||
__timeControl ctrlSetText format ["%1", _dagrTime];
|
136
addons/dagr/functions/fnc_outputWP.sqf
Normal file
136
addons/dagr/functions/fnc_outputWP.sqf
Normal file
@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Author: Rosuto
|
||||
* DAGR waypoint output loop
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
135471 cutRsc ["DAGR_DISPLAY", "plain down"];
|
||||
|
||||
#define __display (uiNameSpace getVariable "DAGR_DISPLAY")
|
||||
|
||||
#define __gridControl (__display displayCtrl 266851)
|
||||
#define __speedControl (__display displayCtrl 266858)
|
||||
#define __elevationControl (__display displayCtrl 266857)
|
||||
#define __headingControl (__display displayCtrl 266854)
|
||||
#define __timeControl (__display displayCtrl 266859)
|
||||
#define __background (__display displayCtrl 266856)
|
||||
|
||||
__background ctrlSetText QUOTE(PATHTOF(UI\dagr_wp.paa));
|
||||
|
||||
if (GVAR(outputPFH) != -1) exitWith {};
|
||||
|
||||
GVAR(outputPFH) = [{
|
||||
private ["_pos", "_mapSize", "_gridConfig", "_offsetX", "_offsetY", "_stepX", "_stepY", "_xGrid", "_yGrid", "_xCoord", "_yCoord", "_dagrHeading", "_dagrGrid", "_bearing", "_MYpos", "_WPpos", "_dagrDistance", "_distance"];
|
||||
|
||||
// Abort Condition
|
||||
if !(GVAR(run) && [ACE_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {
|
||||
GVAR(outputPFH) = -1;
|
||||
135471 cutText ["", "PLAIN"];
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
// GRID
|
||||
_pos = getPosASL ACE_player;
|
||||
|
||||
_mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize");
|
||||
_gridConfig = (configFile >> "CfgWorlds" >> worldName >> "Grid");
|
||||
_offsetX = getNumber (_gridConfig >> "offsetX");
|
||||
_offsetY = getNumber (_gridConfig >> "offsetY");
|
||||
_stepX = getNumber (_gridConfig >> "Zoom1" >> "stepX");
|
||||
_stepY = getNumber (_gridConfig >> "Zoom1" >> "stepY");
|
||||
|
||||
if (_stepY >= 0) then {
|
||||
_pos set [1, (_mapSize - 100) - (_pos select 1) - _offsetY];
|
||||
};
|
||||
|
||||
// Incase grids go neg due to 99-00 boundry
|
||||
if (_pos select 0 < 0) then {_pos set [0, (_pos select 0) + 99999];};
|
||||
if (_pos select 1 < 0) then {_pos set [1, (_pos select 1) + 99999];};
|
||||
|
||||
_xGrid = toArray Str(round(_pos select 0));
|
||||
while {count _xGrid < 5} do {
|
||||
_xGrid = [48] + _xGrid;
|
||||
};
|
||||
_xGrid resize 4;
|
||||
_xGrid = toString _xGrid;
|
||||
_xGrid = parseNumber _xGrid;
|
||||
|
||||
_yGrid = toArray Str(round(_pos select 1));
|
||||
while {count _yGrid < 5} do {
|
||||
_yGrid = [48] + _yGrid;
|
||||
};
|
||||
_yGrid resize 4;
|
||||
_yGrid = toString _yGrid;
|
||||
_yGrid = parseNumber _yGrid;
|
||||
|
||||
_xCoord = switch true do {
|
||||
case (_xGrid >= 1000): { "" + Str(_xGrid) };
|
||||
case (_xGrid >= 100): { "0" + Str(_xGrid) };
|
||||
case (_xGrid >= 10): { "00" + Str(_xGrid) };
|
||||
default { "000" + Str(_xGrid) };
|
||||
};
|
||||
|
||||
_yCoord = switch true do {
|
||||
case (_yGrid >= 1000): { "" + Str(_yGrid) };
|
||||
case (_yGrid >= 100): { "0" + Str(_yGrid) };
|
||||
case (_yGrid >= 10): { "00" + Str(_yGrid) };
|
||||
default { "000" + Str(_yGrid) };
|
||||
};
|
||||
|
||||
_dagrGrid = _xCoord + " " + _yCoord;
|
||||
|
||||
// WP Grid
|
||||
_xGrid2 = floor (DAGR_WP_INFO / 10000);
|
||||
_yGrid2 = DAGR_WP_INFO - _xGrid2 * 10000;
|
||||
|
||||
_xCoord2 = switch true do {
|
||||
case (_xGrid2 >= 1000): { "" + Str(_xGrid2) };
|
||||
case (_xGrid2 >= 100): { "0" + Str(_xGrid2) };
|
||||
case (_xGrid2 >= 10): { "00" + Str(_xGrid2) };
|
||||
default { "000" + Str(_xGrid2) };
|
||||
};
|
||||
|
||||
_yCoord2 = switch true do {
|
||||
case (_yGrid2 >= 1000): { "" + Str(_yGrid2) };
|
||||
case (_yGrid2 >= 100): { "0" + Str(_yGrid2) };
|
||||
case (_yGrid2 >= 10): { "00" + Str(_yGrid2) };
|
||||
default { "000" + Str(_yGrid2) };
|
||||
};
|
||||
|
||||
_dagrGrid2 = _xCoord2 + " " + _yCoord2;
|
||||
|
||||
// Distance
|
||||
_WPpos = [[_xCoord2, _yCoord2], true] call CBA_fnc_mapGridToPos;
|
||||
_MYpos = [[_xCoord, _yCoord], true] call CBA_fnc_mapGridToPos;
|
||||
_distance = _MYpos distance _WPpos;
|
||||
_distance = floor (_distance * 10) / 10;
|
||||
_dagrDistance = str _distance + "m";
|
||||
|
||||
// Heading
|
||||
_dagrHeading = floor (if (GVAR(useDegrees)) then {
|
||||
direction (vehicle ACE_player)
|
||||
} else {
|
||||
DEG_TO_MIL(direction (vehicle ACE_player))
|
||||
});
|
||||
|
||||
// WP Heading
|
||||
_bearing = floor ((_WPpos vectorDiff _MYpos) call CBA_fnc_vectDir);
|
||||
|
||||
// Output
|
||||
__gridControl ctrlSetText format ["%1", _dagrGrid];
|
||||
__speedControl ctrlSetText format ["%1", _bearing];
|
||||
__elevationControl ctrlSetText format ["%1", _dagrGrid2];
|
||||
__headingControl ctrlSetText (if (!GVAR(useDegrees)) then { format ["%1", _dagrHeading] } else { format ["%1°", _dagrHeading] });
|
||||
__timeControl ctrlSetText format ["%1", _dagrDistance];
|
||||
|
||||
}, GVAR(updateInterval), []] call CBA_fnc_addPerFrameHandler;
|
50
addons/dagr/functions/fnc_toggleOverlay.sqf
Normal file
50
addons/dagr/functions/fnc_toggleOverlay.sqf
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Author: Rosuto, Ruthberg
|
||||
* Toggles the DAGR overlay
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(run) = !GVAR(run);
|
||||
|
||||
if (GVAR(run)) then {
|
||||
GVAR(hidden) = true;
|
||||
[{
|
||||
EXPLODE_1_PVT(_this select 0,_vehicle);
|
||||
if (!GVAR(run) || (!alive ACE_player) || (vehicle ACE_player != _vehicle)) exitWith {
|
||||
GVAR(run) = false;
|
||||
135471 cutText ["", "PLAIN"];
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
if (cameraView == "GUNNER") then {
|
||||
if (!GVAR(hidden)) then {
|
||||
GVAR(hidden) = true;
|
||||
135471 cutText ["", "PLAIN"];
|
||||
};
|
||||
} else {
|
||||
if (GVAR(hidden)) then {
|
||||
GVAR(hidden) = false;
|
||||
switch (toUpper GVAR(displaySelection)) do {
|
||||
case "WP" : {
|
||||
call FUNC(outputWP);
|
||||
};
|
||||
case "VECTOR" : {
|
||||
call FUNC(outputVector);
|
||||
};
|
||||
case "DATA" : {
|
||||
call FUNC(outputData);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}, 0.1, [vehicle ACE_player]] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
1
addons/dagr/functions/script_component.hpp
Normal file
1
addons/dagr/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\dagr\script_component.hpp"
|
30
addons/dagr/initKeybinds.sqf
Normal file
30
addons/dagr/initKeybinds.sqf
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
["ACE3 Equipment", QGVAR(MenuKey), "Configure DAGR",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
if (!GVAR(menuRun)) then {
|
||||
[] call FUNC(menuInit);
|
||||
} else {
|
||||
GVAR(PWR) = true; // Simulate pressing the power button
|
||||
};
|
||||
true
|
||||
},
|
||||
{false},
|
||||
[199, [false, true, false]], false] call cba_fnc_addKeybind; // (CTRL + Home)
|
||||
|
||||
["ACE3 Equipment", QGVAR(ToggleKey), "Toggle DAGR",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([_player, "ACE_DAGR"] call EFUNC(common,hasItem)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[] call FUNC(toggleOverlay);
|
||||
true
|
||||
},
|
||||
{false},
|
||||
[199, [false, false, false]], false] call cba_fnc_addKeybind; // (Home)
|
15
addons/dagr/script_component.hpp
Normal file
15
addons/dagr/script_component.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
#define COMPONENT dagr
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_DAGR
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_DAGR
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_DAGR
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
#define DEG_TO_MIL(d) (d / 360 * 6400)
|
||||
#define MIL_TO_DEG(d) (d / 6400 * 360)
|
5
addons/dagr/stringtable.xml
Normal file
5
addons/dagr/stringtable.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="DAGR">
|
||||
</Package>
|
||||
</Project>
|
@ -5,7 +5,7 @@ class CfgMagazines {
|
||||
displayName = CSTRING(magazine_displayName);
|
||||
displayNameShort = "HuntIR";
|
||||
descriptionShort = "";
|
||||
picture = PATHTOF(UI\m_m1070_ca.paa);
|
||||
picture = PATHTOF(data\m_m1070_ca.paa);
|
||||
ammo = "F_HuntIR";
|
||||
};
|
||||
};
|
||||
|
@ -20,6 +20,7 @@ class CfgVehicles {
|
||||
class Parachute_02_base_F;
|
||||
class ACE_HuntIR: Parachute_02_base_F {
|
||||
scope = 1;
|
||||
destrType = "DestructDefault";
|
||||
displayName = "HuntIR";
|
||||
model = PATHTOF(data\huntir.p3d);
|
||||
castDriverShadow = 0;
|
||||
|
@ -3,6 +3,7 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(cam);
|
||||
PREP(handleDamage);
|
||||
PREP(handleFired);
|
||||
PREP(huntir);
|
||||
PREP(huntirCompass);
|
||||
|
Binary file not shown.
@ -65,12 +65,12 @@ GVAR(no_cams) sort true;
|
||||
[{
|
||||
GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE];
|
||||
{
|
||||
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))}) then {
|
||||
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {damage _x < 0.5}) then {
|
||||
GVAR(no_cams) pushBack _x;
|
||||
};
|
||||
} forEach GVAR(nearHuntIRs);
|
||||
{
|
||||
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))}) then {
|
||||
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {damage _x >= 0.5}) then {
|
||||
GVAR(no_cams) deleteAt _forEachIndex;
|
||||
if (_forEachIndex < GVAR(cur_cam)) then {
|
||||
GVAR(cur_cam) = GVAR(cur_cam) - 1;
|
||||
@ -125,7 +125,7 @@ GVAR(no_cams) sort true;
|
||||
};
|
||||
};
|
||||
|
||||
private ["_cam_coord_y", "_cam_coord_x", "_speed", "_cam_time", "_cam_pos"];
|
||||
private ["_cam_coord_y", "_cam_coord_x", "_cam_time", "_cam_pos"];
|
||||
|
||||
GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]);
|
||||
GVAR(logic) setDir GVAR(ROTATE);
|
||||
@ -138,8 +138,7 @@ GVAR(no_cams) sort true;
|
||||
|
||||
ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]];
|
||||
ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]];
|
||||
_speed = 1 max abs((velocity GVAR(huntIR)) select 2);
|
||||
_cam_time = ((GVAR(pos) select 2) - 20) / _speed;
|
||||
_cam_time = ACE_time - (GVAR(huntIR) getVariable [QGVAR(startTime), ACE_time]);
|
||||
ctrlSetText [3, format["%1 s", round(_cam_time)]];
|
||||
_cam_pos = getPosVisual GVAR(huntIR);
|
||||
_cam_pos = format ["X = %1, Y = %2", round (_cam_pos select 0), round (_cam_pos select 1)];
|
||||
|
25
addons/huntir/functions/fnc_handleDamage.sqf
Normal file
25
addons/huntir/functions/fnc_handleDamage.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
*
|
||||
* Handles huntir damage
|
||||
*
|
||||
* Arguments:
|
||||
* 0: huntir <OBJECT>
|
||||
* 1: selectionName <STRING>
|
||||
* 2: damage <NUMBER>
|
||||
* 3: source <OBJECT>
|
||||
* 4: projectile <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Return value:
|
||||
* None
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_5(_huntir,_selectionName,_damage,_source,_projectile);
|
||||
|
||||
systemChat format["Selection: %1; Damage: %2", _selectionName, _damage];
|
||||
|
||||
_damage
|
@ -23,24 +23,29 @@ PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
||||
|
||||
if (_ammo != "F_HuntIR") exitWith {};
|
||||
|
||||
private ["_dir", "_pos", "_dirDegree", "_b", "_a", "_y", "_x"];
|
||||
_dir = ACE_player weaponDirection _weapon;
|
||||
_pos = getPosATL ACE_player;
|
||||
|
||||
_dirDegree = (_dir select 0) atan2 (_dir select 1);
|
||||
_b = 500 / (tan((asin(_dir select 2)) + 10));
|
||||
_a = _b * sin(_dirDegree);
|
||||
_b = _a / tan(_dirDegree);
|
||||
_x = (_pos select 0) + _a;
|
||||
_y = (_pos select 1) + _b;
|
||||
|
||||
[{
|
||||
PARAMS_3(_projectile,_x,_y);
|
||||
PARAMS_1(_projectile);
|
||||
"ACE_HuntIR_Propell" createVehicle (getPosATL _projectile);
|
||||
[{
|
||||
PARAMS_3(_x,_y,_z);
|
||||
PARAMS_1(_position);
|
||||
private ["_huntir"];
|
||||
_huntir = createVehicle ["ACE_HuntIR", [_x, _y, _z], [], 0, "FLY"];
|
||||
_huntir setPosATL [_x, _y, _z];
|
||||
}, [_x, _y, ((getPosATL _projectile) select 2) + 400], 5, 0] call EFUNC(common,waitAndExecute);
|
||||
}, [_projectile, _x, _y], 5, 0] call EFUNC(common,waitAndExecute);
|
||||
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
|
||||
_huntir setPosATL _position;
|
||||
_huntir setVariable [QGVAR(startTime), ACE_time, true];
|
||||
// TODO: Edit the .p3d to allow doing the following _huntir getHit "camera"; _huntir getHit "parachute";
|
||||
//_huntir addEventHandler ["HandleDamage", {_this call FUNC(handleDamage)}];
|
||||
[{
|
||||
EXPLODE_1_PVT(_this select 0,_huntir);
|
||||
if (isNull _huntir) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
if (damage _huntir > 0) then {
|
||||
private ["_velocity"];
|
||||
_velocity = velocity _huntir;
|
||||
_velocity set [2, -1 min -20 * sqrt(damage _huntir)];
|
||||
_huntir setVelocity _velocity;
|
||||
_huntir setVectorUp [0, 0, 1];
|
||||
};
|
||||
}, 0, [_huntir]] call CBA_fnc_addPerFrameHandler;
|
||||
}, [getPosATL _projectile vectorAdd [0, 0, 50]], 2, 0] call EFUNC(common,waitAndExecute);
|
||||
}, [_projectile], 5, 0] call EFUNC(common,waitAndExecute);
|
||||
|
@ -23,15 +23,21 @@ private ["_actions"];
|
||||
_actions = [];
|
||||
|
||||
{
|
||||
private ["_unit"];
|
||||
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 { "" };
|
||||
};
|
||||
_actions pushBack
|
||||
[
|
||||
[
|
||||
str(_unit),
|
||||
[_unit, true] call EFUNC(common,getName),
|
||||
"",
|
||||
_icon,
|
||||
{},
|
||||
{true},
|
||||
{_this call FUNC(addPassengerActions);},
|
||||
|
@ -1,7 +1,7 @@
|
||||
["ACE3 Equipment", QGVAR(KestrelDialogKey), localize LSTRING(KestrelDialogKey),
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if (GVAR(Kestrel4500)) exitWith {
|
||||
closeDialog 0;
|
||||
false
|
||||
@ -16,7 +16,7 @@
|
||||
["ACE3 Equipment", QGVAR(DisplayKestrelKey), localize LSTRING(DisplayKestrelKey),
|
||||
{
|
||||
// Conditions: canInteract
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
[] call FUNC(displayKestrel);
|
||||
|
@ -666,7 +666,7 @@ class CfgVehicles {
|
||||
EGVAR(dragging,dragDirection) = 0;
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
displayName = CSTRING(MainAction);
|
||||
displayName = ECSTRING(interaction,MainAction);
|
||||
distance = 5;
|
||||
condition = QUOTE(true);
|
||||
statement = "";
|
||||
|
@ -13,22 +13,23 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_typeOfProjectile","_typeOfInjury"];
|
||||
_typeOfProjectile = _this select 0;
|
||||
_typeOfInjury = switch (true) do {
|
||||
case (_typeOfProjectile iskindof "BulletBase"): {"Bullet"};
|
||||
case (_typeOfProjectile iskindof "GrenadeCore"): {"Grenade"};
|
||||
case (_typeOfProjectile iskindof "TimeBombCore"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "MineCore"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "FuelExplosion"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "ShellBase"): {"Shell"};
|
||||
case (_typeOfProjectile iskindof "RocketBase"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "MissileBase"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "LaserBombCore"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "BombCore"): {"Explosive"};
|
||||
case (_typeOfProjectile iskindof "Grenade"): {"Grenade"};
|
||||
case (_typeOfProjectile == "VehicleCrash"): {"VehicleCrash"};
|
||||
default {_typeOfProjectile};
|
||||
PARAMS_1(_typeOfProjectile);
|
||||
|
||||
private ["_typeOfDamage"];
|
||||
|
||||
_typeOfDamage = switch (true) do {
|
||||
case (_typeOfProjectile isKindOf "BulletBase"): {"bullet"};
|
||||
case (_typeOfProjectile isKindOf "GrenadeCore"): {"grenade"};
|
||||
case (_typeOfProjectile isKindOf "TimeBombCore"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "MineCore"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "FuelExplosion"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "ShellBase"): {"shell"};
|
||||
case (_typeOfProjectile isKindOf "RocketBase"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "MissileBase"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "LaserBombCore"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "BombCore"): {"explosive"};
|
||||
case (_typeOfProjectile isKindOf "Grenade"): {"grenade"};
|
||||
default {toLower _typeOfProjectile};
|
||||
};
|
||||
// TODO replace the capitalization on the switch results instead..
|
||||
toLower _typeOfInjury;
|
||||
|
||||
_typeOfDamage
|
||||
|
@ -52,6 +52,8 @@ if (GVAR(level) < 2) then {
|
||||
_damageReturn = _this call FUNC(handleDamage_basic);
|
||||
};
|
||||
_newDamage = _this call FUNC(handleDamage_caching);
|
||||
// handleDamage_caching may have modified the projectile string
|
||||
_projectile = _this select 4;
|
||||
_typeOfDamage = [_projectile] call FUNC(getTypeOfDamage);
|
||||
|
||||
_typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage);
|
||||
|
@ -12,7 +12,7 @@
|
||||
* 6: Type of Damage <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Damage To Be Inflicted <NUMBER>
|
||||
* Nothing
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -28,10 +28,7 @@ _typeOfProjectile = _this select 4;
|
||||
_newDamage = _this select 5;
|
||||
|
||||
// Most likely taking exessive fire damage. Lets exit.
|
||||
if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {
|
||||
0
|
||||
};
|
||||
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
|
||||
if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _unit} && {(_selectionName == "head" || isBurning _unit)}) exitwith {};
|
||||
_part = [_selectionName] call FUNC(selectionNameToNumber);
|
||||
if (_part < 0) exitwith {};
|
||||
|
||||
@ -44,6 +41,7 @@ _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
|
||||
|
||||
[_unit] call FUNC(handleDamage_advancedSetDamage);
|
||||
|
||||
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
|
||||
[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds);
|
||||
|
||||
// TODO Disabled until implemented fully
|
||||
@ -63,5 +61,3 @@ if (alive _unit && {!(_unit getvariable ["ACE_isUnconscious", false])}) then {
|
||||
[_unit] call FUNC(setUnconscious);
|
||||
};
|
||||
};
|
||||
|
||||
_amountOfDamage;
|
||||
|
@ -13,42 +13,22 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"];
|
||||
_unit = _this select 0;
|
||||
PARAMS_1(_unit);
|
||||
|
||||
if (!local _unit) exitwith {};
|
||||
|
||||
_bodyStatus = _unit getvariable [QGVAR(bodyPartStatus),[0,0,0,0,0,0]];
|
||||
private ["_bodyStatus", "_headDamage", "_torsoDamage", "_handsDamage", "_legsDamage"];
|
||||
|
||||
// ["head", "body", "hand_l", "hand_r", "leg_l", "leg_r"]
|
||||
_headDamage = _bodyStatus select 0;
|
||||
if (_headDamage > 0.95) then {
|
||||
_unit setHitPointDamage ["hitHead", 0.95];
|
||||
} else {
|
||||
_unit setHitPointDamage ["hitHead", _headDamage];
|
||||
};
|
||||
_bodyStatus = _unit getVariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
|
||||
|
||||
_torsoDamage = _bodyStatus select 1;
|
||||
if (_torsoDamage > 0.95) then {
|
||||
_unit setHitPointDamage ["hitBody", 0.95];
|
||||
} else {
|
||||
_unit setHitPointDamage ["hitBody", _torsoDamage];
|
||||
};
|
||||
EXPLODE_6_PVT(_bodyStatus,_headDamage,_torsoDamage,_handsDamageR,_handsDamageL,_legsDamageR,_legsDamageL);
|
||||
|
||||
_unit setHitPointDamage ["hitHead", _headDamage min 0.95];
|
||||
_unit setHitPointDamage ["hitBody", _torsoDamage min 0.95];
|
||||
_unit setHitPointDamage ["hitHands", (_handsDamageR + _handsDamageL) min 0.95];
|
||||
_unit setHitPointDamage ["hitLegs", (_legsDamageR + _legsDamageL) min 0.95];
|
||||
|
||||
_handsDamage = (_bodyStatus select 2) + (_bodyStatus select 3);
|
||||
if (_handsDamage > 0.95) then {
|
||||
_unit setHitPointDamage ["hitHands", 0.95];
|
||||
} else {
|
||||
_unit setHitPointDamage ["hitHands", _handsDamage];
|
||||
};
|
||||
|
||||
_legsDamage = (_bodyStatus select 4) + (_bodyStatus select 5);
|
||||
if (_legsDamage > 0.95) then {
|
||||
_unit setHitPointDamage ["hitLegs", 0.95];
|
||||
} else {
|
||||
_unit setHitPointDamage ["hitLegs", _legsDamage];
|
||||
};
|
||||
|
||||
if ({_x > 0} count _bodyStatus == 0) then {
|
||||
if (_bodyStatus isEqualTo [0,0,0,0,0,0]) then {
|
||||
_unit setDamage 0;
|
||||
};
|
||||
|
@ -41,17 +41,24 @@ if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isN
|
||||
if (GVAR(enableVehicleCrashes)) then {
|
||||
_selectionName = _hitSelections select (floor(random(count _hitSelections)));
|
||||
_projectile = "vehiclecrash";
|
||||
_this set [1, _selectionName];
|
||||
_this set [4, _projectile];
|
||||
};
|
||||
};
|
||||
|
||||
// From AGM medical:
|
||||
// Exclude falling damage to everything other than legs; reduce structural damage.
|
||||
if (((velocity _unit) select 2 < -5) && {(vehicle _unit == _unit)}) then {
|
||||
_unit setVariable [QGVAR(isFalling), True];
|
||||
_unit setVariable [QGVAR(isFalling), true];
|
||||
_projectile = "falling";
|
||||
_this set [4, "falling"];
|
||||
};
|
||||
|
||||
if (_unit getVariable [QGVAR(isFalling), false] && {!(_selectionName in ["", "leg_l", "leg_r"])}) exitWith {0};
|
||||
if (_unit getVariable [QGVAR(isFalling), false]) then {
|
||||
if (_selectionName == "") then {
|
||||
_selectionName = ["leg_l", "leg_r"] select (floor(random 2));
|
||||
};
|
||||
_this set [1, _selectionName];
|
||||
_newDamage = _newDamage * 0.7;
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
["ACE3 Equipment", QGVAR(RangeCardDialogKey), localize "STR_ACE_RangeCard_RangeCardDialogKey",
|
||||
{
|
||||
// Conditions: canInteract, canShow
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if (GVAR(RangeCardOpened)) exitWith {
|
||||
closeDialog 0;
|
||||
false
|
||||
@ -17,7 +17,7 @@
|
||||
["ACE3 Equipment", QGVAR(RangeCardCopyDialogKey), localize "STR_ACE_RangeCard_RangeCardCopyDialogKey",
|
||||
{
|
||||
// Conditions: canInteract, canShowCopy
|
||||
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if !([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith)) exitWith {false};
|
||||
if (GVAR(RangeCardOpened)) exitWith {
|
||||
closeDialog 0;
|
||||
false
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user