mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of https://github.com/acemod/ACE3 into feature/switchToLogMacros
Conflicts: addons/hearing/functions/fnc_moduleHearing.sqf
This commit is contained in:
commit
657157d767
@ -18,6 +18,8 @@
|
||||
|
||||
params ["_player", "_object"];
|
||||
|
||||
if (!([_player, _object, []] call EFUNC(common,canInteractWith))) exitWith {false};
|
||||
|
||||
private ["_nearestVehicle"];
|
||||
_nearestVehicle = [_player] call FUNC(findNearestVehicle);
|
||||
|
||||
|
@ -39,7 +39,10 @@ SETMVAR(GVAR(initializedClasses),_initializedClasses);
|
||||
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(hasCargo)) != 1) exitWith {};
|
||||
|
||||
private ["_text", "_condition", "_statement", "_icon", "_action"];
|
||||
_condition = {GVAR(enable)};
|
||||
_condition = {
|
||||
params ["_target", "_player"];
|
||||
GVAR(enable) && {[_player, _target, []] call EFUNC(common,canInteractWith)}
|
||||
};
|
||||
_text = localize LSTRING(openMenu);
|
||||
_statement = {GVAR(interactionVehicle) = _target; createDialog QGVAR(menu);};
|
||||
_icon = "";
|
||||
|
@ -327,7 +327,7 @@ GVAR(OldIsCamera) = false;
|
||||
|
||||
// Lastly, do JIP events
|
||||
// JIP Detection and event trigger. Run this at the very end, just in case anything uses it
|
||||
if(isMultiplayer && { ACE_time > 0 || isNull player } ) then {
|
||||
if (didJip) then {
|
||||
// We are jipping! Get ready and wait, and throw the event
|
||||
[{
|
||||
if(!(isNull player)) then {
|
||||
|
@ -74,6 +74,7 @@ class CfgVehicles {
|
||||
scope = 2;
|
||||
displayName = $STR_ACE_CONCERTINA_WIRE;
|
||||
model = PATHTOF(data\ACE_ConcertinaWire.p3d);
|
||||
EGVAR(logistics_wirecutter,isFence) = 1;
|
||||
class ACE_Actions {
|
||||
class ACE_MainActions {
|
||||
selection = "";
|
||||
|
@ -19,4 +19,10 @@ class ACE_Settings {
|
||||
isClientSettable = 1;
|
||||
displayName = CSTRING(DisableEarRinging);
|
||||
};
|
||||
class GVAR(enabledForZeusUnits) {
|
||||
value = 1;
|
||||
typeName = "BOOL";
|
||||
displayName = CSTRING(enabledForZeusUnits_DisplayName);
|
||||
description = CSTRING(enabledForZeusUnits_Description);
|
||||
};
|
||||
};
|
||||
|
@ -130,6 +130,12 @@ class CfgVehicles {
|
||||
};
|
||||
};
|
||||
};
|
||||
class enabledForZeusUnits {
|
||||
displayName = CSTRING(enabledForZeusUnits_DisplayName);
|
||||
description = CSTRING(enabledForZeusUnits_Description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = CSTRING(Module_Description);
|
||||
|
@ -47,5 +47,16 @@ class CfgWeapons {
|
||||
GVAR(lowerVolume) = 0.60;
|
||||
};
|
||||
class H_Cap_marshal: H_Cap_headphones {};
|
||||
};
|
||||
|
||||
class H_HelmetB_light: H_HelmetB {
|
||||
GVAR(protection) = 0.8;
|
||||
GVAR(lowerVolume) = 0.20;
|
||||
};
|
||||
|
||||
class H_HelmetB_plain_mcamo;
|
||||
class H_HelmetSpecB: H_HelmetB_plain_mcamo {
|
||||
GVAR(protection) = 0.8;
|
||||
GVAR(lowerVolume) = 0.20;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -21,6 +21,7 @@ PARAMS_2(_unit,_strength);
|
||||
if (_unit != ACE_player) exitWith {};
|
||||
if (_strength < 0.05) exitWith {};
|
||||
if (!isNull curatorCamera) exitWith {};
|
||||
if ((!GVAR(enabledForZeusUnits)) && {player != ACE_player}) exitWith {};
|
||||
|
||||
if (_unit getVariable ["ACE_hasEarPlugsin", false]) then {
|
||||
_strength = _strength / 4;
|
||||
|
@ -21,4 +21,5 @@ if ((_logic getVariable "DisableEarRinging") != -1) then {
|
||||
[_logic, QGVAR(DisableEarRinging), "DisableEarRinging"] call EFUNC(common,readSettingFromModule);
|
||||
};
|
||||
|
||||
[_logic, QGVAR(enabledForZeusUnits), "enabledForZeusUnits"] call EFUNC(common,readSettingFromModule);
|
||||
ACE_LOGINFO("Hearing Module Initialized.");
|
||||
|
@ -118,7 +118,7 @@
|
||||
<Portuguese>Audição</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_CombatDeafness_DisplayName">
|
||||
<English>Enable combat deafness?</English>
|
||||
<English>Combat Deafness</English>
|
||||
<Polish>Wł. głuchotę bojową</Polish>
|
||||
<Spanish>¿Habilitar sordera de combate?</Spanish>
|
||||
<German>Aktiviere Taubheit im Gefecht?</German>
|
||||
@ -140,5 +140,11 @@
|
||||
<Czech>Ztráta sluchu je možná ve chvíly, kdy se v bezprostřední blízkosti střílí z velkorážní zbraně nebo při bombardování a osoba je bez ochrany sluchu (např. špunty). Tento modul umožňuje tuto věc povolit nebo zakázat.</Czech>
|
||||
<Portuguese>Este módulo ativa / desativa surdez em combate. Quando ativado, os jogadores podem ficar surdos quando uma arma é disparada ao seu redor ou uma explosão ocorre sem proteção auditiva.</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_enabledForZeusUnits_DisplayName">
|
||||
<English>Effect Zeus RC</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Hearing_enabledForZeusUnits_Description">
|
||||
<English>Allow zeus remote controlled units to be able to take hearing damage.</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -7,13 +7,13 @@
|
||||
* 0: HuntIR <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_huntIR);
|
||||
params ["_huntIR"];
|
||||
|
||||
GVAR(huntIR) = _huntIR;
|
||||
GVAR(pos) = getPosVisual GVAR(huntIR);
|
||||
@ -73,7 +73,8 @@ GVAR(no_cams) sort true;
|
||||
if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))} && {_x getHitPointDamage "HitCamera" < 0.25}) then {
|
||||
GVAR(no_cams) pushBack _x;
|
||||
};
|
||||
} forEach GVAR(nearHuntIRs);
|
||||
true
|
||||
} count GVAR(nearHuntIRs);
|
||||
{
|
||||
if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))} || {_x getHitPointDamage "HitCamera" >= 0.25}) then {
|
||||
GVAR(no_cams) deleteAt _forEachIndex;
|
||||
|
@ -13,18 +13,18 @@
|
||||
* 6: projectile - Object of the projectile that was shot <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
||||
params ["_unit", "_weapon", "_muzzle", "_mode", "_ammo", "_magazine", "_projectile"];
|
||||
|
||||
if (_ammo != "F_HuntIR") exitWith {};
|
||||
|
||||
[{
|
||||
PARAMS_1(_projectile);
|
||||
params ["_projectile"];
|
||||
|
||||
//If null (deleted or hit water) exit:
|
||||
if (isNull _projectile) exitWith {};
|
||||
@ -33,15 +33,16 @@ if (_ammo != "F_HuntIR") exitWith {};
|
||||
|
||||
"ACE_HuntIR_Propell" createVehicle (getPosATL _projectile);
|
||||
[{
|
||||
PARAMS_1(_position);
|
||||
private ["_huntir"];
|
||||
params ["_position"];
|
||||
_huntir = createVehicle ["ACE_HuntIR", _position, [], 0, "FLY"];
|
||||
_huntir setPosATL _position;
|
||||
_huntir setVariable [QGVAR(startTime), ACE_time, true];
|
||||
[{
|
||||
EXPLODE_1_PVT(_this select 0,_huntir);
|
||||
params ["_args", "_idPFH"];
|
||||
_args params ["_huntir"];
|
||||
if (isNull _huntir) exitWith {
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
private ["_parachuteDamage", "_velocity"];
|
||||
_parachuteDamage = _huntir getHitPointDamage "HitParachute";
|
||||
|
@ -4,10 +4,10 @@
|
||||
* HuntIR monitor system
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -4,10 +4,10 @@
|
||||
* HuntIR monitor compass
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -32,7 +32,7 @@ disableSerialization;
|
||||
private ["_fnc_correctIt"];
|
||||
|
||||
_fnc_correctIt = {
|
||||
PARAMS_2(_pos,_dir);
|
||||
params ["_pos", "_dir"];
|
||||
if (_dir >= 270 || {_dir <= 90}) then {
|
||||
_pos set [1, (_pos select 1) + __OFFSET_Y]
|
||||
};
|
||||
@ -51,11 +51,12 @@ _fnc_correctIt = {
|
||||
HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"];
|
||||
|
||||
[{
|
||||
EXPLODE_1_PVT(_this select 0,_fnc_correctIt);
|
||||
params ["_args", "_idPFH"];
|
||||
_args params ["_fnc_correctIt"];
|
||||
|
||||
if (GVAR(stop)) exitWith {
|
||||
HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"];
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
private ["_dir", "_x1", "_y1", "_pos"];
|
||||
|
@ -501,8 +501,8 @@ class CfgVehicles {
|
||||
class ACE_Push {
|
||||
displayName = CSTRING(Push);
|
||||
distance = 6;
|
||||
condition = QUOTE(getMass _target < 1000 && {alive _target});
|
||||
statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push););
|
||||
condition = QUOTE(((getMass _target) <= 2600) && {alive _target} && {(vectorMagnitude (velocity _target)) < 3});
|
||||
statement = QUOTE(_this call FUNC(push));
|
||||
showDisabled = 0;
|
||||
priority = -1;
|
||||
};
|
||||
|
@ -10,6 +10,13 @@ ACE_Modifier = 0;
|
||||
_group selectLeader _leader;
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
//Pushing boats from FUNC(push)
|
||||
[QGVAR(pushBoat), {
|
||||
params ["_boat", "_newVelocity"];
|
||||
_boat setVelocity _newVelocity;
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(isOpeningDoor) = false;
|
||||
|
@ -4,23 +4,23 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Boat <OBJECT>
|
||||
* 1: Velocity <ARRAY>
|
||||
* 1: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [target, [vector]] call ace_interaction_fnc_push
|
||||
* [Boats, Jose] call ace_interaction_fnc_push
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_boat,_velocity);
|
||||
params ["_boat", "_player"];
|
||||
|
||||
if !(local _boat) exitWith {
|
||||
[_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc);
|
||||
};
|
||||
private ["_newVelocity"];
|
||||
|
||||
_boat setVelocity _velocity;
|
||||
_newVelocity = [2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5];
|
||||
|
||||
[QGVAR(pushBoat), [_boat], [_boat, _newVelocity]] call EFUNC(common,targetEvent);
|
||||
|
8
addons/laserpointer/CfgJointRails.hpp
Normal file
8
addons/laserpointer/CfgJointRails.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
class asdg_SlotInfo;
|
||||
class asdg_FrontSideRail: asdg_SlotInfo {
|
||||
class compatibleItems {
|
||||
ACE_acc_pointer_red = 1;
|
||||
ACE_acc_pointer_green = 1;
|
||||
ACE_acc_pointer_green_IR = 1;
|
||||
};
|
||||
};
|
@ -16,3 +16,4 @@ class CfgPatches {
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "CfgJointRails.hpp"
|
||||
|
@ -5,4 +5,22 @@ class CfgVehicles {
|
||||
MACRO_ADDITEM(ACE_wirecutter,4);
|
||||
};
|
||||
};
|
||||
|
||||
class Wall_F;
|
||||
class NonStrategic;
|
||||
|
||||
class Land_Net_Fence_4m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Net_Fence_8m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Net_FenceD_8m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_New_WiredFence_5m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_New_WiredFence_10m_Dam_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_New_WiredFence_10m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Pipe_fence_4m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Pipe_fence_4mNoLC_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_SportGround_fence_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Wired_Fence_4m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Wired_Fence_4mD_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Wired_Fence_8m_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Wired_Fence_8mD_F: Wall_F { GVAR(isFence) = 1; };
|
||||
class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; };
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ class CfgWeapons {
|
||||
picture = QUOTE(PATHTOF(ui\item_wirecutter_ca.paa));
|
||||
scope = 2;
|
||||
class ItemInfo: InventoryItem_Base_F {
|
||||
mass = 100;
|
||||
mass = 65;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -3,9 +3,6 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(cutDownFence);
|
||||
PREP(cutDownFenceAbort);
|
||||
PREP(cutDownFenceCallback);
|
||||
PREP(getNearestFence);
|
||||
PREP(interactEH);
|
||||
PREP(isFence);
|
||||
|
||||
|
@ -16,21 +16,35 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define SOUND_CLIP_TIME_SPACEING 1.5
|
||||
private ["_timeToCut", "_progressCheck"];
|
||||
params ["_unit", "_fenceObject"];
|
||||
TRACE_2("params",_unit,_fenceObject);
|
||||
|
||||
private ["_timeToCut", "_progressCheck", "_onCompletion", "_onFail"];
|
||||
|
||||
PARAMS_2(_unit,_fenceObject);
|
||||
if (_unit != ACE_player) exitWith {};
|
||||
|
||||
_timeToCut = if ([ACE_player] call EFUNC(common,isEngineer)) then {7.5} else {11};
|
||||
|
||||
[ACE_player, "AinvPknlMstpSnonWnonDr_medic5", 0] call EFUNC(common,doAnimation);
|
||||
|
||||
_onCompletion = {
|
||||
TRACE_1("_onCompletion",_this);
|
||||
(_this select 0) params ["_fenceObject", "", "_unit"];
|
||||
_fenceObject setdamage 1;
|
||||
[_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
_onFail = {
|
||||
TRACE_1("_onFail", _this);
|
||||
(_this select 0) params ["", "", "_unit"];
|
||||
[_unit, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
||||
};
|
||||
|
||||
_progressCheck = {
|
||||
PARAMS_2(_args,_passedTime);
|
||||
EXPLODE_2_PVT(_args,_fenceObject,_lastSoundEffectTime);
|
||||
params ["_args", "_passedTime"];
|
||||
_args params ["_fenceObject", "_lastSoundEffectTime"];
|
||||
|
||||
if (_passedTime > (_lastSoundEffectTime + SOUND_CLIP_TIME_SPACEING)) then {
|
||||
// playSound "ACE_wirecutter_sound";
|
||||
playSound3D [QUOTE(PATHTO_R(sound\wirecut.ogg)), objNull, false, (getPosASL ACE_player), 3, 1, 10];
|
||||
_args set [1, _passedTime];
|
||||
};
|
||||
@ -38,4 +52,4 @@ _progressCheck = {
|
||||
((!isNull _fenceObject) && {(damage _fenceObject) < 1} && {("ACE_wirecutter" in (items ACE_player))})
|
||||
};
|
||||
|
||||
[_timeToCut, [_fenceObject,0], {(_this select 0) call FUNC(cutDownFenceCallback)}, {(_this select 0) call FUNC(cutDownFenceAbort)}, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar);
|
||||
[_timeToCut, [_fenceObject,0,_unit], _onCompletion, _onFail, localize LSTRING(CuttingFence), _progressCheck] call EFUNC(common,progressBar);
|
||||
|
@ -1,18 +0,0 @@
|
||||
/*
|
||||
* Author: commy2
|
||||
* Stops cutting down fence (reset animation)
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_logistics_wirecutter_fnc_cutDownFenceAbort
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Once progressbar is done: Fence is cutdown
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Fence Object <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [aFence] call ace_logistics_wirecutter_fnc_cutDownFenceCallback
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_fenceObject);
|
||||
|
||||
_fenceObject setdamage 1;
|
||||
// [localize LSTRING(FenceCut)] call EFUNC(common,displayTextStructured);
|
||||
[ACE_player, "AmovPknlMstpSrasWrflDnon", 1] call EFUNC(common,doAnimation);
|
@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Gets nearest fence object (not actully used, left for utility)
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* The return value <OBJECT>
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_logistics_wirecutter_fnc_getNearestFence
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_nearestFence";
|
||||
PARAMS_1(_unit);
|
||||
|
||||
_nearestFence = objNull;
|
||||
{
|
||||
if ((isNull _nearestFence) && {[_x] call FUNC(isFence)}) then {
|
||||
_nearestFence = _x;
|
||||
};
|
||||
} forEach nearestObjects [_unit, [], 15];
|
||||
|
||||
_nearestFence
|
@ -15,22 +15,24 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_interactionType);
|
||||
params ["_interactionType"];
|
||||
|
||||
//Ignore self-interaction menu
|
||||
if (_interactionType != 0) exitWith {};
|
||||
//Ignore self-interaction menu or mounted vehicle interaction
|
||||
if ((_interactionType != 0) || {(vehicle ACE_player) != ACE_player}) exitWith {};
|
||||
|
||||
//for performance only do stuff it they have a wirecutter item
|
||||
//(if they somehow get one durring keydown they'll just have to reopen)
|
||||
if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
|
||||
|
||||
TRACE_1("Starting wire-cut action PFEH",_interactionType);
|
||||
|
||||
[{
|
||||
private ["_fncStatement", "_attachedFence", "_fncCondition", "_helper", "_action"];
|
||||
PARAMS_2(_args,_pfID);
|
||||
EXPLODE_3_PVT(_args,_setPosition,_addedHelpers,_fencesHelped);
|
||||
params ["_args", "_pfID"];
|
||||
_args params ["_setPosition", "_addedHelpers", "_fencesHelped"];
|
||||
|
||||
if (!EGVAR(interact_menu,keyDown)) then {
|
||||
{deleteVehicle _x;} forEach _addedHelpers;
|
||||
{deleteVehicle _x; nil} count _addedHelpers;
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
} else {
|
||||
// Prevent Rare Error when ending mission with interact key down:
|
||||
@ -40,11 +42,12 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
|
||||
if (((getPosASL ace_player) distance _setPosition) > 5) then {
|
||||
|
||||
_fncStatement = {
|
||||
PARAMS_3(_dummyTarget,_player,_attachedFence);
|
||||
params ["", "_player", "_attachedFence"];
|
||||
[_player, _attachedFence] call FUNC(cutDownFence);
|
||||
};
|
||||
_fncCondition = {
|
||||
PARAMS_3(_dummyTarget,_player,_attachedFence);
|
||||
params ["", "_player", "_attachedFence"];
|
||||
if (!([_player, _attachedFence, []] call EFUNC(common,canInteractWith))) exitWith {false};
|
||||
((!isNull _attachedFence) && {(damage _attachedFence) < 1} && {("ACE_wirecutter" in (items _player))})
|
||||
};
|
||||
|
||||
@ -52,15 +55,15 @@ if (!("ACE_wirecutter" in (items ace_player))) exitWith {};
|
||||
if (!(_x in _fencesHelped)) then {
|
||||
if ([_x] call FUNC(isFence)) then {
|
||||
_fencesHelped pushBack _x;
|
||||
_helper = "Sign_Sphere25cm_F" createVehicleLocal (getpos _x);
|
||||
_helper = "ACE_LogicDummy" createVehicleLocal (getpos _x);
|
||||
_action = [QGVAR(helperCutFence), (localize LSTRING(CutFence)), QUOTE(PATHTOF(ui\wirecutter_ca.paa)), _fncStatement, _fncCondition, {}, _x, [0,0,0], 5] call EFUNC(interact_menu,createAction);
|
||||
[_helper, 0, [],_action] call EFUNC(interact_menu,addActionToObject);
|
||||
_helper setPosASL ((getPosASL _x) vectorAdd [0,0,1.25]);
|
||||
_helper hideObject true;
|
||||
_addedHelpers pushBack _helper;
|
||||
};
|
||||
};
|
||||
} forEach nearestObjects [ace_player, [], 15];
|
||||
nil
|
||||
} count nearestObjects [ace_player, [], 15];
|
||||
|
||||
_args set [0, (getPosASL ace_player)];
|
||||
};
|
||||
|
@ -16,27 +16,26 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//find is case sensitive, so keep everything lowercase
|
||||
#define FENCE_TYPENAMES ["land_net_fence_4m_f", "land_net_fence_8m_f", "land_net_fenced_8m_f", "land_new_wiredfence_5m_f", "land_new_wiredfence_10m_dam_f", "land_new_wiredfence_10m_f", "land_pipe_fence_4m_f", "land_pipe_fence_4mnolc_f", "land_sportground_fence_f", "land_wired_fence_4m_f", "land_wired_fence_4md_f", "land_wired_fence_8m_f", "land_wired_fence_8md_f", "land_razorwire_f", "ace_concertinawire"]
|
||||
|
||||
#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
|
||||
params ["_object"];
|
||||
TRACE_1("params",_object);
|
||||
|
||||
private ["_typeOf", "_returnValue"];
|
||||
PARAMS_1(_object);
|
||||
|
||||
_typeOf = toLower (typeOf _object);
|
||||
_typeOf = typeOf _object;
|
||||
_returnValue = false;
|
||||
|
||||
if (_typeOf != "") then {
|
||||
//If the fence has configEntry we can check it directly
|
||||
_returnValue = _typeOf in FENCE_TYPENAMES;
|
||||
_returnValue = (1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence))));
|
||||
} else {
|
||||
//TODO: 1.50 use getModelInfo
|
||||
_typeOf = toLower (str _object); //something like "123201: wall_indfnc_9.p3d"
|
||||
{
|
||||
if ((_typeOf find _x) != -1) exitWith {
|
||||
_returnValue = true;
|
||||
};
|
||||
} forEach FENCE_P3DS;
|
||||
nil
|
||||
} count FENCE_P3DS;
|
||||
};
|
||||
|
||||
_returnValue
|
||||
|
@ -1,6 +1,8 @@
|
||||
#define COMPONENT logistics_wirecutter
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
// #define DEBUG_MODE_FULL
|
||||
|
||||
#ifdef DEBUG_ENABLED_LOGISTICS_WIRECUTTER
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
@ -10,3 +12,9 @@
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
|
||||
//find is case sensitive, so keep everything lowercase
|
||||
#define FENCE_P3DS ["mil_wiredfence_f.p3d","wall_indfnc_3.p3d", "wall_indfnc_9.p3d", "wall_indfnc_corner.p3d", "pletivo_wired.p3d", "wall_fen1_5.p3d"]
|
||||
|
||||
#define SOUND_CLIP_TIME_SPACEING 1.5
|
||||
|
@ -541,7 +541,7 @@ class CfgPatches {
|
||||
"a3_weapons_f_vests",
|
||||
"a3data",
|
||||
"map_vr",
|
||||
"extended_eventhandlers", "CBA_UI", "CBA_XEH", "CBA_XEH_A3"
|
||||
"extended_eventhandlers", "cba_ui", "cba_xeh", "cba_xeh_a3", "cba_jr"
|
||||
};
|
||||
author[] = {"ACE Team"};
|
||||
authorUrl = "";
|
||||
|
@ -97,5 +97,87 @@
|
||||
// Time functions for accuracy per frame
|
||||
#define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime))
|
||||
|
||||
#define ACE_LOG(module,level,message) diag_log text ACE_LOGFORMAT(module,level,message)
|
||||
#define ACE_LOGFORMAT(module,level,message) FORMAT_2(QUOTE([ACE] (module) %1: %2),level,message)
|
||||
|
||||
#define ACE_LOGERROR(message) ACE_LOG(COMPONENT,"ERROR",message)
|
||||
#define ACE_LOGERROR_1(message,arg1) ACE_LOGERROR(FORMAT_1(message,arg1))
|
||||
#define ACE_LOGERROR_2(message,arg1,arg2) ACE_LOGERROR(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_LOGERROR_3(message,arg1,arg2,arg3) ACE_LOGERROR(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_LOGERROR_4(message,arg1,arg2,arg3,arg4) ACE_LOGERROR(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_LOGERROR_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGERROR(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_LOGERROR_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGERROR(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_LOGERROR_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGERROR(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_LOGERROR_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGERROR(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_ERRORFORMAT(message) ACE_LOGFORMAT(COMPONENT,"ERROR",message)
|
||||
#define ACE_ERRORFORMAT_1(message,arg1) ACE_ERRORFORMAT(FORMAT_1(message,arg1))
|
||||
#define ACE_ERRORFORMAT_2(message,arg1,arg2) ACE_ERRORFORMAT(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_ERRORFORMAT_3(message,arg1,arg2,arg3) ACE_ERRORFORMAT(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_ERRORFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_ERRORFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_ERRORFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_ERRORFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_ERRORFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_ERRORFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_ERRORFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_ERRORFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_ERRORFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_ERRORFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_LOGWARNING(message) ACE_LOG(COMPONENT,"WARNING",message)
|
||||
#define ACE_LOGWARNING_1(message,arg1) ACE_LOGWARNING(FORMAT_1(message,arg1))
|
||||
#define ACE_LOGWARNING_2(message,arg1,arg2) ACE_LOGWARNING(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_LOGWARNING_3(message,arg1,arg2,arg3) ACE_LOGWARNING(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_LOGWARNING_4(message,arg1,arg2,arg3,arg4) ACE_LOGWARNING(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_LOGWARNING_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGWARNING(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_LOGWARNING_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGWARNING(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_LOGWARNING_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGWARNING(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_LOGWARNING_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGWARNING(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_WARNINGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"WARNING",message)
|
||||
#define ACE_WARNINGFORMAT_1(message,arg1) ACE_WARNINGFORMAT(FORMAT_1(message,arg1))
|
||||
#define ACE_WARNINGFORMAT_2(message,arg1,arg2) ACE_WARNINGFORMAT(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_WARNINGFORMAT_3(message,arg1,arg2,arg3) ACE_WARNINGFORMAT(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_WARNINGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_WARNINGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_WARNINGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_WARNINGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_WARNINGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_WARNINGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_WARNINGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_WARNINGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_WARNINGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_WARNINGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_LOGINFO(message) ACE_LOG(COMPONENT,"INFO",message)
|
||||
#define ACE_LOGINFO_1(message,arg1) ACE_LOGINFO(FORMAT_1(message,arg1))
|
||||
#define ACE_LOGINFO_2(message,arg1,arg2) ACE_LOGINFO(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_LOGINFO_3(message,arg1,arg2,arg3) ACE_LOGINFO(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_LOGINFO_4(message,arg1,arg2,arg3,arg4) ACE_LOGINFO(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_LOGINFO_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGINFO(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_LOGINFO_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGINFO(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_LOGINFO_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGINFO(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_LOGINFO_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGINFO(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_INFOFORMAT(message) ACE_LOGFORMAT(COMPONENT,"INFO",message)
|
||||
#define ACE_INFOFORMAT_1(message,arg1) ACE_INFOFORMAT(FORMAT_1(message,arg1))
|
||||
#define ACE_INFOFORMAT_2(message,arg1,arg2) ACE_INFOFORMAT(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_INFOFORMAT_3(message,arg1,arg2,arg3) ACE_INFOFORMAT(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_INFOFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_INFOFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_INFOFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_INFOFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_INFOFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_INFOFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_INFOFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_INFOFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_INFOFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_INFOFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_LOGDEBUG(message) ACE_LOG(COMPONENT,"DEBUG",message)
|
||||
#define ACE_LOGDEBUG_1(message,arg1) ACE_LOGDEBUG(FORMAT_1(message,arg1))
|
||||
#define ACE_LOGDEBUG_2(message,arg1,arg2) ACE_LOGDEBUG(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_LOGDEBUG_3(message,arg1,arg2,arg3) ACE_LOGDEBUG(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_LOGDEBUG_4(message,arg1,arg2,arg3,arg4) ACE_LOGDEBUG(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_LOGDEBUG_5(message,arg1,arg2,arg3,arg4,arg5) ACE_LOGDEBUG(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_LOGDEBUG_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_LOGDEBUG(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_LOGDEBUG_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_LOGDEBUG(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_LOGDEBUG_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_LOGDEBUG(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#define ACE_DEBUGFORMAT(message) ACE_LOGFORMAT(COMPONENT,"DEBUG",message)
|
||||
#define ACE_DEBUGFORMAT_1(message,arg1) ACE_DEBUGFORMAT(FORMAT_1(message,arg1))
|
||||
#define ACE_DEBUGFORMAT_2(message,arg1,arg2) ACE_DEBUGFORMAT(FORMAT_2(message,arg1,arg2))
|
||||
#define ACE_DEBUGFORMAT_3(message,arg1,arg2,arg3) ACE_DEBUGFORMAT(FORMAT_3(message,arg1,arg2,arg3))
|
||||
#define ACE_DEBUGFORMAT_4(message,arg1,arg2,arg3,arg4) ACE_DEBUGFORMAT(FORMAT_4(message,arg1,arg2,arg3,arg4))
|
||||
#define ACE_DEBUGFORMAT_5(message,arg1,arg2,arg3,arg4,arg5) ACE_DEBUGFORMAT(FORMAT_5(message,arg1,arg2,arg3,arg4,arg5))
|
||||
#define ACE_DEBUGFORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6) ACE_DEBUGFORMAT(FORMAT_6(message,arg1,arg2,arg3,arg4,arg5,arg6))
|
||||
#define ACE_DEBUGFORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7) ACE_DEBUGFORMAT(FORMAT_7(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7))
|
||||
#define ACE_DEBUGFORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ACE_DEBUGFORMAT(FORMAT_8(message,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8))
|
||||
|
||||
#include "script_debug.hpp"
|
@ -14,7 +14,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_caller","_target"];
|
||||
private ["_caller","_target","_selectionName"];
|
||||
_caller = _this select 0;
|
||||
_target = _this select 1;
|
||||
[[_caller, _target], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
_selectionName = _this select 2;
|
||||
[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckBloodPressureLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
|
@ -14,9 +14,10 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_caller","_target","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"];
|
||||
private ["_caller","_target","_selectionName","_bloodPressure","_bloodPressureHigh","_bloodPressureLow", "_logOutPut", "_output"];
|
||||
_caller = _this select 0;
|
||||
_target = _this select 1;
|
||||
_selectionName = _this select 2;
|
||||
|
||||
_bloodPressure = [_target] call FUNC(getBloodPressure);
|
||||
if (!alive _target) then {
|
||||
@ -54,6 +55,11 @@ if ([_caller] call FUNC(isMedic)) then {
|
||||
};
|
||||
};
|
||||
|
||||
if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then {
|
||||
_output = LSTRING(Check_Bloodpressure_Output_6);
|
||||
_logOutPut = "";
|
||||
};
|
||||
|
||||
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent);
|
||||
|
||||
if (_logOutPut != "") then {
|
||||
|
@ -14,7 +14,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_caller","_target"];
|
||||
private ["_caller","_target","_selectionName"];
|
||||
_caller = _this select 0;
|
||||
_target = _this select 1;
|
||||
[[_caller, _target], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
_selectionName = _this select 2;
|
||||
[[_caller, _target, _selectionName], QUOTE(DFUNC(actionCheckPulseLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
|
||||
|
@ -14,10 +14,10 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_caller", "_unit", "_heartRateOutput", "_heartRate", "_logOutPut"];
|
||||
private ["_caller", "_unit", "_selectionName", "_heartRateOutput", "_heartRate", "_logOutPut"];
|
||||
_caller = _this select 0;
|
||||
_unit = _this select 1;
|
||||
|
||||
_selectionName = _this select 2;
|
||||
|
||||
_heartRate = _unit getvariable [QGVAR(heartRate), 80];
|
||||
if (!alive _unit) then {
|
||||
@ -46,6 +46,11 @@ if (_heartRate > 1.0) then {
|
||||
};
|
||||
};
|
||||
|
||||
if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(hasTourniquetAppliedTo)}) then {
|
||||
_heartRateOutput = LSTRING(Check_Pulse_Output_5);
|
||||
_logOutPut = LSTRING(Check_Pulse_None);
|
||||
};
|
||||
|
||||
["displayTextStructured", [_caller], [[_heartRateOutput, [_unit] call EFUNC(common,getName), round(_heartRate)], 1.5, _caller]] call EFUNC(common,targetEvent);
|
||||
|
||||
if (_logOutPut != "") then {
|
||||
|
@ -37,7 +37,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(Module_DisplayName);
|
||||
function = QFUNC(moduleMapFill);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isGlobal = 0;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {
|
||||
@ -46,9 +46,9 @@ class CfgVehicles {
|
||||
description = CSTRING(MapDataAvailable_Description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class None {name = CSTRING(None); value = MAP_DETAIL_SAT; default = 1;};
|
||||
class Side {name = CSTRING(Side); value = MAP_DETAIL_TOPOROADS;};
|
||||
class Unique {name = CSTRING(Unique); value = MAP_DETAIL_NONE;};
|
||||
class Full {name = CSTRING(MapFill_Full); value = MAP_DETAIL_SAT; default = 1;};
|
||||
class Roads {name = CSTRING(MapFill_OnlyRoads); value = MAP_DETAIL_TOPOROADS;};
|
||||
class Disabled {name = CSTRING(MapFill_None); value = MAP_DETAIL_NONE;};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 0: String version of Keypad entry ["ok","del","1",...] <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry
|
||||
@ -16,15 +16,12 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_display", "_editText", "_actualPos"];
|
||||
PARAMS_1(_keypadButton);
|
||||
|
||||
params ["_keypadButton"];
|
||||
|
||||
disableSerialization;
|
||||
_display = displayNull;
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
||||
} else {
|
||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
||||
};
|
||||
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};
|
||||
|
@ -3,18 +3,18 @@
|
||||
* Handles the "Connect To" button from the menu application
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_microdagr_fnc_appMenuButtonConnectRangefinder
|
||||
* call ace_microdagr_fnc_appMenuButtonConnectRangefinder
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2};
|
||||
GVAR(currentWaypoint) = [-2, -1] select (GVAR(currentWaypoint) == -2);
|
||||
GVAR(rangeFinderPositionASL) = [];
|
||||
[APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode);
|
||||
|
@ -7,7 +7,7 @@
|
||||
* 1: Index <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick
|
||||
@ -17,7 +17,7 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
PARAMS_2(_control,_itemClicked);
|
||||
params ["", "_itemClicked"];
|
||||
|
||||
switch (_itemClicked) do {
|
||||
case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)};
|
||||
|
@ -3,13 +3,13 @@
|
||||
* Handles clicking the delete button from the waypoint application
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_microdagr_fnc_appWaypointsButtonDeleteWP
|
||||
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -18,12 +18,8 @@
|
||||
private ["_display", "_wpIndex"];
|
||||
|
||||
disableSerialization;
|
||||
_display = displayNull;
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
||||
} else {
|
||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
||||
};
|
||||
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select GVAR(currentShowMode) == DISPLAY_MODE_DIALOG, displayNull];
|
||||
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);
|
||||
|
@ -6,10 +6,10 @@
|
||||
* The "SetWP" button <CONTROL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_microdagr_fnc_appWaypointsButtonSetWP
|
||||
* [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
@ -18,7 +18,7 @@
|
||||
private ["_wpListBox", "_newWpIndex", "_waypoints"];
|
||||
|
||||
disableSerialization;
|
||||
PARAMS_1(_wpButton);
|
||||
params ["_wpButton"];
|
||||
|
||||
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
|
||||
_newWpIndex = lbCurSel _wpListBox;
|
||||
|
@ -6,32 +6,31 @@
|
||||
* The display mode to test showing <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [mode] call ace_microdagr_fnc_canShow
|
||||
* [1] call ace_microdagr_fnc_canShow
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_showType);
|
||||
params ["_showType"];
|
||||
|
||||
private ["_returnValue"];
|
||||
|
||||
_returnValue = false;
|
||||
|
||||
switch (_showType) do {
|
||||
case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close
|
||||
case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide
|
||||
|
||||
case (DISPLAY_MODE_DIALOG): {
|
||||
_returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
|
||||
_returnValue = switch (_showType) do {
|
||||
case (DISPLAY_MODE_CLOSED): { true }; //Can always close
|
||||
case (DISPLAY_MODE_HIDDEN): { true }; //Can always hide
|
||||
case (DISPLAY_MODE_DIALOG): {
|
||||
("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
|
||||
};
|
||||
case (DISPLAY_MODE_DISPLAY): {
|
||||
case (DISPLAY_MODE_DISPLAY): {
|
||||
//Can't have minimap up while zoomed in
|
||||
_returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
|
||||
(cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
|
||||
};
|
||||
default { false };
|
||||
};
|
||||
|
||||
_returnValue
|
||||
|
@ -8,7 +8,7 @@
|
||||
* 1: Waypoint Position ASL <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint
|
||||
@ -17,10 +17,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_2(_waypointName,_waypointPosASL);
|
||||
|
||||
private "_waypoints";
|
||||
params ["_waypointName","_waypointPosASL"];
|
||||
|
||||
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
|
||||
|
||||
|
||||
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
|
||||
_waypoints pushBack [_waypointName, _waypointPosASL];
|
||||
ace_player setVariable [QGVAR(waypoints), _waypoints];
|
||||
ACE_player setVariable [QGVAR(waypoints), _waypoints];
|
||||
|
@ -7,7 +7,7 @@
|
||||
* 0: Waypoint Index <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint
|
||||
@ -16,13 +16,12 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_wpIndex);
|
||||
|
||||
private "_waypoints";
|
||||
params ["_wpIndex"];
|
||||
|
||||
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
|
||||
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
|
||||
|
||||
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};
|
||||
|
||||
_waypoints deleteAt _wpIndex;
|
||||
ace_player setVariable [QGVAR(waypoints), _waypoints];
|
||||
ACE_player setVariable [QGVAR(waypoints), _waypoints];
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Device saving not implemented yet, just save to player object
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Waypoints <ARRAY>
|
||||
@ -16,4 +16,4 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
(ace_player getVariable [QGVAR(waypoints), []])
|
||||
(ACE_player getVariable [QGVAR(waypoints), []])
|
||||
|
@ -3,13 +3,13 @@
|
||||
* Handles the dialog closeing, switches back to display mode
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_microdagr_fnc_dialogClosedEH
|
||||
* call ace_microdagr_fnc_dialogClosedEH
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
@ -10,7 +10,7 @@
|
||||
* 3: MousePosY <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH
|
||||
@ -19,7 +19,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
|
||||
params ["", "_mouseButton"];
|
||||
|
||||
//Only handle RMB
|
||||
if (_mouseButton != 1) exitWith {};
|
||||
|
@ -9,7 +9,7 @@
|
||||
* 3: MousePosY <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
|
||||
@ -18,7 +18,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
|
||||
params ["_theMap", "_mouseButton", "_xPos", "_yPos"];
|
||||
|
||||
private ["_worldPos"];
|
||||
|
||||
@ -26,7 +26,7 @@ private ["_worldPos"];
|
||||
if (_mouseButton != 0) exitWith {};
|
||||
|
||||
_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
|
||||
_worldPos set [2, (getTerrainHeightASL _worldPos)];
|
||||
_worldPos pushBack (getTerrainHeightASL _worldPos);
|
||||
|
||||
GVAR(newWaypointPosition) = _worldPos;
|
||||
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 0: The Map <CONTROL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [compassMap] call ace_microdagr_fnc_mapOnDrawEH
|
||||
@ -15,10 +15,10 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_theMap);
|
||||
|
||||
private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"];
|
||||
|
||||
params ["_theMap"];
|
||||
|
||||
_mapSize = (ctrlPosition _theMap) select 3;
|
||||
|
||||
_waypoints = [] call FUNC(deviceGetWaypoints);
|
||||
@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then {
|
||||
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
|
||||
ctrlMapAnimCommit _theMap;
|
||||
_size = 412 * _mapSize;
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ];
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ];
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ];
|
||||
|
||||
if (GVAR(currentWaypoint) != -1) then {
|
||||
@ -42,23 +42,23 @@ if (GVAR(currentApplicationPage) == 1) then {
|
||||
};
|
||||
};
|
||||
if ((count _targetPos) == 3) then {
|
||||
_relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo;
|
||||
_relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo;
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ];
|
||||
};
|
||||
};
|
||||
|
||||
} else { //Map Mode:
|
||||
if (GVAR(mapAutoTrackPosition)) then {
|
||||
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)];
|
||||
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ACE_player)];
|
||||
ctrlMapAnimCommit _theMap;
|
||||
};
|
||||
_size = 48 * _mapSize;
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ];
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (getDir ACE_player), '', 0 ];
|
||||
|
||||
if (GVAR(settingShowAllWaypointsOnMap)) then {
|
||||
_size = 32 * _mapSize;
|
||||
{
|
||||
EXPLODE_2_PVT(_x,_wpName,_wpPos);
|
||||
_x params ["_wpName", "_wpPos"];
|
||||
_alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5};
|
||||
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ];
|
||||
} forEach _waypoints;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 0: String of the map button pressed <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["autotrack"] call ace_microdagr_fnc_modeMapButtons
|
||||
@ -15,7 +15,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_1(_mode);
|
||||
params ["_mode"];
|
||||
|
||||
[-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom
|
||||
|
||||
|
@ -4,23 +4,18 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: logic <OBJECT>
|
||||
* 1: synced units-not used <ARRAY>
|
||||
* 2: Module Activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [module, [], true] call ace_microdagr_fnc_moduleMapFill
|
||||
* [module] call ace_microdagr_fnc_moduleMapFill
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
PARAMS_3(_logic,_syncedUnits,_activated);
|
||||
if !(isServer) exitWith {};
|
||||
params ["_logic"];
|
||||
|
||||
if (!_activated) exitWith {WARNING("Module Placed but not active");};
|
||||
|
||||
if (isServer) then {
|
||||
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);
|
||||
};
|
||||
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);
|
||||
|
@ -6,7 +6,7 @@
|
||||
* 0: Display Mode to show the microDAGR in <NUMBER><OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [1] call ace_microdagr_fnc_openDisplay
|
||||
@ -15,9 +15,9 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_oldShowMode", "_args", "_pfID", "_player"];
|
||||
private ["_oldShowMode", "_args", "_player"];
|
||||
|
||||
DEFAULT_PARAM(0,_newDisplayShowMode,-1);
|
||||
params [["_newDisplayShowMode", -1, [-1]]];
|
||||
_oldShowMode = GVAR(currentShowMode);
|
||||
|
||||
if (_newDisplayShowMode == -1) then {
|
||||
@ -30,11 +30,10 @@ if ((_newDisplayShowMode == DISPLAY_MODE_DISPLAY) && {!([DISPLAY_MODE_DISPLAY] c
|
||||
if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN};
|
||||
|
||||
|
||||
|
||||
//On first-startup
|
||||
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
|
||||
GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY;
|
||||
GVAR(mapPosition) = getPos ace_player;
|
||||
GVAR(mapPosition) = getPos ACE_player;
|
||||
};
|
||||
|
||||
if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then {
|
||||
@ -74,14 +73,14 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
|
||||
//Start a pfeh to update display and handle hiding display
|
||||
|
||||
[{
|
||||
PARAMS_2(_args,_pfID);
|
||||
EXPLODE_1_PVT(_args,_player);
|
||||
if ((isNull ace_player) || {!alive ace_player} || {ace_player != _player} || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
|
||||
params ["_args", "_idPFH"];
|
||||
_args params ["_player"];
|
||||
if ((isNull ACE_player) || {!alive ACE_player} || {ACE_player != _player} || {!("ACE_microDAGR" in (items ACE_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
|
||||
//Close Display if still open:
|
||||
if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then {
|
||||
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
|
||||
};
|
||||
[_pfID] call CBA_fnc_removePerFrameHandler;
|
||||
[_idPFH] call CBA_fnc_removePerFrameHandler;
|
||||
} else {
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
|
||||
//If display is hidden, and we can show, then swithc modes:
|
||||
@ -96,5 +95,5 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
|
||||
};
|
||||
};
|
||||
};
|
||||
}, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler;
|
||||
}, 0.1, [ACE_player]] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
|
@ -8,7 +8,7 @@
|
||||
* 2: Inclination (Degrees) <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"];
|
||||
|
||||
PARAMS_3(_slopeDistance,_azimuth,_inclination);
|
||||
params ["_slopeDistance", "_azimuth", "_inclination"];
|
||||
|
||||
if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected"
|
||||
if (_slopeDistance < 0) exitWith {}; //Bad Data
|
||||
@ -29,6 +29,6 @@ _verticleDistance = (sin _inclination) * _slopeDistance;
|
||||
|
||||
_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance];
|
||||
//This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different
|
||||
_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset;
|
||||
_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset;
|
||||
|
||||
GVAR(rangeFinderPositionASL) = _targetPosASL;
|
||||
|
@ -7,7 +7,7 @@
|
||||
* 0: New Mode <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode
|
||||
@ -16,24 +16,21 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"];
|
||||
private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"];
|
||||
|
||||
PARAMS_1(_newMode);
|
||||
params ["_newMode"];
|
||||
|
||||
disableSerialization;
|
||||
_display = displayNull;
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
||||
} else {
|
||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
||||
};
|
||||
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
if (GVAR(currentApplicationPage) == 2) then {
|
||||
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
|
||||
_theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture));
|
||||
_mapCtrlPos = ctrlPosition _theMap;
|
||||
_mapSize = _mapCtrlPos select 3;
|
||||
_centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)];
|
||||
|
||||
_mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"];
|
||||
_centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)];
|
||||
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
|
||||
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
* Changes the "application page" shown on the microDAGR
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_microdagr_fnc_showApplicationPage
|
||||
@ -19,12 +19,8 @@ private ["_display", "_theMap", "_mapSize"];
|
||||
|
||||
disableSerialization;
|
||||
|
||||
_display = displayNull;
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
||||
} else {
|
||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
||||
};
|
||||
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
//TopBar
|
||||
|
@ -3,10 +3,10 @@
|
||||
* Updates the display (several times a second) called from the pfeh
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_microdagr_fnc_updateDisplay
|
||||
@ -15,15 +15,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"];
|
||||
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"];
|
||||
|
||||
disableSerialization;
|
||||
_display = displayNull;
|
||||
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
|
||||
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
|
||||
} else {
|
||||
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
|
||||
};
|
||||
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
|
||||
|
||||
if (isNull _display) exitWith {ERROR("No Display");};
|
||||
|
||||
//Fade "shell" at night
|
||||
@ -44,21 +40,21 @@ case (APP_MODE_INFODISPLAY): {
|
||||
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
|
||||
|
||||
//Elevation:
|
||||
_numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude);
|
||||
_numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude);
|
||||
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
|
||||
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
|
||||
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
|
||||
|
||||
//Heading:
|
||||
_compassAngleText = if (GVAR(settingUseMils)) then {
|
||||
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
|
||||
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
|
||||
} else {
|
||||
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||
};
|
||||
(_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText;
|
||||
|
||||
//Speed:
|
||||
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];;
|
||||
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ACE_player)))];;
|
||||
|
||||
|
||||
if (GVAR(currentWaypoint) == -1) then {
|
||||
@ -89,13 +85,13 @@ case (APP_MODE_INFODISPLAY): {
|
||||
};
|
||||
|
||||
if (!(_targetPosLocationASL isEqualTo [])) then {
|
||||
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
||||
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
||||
_bearingText = if (GVAR(settingUseMils)) then {
|
||||
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
|
||||
} else {
|
||||
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||
};
|
||||
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
|
||||
_2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000;
|
||||
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
|
||||
_numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude);
|
||||
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
|
||||
@ -111,14 +107,14 @@ case (APP_MODE_INFODISPLAY): {
|
||||
case (APP_MODE_COMPASS): {
|
||||
//Heading:
|
||||
_compassAngleText = if (GVAR(settingUseMils)) then {
|
||||
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
|
||||
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
|
||||
} else {
|
||||
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||
};
|
||||
(_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText;
|
||||
|
||||
//Speed:
|
||||
_SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];;
|
||||
_SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];;
|
||||
(_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText;
|
||||
|
||||
if (GVAR(currentWaypoint) == -1) then {
|
||||
@ -126,8 +122,6 @@ case (APP_MODE_COMPASS): {
|
||||
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
|
||||
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
|
||||
} else {
|
||||
_playerPos2d = (getPosASL ace_player) select [0,2];
|
||||
|
||||
_targetPosName = "";
|
||||
_targetPosLocationASL = [];
|
||||
|
||||
@ -147,13 +141,13 @@ case (APP_MODE_COMPASS): {
|
||||
_rangeText = "---";
|
||||
|
||||
if (!(_targetPosLocationASL isEqualTo [])) then {
|
||||
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
||||
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
|
||||
_bearingText = if (GVAR(settingUseMils)) then {
|
||||
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
|
||||
} else {
|
||||
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
|
||||
};
|
||||
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
|
||||
_2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000;
|
||||
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
|
||||
};
|
||||
|
||||
@ -169,9 +163,9 @@ case (APP_MODE_WAYPOINTS): {
|
||||
|
||||
lbClear _wpListBox;
|
||||
{
|
||||
EXPLODE_2_PVT(_x,_wpName,_wpPos);
|
||||
_x params ["_wpName", "_wpPos"];
|
||||
_wpListBox lbAdd _wpName;
|
||||
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000;
|
||||
_2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000;
|
||||
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
|
||||
} forEach _waypoints;
|
||||
|
||||
|
@ -325,7 +325,7 @@
|
||||
<Czech>Kolik informací je načteno do MicroDAGR?</Czech>
|
||||
<Portuguese>Quanta informação é preenchida no mapa do MicroDAGR</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MicroDAGR_None">
|
||||
<Key ID="STR_ACE_MicroDAGR_MapFill_Full">
|
||||
<English>Full Satellite + Buildings</English>
|
||||
<Polish>Pełna satelitarna + budynki</Polish>
|
||||
<Spanish>Satelite completo + Edificios</Spanish>
|
||||
@ -333,7 +333,7 @@
|
||||
<Czech>Satelit + Budovy</Czech>
|
||||
<Portuguese>Satélite completo + Edifícios</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MicroDAGR_Side">
|
||||
<Key ID="STR_ACE_MicroDAGR_MapFill_OnlyRoads">
|
||||
<English>Topographical + Roads</English>
|
||||
<Polish>Topograficzna + drogi</Polish>
|
||||
<Spanish>Topografico + Carreteras</Spanish>
|
||||
@ -341,7 +341,7 @@
|
||||
<Czech>Topografické + Cesty</Czech>
|
||||
<Portuguese>Topográfico + Estradas</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_MicroDAGR_Unique">
|
||||
<Key ID="STR_ACE_MicroDAGR_MapFill_None">
|
||||
<English>None (Cannot use map view)</English>
|
||||
<Polish>Żadna (wyłącza ekran mapy)</Polish>
|
||||
<Spanish>Nada (No se puede el mapa)</Spanish>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
|
15
addons/optics/CfgJointRails.hpp
Normal file
15
addons/optics/CfgJointRails.hpp
Normal file
@ -0,0 +1,15 @@
|
||||
class asdg_OpticRail;
|
||||
class asdg_OpticRail1913: asdg_OpticRail {
|
||||
class compatibleItems {
|
||||
ACE_optic_Hamr_2D = 1;
|
||||
ACE_optic_Hamr_PIP = 1;
|
||||
ACE_optic_Arco_2D = 1;
|
||||
ACE_optic_Arco_PIP = 1;
|
||||
ACE_optic_MRCO_2D = 1;
|
||||
ACE_optic_MRCO_PIP = 1;
|
||||
ACE_optic_SOS_2D = 1;
|
||||
ACE_optic_SOS_PIP = 1;
|
||||
ACE_optic_LRPS_2D = 1;
|
||||
ACE_optic_LRPS_PIP = 1;
|
||||
};
|
||||
};
|
@ -1,4 +1,3 @@
|
||||
|
||||
class CfgOpticsEffect {
|
||||
class ACE_OpticsRadBlur1 {
|
||||
type = "radialblur";
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#define MACRO_PRELOAD \
|
||||
GVAR(BodyDay) = "*"; \
|
||||
GVAR(BodyNight) = "*"; \
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
class RscOpticsValue;
|
||||
class RscMapControl;
|
||||
class RscText;
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
class CfgVehicles {
|
||||
class Box_NATO_Support_F;
|
||||
class ACE_Box_Misc: Box_NATO_Support_F {
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
class CfgWeapons {
|
||||
class ItemCore;
|
||||
class InventoryOpticsItem_Base_F;
|
||||
@ -8,7 +7,7 @@ class CfgWeapons {
|
||||
forceOptics = 0; // Allow using compass with Binocular
|
||||
opticsZoomMin = 0.056889; // 5.25x power
|
||||
opticsZoomMax = 0.056889; // 9 px/mil
|
||||
modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7° horizontal field of view
|
||||
modelOptics = "\z\ace\addons\optics\models\NWD_M22_5x"; // 7 degrees horizontal field of view
|
||||
visionMode[] = {"Normal"}; // Can't use nvgs with binoculars any more than you can with scopes
|
||||
// Fix AI using Binocs on short range - #18737
|
||||
// minRange = 300; // 300 = uses Rangefinder often (runs a few meters, stops, uses RF, repeats)
|
||||
|
@ -30,5 +30,6 @@ class CfgPatches {
|
||||
#include "CfgRscTitles.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "CfgWeapons.hpp"
|
||||
#include "CfgJointRails.hpp"
|
||||
|
||||
#include "CfgPreloadTextures.hpp"
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
class Mode_SemiAuto;
|
||||
class Mode_FullAuto;
|
||||
|
||||
class CfgWeapons {
|
||||
@ -510,14 +510,14 @@ class CfgWeapons {
|
||||
class player: player {};
|
||||
};
|
||||
|
||||
class cannon_105mm: cannon_120mm {
|
||||
class cannon_105mm: CannonCore {
|
||||
displayName = "M68";
|
||||
class player: player {
|
||||
class player: Mode_SemiAuto {
|
||||
displayName = "M68";
|
||||
};
|
||||
};
|
||||
|
||||
class cannon_125mm: cannon_120mm {
|
||||
class cannon_125mm: CannonCore {
|
||||
displayName = "2A46";
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,7 @@ class ACE_Repair {
|
||||
class MiscRepair: ReplaceWheel {
|
||||
displayName = CSTRING(Repairing); // let's make empty string an auto generated string
|
||||
displayNameProgress = CSTRING(RepairingHitPoint);
|
||||
condition = QUOTE((_target getHitPointDamage _hitPoint) > ([_caller] call FUNC(getPostRepairDamage)));
|
||||
condition = QUOTE(call FUNC(canMiscRepair));
|
||||
requiredEngineer = 0;
|
||||
repairingTime = 15;
|
||||
callbackSuccess = QUOTE(call FUNC(doRepair));
|
||||
@ -63,7 +63,7 @@ class ACE_Repair {
|
||||
requiredEngineer = QGVAR(engineerSetting_fullRepair);
|
||||
repairLocations[] = {QGVAR(fullRepairLocation)};
|
||||
repairingTime = 30;
|
||||
condition = "damage (_this select 1) > 0";
|
||||
condition = "damage _target > 0";
|
||||
callbackSuccess = QUOTE(call FUNC(doFullRepair));
|
||||
};
|
||||
};
|
||||
|
@ -285,7 +285,10 @@ class CfgVehicles {
|
||||
transportRepair = 0;
|
||||
};
|
||||
|
||||
class Heli_Transport_04_base_F;
|
||||
class Helicopter_Base_H;
|
||||
class Heli_Transport_04_base_F: Helicopter_Base_H {
|
||||
GVAR(hitpointGroups[]) = { {"HitEngine", {"HitEngine1", "HitEngine2"}}, {"Glass_1_hitpoint", {"Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"}} };
|
||||
};
|
||||
class O_Heli_Transport_04_repair_F: Heli_Transport_04_base_F {
|
||||
GVAR(canRepair) = 1;
|
||||
transportRepair = 0;
|
||||
@ -303,12 +306,19 @@ class CfgVehicles {
|
||||
transportRepair = 0;
|
||||
};
|
||||
|
||||
class Offroad_01_base_F;
|
||||
class Car_F;
|
||||
class Offroad_01_base_F: Car_F {
|
||||
GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2"}} };
|
||||
};
|
||||
class Offroad_01_repair_base_F: Offroad_01_base_F {
|
||||
GVAR(canRepair) = 1;
|
||||
transportRepair = 0;
|
||||
};
|
||||
|
||||
class MRAP_01_base_F: Car_F {
|
||||
GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6"}} };
|
||||
};
|
||||
|
||||
class B_Truck_01_mover_F;
|
||||
class B_Truck_01_Repair_F: B_Truck_01_mover_F {
|
||||
GVAR(canRepair) = 1;
|
||||
|
@ -3,6 +3,7 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(addRepairActions);
|
||||
PREP(canMiscRepair);
|
||||
PREP(canRemove);
|
||||
PREP(canRepair);
|
||||
PREP(canRepairTrack);
|
||||
@ -15,6 +16,7 @@ PREP(doRepair);
|
||||
PREP(doRepairTrack);
|
||||
PREP(doReplaceTrack);
|
||||
PREP(doReplaceWheel);
|
||||
PREP(getHitPointString);
|
||||
PREP(getPostRepairDamage);
|
||||
PREP(getWheelHitPointsWithSelections);
|
||||
PREP(hasItems);
|
||||
|
@ -14,7 +14,6 @@
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]
|
||||
|
||||
params ["_vehicle"];
|
||||
TRACE_1("params", _vehicle);
|
||||
@ -35,6 +34,11 @@ if (_type in _initializedClasses) exitWith {};
|
||||
([_vehicle] call FUNC(getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitPointSelections"];
|
||||
|
||||
|
||||
private ["_hitPointsAddedNames", "_hitPointsAddedStrings", "_hitPointsAddedAmount"];
|
||||
_hitPointsAddedNames = [];
|
||||
_hitPointsAddedStrings = [];
|
||||
_hitPointsAddedAmount = [];
|
||||
|
||||
// add repair events to this vehicle class
|
||||
{
|
||||
if (_x in _wheelHitPoints) then {
|
||||
@ -51,7 +55,7 @@ if (_type in _initializedClasses) exitWith {};
|
||||
|
||||
// remove wheel action
|
||||
_name = format ["Remove_%1", _x];
|
||||
_text = localize "STR_ACE_Repair_RemoveWheel";
|
||||
_text = localize LSTRING(RemoveWheel);
|
||||
|
||||
_condition = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(canRepair)};
|
||||
_statement = {[_this select 1, _this select 0, _this select 2 select 0, "RemoveWheel"] call DFUNC(repair)};
|
||||
@ -74,22 +78,39 @@ if (_type in _initializedClasses) exitWith {};
|
||||
// exit if the hitpoint is in the blacklist, e.g. glasses
|
||||
if (_x in IGNORED_HITPOINTS) exitWith {};
|
||||
|
||||
private ["_hitpointGroupConfig", "_inHitpointSubGroup", "_currentHitpoint"];
|
||||
|
||||
// Get hitpoint groups if available
|
||||
_hitpointGroupConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups);
|
||||
_inHitpointSubGroup = false;
|
||||
if (isArray _hitpointGroupConfig) then {
|
||||
// Set variable if current hitpoint is in a sub-group (to be excluded from adding action)
|
||||
_currentHitpoint = _x;
|
||||
{
|
||||
{
|
||||
if (_x == _currentHitpoint) exitWith {
|
||||
_inHitpointSubGroup = true;
|
||||
};
|
||||
} forEach (_x select 1);
|
||||
} forEach (getArray _hitpointGroupConfig);
|
||||
};
|
||||
|
||||
// Exit if current hitpoint is in sub-group (only main hitpoints get actions)
|
||||
if (_inHitpointSubGroup) exitWith {};
|
||||
|
||||
// exit if the hitpoint is virtual
|
||||
if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {};
|
||||
|
||||
// add misc repair action
|
||||
|
||||
private ["_name", "_text", "_icon", "_selection", "_customSelectionsConfig", "_currentHitpoint", "_condition", "_statement"];
|
||||
private ["_name", "_icon", "_selection", "_condition", "_statement"];
|
||||
|
||||
_name = format ["Repair_%1", _x];
|
||||
|
||||
_text = format ["STR_ACE_Repair_%1", _x];
|
||||
|
||||
if (isLocalized _text) then {
|
||||
_text = format [localize LSTRING(RepairHitpoint), localize _text];
|
||||
} else {
|
||||
_text = format [localize LSTRING(RepairHitpoint), _x];
|
||||
};
|
||||
// Find localized string and track those added for numerization
|
||||
([_x, "%1", _x, [_hitPointsAddedNames, _hitPointsAddedStrings, _hitPointsAddedAmount]] call FUNC(getHitPointString)) params ["_text", "_trackArray"];
|
||||
_hitPointsAddedNames = _trackArray select 0;
|
||||
_hitPointsAddedStrings = _trackArray select 1;
|
||||
_hitPointsAddedAmount = _trackArray select 2;
|
||||
|
||||
_icon = "A3\ui_f\data\igui\cfg\actions\repair_ca.paa";
|
||||
|
||||
|
54
addons/repair/functions/fnc_canMiscRepair.sqf
Normal file
54
addons/repair/functions/fnc_canMiscRepair.sqf
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Check if misc repair action can be done, called from callbackSuccess.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit that does the repairing <OBJECT>
|
||||
* 1: Vehicle to repair <OBJECT>
|
||||
* 2: Selected hitpoint <STRING>
|
||||
*
|
||||
* Return Value:
|
||||
* Can Misc Repair <BOOL>
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_canMiscRepair
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"];
|
||||
params ["_caller", "_target", "_hitPoint"];
|
||||
|
||||
// Get hitpoint groups if available
|
||||
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups);
|
||||
_hitpointGroup = [];
|
||||
if (isArray _hitpointGroupConfig) then {
|
||||
// Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group
|
||||
{
|
||||
// Exit using found hitpoint group if this hitpoint is leader of any
|
||||
if (_x select 0 == _hitPoint) exitWith {
|
||||
_hitpointGroup = _x select 1;
|
||||
};
|
||||
} forEach (getArray _hitpointGroupConfig);
|
||||
};
|
||||
|
||||
// Add current hitpoint to the group
|
||||
_hitpointGroup pushBack _hitPoint;
|
||||
|
||||
// Get post repair damage
|
||||
_postRepairDamage = [_caller] call FUNC(getPostRepairDamage);
|
||||
|
||||
// Return true if damage can be repaired on any hitpoint in the group, else false
|
||||
_return = false;
|
||||
{
|
||||
if ((_target getHitPointDamage _x) > _postRepairDamage) exitWith {
|
||||
_return = true;
|
||||
};
|
||||
} forEach _hitpointGroup;
|
||||
|
||||
if (typeOf _target == "B_MRAP_01_F") then {
|
||||
diag_log format ["%1 - %2", _hitPoint, _hitpointGroup];
|
||||
};
|
||||
|
||||
_return
|
@ -17,11 +17,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_hitPointDamage", "_text", "_hitpointGroup"];
|
||||
params ["_unit", "_vehicle", "_hitPoint"];
|
||||
TRACE_3("params",_unit,_vehicle,_hitPoint);
|
||||
|
||||
// get current hitpoint damage
|
||||
private "_hitPointDamage";
|
||||
_hitPointDamage = _vehicle getHitPointDamage _hitPoint;
|
||||
|
||||
_hitPointDamage = _hitPointDamage - 0.5;
|
||||
@ -31,16 +31,36 @@ _hitPointDamage = _hitPointDamage max ([_unit] call FUNC(getPostRepairDamage));
|
||||
// raise event to set the new hitpoint damage
|
||||
["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent);
|
||||
|
||||
// Get hitpoint groups if available
|
||||
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups);
|
||||
_hitpointGroup = [];
|
||||
if (isArray _hitpointGroupConfig) then {
|
||||
// Retrieve group if current hitpoint is leader of any
|
||||
{
|
||||
if (_x select 0 == _hitPoint) exitWith {
|
||||
([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitpoints"];
|
||||
// Set all sub-group hitpoints' damage to 0, if a hitpoint is invalid print RPT error
|
||||
{
|
||||
if (_x in _hitpoints) then {
|
||||
["setVehicleHitPointDamage", _vehicle, [_vehicle, _x, 0]] call EFUNC(common,targetEvent);
|
||||
} else {
|
||||
diag_log text format ["[ACE] ERROR: Invalid hitpoint %1 in hitpointGroups of %2", _x, _vehicle];
|
||||
};
|
||||
|
||||
} forEach (_x select 1);
|
||||
};
|
||||
} forEach (getArray _hitpointGroupConfig);
|
||||
};
|
||||
|
||||
// display text message if enabled
|
||||
if (GVAR(DisplayTextOnRepair)) then {
|
||||
private "_text";
|
||||
_text = format ["STR_ACE_Repair_%1", _hitPoint];
|
||||
private ["_textLocalized", "_textDefault"];
|
||||
|
||||
if (isLocalized _text) then {
|
||||
_text = format [localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0)), localize _text];
|
||||
} else {
|
||||
_text = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0));
|
||||
};
|
||||
// Find localized string
|
||||
_textLocalized = localize ([LSTRING(RepairedHitPointFully), LSTRING(RepairedHitPointPartially)] select (_hitPointDamage > 0));
|
||||
_textDefault = localize ([LSTRING(RepairedFully), LSTRING(RepairedPartially)] select (_hitPointDamage > 0));
|
||||
([_hitPoint, _textLocalized, _textDefault] call FUNC(getHitPointString)) params ["_text"];
|
||||
|
||||
// Display text
|
||||
[_text] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
|
89
addons/repair/functions/fnc_getHitPointString.sqf
Normal file
89
addons/repair/functions/fnc_getHitPointString.sqf
Normal file
@ -0,0 +1,89 @@
|
||||
/*
|
||||
* Author: Jonpas
|
||||
* Finds the localized string of the given hitpoint name or uses default text if none found.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Hitpoint <STRING>
|
||||
* 1: Localized Text <STRING>
|
||||
* 2: Default Text <STRING>
|
||||
* 3: Track Added Hitpoints <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* 0: Text
|
||||
* 1: Added Hitpoint (default: [])
|
||||
*
|
||||
* Example:
|
||||
* [unit, vehicle, "hitpoint"] call ace_repair_fnc_getHitPointString
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_track", "_trackNames", "_trackStrings", "_trackAmount", "_text", "_toFind", "_trackIndex", "_combinedString"];
|
||||
params ["_hitPoint", "_textLocalized", "_textDefault", ["_trackArray", []]];
|
||||
|
||||
_track = if (count _trackArray > 0) then {true} else {false};
|
||||
_trackNames = [];
|
||||
_trackStrings = [];
|
||||
_trackAmount = [];
|
||||
|
||||
if (_track) then {
|
||||
_trackNames = _trackArray select 0;
|
||||
_trackStrings = _trackArray select 1;
|
||||
_trackAmount = _trackArray select 2;
|
||||
};
|
||||
|
||||
// Prepare first part of the string from stringtable
|
||||
_text = LSTRING(Hit);
|
||||
|
||||
// Remove "Hit" from hitpoint name if one exists
|
||||
_toFind = if (_hitPoint find "Hit" == 0) then {
|
||||
[_hitPoint, 3] call CBA_fnc_substr
|
||||
} else {
|
||||
_hitPoint
|
||||
};
|
||||
|
||||
// Loop through always shorter part of the hitpoint name to find the string from stringtable
|
||||
for "_i" from 0 to (count _hitPoint) do {
|
||||
if (_track) then {
|
||||
// Loop through already added hitpoints and save index
|
||||
_trackIndex = -1;
|
||||
{
|
||||
if (_x == _toFind) exitWith {
|
||||
_trackIndex = _forEachIndex;
|
||||
};
|
||||
} forEach _trackNames;
|
||||
|
||||
// Use already added hitpoint if one found above and numerize
|
||||
if (_trackIndex != -1) exitWith {
|
||||
_text = localize (_trackStrings select _trackIndex) + " " + str(_trackAmount select _trackIndex);
|
||||
_trackAmount set [_trackIndex, (_trackAmount select _trackIndex) + 1]; // Set amount
|
||||
TRACE_2("Same hitpoint found",_toFind,_trackNames);
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Localize if localization found
|
||||
_combinedString = _text + _toFind;
|
||||
if (isLocalized _combinedString) exitWith {
|
||||
_text = format [_textLocalized, localize _combinedString];
|
||||
TRACE_1("Hitpoint localized",_toFind);
|
||||
|
||||
if (_track) then {
|
||||
// Add hitpoint to the list
|
||||
_trackNames pushBack _toFind;
|
||||
_trackStrings pushBack _combinedString;
|
||||
_trackAmount pushBack 2;
|
||||
};
|
||||
};
|
||||
|
||||
// Cut off one character
|
||||
_toFind = [_toFind, 0, count _toFind - 1] call CBA_fnc_substr;
|
||||
};
|
||||
|
||||
// Don't display part name if no string is found in stringtable
|
||||
if (_text == LSTRING(Hit)) then {
|
||||
_text = _textDefault;
|
||||
};
|
||||
|
||||
[_text, [_trackNames, _trackStrings, _trackAmount]]
|
@ -164,14 +164,10 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then {
|
||||
0;
|
||||
};
|
||||
|
||||
private ["_text", "_processText"];
|
||||
private ["_processText"];
|
||||
// Find localized string
|
||||
_processText = getText (_config >> "displayNameProgress");
|
||||
_text = format ["STR_ACE_Repair_%1", _hitPoint];
|
||||
if (isLocalized _text) then {
|
||||
_text = format [_processText, localize _text];
|
||||
} else {
|
||||
_text = _processText;
|
||||
};
|
||||
([_hitPoint, _processText, _processText] call FUNC(getHitPointString)) params ["_text"];
|
||||
|
||||
// Start repair
|
||||
[
|
||||
|
@ -12,5 +12,5 @@
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
|
||||
|
||||
#define IGNORED_HITPOINTS ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitGlass9","HitGlass10","HitGlass11","HitGlass12","HitGlass13","HitGlass14","HitGlass15","HitRGlass","HitLGlass"]
|
||||
// #define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"];
|
||||
#define IGNORED_HITPOINTS ["HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitGlass7", "HitGlass8", "HitGlass9", "HitGlass10", "HitGlass11", "HitGlass12", "HitGlass13", "HitGlass14", "HitGlass15", "HitRGlass", "HitLGlass", "Glass_1_hitpoint", "Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"]
|
||||
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2014-12-21 -->
|
||||
<Project name="ACE">
|
||||
<Package name="repair">
|
||||
@ -118,18 +118,6 @@
|
||||
<English>Who can perform a full repair on a vehicle?</English>
|
||||
<Polish>Kto może przeprowadzić pełną naprawę pojazdu?</Polish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_RepairHitpoint">
|
||||
<English>Repair %1</English>
|
||||
<German>Reparieren %1</German>
|
||||
<Spanish>Reparación %1</Spanish>
|
||||
<French>Réparer %1</French>
|
||||
<Polish>Napraw %1</Polish>
|
||||
<Czech>Opravit %1</Czech>
|
||||
<Portuguese>Reparar %1</Portuguese>
|
||||
<Italian>Ripara %1</Italian>
|
||||
<Hungarian>Szerelés %1</Hungarian>
|
||||
<Russian>Ремонт %1</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_Repair">
|
||||
<English>Repair >></English>
|
||||
<German>Reparieren >></German>
|
||||
@ -242,6 +230,15 @@
|
||||
<Hungarian>Motor</Hungarian>
|
||||
<Russian>Двигатель</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitHStabilizerL1">
|
||||
<English>Left Horizontal Stabilizer</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitHStabilizerR1">
|
||||
<English>Right Horizontal Stabilizer</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitVStabilizer1">
|
||||
<English>Vertical Stabilizer</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitFuel">
|
||||
<English>Fuel Tank</English>
|
||||
<German>Tank</German>
|
||||
@ -254,15 +251,36 @@
|
||||
<Hungarian>Üzemanyagtank</Hungarian>
|
||||
<Russian>Топливный бак</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitTransmission">
|
||||
<English>Transmission</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGear">
|
||||
<English>Gear</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitStarter">
|
||||
<English>Starter</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitTail">
|
||||
<English>Tail</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitPilotTube">
|
||||
<English>Pilot Tube</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitStaticPort">
|
||||
<English>Static Port</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitAmmo">
|
||||
<English>Ammo</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitTurret">
|
||||
<English>Main Turret</English>
|
||||
<English>Turret</English>
|
||||
<German>Turm</German>
|
||||
<Spanish>Torreta príncipal</Spanish>
|
||||
<Spanish>Torreta</Spanish>
|
||||
<French>Tourelle</French>
|
||||
<Polish>Wieżyczka</Polish>
|
||||
<Czech>Hlavní Věž</Czech>
|
||||
<Portuguese>Torre principal</Portuguese>
|
||||
<Italian>Torretta principale</Italian>
|
||||
<Czech>Věž</Czech>
|
||||
<Portuguese>Torre</Portuguese>
|
||||
<Italian>Torretta</Italian>
|
||||
<Hungarian>Lövegtorony</Hungarian>
|
||||
<Russian>Башню</Russian>
|
||||
</Key>
|
||||
@ -278,6 +296,9 @@
|
||||
<Hungarian>Ágyú</Hungarian>
|
||||
<Russian>Пушку</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitMissiles">
|
||||
<English>Missiles</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitLTrack">
|
||||
<English>Left Track</English>
|
||||
<German>Linke Kette</German>
|
||||
@ -463,77 +484,17 @@
|
||||
<Hungarian>Bal szélvédő</Hungarian>
|
||||
<Russian>Стекло (слава)</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGlass1">
|
||||
<English>Glass 1</English>
|
||||
<German>Scheibe 1</German>
|
||||
<Spanish>Ventana 1</Spanish>
|
||||
<French>Vitre 1</French>
|
||||
<Polish>Szyba 1</Polish>
|
||||
<Czech>Sklo 1</Czech>
|
||||
<Portuguese>Vidro 1</Portuguese>
|
||||
<Italian>Vetro 1</Italian>
|
||||
<Hungarian>Üveg 1</Hungarian>
|
||||
<Russian>Стекло 1</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGlass2">
|
||||
<English>Glass 2</English>
|
||||
<German>Scheibe 2</German>
|
||||
<Spanish>Ventana 2</Spanish>
|
||||
<French>Vitre 2</French>
|
||||
<Polish>Szyba 2</Polish>
|
||||
<Czech>Sklo 2</Czech>
|
||||
<Portuguese>Vidro 2</Portuguese>
|
||||
<Italian>Vetro 2</Italian>
|
||||
<Hungarian>Üveg 2</Hungarian>
|
||||
<Russian>Стекло 2</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGlass3">
|
||||
<English>Glass 3</English>
|
||||
<German>Scheibe 3</German>
|
||||
<Spanish>Ventana 3</Spanish>
|
||||
<French>Vitre 3</French>
|
||||
<Polish>Szyba 3</Polish>
|
||||
<Czech>Sklo 3</Czech>
|
||||
<Portuguese>Vidro 3</Portuguese>
|
||||
<Italian>Vetro 3</Italian>
|
||||
<Hungarian>Üveg 3</Hungarian>
|
||||
<Russian>Стекло 3</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGlass4">
|
||||
<English>Glass 4</English>
|
||||
<German>Scheibe 4</German>
|
||||
<Spanish>Ventana 4</Spanish>
|
||||
<French>Vitre 4</French>
|
||||
<Polish>Szyba 4</Polish>
|
||||
<Czech>Sklo 4</Czech>
|
||||
<Portuguese>Vidro 4</Portuguese>
|
||||
<Italian>Vetro 4</Italian>
|
||||
<Hungarian>Üveg 4</Hungarian>
|
||||
<Russian>Стекло 4</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGlass5">
|
||||
<English>Glass 5</English>
|
||||
<German>Scheibe 5</German>
|
||||
<Spanish>Ventana 5</Spanish>
|
||||
<French>Vitre 5</French>
|
||||
<Polish>Szyba 5</Polish>
|
||||
<Czech>Sklo 5</Czech>
|
||||
<Portuguese>Vidro 5</Portuguese>
|
||||
<Italian>Vetro 5</Italian>
|
||||
<Hungarian>Üveg 5</Hungarian>
|
||||
<Russian>Стекло 5</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_HitGlass6">
|
||||
<English>Glass 6</English>
|
||||
<German>Scheibe 6</German>
|
||||
<Spanish>Ventana 6</Spanish>
|
||||
<French>Vitre 6</French>
|
||||
<Polish>Szyba 6</Polish>
|
||||
<Czech>Sklo 6</Czech>
|
||||
<Portuguese>Vidro 6</Portuguese>
|
||||
<Italian>Vetro 6</Italian>
|
||||
<Hungarian>Üveg 6</Hungarian>
|
||||
<Russian>Стекло 6</Russian>
|
||||
<Key ID="STR_ACE_Repair_HitGlass">
|
||||
<English>Glass</English>
|
||||
<German>Scheibe</German>
|
||||
<Spanish>Ventana</Spanish>
|
||||
<French>Vitre</French>
|
||||
<Polish>Szyba</Polish>
|
||||
<Czech>Sklo</Czech>
|
||||
<Portuguese>Vidro</Portuguese>
|
||||
<Italian>Vetro</Italian>
|
||||
<Hungarian>Üveg</Hungarian>
|
||||
<Russian>Стекло</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Repair_moduleName">
|
||||
<English>Repair Settings</English>
|
||||
|
1
addons/spectator/$PBOPREFIX$
Normal file
1
addons/spectator/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\spectator
|
22
addons/spectator/ACE_Settings.hpp
Normal file
22
addons/spectator/ACE_Settings.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
class ACE_Settings {
|
||||
class GVAR(filterUnits) {
|
||||
typeName = "SCALAR";
|
||||
value = 2;
|
||||
values[] = {CSTRING(units_none), CSTRING(units_players), CSTRING(units_playable), CSTRING(units_all)};
|
||||
};
|
||||
class GVAR(filterSides) {
|
||||
typeName = "SCALAR";
|
||||
value = 0;
|
||||
values[] = {CSTRING(sides_player), CSTRING(sides_friendly), CSTRING(sides_hostile), CSTRING(sides_all)};
|
||||
};
|
||||
class GVAR(restrictModes) {
|
||||
typeName = "SCALAR";
|
||||
value = 0;
|
||||
values[] = {CSTRING(modes_all), CSTRING(modes_unit), CSTRING(modes_free), CSTRING(modes_internal), CSTRING(modes_external)};
|
||||
};
|
||||
class GVAR(restrictVisions) {
|
||||
typeName = "SCALAR";
|
||||
value = 0;
|
||||
values[] = {CSTRING(modes_all), CSTRING(visions_nv), CSTRING(visions_ti), "$STR_Special_None"};
|
||||
};
|
||||
};
|
11
addons/spectator/CfgEventHandlers.hpp
Normal file
11
addons/spectator/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));
|
||||
};
|
||||
};
|
117
addons/spectator/CfgVehicles.hpp
Normal file
117
addons/spectator/CfgVehicles.hpp
Normal file
@ -0,0 +1,117 @@
|
||||
class CfgVehicles {
|
||||
class ACE_Module;
|
||||
class GVAR(moduleSettings): ACE_Module {
|
||||
scope = 2;
|
||||
displayName = CSTRING(Settings_DisplayName);
|
||||
icon = PATHTOF(UI\Icon_Module_Spectator_ca.paa);
|
||||
category = "ACE";
|
||||
function = QFUNC(moduleSpectatorSettings);
|
||||
isGlobal = 1;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class unitsFilter {
|
||||
displayName = CSTRING(units_DisplayName);
|
||||
description = CSTRING(units_Description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class none {
|
||||
name = CSTRING(units_none);
|
||||
value = 0;
|
||||
};
|
||||
class players {
|
||||
name = CSTRING(units_players);
|
||||
value = 1;
|
||||
};
|
||||
class playable {
|
||||
name = CSTRING(units_playable);
|
||||
value = 2;
|
||||
default = 1;
|
||||
};
|
||||
class all {
|
||||
name = CSTRING(units_all);
|
||||
value = 3;
|
||||
};
|
||||
};
|
||||
};
|
||||
class sidesFilter {
|
||||
displayName = CSTRING(sides_DisplayName);
|
||||
description = CSTRING(sides_Description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class player {
|
||||
name = CSTRING(sides_player);
|
||||
value = 0;
|
||||
default = 1;
|
||||
};
|
||||
class friendly {
|
||||
name = CSTRING(sides_friendly);
|
||||
value = 1;
|
||||
};
|
||||
class hostile {
|
||||
name = CSTRING(sides_hostile);
|
||||
value = 2;
|
||||
};
|
||||
class all {
|
||||
name = CSTRING(sides_all);
|
||||
value = 3;
|
||||
};
|
||||
};
|
||||
};
|
||||
class cameraModes {
|
||||
displayName = CSTRING(modes_DisplayName);
|
||||
description = CSTRING(modes_Description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class all {
|
||||
name = CSTRING(modes_all);
|
||||
value = 0;
|
||||
default = 1;
|
||||
};
|
||||
class unit {
|
||||
name = CSTRING(modes_unit);
|
||||
value = 1;
|
||||
};
|
||||
class free {
|
||||
name = CSTRING(modes_free);
|
||||
value = 2;
|
||||
};
|
||||
class internal {
|
||||
name = CSTRING(modes_internal);
|
||||
value = 3;
|
||||
};
|
||||
class external {
|
||||
name = CSTRING(modes_external);
|
||||
value = 4;
|
||||
};
|
||||
};
|
||||
};
|
||||
class visionModes {
|
||||
displayName = CSTRING(visions_DisplayName);
|
||||
description = CSTRING(visions_Description);
|
||||
typeName = "NUMBER";
|
||||
class values {
|
||||
class all {
|
||||
name = CSTRING(modes_all);
|
||||
value = 0;
|
||||
default = 1;
|
||||
};
|
||||
class nv {
|
||||
name = CSTRING(visions_nv);
|
||||
value = 1;
|
||||
};
|
||||
class ti {
|
||||
name = CSTRING(visions_ti);
|
||||
value = 2;
|
||||
};
|
||||
class none {
|
||||
name = "$STR_Special_None";
|
||||
value = 3;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ModuleDescription {
|
||||
description = CSTRING(Settings_Description);
|
||||
};
|
||||
};
|
||||
};
|
14
addons/spectator/README.md
Normal file
14
addons/spectator/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
ace_spectator
|
||||
=======
|
||||
|
||||
A flexible spectator framework for mission makers to use.
|
||||
|
||||
Includes a public API for integration into custom respawn frameworks and a template for use with the vanilla respawn framework.
|
||||
|
||||
For more information, see: http://ace3mod.com/wiki/feature/spectator.html
|
||||
|
||||
## Maintainers
|
||||
|
||||
The people responsible for merging changes to this component or answering potential questions.
|
||||
|
||||
- [SilentSpike](https://github.com/SilentSpike)
|
BIN
addons/spectator/UI/Icon_Module_Spectator_ca.paa
Normal file
BIN
addons/spectator/UI/Icon_Module_Spectator_ca.paa
Normal file
Binary file not shown.
255
addons/spectator/UI/interface.hpp
Normal file
255
addons/spectator/UI/interface.hpp
Normal file
@ -0,0 +1,255 @@
|
||||
// Temporary fix until BI take care of it
|
||||
class RscFrame {
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = 0;
|
||||
h = 0;
|
||||
};
|
||||
|
||||
|
||||
class RscButtonMenu;
|
||||
class RscControlsGroupNoScrollbars;
|
||||
//class RscFrame;
|
||||
class RscListBox;
|
||||
class RscMapControl;
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class RscTree;
|
||||
|
||||
class GVAR(interface) {
|
||||
idd = 12249;
|
||||
enableSimulation = 1;
|
||||
movingEnable = 0;
|
||||
onLoad = QUOTE([ARR_2('onLoad',_this)] call FUNC(handleInterface));
|
||||
onUnload = QUOTE([ARR_2('onUnload',_this)] call FUNC(handleInterface));
|
||||
onKeyDown = QUOTE([ARR_2('onKeyDown',_this)] call FUNC(handleInterface));
|
||||
onKeyUp = QUOTE([ARR_2('onKeyUp',_this)] call FUNC(handleInterface));
|
||||
class controlsBackground {
|
||||
class mouseHandler: RscControlsGroupNoScrollbars {
|
||||
x = safeZoneXAbs;
|
||||
y = safeZoneY;
|
||||
w = safeZoneWAbs;
|
||||
h = safeZoneH;
|
||||
onMouseButtonDown = QUOTE([ARR_2('onMouseButtonDown',_this)] call FUNC(handleInterface));
|
||||
onMouseButtonUp = QUOTE([ARR_2('onMouseButtonUp',_this)] call FUNC(handleInterface));
|
||||
onMouseZChanged = QUOTE([ARR_2('onMouseZChanged',_this)] call FUNC(handleInterface));
|
||||
onMouseMoving = QUOTE([ARR_2('onMouseMoving',_this)] call FUNC(handleInterface));
|
||||
onMouseHolding = QUOTE([ARR_2('onMouseMoving',_this)] call FUNC(handleInterface));
|
||||
};
|
||||
};
|
||||
class controls {
|
||||
class compass: RscControlsGroupNoScrollbars {
|
||||
idc = IDC_COMP;
|
||||
x = COMPASS_X;
|
||||
y = safeZoneY;
|
||||
w = COMPASS_W;
|
||||
h = TOOL_H;
|
||||
class controls {
|
||||
class compassBack: RscText {
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = COMPASS_W;
|
||||
h = TOOL_H;
|
||||
colorBackground[] = {COL_BACK};
|
||||
};
|
||||
class compass0_90: RscPicture {
|
||||
idc = IDC_COMP_0;
|
||||
x = COMPASS_W * 0.5;
|
||||
y = 0;
|
||||
w = COMPASS_W * 0.5;
|
||||
h = TOOL_H;
|
||||
text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture180_ca.paa";
|
||||
};
|
||||
class compass90_180: compass0_90 {
|
||||
idc = IDC_COMP_90;
|
||||
x = COMPASS_W;
|
||||
text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture270_ca.paa";
|
||||
};
|
||||
class compass180_270: compass0_90 {
|
||||
idc = IDC_COMP_180;
|
||||
x = 0;
|
||||
text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture0_ca.paa";
|
||||
};
|
||||
class compass270_0: compass0_90 {
|
||||
idc = IDC_COMP_270;
|
||||
x = COMPASS_W * -0.5;
|
||||
text = "A3\UI_F_Curator\Data\CfgIngameUI\compass\texture90_ca.paa";
|
||||
};
|
||||
class compassCaret: RscFrame {
|
||||
x = COMPASS_W * 0.5;
|
||||
y = 0;
|
||||
w = 0;
|
||||
h = TOOL_H;
|
||||
colorText[] = {COL_FORE};
|
||||
};
|
||||
class compassFrame: compassBack {
|
||||
style = 64;
|
||||
shadow=2;
|
||||
colorText[] = {COL_FORE};
|
||||
};
|
||||
};
|
||||
};
|
||||
class toolbar: RscControlsGroupNoScrollbars {
|
||||
idc = IDC_TOOL;
|
||||
x = safeZoneX;
|
||||
y = safeZoneY + safeZoneH - TOOL_H;
|
||||
w = safeZoneW;
|
||||
h = TOOL_H;
|
||||
class controls {
|
||||
class nameTool: RscText {
|
||||
idc = IDC_TOOL_NAME;
|
||||
style = 2;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = TOOL_W * 2;
|
||||
h = TOOL_H;
|
||||
shadow = 2;
|
||||
colorText[]={COL_FORE};
|
||||
colorBackground[] = {COL_BACK};
|
||||
sizeEx = H_PART(1);
|
||||
};
|
||||
class nameFrame: nameTool {
|
||||
idc = -1;
|
||||
style = 64;
|
||||
};
|
||||
class viewTool: nameTool {
|
||||
idc = IDC_TOOL_VIEW;
|
||||
x = TOOL_W * 2 + MARGIN;
|
||||
w = TOOL_W;
|
||||
};
|
||||
class viewFrame: viewTool {
|
||||
idc = -1;
|
||||
style = 64;
|
||||
};
|
||||
class visionTool: viewTool {
|
||||
idc = IDC_TOOL_VISION;
|
||||
x = TOOL_W * 3 + MARGIN * 2;
|
||||
};
|
||||
class visionFrame: visionTool {
|
||||
idc = -1;
|
||||
style = 64;
|
||||
};
|
||||
class clockTool: viewTool {
|
||||
idc = IDC_TOOL_CLOCK;
|
||||
x = safeZoneW - TOOL_W * 3 - MARGIN * 2;
|
||||
};
|
||||
class clockFrame: clockTool {
|
||||
idc = -1;
|
||||
style = 64;
|
||||
};
|
||||
class zoomTool: viewTool {
|
||||
idc = IDC_TOOL_FOV;
|
||||
x = safeZoneW - TOOL_W * 2 - MARGIN;
|
||||
};
|
||||
class zoomFrame: zoomTool {
|
||||
idc = -1;
|
||||
style = 64;
|
||||
};
|
||||
class speedTool: viewTool {
|
||||
idc = IDC_TOOL_SPEED;
|
||||
x = safeZoneW - TOOL_W;
|
||||
};
|
||||
class speedFrame: speedTool {
|
||||
idc = -1;
|
||||
style = 64;
|
||||
};
|
||||
};
|
||||
};
|
||||
class unitWindow: RscControlsGroupNoScrollbars {
|
||||
idc = IDC_UNIT;
|
||||
x = safeZoneX;
|
||||
y = safeZoneY + TOOL_H * 6;
|
||||
w = TOOL_W * 2;
|
||||
h = safeZoneH - TOOL_H * 13;
|
||||
class controls {
|
||||
class unitTitle: RscText {
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = TOOL_W * 2;
|
||||
h = H_PART(1);
|
||||
style = 2;
|
||||
colorText[] = {COL_FORE};
|
||||
colorBackground[] = {COL_FORE_D};
|
||||
sizeEx = H_PART(1);
|
||||
text = CSTRING(UnitTitle);
|
||||
};
|
||||
class unitTree: RscTree {
|
||||
idc = IDC_UNIT_TREE;
|
||||
x = 0;
|
||||
y = H_PART(1);
|
||||
w = TOOL_W * 2;
|
||||
h = safeZoneH - TOOL_H * 14;
|
||||
sizeEx = H_PART(0.8);
|
||||
colorText[] = {COL_FORE};
|
||||
colorBorder[] = {0,0,0,0};
|
||||
colorBackground[] = {COL_BACK};
|
||||
colorSelect[] = {
|
||||
"profilenamespace getvariable ['GUI_BCG_RGB_R',0.77]",
|
||||
"profilenamespace getvariable ['GUI_BCG_RGB_G',0.51]",
|
||||
"profilenamespace getvariable ['GUI_BCG_RGB_B',0.08]",
|
||||
1
|
||||
};
|
||||
multiselectEnabled = 0;
|
||||
onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface));
|
||||
onTreeSelChanged = QUOTE([ARR_2('onTreeSelChanged',_this)] call FUNC(handleInterface));
|
||||
};
|
||||
class unitFrame: RscFrame {
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = TOOL_W * 2;
|
||||
h = safeZoneH - TOOL_H * 13;
|
||||
shadow = 2;
|
||||
colorText[] = {COL_FORE};
|
||||
};
|
||||
};
|
||||
};
|
||||
class helpWindow: RscControlsGroupNoScrollbars {
|
||||
idc = IDC_HELP;
|
||||
x = safeZoneX + safeZoneW - TOOL_W * 2;
|
||||
y = safeZoneY + TOOL_H * 6;
|
||||
w = TOOL_W * 2;
|
||||
h = safeZoneH - TOOL_H * 13;
|
||||
class controls {
|
||||
class helpTitle: RscText {
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = TOOL_W * 2;
|
||||
h = H_PART(1);
|
||||
style = 2;
|
||||
colorText[] = {COL_FORE};
|
||||
colorBackground[] = {COL_FORE_D};
|
||||
sizeEx = H_PART(1);
|
||||
text = CSTRING(HelpTitle);
|
||||
};
|
||||
class helpContent: RscListBox {
|
||||
idc = IDC_HELP_LIST;
|
||||
x = 0;
|
||||
y = H_PART(1);
|
||||
w = TOOL_W * 2;
|
||||
h = safeZoneH - TOOL_H * 14;
|
||||
colorBackground[] = {COL_BACK};
|
||||
sizeEx = H_PART(0.8);
|
||||
default = 1;
|
||||
};
|
||||
class helpFrame: RscFrame {
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = TOOL_W * 2;
|
||||
h = safeZoneH - TOOL_H * 13;
|
||||
shadow = 2;
|
||||
colorText[] = {COL_FORE};
|
||||
};
|
||||
};
|
||||
};
|
||||
class mapOverlay: RscMapControl {
|
||||
idc = IDC_MAP;
|
||||
type = 100;
|
||||
x = safeZoneX;
|
||||
y = safeZoneY;
|
||||
w = safeZoneW;
|
||||
h = safeZoneH;
|
||||
onMouseButtonDown = QUOTE([ARR_2('onMapClick',_this)] call FUNC(handleInterface));
|
||||
onDraw = QUOTE(_this call FUNC(handleMap));
|
||||
};
|
||||
};
|
||||
};
|
10
addons/spectator/XEH_postInit.sqf
Normal file
10
addons/spectator/XEH_postInit.sqf
Normal file
@ -0,0 +1,10 @@
|
||||
#include "script_component.hpp"
|
||||
//#include "initKeybinds.sqf";
|
||||
|
||||
// Add interaction menu exception
|
||||
["isNotSpectating", {!(GETVAR((_this select 0),GVAR(isStaged),false))}] call EFUNC(common,addCanInteractWithCondition);
|
||||
|
||||
["SettingsInitialized", {
|
||||
GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes);
|
||||
GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions);
|
||||
}] call EFUNC(common,addEventHandler);
|
59
addons/spectator/XEH_preInit.sqf
Normal file
59
addons/spectator/XEH_preInit.sqf
Normal file
@ -0,0 +1,59 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(cacheUnitInfo);
|
||||
PREP(cycleCamera);
|
||||
PREP(handleCamera);
|
||||
PREP(handleCompass);
|
||||
PREP(handleIcons);
|
||||
PREP(handleInterface);
|
||||
PREP(handleMap);
|
||||
PREP(handleMouse);
|
||||
PREP(handleToolbar);
|
||||
PREP(handleUnits);
|
||||
PREP(interrupt);
|
||||
PREP(moduleSpectatorSettings);
|
||||
PREP(respawnTemplate);
|
||||
PREP(setCameraAttributes);
|
||||
PREP(setSpectator);
|
||||
PREP(stageSpectator);
|
||||
PREP(transitionCamera);
|
||||
PREP(toggleInterface);
|
||||
PREP(updateCameraModes);
|
||||
PREP(updateSpectatableSides);
|
||||
PREP(updateUnits);
|
||||
PREP(updateVisionModes);
|
||||
|
||||
// Permanent variables
|
||||
GVAR(availableModes) = [0,1,2];
|
||||
GVAR(availableSides) = [west,east,resistance,civilian];
|
||||
GVAR(availableVisions) = [-2,-1,0,1];
|
||||
|
||||
GVAR(camAgent) = objNull;
|
||||
GVAR(camMode) = 0;
|
||||
GVAR(camPan) = 0;
|
||||
GVAR(camPos) = ATLtoASL [worldSize * 0.5, worldSize * 0.5, 20];
|
||||
GVAR(camSpeed) = 2.5;
|
||||
GVAR(camTilt) = -10;
|
||||
GVAR(camUnit) = objNull;
|
||||
GVAR(camVision) = -2;
|
||||
GVAR(camZoom) = 1.25;
|
||||
|
||||
GVAR(interrupts) = [];
|
||||
GVAR(isSet) = false;
|
||||
|
||||
GVAR(showComp) = true;
|
||||
GVAR(showHelp) = true;
|
||||
GVAR(showIcons) = true;
|
||||
GVAR(showInterface) = true;
|
||||
GVAR(showMap) = false;
|
||||
GVAR(showTool) = true;
|
||||
GVAR(showUnit) = true;
|
||||
|
||||
GVAR(unitList) = [];
|
||||
GVAR(unitBlacklist) = [];
|
||||
GVAR(unitWhitelist) = [];
|
||||
GVAR(groupList) = [];
|
||||
|
||||
ADDON = true;
|
25
addons/spectator/config.cpp
Normal file
25
addons/spectator/config.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"F3 Project","Head","SilentSpike","voiper"};
|
||||
authorUrl = "https://github.com/acemod";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "ACE_Settings.hpp"
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
#include "ui\interface.hpp"
|
||||
|
||||
class CfgRespawnTemplates {
|
||||
class ADDON {
|
||||
onPlayerKilled = QFUNC(respawnTemplate);
|
||||
onPlayerRespawn = QFUNC(respawnTemplate);
|
||||
};
|
||||
};
|
38
addons/spectator/functions/fnc_cacheUnitInfo.sqf
Normal file
38
addons/spectator/functions/fnc_cacheUnitInfo.sqf
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Caches the units information for quick retrevial in spectator interface PFHs
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit to have info cached for <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [vehicle player] call ace_spectator_fnc_cacheUnitInfo
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
private ["_color","_icon","_name"];
|
||||
|
||||
// Group info only needs to be cached once (groups can't change)
|
||||
if (isNil { GETVAR((group _unit),GVAR(gColor),nil) }) then {
|
||||
_color = [side group _unit] call BIS_fnc_sideColor;
|
||||
SETVAR((group _unit),GVAR(gColor),_color);
|
||||
};
|
||||
|
||||
// Unit info should be updated each time
|
||||
_icon = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "Icon");
|
||||
_name = [_unit,false] call EFUNC(common,getName);
|
||||
|
||||
// Handle CfgVehicleIcons
|
||||
if (isText (configFile >> "CfgVehicleIcons" >> _icon)) then {
|
||||
_icon = getText (configFile >> "CfgVehicleIcons" >> _icon);
|
||||
};
|
||||
|
||||
SETVAR(_unit,GVAR(uIcon),_icon);
|
||||
SETVAR(_unit,GVAR(uName),_name);
|
58
addons/spectator/functions/fnc_cycleCamera.sqf
Normal file
58
addons/spectator/functions/fnc_cycleCamera.sqf
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Cycle through the spectator camera vision/view/units in steps
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Camera mode steps <NUMBER>
|
||||
* 1: Camera unit steps <NUMBER>
|
||||
* 2: Vision mode steps <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [0, -1] call ace_spectator_fnc_cycleCamera
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_stepMode",0], ["_stepUnit",0], ["_stepVision",0]];
|
||||
private ["_modes","_visions","_iMode","_iVision","_countModes","_countVisions","_newMode","_newVision","_newUnit"];
|
||||
|
||||
_modes = GVAR(availableModes);
|
||||
_units = GVAR(unitList);
|
||||
_visions = GVAR(availableVisions);
|
||||
|
||||
// Get current index
|
||||
_iMode = (_modes find GVAR(camMode)) max 0;
|
||||
_iUnit = (_units find GVAR(camUnit)) max 0;
|
||||
_iVision = (_visions find GVAR(camVision)) max 0;
|
||||
|
||||
_countModes = count _modes;
|
||||
_countUnits = count _units;
|
||||
_countVisions = count _visions;
|
||||
|
||||
// Step index by step number (loop at ends)
|
||||
if (_countModes != 0) then {
|
||||
_iMode = (_iMode + _stepMode) % _countModes;
|
||||
if (_iMode < 0) then { _iMode = _countModes + _iMode; };
|
||||
};
|
||||
|
||||
if (_countUnits != 0) then {
|
||||
_iUnit = (_iUnit + _stepUnit) % _countUnits;
|
||||
if (_iUnit < 0) then { _iUnit = _countUnits + _iUnit; };
|
||||
};
|
||||
|
||||
if (_countVisions != 0) then {
|
||||
_iVision = (_iVision + _stepVision) % _countVisions;
|
||||
if (_iVision < 0) then { _iVision = _countVisions + _iVision; };
|
||||
};
|
||||
|
||||
// Get value at new index
|
||||
_newMode = _modes select _iMode;
|
||||
_newUnit = _units select _iUnit;
|
||||
_newVision = _visions select _iVision;
|
||||
|
||||
[_newMode, _newUnit, _newVision] call FUNC(transitionCamera);
|
48
addons/spectator/functions/fnc_handleCamera.sqf
Normal file
48
addons/spectator/functions/fnc_handleCamera.sqf
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Author: F3 Project, Head, SilentSpike
|
||||
* Handles free camera manipulation according to input
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleCamera, 0] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
// Kill PFH when not in free cam (or display is closed)
|
||||
if (isNil QGVAR(camHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
|
||||
private ["_camera","_oldPos","_altMod","_zoomMod","_mX","_mY","_mZ","_pan","_x","_y","_z"];
|
||||
|
||||
_camera = GVAR(camera);
|
||||
_oldPos = getPosASL _camera;
|
||||
|
||||
// Dolly/Boom amount should be influnced by zoom level (it should really be exponential)
|
||||
// Dollying should also slow as the camera gets close to the ground
|
||||
_zoomMod = (GVAR(camZoom) * 0.8) max 1;
|
||||
_altMod = ((((getPos _camera) select 2) * 0.05) max 0.1) min 1;
|
||||
|
||||
_mX = (GVAR(camDolly) select 0) * _altMod / _zoomMod;
|
||||
_mY = (GVAR(camDolly) select 1) * _altMod / _zoomMod;
|
||||
_mZ = GVAR(camBoom) / _zoomMod;
|
||||
|
||||
_pan = (GVAR(camPan) + 360) % 360;
|
||||
_x = (_oldPos select 0) + (_mX * cos(_pan)) + (_mY * sin(_pan));
|
||||
_y = (_oldPos select 1) - (_mX * sin(_pan)) + (_mY * cos(_pan));
|
||||
_z = (_oldPos select 2) + _mZ;
|
||||
|
||||
// Prevent camera going under terrain
|
||||
GVAR(camPos) = [_x,_y,_z max (getTerrainHeightASL [_x,_y])];
|
||||
|
||||
// Update camera position and rotation
|
||||
_camera setPosASL GVAR(camPos);
|
||||
_camera setDir GVAR(camPan);
|
||||
[_camera, GVAR(camTilt), 0] call BIS_fnc_setPitchBank;
|
67
addons/spectator/functions/fnc_handleCompass.sqf
Normal file
67
addons/spectator/functions/fnc_handleCompass.sqf
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Author: SilentSpike, voiper
|
||||
* Handles the spectator UI compass
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleCompass, 0, _display] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
// Kill PFH when compass hidden (or display is closed)
|
||||
if (isNil QGVAR(compHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
|
||||
private ["_compass","_NE","_ES","_SW","_WN","_compassW","_degree","_heading","_offset","_positions","_sequence"];
|
||||
|
||||
_compass = _display displayCtrl IDC_COMP;
|
||||
|
||||
_NE = _compass controlsGroupCtrl IDC_COMP_0;
|
||||
_ES = _compass controlsGroupCtrl IDC_COMP_90;
|
||||
_SW = _compass controlsGroupCtrl IDC_COMP_180;
|
||||
_WN = _compass controlsGroupCtrl IDC_COMP_270;
|
||||
|
||||
_compassW = (ctrlPosition _compass) select 2;
|
||||
_degree = _compassW / 180;
|
||||
|
||||
// Get direction of screen rather than object (accounts for unit freelook)
|
||||
_heading = (positionCameraToWorld [0,0,1]) vectorDiff (positionCameraToWorld [0,0,0]);
|
||||
_heading = (((_heading select 0) atan2 (_heading select 1)) + 360) % 360;
|
||||
_offset = -(_heading % 90) * _degree;
|
||||
|
||||
_positions = [
|
||||
[_compassW * -0.5 + _offset, 0],
|
||||
[_offset, 0],
|
||||
[_compassW * 0.5 + _offset, 0],
|
||||
[_compassW + _offset, 0]
|
||||
];
|
||||
|
||||
_sequence = if (_heading < 90) then {
|
||||
[_SW, _WN, _NE, _ES]
|
||||
} else {
|
||||
if (_heading < 180) then {
|
||||
[_WN, _NE, _ES, _SW]
|
||||
} else {
|
||||
if (_heading < 270) then {
|
||||
[_NE, _ES, _SW, _WN]
|
||||
} else {
|
||||
[_ES, _SW, _WN, _NE]
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
{
|
||||
_x ctrlSetPosition (_positions select _forEachIndex);
|
||||
_x ctrlCommit 0;
|
||||
} forEach _sequence;
|
46
addons/spectator/functions/fnc_handleIcons.sqf
Normal file
46
addons/spectator/functions/fnc_handleIcons.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Author: Head, SilentSpike
|
||||
* Handles rendering the spectator 3D unit icons
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
if !(GVAR(showIcons)) exitWith {};
|
||||
private ["_refPoint","_drawVehicles","_leader","_color","_txt","_unit"];
|
||||
|
||||
// Draw groups unless leader is within distance
|
||||
_refPoint = [GVAR(camera),GVAR(camUnit)] select (GVAR(camMode) > 0);
|
||||
_drawVehicles = [];
|
||||
{
|
||||
_leader = leader _x;
|
||||
if ((_leader distanceSqr _refPoint) > 40000) then {
|
||||
_color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]);
|
||||
_txt = groupID _x;
|
||||
|
||||
drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader modelToWorldVisual [0,0,30], 1, 1, 0, _txt, 2, 0.02];
|
||||
} else {
|
||||
_drawVehicles append (units _x);
|
||||
};
|
||||
false
|
||||
} count GVAR(groupList);
|
||||
|
||||
// Draw units for groups within distance
|
||||
{
|
||||
_color = GETVAR((group _x),GVAR(gColor),[ARR_4(0,0,0,0)]);
|
||||
_txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x);
|
||||
|
||||
drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _color, _x modelToWorldVisual [0,0,3], 0.7, 0.7, 0, _txt, 1, 0.02];
|
||||
false
|
||||
} count (_drawVehicles arrayIntersect GVAR(unitList));
|
493
addons/spectator/functions/fnc_handleInterface.sqf
Normal file
493
addons/spectator/functions/fnc_handleInterface.sqf
Normal file
@ -0,0 +1,493 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Handles spectator interface events
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Event name <STRING>
|
||||
* 1: Event arguments <ANY>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* ["onLoad",_this] call ace_spectator_fnc_handleInterface
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_mode",["_args",[]]];
|
||||
|
||||
switch (toLower _mode) do {
|
||||
case "onload": {
|
||||
_args params ["_display"];
|
||||
|
||||
// Always show interface and hide map upon opening
|
||||
[_display,nil,nil,!GVAR(showInterface),GVAR(showMap)] call FUNC(toggleInterface);
|
||||
|
||||
// Keep unit list and tree up to date
|
||||
[FUNC(handleUnits), 21, _display] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
// Handle 3D unit icons
|
||||
GVAR(iconHandler) = addMissionEventHandler ["Draw3D",FUNC(handleIcons)];
|
||||
|
||||
// Populate the help window
|
||||
private "_help";
|
||||
_help = (_display displayCtrl IDC_HELP) controlsGroupCtrl IDC_HELP_LIST;
|
||||
{
|
||||
_i = _help lbAdd (_x select 0);
|
||||
if ((_x select 1) == "") then {
|
||||
_help lbSetPicture [_i,"\A3\ui_f\data\map\markers\military\dot_CA.paa"];
|
||||
_help lbSetPictureColor [_i,[COL_FORE]];
|
||||
} else {
|
||||
_help lbSetTooltip [_i,_x select 1];
|
||||
};
|
||||
} forEach [
|
||||
[localize LSTRING(uiControls),""],
|
||||
[localize LSTRING(uiToggleUnits),"1"],
|
||||
[localize LSTRING(uiToggleHelp),"2"],
|
||||
[localize LSTRING(uiToggleTools),"3"],
|
||||
[localize LSTRING(uiToggleCompass),"4"],
|
||||
[localize LSTRING(uiToggleIcons),"5"],
|
||||
[localize LSTRING(uiToggleMap),"M"],
|
||||
[localize LSTRING(uiToggleInterface),"Backspace"],
|
||||
[localize LSTRING(freeCamControls),""],
|
||||
[localize LSTRING(freeCamForward),"W"],
|
||||
[localize LSTRING(freeCamBackward),"S"],
|
||||
[localize LSTRING(freeCamLeft),"A"],
|
||||
[localize LSTRING(freeCamRight),"D"],
|
||||
[localize LSTRING(freeCamUp),"Q"],
|
||||
[localize LSTRING(freeCamDown),"Z"],
|
||||
[localize LSTRING(freeCamPan),"RMB (Hold)"],
|
||||
[localize LSTRING(freeCamDolly),"LMB (Hold)"],
|
||||
[localize LSTRING(freeCamBoost),"Shift (Hold)"],
|
||||
[localize LSTRING(freeCamFocus),"F"],
|
||||
[localize LSTRING(attributeControls),""],
|
||||
[localize LSTRING(nextCam),"Up Arrow"],
|
||||
[localize LSTRING(prevCam),"Down Arrow"],
|
||||
[localize LSTRING(nextUnit),"Right Arrow"],
|
||||
[localize LSTRING(prevUnit),"Left Arrow"],
|
||||
[localize LSTRING(nextVis),"N"],
|
||||
[localize LSTRING(prevVis),"Ctrl + N"],
|
||||
[localize LSTRING(adjZoom),"Scrollwheel"],
|
||||
[localize LSTRING(adjSpeed),"Ctrl + Scrollwheel"],
|
||||
[localize LSTRING(incZoom),"Num-/Num+"],
|
||||
[localize LSTRING(incSpeed),"Ctrl + Num-/Num+"],
|
||||
[localize LSTRING(reZoom),"Alt + Num-"],
|
||||
[localize LSTRING(reSpeed),"Alt + Num+"]
|
||||
];
|
||||
|
||||
// Handle support for BI's respawn counter
|
||||
[{
|
||||
if !(isNull (GETUVAR(RscRespawnCounter,displayNull))) then {
|
||||
disableSerialization;
|
||||
private ["_counter","_title","_back","_timer","_frame","_x","_y"];
|
||||
_counter = GETUVAR(RscRespawnCounter,displayNull);
|
||||
_title = _counter displayCtrl 1001;
|
||||
_back = _counter displayCtrl 1002;
|
||||
_timer = _counter displayCtrl 1003;
|
||||
_frame = _counter ctrlCreate ["RscFrame",1008];
|
||||
|
||||
_x = safeZoneX + safeZoneW - TOOL_W * 4 - MARGIN * 3;
|
||||
_y = safeZoneY + safeZoneH - TOOL_H;
|
||||
|
||||
// Timer
|
||||
_title ctrlSetPosition [_x,_y,TOOL_W,TOOL_H];
|
||||
_back ctrlSetPosition [_x,_y,TOOL_W,TOOL_H];
|
||||
_timer ctrlSetPosition [_x,_y,TOOL_W,TOOL_H];
|
||||
_frame ctrlSetPosition [_x,_y,TOOL_W,TOOL_H];
|
||||
|
||||
_title ctrlSetBackgroundColor [0,0,0,0];
|
||||
_back ctrlSetBackgroundColor [COL_BACK];
|
||||
_timer ctrlSetFontHeight TOOL_H;
|
||||
_frame ctrlSetTextColor [COL_FORE];
|
||||
|
||||
_title ctrlCommit 0;
|
||||
_back ctrlCommit 0;
|
||||
_timer ctrlCommit 0;
|
||||
_frame ctrlCommit 0;
|
||||
};
|
||||
},[],0.5] call EFUNC(common,waitAndExecute);
|
||||
};
|
||||
case "onunload": {
|
||||
// Kill GUI PFHs
|
||||
removeMissionEventHandler ["Draw3D",GVAR(iconHandler)];
|
||||
GVAR(camHandler) = nil;
|
||||
GVAR(compHandler) = nil;
|
||||
GVAR(iconHandler) = nil;
|
||||
GVAR(toolHandler) = nil;
|
||||
|
||||
// Reset variables
|
||||
GVAR(camBoom) = 0;
|
||||
GVAR(camDolly) = [0,0];
|
||||
GVAR(ctrlKey) = false;
|
||||
GVAR(heldKeys) = [];
|
||||
GVAR(heldKeys) resize 255;
|
||||
GVAR(mouse) = [false,false];
|
||||
GVAR(mousePos) = [0.5,0.5];
|
||||
GVAR(treeSel) = objNull;
|
||||
};
|
||||
// Mouse events
|
||||
case "onmousebuttondown": {
|
||||
_args params ["_ctrl","_button"];
|
||||
GVAR(mouse) set [_button,true];
|
||||
|
||||
// Detect right click
|
||||
if ((_button == 1) && (GVAR(camMode) == 1)) then {
|
||||
// In first person toggle sights mode
|
||||
GVAR(camGun) = !GVAR(camGun);
|
||||
[] call FUNC(transitionCamera);
|
||||
};
|
||||
};
|
||||
case "onmousebuttonup": {
|
||||
_args params ["_ctrl","_button"];
|
||||
|
||||
GVAR(mouse) set [_button,false];
|
||||
if (_button == 0) then { GVAR(camDolly) = [0,0]; };
|
||||
};
|
||||
case "onmousezchanged": {
|
||||
_args params ["_ctrl","_zChange"];
|
||||
|
||||
// Scroll to change speed, modifier for zoom
|
||||
if (GVAR(ctrlKey)) then {
|
||||
[nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + _zChange * 0.2] call FUNC(setCameraAttributes);
|
||||
} else {
|
||||
[nil,nil,nil,nil,nil,nil, GVAR(camZoom) + _zChange * 0.1] call FUNC(setCameraAttributes);
|
||||
};
|
||||
};
|
||||
case "onmousemoving": {
|
||||
_args params ["_ctrl","_x","_y"];
|
||||
|
||||
[_x,_y] call FUNC(handleMouse);
|
||||
};
|
||||
// Keyboard events
|
||||
case "onkeydown": {
|
||||
_args params ["_display","_dik","_shift","_ctrl","_alt"];
|
||||
|
||||
if ((alive player) && {_dik in (actionKeys "curatorInterface")} && {!isNull (getAssignedCuratorLogic player)}) exitWith {
|
||||
[QGVAR(zeus)] call FUNC(interrupt);
|
||||
["zeus"] call FUNC(handleInterface);
|
||||
};
|
||||
if ((isServer || {serverCommandAvailable "#kick"}) && {_dik in (actionKeys "Chat" + actionKeys "PrevChannel" + actionKeys "NextChannel")}) exitWith {
|
||||
false
|
||||
};
|
||||
|
||||
// Handle held keys (prevent repeat calling)
|
||||
if (GVAR(heldKeys) param [_dik,false]) exitwith {};
|
||||
// Exclude movement/adjustment keys so that speed can be adjusted on fly
|
||||
if !(_dik in [16,17,30,31,32,44,74,78]) then {
|
||||
GVAR(heldKeys) set [_dik,true];
|
||||
};
|
||||
|
||||
switch (_dik) do {
|
||||
case 1: { // Esc
|
||||
[QGVAR(escape)] call FUNC(interrupt);
|
||||
["escape"] call FUNC(handleInterface);
|
||||
};
|
||||
case 2: { // 1
|
||||
[_display,nil,nil,nil,nil,nil,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 3: { // 2
|
||||
[_display,nil,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 4: { // 3
|
||||
[_display,nil,nil,nil,nil,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 5: { // 4
|
||||
[_display,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 6: { // 5
|
||||
GVAR(showIcons) = !GVAR(showIcons);
|
||||
};
|
||||
case 14: { // Backspace
|
||||
[_display,nil,nil,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 16: { // Q
|
||||
GVAR(camBoom) = 0.5 * GVAR(camSpeed) * ([1, 2] select _shift);
|
||||
};
|
||||
case 17: { // W
|
||||
GVAR(camDolly) set [1, GVAR(camSpeed) * ([1, 2] select _shift)];
|
||||
};
|
||||
case 29: { // Ctrl
|
||||
GVAR(ctrlKey) = true;
|
||||
};
|
||||
case 30: { // A
|
||||
GVAR(camDolly) set [0, -GVAR(camSpeed) * ([1, 2] select _shift)];
|
||||
};
|
||||
case 31: { // S
|
||||
GVAR(camDolly) set [1, -GVAR(camSpeed) * ([1, 2] select _shift)];
|
||||
};
|
||||
case 32: { // D
|
||||
GVAR(camDolly) set [0, GVAR(camSpeed) * ([1, 2] select _shift)];
|
||||
};
|
||||
case 33: { // F
|
||||
private ["_sel","_vector"];
|
||||
_sel = GVAR(treeSel);
|
||||
if ((GVAR(camMode) == 0) && {!isNull _sel} && {_sel in GVAR(unitList)}) then {
|
||||
_vector = (positionCameraToWorld [0,0,0]) vectorDiff (positionCameraToWorld [0,0,25]);
|
||||
[nil,nil,nil,(getPosATL _sel) vectorAdd _vector] call FUNC(setCameraAttributes);
|
||||
};
|
||||
};
|
||||
case 44: { // Z
|
||||
GVAR(camBoom) = -0.5 * GVAR(camSpeed) * ([1, 2] select _shift);
|
||||
};
|
||||
case 49: { // N
|
||||
if (GVAR(camMode) == 0) then {
|
||||
if (_ctrl) then {
|
||||
[nil,nil,-1] call FUNC(cycleCamera);
|
||||
} else {
|
||||
[nil,nil,1] call FUNC(cycleCamera);
|
||||
};
|
||||
};
|
||||
};
|
||||
case 50: { // M
|
||||
[_display,nil,nil,nil,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 57: { // Spacebar
|
||||
// Freecam attachment here, if in external then set cam pos and attach
|
||||
};
|
||||
case 74: { // Num -
|
||||
if (_alt) exitWith { [nil,nil,nil,nil,nil,nil, 1.25] call FUNC(setCameraAttributes); };
|
||||
if (_ctrl) then {
|
||||
[nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) - 0.05] call FUNC(setCameraAttributes);
|
||||
} else {
|
||||
[nil,nil,nil,nil,nil,nil, GVAR(camZoom) - 0.01] call FUNC(setCameraAttributes);
|
||||
};
|
||||
};
|
||||
case 78: { // Num +
|
||||
if (_alt) exitWith { [nil,nil,nil,nil,nil,nil,nil, 2.5] call FUNC(setCameraAttributes); };
|
||||
if (_ctrl) then {
|
||||
[nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + 0.05] call FUNC(setCameraAttributes);
|
||||
} else {
|
||||
[nil,nil,nil,nil,nil,nil, GVAR(camZoom) + 0.01] call FUNC(setCameraAttributes);
|
||||
};
|
||||
};
|
||||
case 200: { // Up arrow
|
||||
[-1] call FUNC(cycleCamera);
|
||||
};
|
||||
case 203: { // Left arrow
|
||||
[nil,1] call FUNC(cycleCamera);
|
||||
};
|
||||
case 205: { // Right arrow
|
||||
[nil,-1] call FUNC(cycleCamera);
|
||||
};
|
||||
case 208: { // Down arrow
|
||||
[1] call FUNC(cycleCamera);
|
||||
};
|
||||
};
|
||||
|
||||
true
|
||||
};
|
||||
case "onkeyup": {
|
||||
_args params ["_display","_dik","_shift","_ctrl","_alt"];
|
||||
|
||||
// No longer being held
|
||||
GVAR(heldKeys) set [_dik,nil];
|
||||
|
||||
switch (_dik) do {
|
||||
case 16: { // Q
|
||||
GVAR(camBoom) = 0;
|
||||
};
|
||||
case 17: { // W
|
||||
GVAR(camDolly) set [1, 0];
|
||||
};
|
||||
case 29: { // Ctrl
|
||||
GVAR(ctrlKey) = false;
|
||||
};
|
||||
case 30: { // A
|
||||
GVAR(camDolly) set [0, 0];
|
||||
};
|
||||
case 31: { // S
|
||||
GVAR(camDolly) set [1, 0];
|
||||
};
|
||||
case 32: { // D
|
||||
GVAR(camDolly) set [0, 0];
|
||||
};
|
||||
case 44: { // Z
|
||||
GVAR(camBoom) = 0;
|
||||
};
|
||||
};
|
||||
|
||||
true
|
||||
};
|
||||
// Tree events
|
||||
case "ontreedblclick": {
|
||||
// Update camera view when listbox unit is double clicked on
|
||||
_args params ["_tree","_sel"];
|
||||
|
||||
// Ensure a unit was selected
|
||||
if (count _sel == 3) then {
|
||||
private ["_netID","_newUnit","_newMode"];
|
||||
_netID = (_args select 0) tvData _sel;
|
||||
_newUnit = objectFromNetId _netID;
|
||||
|
||||
// When unit is reselected, toggle camera mode
|
||||
if (_newUnit == GVAR(camUnit) || GVAR(camMode) == 0) then {
|
||||
_newMode = [2,2,1] select GVAR(camMode);
|
||||
};
|
||||
|
||||
[_newMode,_newUnit] call FUNC(transitionCamera);
|
||||
};
|
||||
};
|
||||
case "ontreeselchanged": {
|
||||
_args params ["_tree","_sel"];
|
||||
|
||||
if (count _sel == 3) then {
|
||||
GVAR(treeSel) = objectFromNetId (_tree tvData _sel);
|
||||
} else {
|
||||
GVAR(treeSel) = objNull;
|
||||
};
|
||||
};
|
||||
case "onunitsupdate": {
|
||||
_args params ["_tree"];
|
||||
private ["_cachedUnits","_cachedGrps","_cachedSides","_s","_g","_grp","_u","_unit","_side"];
|
||||
|
||||
// Cache existing group and side nodes and cull removed data
|
||||
_cachedUnits = [];
|
||||
_cachedGrps = [];
|
||||
_cachedSides = [];
|
||||
for "_s" from 0 to ((_tree tvCount []) - 1) do {
|
||||
for "_g" from 0 to ((_tree tvCount [_s]) - 1) do {
|
||||
_grp = groupFromNetID (_tree tvData [_s,_g]);
|
||||
|
||||
if (_grp in GVAR(groupList)) then {
|
||||
_cachedGrps pushBack _grp;
|
||||
_cachedGrps pushBack _g;
|
||||
|
||||
for "_u" from 0 to ((_tree tvCount [_s,_g])) do {
|
||||
_unit = objectFromNetId (_tree tvData [_s,_g,_u]);
|
||||
|
||||
if (_unit in GVAR(unitList)) then {
|
||||
_cachedUnits pushBack _unit;
|
||||
} else {
|
||||
_tree tvDelete [_s,_g,_u];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_tree tvDelete [_s,_g];
|
||||
};
|
||||
};
|
||||
|
||||
if ((_tree tvCount [_s]) > 0) then {
|
||||
_cachedSides pushBack (_tree tvText [_s]);
|
||||
_cachedSides pushBack _s;
|
||||
} else {
|
||||
_tree tvDelete [_s];
|
||||
};
|
||||
};
|
||||
|
||||
// Update the tree from the unit list
|
||||
{
|
||||
_grp = group _x;
|
||||
_side = [side _grp] call BIS_fnc_sideName;
|
||||
|
||||
// Use correct side node
|
||||
if !(_side in _cachedSides) then {
|
||||
// Add side node
|
||||
_s = _tree tvAdd [[], _side];
|
||||
_tree tvExpand [_s];
|
||||
|
||||
_cachedSides pushBack _side;
|
||||
_cachedSides pushBack _s;
|
||||
} else {
|
||||
// If side already processed, use existing node
|
||||
_s = _cachedSides select ((_cachedSides find _side) + 1);
|
||||
};
|
||||
|
||||
// Use correct group node
|
||||
if !(_grp in _cachedGrps) then {
|
||||
// Add group node
|
||||
_g = _tree tvAdd [[_s], groupID _grp];
|
||||
_tree tvSetData [[_s,_g], netID _grp];
|
||||
|
||||
_cachedGrps pushBack _grp;
|
||||
_cachedGrps pushBack _g;
|
||||
} else {
|
||||
// If group already processed, use existing node
|
||||
_g = _cachedGrps select ((_cachedGrps find _grp) + 1);
|
||||
};
|
||||
|
||||
_u = _tree tvAdd [[_s,_g], GETVAR(_x,GVAR(uName),"")];
|
||||
_tree tvSetData [[_s,_g,_u], netID _x];
|
||||
_tree tvSetPicture [[_s,_g,_u], GETVAR(_x,GVAR(uIcon),"")];
|
||||
_tree tvSetPictureColor [[_s,_g,_u], GETVAR(_grp,GVAR(gColor),[ARR_4(1,1,1,1)])];
|
||||
|
||||
_tree tvSort [[_s,_g],false];
|
||||
} forEach (GVAR(unitList) - _cachedUnits);
|
||||
|
||||
_tree tvSort [[],false];
|
||||
|
||||
if ((_tree tvCount []) <= 0) then {
|
||||
_tree tvAdd [[], localize LSTRING(units_none)];
|
||||
};
|
||||
};
|
||||
// Map events
|
||||
case "onmapclick": {
|
||||
_args params ["_map","_button","_x","_y","_shift","_ctrl","_alt"];
|
||||
private ["_newPos","_oldZ"];
|
||||
|
||||
if ((GVAR(camMode) == 0) && (_button == 0)) then {
|
||||
_newPos = _map ctrlMapScreenToWorld [_x,_y];
|
||||
_oldZ = (ASLtoATL GVAR(camPos)) select 2;
|
||||
_newPos set [2, _oldZ];
|
||||
[nil,nil,nil, _newPos] call FUNC(setCameraAttributes);
|
||||
};
|
||||
};
|
||||
// Interrupt events
|
||||
case "escape": {
|
||||
private "_dlg";
|
||||
|
||||
createDialog (["RscDisplayInterrupt", "RscDisplayMPInterrupt"] select isMultiplayer);
|
||||
|
||||
disableSerialization;
|
||||
_dlg = finddisplay 49;
|
||||
_dlg displayAddEventHandler ["KeyDown", {
|
||||
_key = _this select 1;
|
||||
!(_key == 1)
|
||||
}];
|
||||
|
||||
// Disable save, respawn, options & manual buttons
|
||||
(_dlg displayCtrl 103) ctrlEnable false;
|
||||
if !(alive player) then {
|
||||
(_dlg displayCtrl 1010) ctrlEnable false;
|
||||
};
|
||||
(_dlg displayCtrl 101) ctrlEnable false;
|
||||
(_dlg displayCtrl 122) ctrlEnable false;
|
||||
|
||||
// Initalize abort button (the "spawn" is a necessary evil)
|
||||
(_dlg displayCtrl 104) ctrlAddEventHandler ["ButtonClick",{_this spawn {
|
||||
disableSerialization;
|
||||
_display = ctrlparent (_this select 0);
|
||||
_abort = [localize "str_msg_confirm_return_lobby",nil,localize "str_disp_xbox_hint_yes",localize "str_disp_xbox_hint_no",_display,nil,true] call BIS_fnc_guiMessage;
|
||||
if (_abort) then {_display closeDisplay 2; failMission "loser"};
|
||||
}}];
|
||||
|
||||
// PFH to re-open display when menu closes
|
||||
[{
|
||||
if !(isNull (findDisplay 49)) exitWith {};
|
||||
|
||||
// If still a spectator then re-enter the interface
|
||||
[QGVAR(escape),false] call FUNC(interrupt);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
},0] call CBA_fnc_addPerFrameHandler;
|
||||
};
|
||||
case "zeus": {
|
||||
openCuratorInterface;
|
||||
|
||||
[{
|
||||
// PFH to re-open display when menu closes
|
||||
[{
|
||||
if !((isNull curatorCamera) && {isNull (GETMVAR(bis_fnc_moduleRemoteControl_unit,objNull))}) exitWith {};
|
||||
|
||||
// If still a spectator then re-enter the interface
|
||||
[QGVAR(zeus),false] call FUNC(interrupt);
|
||||
|
||||
[_this select 1] call CBA_fnc_removePerFrameHandler;
|
||||
},0] call CBA_fnc_addPerFrameHandler;
|
||||
},[],5] call EFUNC(common,waitAndExecute);
|
||||
|
||||
true
|
||||
};
|
||||
};
|
47
addons/spectator/functions/fnc_handleMap.sqf
Normal file
47
addons/spectator/functions/fnc_handleMap.sqf
Normal file
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Author: Head, SilentSpike
|
||||
* Handles rendering the spectator map icons
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleIcons, 0] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_map"];
|
||||
private ["_cachedVehicles","_unit","_color","_icon","_txt"];
|
||||
|
||||
if (GVAR(camMode) == 0) then {
|
||||
_map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(camera),20,20,GVAR(camPan)];
|
||||
};
|
||||
|
||||
_cachedVehicles = [];
|
||||
{
|
||||
_unit = vehicle _x;
|
||||
|
||||
if !(_unit in _cachedVehicles) then {
|
||||
_cachedVehicles pushBack _unit;
|
||||
|
||||
// Use previously cached info where possible
|
||||
if (GETVAR(_unit,GVAR(uIcon),"") == "") then {
|
||||
[_unit] call FUNC(cacheUnitInfo);
|
||||
};
|
||||
|
||||
// Function has caching built in
|
||||
_color = [side effectiveCommander _unit] call BIS_fnc_sideColor;
|
||||
_icon = GETVAR(_unit,GVAR(uIcon),"");
|
||||
_txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x);
|
||||
|
||||
_map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit, _txt, 1, 0.03];
|
||||
};
|
||||
false
|
||||
} count GVAR(unitList);
|
46
addons/spectator/functions/fnc_handleMouse.sqf
Normal file
46
addons/spectator/functions/fnc_handleMouse.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Author: F3 Project, Head, SilentSpike
|
||||
* Processes the change in mouse position for the spectator camera
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Mouse x coord <NUMBER>
|
||||
* 1: Mouse y coord <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [0.5, 0.5] call ace_spectator_fnc_handleMouse;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_x","_y"];
|
||||
private ["_leftButton","_rightButton","_oldX","_oldY","_deltaX","_deltaY","_zoomMod"];
|
||||
|
||||
_leftButton = GVAR(mouse) select 0;
|
||||
_rightButton = GVAR(mouse) select 1;
|
||||
|
||||
_oldX = GVAR(mousePos) select 0;
|
||||
_oldY = GVAR(mousePos) select 1;
|
||||
|
||||
// Get change in pos
|
||||
_deltaX = _oldX - _x;
|
||||
_deltaY = _oldY - _y;
|
||||
|
||||
if (_leftButton) then {
|
||||
GVAR(camDolly) set [0, _deltaX * -100 * GVAR(camSpeed)];
|
||||
GVAR(camDolly) set [1, _deltaY * 100 * GVAR(camSpeed)];
|
||||
} else {
|
||||
if (_rightButton) then {
|
||||
// Pan/Tilt amount should be influnced by zoom level (it should really be exponential)
|
||||
_zoomMod = (GVAR(camZoom) * 0.8) max 1;
|
||||
|
||||
GVAR(camPan) = GVAR(camPan) - ((_deltaX * 360) / _zoomMod);
|
||||
GVAR(camTilt) = ((GVAR(camTilt) + ((_deltaY * 180) / _zoomMod)) min 89) max -89;
|
||||
};
|
||||
};
|
||||
|
||||
GVAR(mousePos) = [_x,_y];
|
54
addons/spectator/functions/fnc_handleToolbar.sqf
Normal file
54
addons/spectator/functions/fnc_handleToolbar.sqf
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Author: Karel Moricky, SilentSpike
|
||||
* Handles the spectator UI toolbar values
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleToolbar, 0, _display] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
// Kill PFH when toolbar hidden (or display is closed)
|
||||
if (isNil QGVAR(toolHandler)) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
|
||||
private ["_name","_vision","_fov","_speed","_mode","_time","_toolbar"];
|
||||
_toolbar = _display displayCtrl IDC_TOOL;
|
||||
|
||||
// Find all tool values
|
||||
if (GVAR(camMode) == 0) then {
|
||||
_vision = if (GVAR(camVision) >= 0) then {localize LSTRING(VisionThermal)} else { [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1) };
|
||||
_fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01];
|
||||
_speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01];
|
||||
} else {
|
||||
_vision = [side group GVAR(camUnit)] call BIS_fnc_sideName;
|
||||
_fov = format ["%1 m", floor(getPosASL GVAR(camUnit) select 2)];
|
||||
_speed = format ["%1 km/h", floor(speed GVAR(camUnit)) max 0];
|
||||
};
|
||||
|
||||
if (alive GVAR(camUnit)) then {
|
||||
_name = GETVAR(GVAR(camUnit),GVAR(uName),"");
|
||||
} else {
|
||||
_name = localize "STR_Special_None";
|
||||
};
|
||||
|
||||
_mode = [localize LSTRING(ViewFree),localize LSTRING(ViewInternal),localize LSTRING(ViewExternal)] select GVAR(camMode);
|
||||
_time = [daytime,"HH:MM"] call BIS_fnc_timeToString;
|
||||
|
||||
// Update the UI tools
|
||||
(_toolbar controlsGroupCtrl IDC_TOOL_CLOCK) ctrlSetText _time;
|
||||
(_toolbar controlsGroupCtrl IDC_TOOL_VISION) ctrlSetText _vision;
|
||||
(_toolbar controlsGroupCtrl IDC_TOOL_FOV) ctrlSetText _fov;
|
||||
(_toolbar controlsGroupCtrl IDC_TOOL_NAME) ctrlSetText _name;
|
||||
(_toolbar controlsGroupCtrl IDC_TOOL_SPEED) ctrlSetText _speed;
|
||||
(_toolbar controlsGroupCtrl IDC_TOOL_VIEW) ctrlSetText _mode;
|
40
addons/spectator/functions/fnc_handleUnits.sqf
Normal file
40
addons/spectator/functions/fnc_handleUnits.sqf
Normal file
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Maintains the spectatable unit list and updates the unit tree accordingly
|
||||
* Also updates current camera unit when status changes
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Parameters <ANY>
|
||||
* 1: PFH handle <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [ace_spectator_fnc_handleUnits, 10, _display] call CBA_fnc_addPerFrameHandler;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_display"];
|
||||
|
||||
// Kill PFH when display is closed
|
||||
if (isNull _display) exitWith { [_this select 1] call CBA_fnc_removePerFrameHandler; };
|
||||
|
||||
// Remove all dead and null units from the list
|
||||
[] call FUNC(updateUnits);
|
||||
|
||||
// Camera shouldn't stay on unit that isn't in the list (unless dead)
|
||||
if !(GVAR(camUnit) in GVAR(unitList)) then {
|
||||
if (alive GVAR(camUnit) || isNull GVAR(camUnit)) then {
|
||||
[nil,1] call FUNC(cycleCamera);
|
||||
};
|
||||
};
|
||||
|
||||
// Reduce overhead when unit tree is hidden
|
||||
if (ctrlShown (_display displayCtrl IDC_UNIT)) then {
|
||||
// Reduce overhead by spreading across frames
|
||||
[FUNC(handleInterface),["onUnitsUpdate",[(_display displayCtrl IDC_UNIT) controlsGroupCtrl IDC_UNIT_TREE]],1] call EFUNC(common,waitAndExecute);
|
||||
};
|
44
addons/spectator/functions/fnc_interrupt.sqf
Normal file
44
addons/spectator/functions/fnc_interrupt.sqf
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Interrupts the spectator interface for external systems
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Reason <STRING>
|
||||
* 1: Interrupting <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* ["mySystem"] call ace_spectator_fnc_interrupt
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_reason", "", [""]], ["_interrupt", true, [true]]];
|
||||
|
||||
// Nothing to do when spectator is closed
|
||||
if !(GVAR(isSet)) exitWith {};
|
||||
|
||||
if (_reason == "") exitWith { ERROR("Invalid Reason"); };
|
||||
if (_interrupt) then {
|
||||
GVAR(interrupts) pushBack _reason;
|
||||
} else {
|
||||
GVAR(interrupts) = GVAR(interrupts) - [_reason];
|
||||
};
|
||||
|
||||
if (GVAR(interrupts) isEqualTo []) then {
|
||||
if (isNull (findDisplay 12249)) then {
|
||||
createDialog QGVAR(interface);
|
||||
[] call FUNC(transitionCamera);
|
||||
};
|
||||
} else {
|
||||
if !(isNull (findDisplay 12249)) then {
|
||||
while {dialog} do {
|
||||
closeDialog 0;
|
||||
};
|
||||
|
||||
(findDisplay 12249) closeDisplay 0;
|
||||
};
|
||||
};
|
25
addons/spectator/functions/fnc_moduleSpectatorSettings.sqf
Normal file
25
addons/spectator/functions/fnc_moduleSpectatorSettings.sqf
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Read spectator settings from module
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The module logic <LOGIC>
|
||||
* 1: units <ARRAY>
|
||||
* 2: activated <BOOL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(filterUnits), "unitsFilter"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(filterSides), "sidesFilter"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(restrictModes), "cameraModes"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(restrictVisions), "visionModes"] call EFUNC(common,readSettingFromModule);
|
44
addons/spectator/functions/fnc_respawnTemplate.sqf
Normal file
44
addons/spectator/functions/fnc_respawnTemplate.sqf
Normal file
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* The ace_spectator respawn template, handles killed + respawn
|
||||
* Can be used via BI's respawn framework, see:
|
||||
* https://community.bistudio.com/wiki/Arma_3_Respawn
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Corpse/New Unit <OBJECT>
|
||||
* 1: Killer/Old Unit <OBJECT>
|
||||
* 2: Respawn Type <NUMBER>
|
||||
* 3: Respawn Delay <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_unit",objNull,[objNull]], ["_killer",objNull,[objNull]], ["_respawn",0,[0]], ["_respawnDelay",0,[0]]];
|
||||
private ["_vision","_pos"];
|
||||
|
||||
// End mission when all are dead with respawn type "None"
|
||||
if ((_respawn == 0) && {{alive _x} count allPlayers <= 0}) exitWith {
|
||||
[["endDeath",false],"BIS_fnc_endMission"] call EFUNC(common,execRemoteFnc);
|
||||
};
|
||||
|
||||
if (isNull _killer) then {_killer = _unit};
|
||||
_vision = [-2,-1] select (sunOrMoon < 1);
|
||||
_pos = (getPosATL _unit) vectorAdd [0,0,5];
|
||||
|
||||
if (alive _unit) then {
|
||||
if (_respawn == 1) then {
|
||||
[_unit,QGVAR(isSeagull)] call EFUNC(common,hideUnit);
|
||||
[2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes);
|
||||
[true] call FUNC(setSpectator);
|
||||
} else {
|
||||
[false] call FUNC(setSpectator);
|
||||
};
|
||||
} else {
|
||||
[2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes);
|
||||
[true] call FUNC(setSpectator);
|
||||
};
|
67
addons/spectator/functions/fnc_setCameraAttributes.sqf
Normal file
67
addons/spectator/functions/fnc_setCameraAttributes.sqf
Normal file
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Sets the spectator camera attributes as desired
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Camera mode <NUMBER> <OPTIONAL>
|
||||
* - 0: Free
|
||||
* - 1: Internal
|
||||
* - 2: External
|
||||
* 1: Camera unit (objNull for random) <OBJECT> <OPTIONAL>
|
||||
* 2: Camera vision <NUMBER> <OPTIONAL>
|
||||
* - -2: Normal
|
||||
* - -1: Night vision
|
||||
* - 0: Thermal white hot
|
||||
* - 1: Thermal black hot
|
||||
* 3: Camera position (ATL) <ARRAY> <OPTIONAL>
|
||||
* 4: Camera pan (0 - 360) <NUMBER> <OPTIONAL>
|
||||
* 5: Camera tilt (-90 - 90) <NUMBER> <OPTIONAL>
|
||||
* 6: Camera zoom (0.01 - 2) <NUMBER> <OPTIONAL>
|
||||
* 7: Camera speed in m/s (0.05 - 10) <NUMBER> <OPTIONAL>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
*
|
||||
* Example:
|
||||
* [1, objNull] call ace_spectator_fnc_setCameraAttributes
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [
|
||||
["_mode",GVAR(camMode),[0]],
|
||||
["_unit",GVAR(camUnit),[objNull]],
|
||||
["_vision",GVAR(camVision),[0]],
|
||||
["_position",ASLtoATL GVAR(camPos),[[]],3],
|
||||
["_heading",GVAR(camPan),[0]],
|
||||
["_tilt",GVAR(camTilt),[0]],
|
||||
["_zoom",GVAR(camZoom),[0]],
|
||||
["_speed",GVAR(camSpeed),[0]]
|
||||
];
|
||||
|
||||
// Normalize input
|
||||
if !(_mode in GVAR(availableModes)) then {
|
||||
_mode = GVAR(availableModes) select ((GVAR(availableModes) find GVAR(camMode)) max 0);
|
||||
};
|
||||
|
||||
if !(_vision in GVAR(availableVisions)) then {
|
||||
_vision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0);
|
||||
};
|
||||
|
||||
GVAR(camPan) = _heading % 360;
|
||||
GVAR(camSpeed) = (_speed max 0.05) min 10;
|
||||
GVAR(camTilt) = (_tilt max -89) min 89;
|
||||
GVAR(camUnit) = _unit;
|
||||
GVAR(camVision) = _vision;
|
||||
GVAR(camZoom) = (_zoom min 2) max 0.01;
|
||||
|
||||
// Apply if camera exists
|
||||
if (isNil QGVAR(camera)) then {
|
||||
GVAR(camMode) = _mode;
|
||||
GVAR(camPos) = (ATLtoASL _position);
|
||||
} else {
|
||||
[_mode,_unit,_vision] call FUNC(transitionCamera);
|
||||
GVAR(camera) setPosATL _position;
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user