diff --git a/addons/apl/data/default_vehicle_ti_ca.paa b/addons/apl/data/default_vehicle_ti_ca.paa new file mode 100644 index 0000000000..53ca8a62b7 Binary files /dev/null and b/addons/apl/data/default_vehicle_ti_ca.paa differ diff --git a/addons/apl/sounds/padak_let.wss b/addons/apl/sounds/padak_let.wss new file mode 100644 index 0000000000..19476becd8 Binary files /dev/null and b/addons/apl/sounds/padak_let.wss differ diff --git a/addons/huntir/$PBOPREFIX$ b/addons/huntir/$PBOPREFIX$ new file mode 100644 index 0000000000..b19f9d28e8 --- /dev/null +++ b/addons/huntir/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\huntir \ No newline at end of file diff --git a/addons/huntir/CfgAmmo.hpp b/addons/huntir/CfgAmmo.hpp new file mode 100644 index 0000000000..fac4d6fe60 --- /dev/null +++ b/addons/huntir/CfgAmmo.hpp @@ -0,0 +1,45 @@ +class CfgAmmo { + class FlareBase; + class F_HuntIR: FlareBase { + model = PATHTOF(data\ace_m1070_armed.p3d); + lightColor[] = {0, 0, 0, 0}; + smokeColor[] = {0, 0, 0, 0}; + timeToLive = 6; + }; + + class ShellBase; + class ACE_HuntIR_Propell: ShellBase { + supersonicCrackNear[] = {"",0.316228,1,50}; + supersonicCrackFar[] = {"",0.223872,1,150}; + CraterEffects = ""; + CraterWaterEffects = ""; + ExplosionEffects = "ACE_HuntIR_Propell_Fx"; + visibleFire = 1; + audibleFire = 1; + dangerRadiusHit = -1; + suppressionRadiusHit = 0; + soundHit1[] = {"",3.16228,1,2000}; + soundHit2[] = {"",3.16228,1,2000}; + soundHit3[] = {"",3.16228,1,2000}; + soundHit4[] = {"",3.16228,1,2000}; + soundHit5[] = {"",3.16228,1,2000}; + soundHit6[] = {"",3.16228,1,2000}; + soundHit7[] = {"",3.16228,1,2000}; + soundHit8[] = {"",3.16228,1,2000}; + multiSoundHit[] = {}; + class HitEffects {}; + soundFakeFall0[] = {"",3.16228,1,1000}; + soundFakeFall1[] = {"",3.16228,1,1000}; + soundFakeFall2[] = {"",3.16228,1,1000}; + soundFakeFall3[] = {"",3.16228,1,1000}; + soundFakeFall[] = {}; + hit = 0; + indirectHit = 0; + indirectHitRange = 0; + explosive = 1; + model = "\A3\weapons_f\empty"; + airFriction = 0; + timeToLive = 1; + explosionTime = 0.001; + }; +}; diff --git a/addons/huntir/CfgCloudlets.hpp b/addons/huntir/CfgCloudlets.hpp new file mode 100644 index 0000000000..4ff0ff2f6f --- /dev/null +++ b/addons/huntir/CfgCloudlets.hpp @@ -0,0 +1,92 @@ +class ACE_HuntIR_Propell_Fx { + class ACE_HuntIR_ExploAmmoFlash { + simulation = "particles"; + type = "ACE_HuntIR_ExploAmmoFlash"; + position[] = { 0, 0, 0 }; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + class ACE_HuntIR_ExploAmmoSmoke { + simulation = "particles"; + type = "ACE_HuntIR_ExploAmmoSmoke"; + position[] = { 0, 0, 0 }; + intensity = 1; + interval = 1; + lifeTime = 0.8; + }; +}; + +class CfgCloudlets { + class Default; + class ACE_HuntIR_ExploAmmoFlash: Default { + interval = 0.1; + circleRadius = 0; + circleVelocity[] = { 0, 0, 0 }; + particleShape = "\A3\data_f\ParticleEffects\Universal\Universal"; + particleFSNtieth = 16; + particleFSIndex = 0; + particleFSFrameCount = 32; + particleFSLoop = 0; + angleVar = 1; + animationName = ""; + particleType = "Billboard"; + timerPeriod = 1; + lifeTime = 0.5; + moveVelocity[] = { 0, 1, 0 }; + rotationVelocity = 1; + weight = 10; + volume = 7.9; + rubbing = 0.1; + size[] = { "0.0125 * intensity + 0.25", "0.0125 * intensity + 0.125" }; + color[] = { { 1, 1, 1, -1 }, { 1, 1, 1, 0 } }; + animationSpeed[] = { 2 }; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 0.2; + onTimerScript = ""; + beforeDestroyScript = ""; + lifeTimeVar = 0; + positionVar[] = { 0, 0.1, 0 }; + MoveVelocityVar[] = { 0.2, 0.5, 0.2 }; + rotationVelocityVar = 1; + sizeVar = 0.5; + colorVar[] = { 0, 0, 0, 0 }; + randomDirectionPeriodVar = 0; + randomDirectionIntensityVar = 0; + }; + class ACE_HuntIR_ExploAmmoSmoke: Default { + interval = "0.02 * interval + 0.02"; + circleRadius = 0; + circleVelocity[] = { 0, 0, 0 }; + particleShape = "\A3\data_f\ParticleEffects\Universal\Universal"; + particleFSNtieth = 16; + particleFSIndex = 7; + particleFSFrameCount = 48; + particleFSLoop = 1; + angleVar = 1; + animationName = ""; + particleType = "Billboard"; + timerPeriod = 1; + lifeTime = 0.25; + moveVelocity[] = { 0, 1, 0 }; + rotationVelocity = 1; + weight = 0.053; + volume = 0.04; + rubbing = 0.2; + size[] = { "0.0125 * intensity + 0.25", "0.0125 * intensity + 1.25", "0.0125 * intensity + 2.75", "0.0125 * intensity + 3.75" }; + color[] = { { 0.6, 0.6, 0.6, 1 }, { 0.7, 0.7, 0.7, 0.5 }, { 0.78, 0.78, 0.78, 0.25 } }; + animationSpeed[] = { 1.7, 0.6, 0.4, 0.3, 0.3 }; + randomDirectionPeriod = 0.2; + randomDirectionIntensity = 0.2; + onTimerScript = ""; + beforeDestroyScript = ""; + lifeTimeVar = 2; + positionVar[] = { 0.5, 0.3, 0.5 }; + MoveVelocityVar[] = { 1.5, 2, 1.5 }; + rotationVelocityVar = 1; + sizeVar = 0.5; + colorVar[] = { 0, 0, 0, 0 }; + randomDirectionPeriodVar = 0; + randomDirectionIntensityVar = 0; + }; +}; diff --git a/addons/huntir/CfgEventhandlers.hpp b/addons/huntir/CfgEventhandlers.hpp new file mode 100644 index 0000000000..308df09c1b --- /dev/null +++ b/addons/huntir/CfgEventhandlers.hpp @@ -0,0 +1,19 @@ +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_preInit) ); + }; +}; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE( call COMPILE_FILE(XEH_postInit) ); + }; +}; + +class Extended_FiredBIS_EventHandlers { + class CAManBase { + class ADDON { + clientFiredBIS = QUOTE(_this call FUNC(handleFired)); + }; + }; +}; \ No newline at end of file diff --git a/addons/huntir/CfgMagazines.hpp b/addons/huntir/CfgMagazines.hpp new file mode 100644 index 0000000000..921ffbe09a --- /dev/null +++ b/addons/huntir/CfgMagazines.hpp @@ -0,0 +1,11 @@ + +class CfgMagazines { + class 1Rnd_HE_Grenade_shell; + class ACE_HuntIR_M203: 1Rnd_HE_Grenade_shell { + displayName = $STR_ACE_HUNTIR_ROUND; + displayNameShort = "HuntIR"; + descriptionShort = ""; + picture = PATHTOF(UI\m_m1070_ca.paa); + ammo = "F_HuntIR"; + }; +}; diff --git a/addons/huntir/CfgVehicles.hpp b/addons/huntir/CfgVehicles.hpp new file mode 100644 index 0000000000..54876d4cf5 --- /dev/null +++ b/addons/huntir/CfgVehicles.hpp @@ -0,0 +1,58 @@ + +class CfgVehicles { + class Man; + class CAManBase: Man { + class ACE_SelfActions { + class ACE_Equipment { + class GVAR(open) { + displayName = $STR_ACE_HUNTIR_MON_ACT; + condition = QUOTE([ARR_2(ACE_player,'ACE_HuntIR_monitor')] call EFUNC(common,hasItem)); + statement = QUOTE(call FUNC(huntir)); + showDisabled = 0; + priority = 2; + icon = PATHTOF(UI\w_huntir_monitor_ca.paa); + exceptions[] = {}; + }; + }; + }; + }; + + class Parachute_02_base_F; + class ACE_HuntIR: Parachute_02_base_F { + scope = 1; + displayName = "HuntIR"; + model = PATHTOF(data\huntir.p3d); + castDriverShadow = 0; + soundEnviron[] = {"z\ace\addons\apl\sounds\padak_let", 0.316228, 1, 80}; + soundCrash[] = {"", db-30, 1 }; + soundLandCrash[] = {"", db-30, 1 }; + soundWaterCrash[] = {"", db10, 1 }; + mapSize = 0; + }; + + class Item_Base_F; + class ACE_Item_HuntIR_monitor: Item_Base_F { + scope = 2; + scopeCurator = 2; + displayName = $STR_ACE_HUNTIR_MON; + vehicleClass = "Items"; + class TransportItems { + class ACE_HuntIR_monitor { + name = "ACE_HuntIR_monitor"; + count = 1; + }; + }; + }; + + class ReammoBox_F; + class ACE_HuntIR_Box: ReammoBox_F { + model = PATHTOF(data\ace_huntirbox.p3d); + displayName = $STR_DN_ACE_HUNTIRBOX; + class TransportItems { + MACRO_ADDITEM(ACE_HuntIR_monitor,5); + }; + class TransportMagazines { + MACRO_ADDMAGAZINE(ACE_HuntIR_M203,20); + }; + }; +}; diff --git a/addons/huntir/CfgWeapons.hpp b/addons/huntir/CfgWeapons.hpp new file mode 100644 index 0000000000..42844acffb --- /dev/null +++ b/addons/huntir/CfgWeapons.hpp @@ -0,0 +1,34 @@ + +class CfgWeapons { + class ACE_ItemCore; + class InventoryItem_Base_F; + + class ACE_HuntIR_monitor: ACE_ItemCore { + scope = 2; + displayName = $STR_ACE_HUNTIR_MON; + picture = PATHTOF(UI\w_huntir_monitor_ca.paa); + descriptionShort = $STR_ACE_HUNTIR_MON; + model = PATHTOF(data\ace_huntir_monitor.p3d); + + class ItemInfo: InventoryItem_Base_F { + mass = 20; + }; + }; + + class GrenadeLauncher; + class UGL_F: GrenadeLauncher { + magazines[] += {"ACE_HuntIR_M203"}; + }; + class GL_3GL_F: UGL_F { + //magazines[] += {"ACE_HuntIR_M203"}; + magazines[] = {"1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell","ACE_HuntIR_M203"}; + }; + + class Rifle_Base_F; + class arifle_MX_Base_F: Rifle_Base_F { + class GL_3GL_F: UGL_F { + //magazines[] += {"ACE_HuntIR_M203"}; + magazines[] = {"1Rnd_HE_Grenade_shell","UGL_FlareWhite_F","UGL_FlareGreen_F","UGL_FlareRed_F","UGL_FlareYellow_F","UGL_FlareCIR_F","1Rnd_Smoke_Grenade_shell","1Rnd_SmokeRed_Grenade_shell","1Rnd_SmokeGreen_Grenade_shell","1Rnd_SmokeYellow_Grenade_shell","1Rnd_SmokePurple_Grenade_shell","1Rnd_SmokeBlue_Grenade_shell","1Rnd_SmokeOrange_Grenade_shell","3Rnd_HE_Grenade_shell","3Rnd_UGL_FlareWhite_F","3Rnd_UGL_FlareGreen_F","3Rnd_UGL_FlareRed_F","3Rnd_UGL_FlareYellow_F","3Rnd_UGL_FlareCIR_F","3Rnd_Smoke_Grenade_shell","3Rnd_SmokeRed_Grenade_shell","3Rnd_SmokeGreen_Grenade_shell","3Rnd_SmokeYellow_Grenade_shell","3Rnd_SmokePurple_Grenade_shell","3Rnd_SmokeBlue_Grenade_shell","3Rnd_SmokeOrange_Grenade_shell","ACE_HuntIR_M203"}; + }; + }; +}; diff --git a/addons/huntir/Dialog.hpp b/addons/huntir/Dialog.hpp new file mode 100644 index 0000000000..c3ef2f6567 --- /dev/null +++ b/addons/huntir/Dialog.hpp @@ -0,0 +1,401 @@ +#define CT_STATIC 0 +#define CT_BUTTON 1 +#define CT_EDIT 2 +#define CT_SLIDER 3 +#define CT_COMBO 4 +#define CT_LISTBOX 5 +#define CT_TOOLBOX 6 +#define CT_CHECKBOXES 7 +#define CT_PROGRESS 8 +#define CT_HTML 9 +#define CT_STATIC_SKEW 10 +#define CT_ACTIVETEXT 11 +#define CT_TREE 12 +#define CT_STRUCTURED_TEXT 13 +#define CT_CONTEXT_MENU 14 +#define CT_CONTROLS_GROUP 15 +#define CT_XKEYDESC 40 +#define CT_XBUTTON 41 +#define CT_XLISTBOX 42 +#define CT_XSLIDER 43 +#define CT_XCOMBO 44 +#define CT_ANIMATED_TEXTURE 45 +#define CT_OBJECT 80 +#define CT_OBJECT_ZOOM 81 +#define CT_OBJECT_CONTAINER 82 +#define CT_OBJECT_CONT_ANIM 83 +#define CT_LINEBREAK 98 +#define CT_USER 99 +#define CT_MAP 100 +#define CT_MAP_MAIN 101 +#define ST_POS 0x0F +#define ST_HPOS 0x03 +#define ST_VPOS 0x0C +#define ST_LEFT 0x00 +#define ST_RIGHT 0x01 +#define ST_CENTER 0x02 +#define ST_DOWN 0x04 +#define ST_UP 0x08 +#define ST_VCENTER 0x0c +#define ST_TYPE 0xF0 +#define ST_SINGLE 0 +#define ST_MULTI 16 +#define ST_TITLE_BAR 32 +#define ST_PICTURE 48 +#define ST_FRAME 64 +#define ST_BACKGROUND 80 +#define ST_GROUP_BOX 96 +#define ST_GROUP_BOX2 112 +#define ST_HUD_BACKGROUND 128 +#define ST_TILE_PICTURE 144 +#define ST_WITH_RECT 160 +#define ST_LINE 176 +#define FontM "PuristaMedium" +#define __XA SafeZoneXAbs +#define __X SafeZoneX +#define __Y SafeZoneY +#define __WA SafeZoneWAbs +#define __W SafeZoneW +#define __H SafeZoneH + +class ace_huntir_cam_dialog { + idd = 18880; + movingEnable = true; + controlsBackground[] = { }; + objects[] = { }; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + //HELP_DIALOG, + CAM_BG, + CAM_HEIGHT, + CAM_ALT, + CAM_No, + CAM_NO_x, + CAM_TIME_REMAIN, + CAM_TIME, + CAM_ZOOM, + ZOOM_X, + CAM_POS, + CAM_POS_X, + CAM_DIR, + CAM_DIR_x + }; + + class TOP_BORDER { + idc = -1; + type = CT_STATIC; + style = ST_CENTER; + x = __XA; + y = __Y; + w = __WA; + h = 0.08; + font = FontM; + sizeEx = 0.04; + colorText[] = { 1, 1, 1, 1 }; + colorBackground[] = {0,0,0,1}; + text = ""; + blinkingPeriod = 0; + }; + class BOTTOM_BORDER: TOP_BORDER { + y = __Y + __H - 0.05; + h = 0.05; + }; + class LEFT_BORDER: TOP_BORDER { + w = (abs(__XA) - abs(__X)) + 0.05; + h = __H; + }; + class RIGHT_BORDER: TOP_BORDER { + x = __X + __W - 0.05; + w = (__WA - __W) + 0.05; + h = __H; + }; + class HELP_DIALOG { + idc = -1; + type = CT_BUTTON; + style = ST_CENTER; + font = FontM; + sizeEx = 0.025; + colorText[] = { 1, 1, 1, 1 }; + colorFocused[] = { 0.31, 0.31, 0.31, 0.31 }; + colorDisabled[] = { 0, 0, 1, 0.7 }; + colorBackground[] = { 0, 0, 0, 0 }; + colorBackgroundDisabled[] = { 1, 1, 1, 0.5 }; + colorBackgroundActive[] = { 0.5, 0.5, 0.5, 0.5 }; + offsetX = 0.003; + offsetY = 0.003; + offsetPressedX = 0.002; + offsetPressedY = 0.002; + colorShadow[] = { 0, 0, 0, 0.5 }; + colorBorder[] = { 0, 0, 0, 0 }; + borderSize = 0; + soundEnter[] = { "", 0, 1 }; + soundPush[] = { "buttonpushed.ogg", 0.1, 1 }; + soundClick[] = { "", 0, 1 }; + soundEscape[] = { "", 0, 1 }; + x = __X + (2*0.8); y = __Y + 0.045; + w = 0.05; h = 0.02; + text = "$STR_ACE_HUNTIR_HELP"; + action = "createDialog 'ace_huntir_help_dialog'"; + }; + class CAM_BG { + idc = -1; + type = 0; + style = 48; + colorText[ ]={ 1,1,1,1 }; + colorBackground[ ]={ 0.4,0.4,0.4,1 }; + font = "PuristaMedium"; + sizeEx = 0.021; + lineSpacing = 1; + x = __X; + y = __Y + 0.08; + w = __W; + h = __H + 0.2; + border = 0; + text = PATHTOF(UI\ace_huntir_monitor_on.paa); + }; + class CAM_HEIGHT { + type = CT_STATIC; + idc = 1; + style = ST_LEFT; + colorBackground[] = {0, 0, 0, 0}; + colorText[] = {1, 1, 1, 1}; + font = FontM; + sizeEx = 0.02; + x = __X + 0.42; + y = __Y + 0.32; + w = 0.08; + h = 0.04; + text = ""; + blinkingPeriod = 0; + }; + class CAM_ALT: CAM_HEIGHT { + x = __X + 0.35; + text = "$STR_ACE_HUNTIR_ALT"; + }; + class CAM_No: CAM_HEIGHT { + x = __X + __W - 0.64; + text = "$STR_ACE_HUNTIR_CAM"; + }; + class CAM_NO_x: CAM_HEIGHT { + idc = 2; + x = __X + __W - 0.56; + y = __Y + 0.32; + text = ""; + }; + class CAM_TIME: CAM_HEIGHT { + x = __X + 0.35; + y = __Y + __H - 0.65; + w = 0.12; + text = "$STR_ACE_HUNTIR_TIME"; + }; + class CAM_TIME_REMAIN: CAM_TIME { + idc = 3; + x = __X + 0.46; + text = ""; + }; + class CAM_ZOOM: CAM_No { + y = __Y + 0.36; + text = "Zoom:"; + }; + class ZOOM_X: CAM_ZOOM { + idc = 4; + x = __X + __W - 0.56; + text = ""; + }; + class CAM_POS: CAM_HEIGHT { + x = __X + 0.35; + y = __Y + 0.36; + text = "GPS Pos:"; + }; + class CAM_POS_X: CAM_POS { + idc = 5; + x = __X + 0.42; + w = 0.16; + text = ""; + }; + class CAM_DIR: CAM_POS { + y = __Y + 0.4; + text = ""; //"Az:"; + }; + class CAM_DIR_x: CAM_DIR { + idc = 6; + x = __X + 0.42; + w = 0.16; + text = ""; + }; +}; + +class ace_huntir_cam_dialog_inactive: ace_huntir_cam_dialog { + idd = 18881; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + //HELP_DIALOG, + //PRESS_HELP, + CAM_BG, + SEARCHING_CAM + }; + + class TOP_BORDER: TOP_BORDER {}; + class BOTTOM_BORDER: BOTTOM_BORDER {}; + class LEFT_BORDER: LEFT_BORDER {}; + class RIGHT_BORDER: RIGHT_BORDER {}; + class PRESS_HELP { + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + x = __X + (__W - 0.2); + y = __Y + 0.06; + w = 0.4; + h = 0.02; + font = FontM; + sizeEx = 0.02; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0,0,0,0}; + text = ""; + blinkingPeriod = 0; + }; + class HELP_DIALOG { + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + x = __X + (__W - 0.2); + y = __Y + 0.03; + w = 0.4; + h = 0.02; + font = FontM; + sizeEx = 0.02; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0,0,0,0}; + text = "$STR_ACE_HUNTIR_ESC"; + blinkingPeriod = 0; + }; + class CAM_BG: CAM_BG {}; + class SEARCHING_CAM { + idc = 1; + type = CT_STATIC; + style = ST_LEFT; + colorText[] = {1, 1, 1, 1}; + colorBackground[] = {0,0,0,0}; + x = __X + (__W/2) - 0.07; + y = __Y + (__H/2); + w = 0.6; + h = 0.08; + font = FontM; + sizeEx = 0.04; + text = ""; + blinkingPeriod = 0; + }; +}; + +class ace_huntir_cam_dialog_off: ace_huntir_cam_dialog_inactive { + idd = 18882; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + //HELP_DIALOG, + //PRESS_HELP, + CAM_BG + }; + + class TOP_BORDER: TOP_BORDER {}; + class BOTTOM_BORDER: BOTTOM_BORDER {}; + class LEFT_BORDER: LEFT_BORDER {}; + class RIGHT_BORDER: RIGHT_BORDER {}; + class PRESS_HELP: PRESS_HELP {}; + class HELP_DIALOG: HELP_DIALOG {}; + class CAM_BG: CAM_BG { text = PATHTOF(UI\ace_huntir_monitor_off.paa); }; +}; +//ACTIVE PARA CAMERA DIALOG +class ace_huntir_help_dialog: ace_huntir_cam_dialog { + idd = -1; + controls[] = { + TOP_BORDER, + BOTTOM_BORDER, + LEFT_BORDER, + RIGHT_BORDER, + CAM_BG, + CAM_HEIGHT, + CAM_ALT, + CAM_TIME_REMAIN, + CAM_TIME, + CAM_ZOOM, + ZOOM_X, + CAM_POS, + CAM_POS_x, + CAM_No, + CAM_No_X, + CAM_DIR, + CAM_DIR_x, + HELP0, + HELP1, + HELP2, + HELP3, + HELP4, + HELP5, + HELP6 + }; + class TOP_BORDER: TOP_BORDER {}; + class BOTTOM_BORDER: BOTTOM_BORDER {}; + class LEFT_BORDER: LEFT_BORDER {}; + class RIGHT_BORDER: RIGHT_BORDER {}; + class CAM_BG: CAM_BG {}; + class CAM_HEIGHT: CAM_HEIGHT {}; + class CAM_ALT: CAM_ALT {}; + class CAM_No: CAM_No {}; + class CAM_NO_x: CAM_NO_x {}; + class CAM_TIME_REMAIN: CAM_TIME_REMAIN {}; + class CAM_TIME: CAM_TIME {}; + class CAM_ZOOM: CAM_ZOOM {}; + class ZOOM_X: ZOOM_X {}; + class CAM_POS: CAM_POS {}; + class CAM_POS_X: CAM_POS_X {}; + class CAM_DIR: CAM_DIR {}; + class CAM_DIR_x: CAM_DIR_x {}; + class HELP0 { + idc = -1; + type = CT_STATIC; + style = ST_LEFT; + x = __X + (__W - 0.3); + y = __Y + 0.03; + w = 0.4; + h = 0.03; + font = FontM; + sizeEx = 0.022; + colorText[] = { 1, 1, 1, 1 }; + colorBackground[] = {0,0,0,1}; + text = "$STR_ACE_HUNTIR_HELP_EXIT"; + blinkingPeriod = 0; + }; + class HELP1: HELP0 { + y = __Y + 0.06; + text = "$STR_ACE_HUNTIR_HELP_ZOOM"; + }; + class HELP2: HELP0 { + y = __Y + 0.09; + text = "$STR_ACE_HUNTIR_HELP_CAM"; + }; + class HELP3: HELP0 { + y = __Y + 0.12; + text = "$STR_ACE_HUNTIR_HELP_ROT"; + }; + class HELP4: HELP0 { + y = __Y + 0.15; + text = "$STR_ACE_HUNTIR_HELP_ELV"; + }; + class HELP5: HELP0 { + y = __Y + 0.18; + text = "$STR_ACE_HUNTIR_HELP_MOD"; + }; + class HELP6: HELP0 { + y = __Y + 0.21; + text = "$STR_ACE_HUNTIR_HELP_RES"; + }; +}; diff --git a/addons/huntir/RscTitles.hpp b/addons/huntir/RscTitles.hpp new file mode 100644 index 0000000000..de94f17a5e --- /dev/null +++ b/addons/huntir/RscTitles.hpp @@ -0,0 +1,41 @@ +#define __FONTHEIGHT 0.02 + +class RscTitles { + class ace_huntir_cam_rose { + idd=-1; + movingEnable = true; + fadein = 0; + fadeout = 1; + duration = 1e+011; + name="ace_huntir_cam_rose"; + onLoad = "uiNamespace setVariable ['ace_huntir_cam_rose', _this select 0]"; + class controls { + class CHAR_N { + type = 0; + idc = 64432; + style = 0; + x = 0.497;y = 0.297;w = 0.2;h = 0.2; + font = "PuristaMedium"; + sizeEx = __FONTHEIGHT; + colorText[] = {1, 1, 1, 1}; + colorBackground[]={0,0,0,0}; + text = "N"; + }; + class CHAR_E: CHAR_N { + idc = 64433; + x = 0.697;y = 0.497; + text = "E"; + }; + class CHAR_S: CHAR_N { + idc = 64434; + x = 0.497;y = 0.697; + text = "S"; + }; + class CHAR_W: CHAR_N { + idc = 64435; + x = 0.297;y = 0.497; + text = "W"; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/huntir/UI/ace_huntir_monitor_off.paa b/addons/huntir/UI/ace_huntir_monitor_off.paa new file mode 100644 index 0000000000..be37d17b99 Binary files /dev/null and b/addons/huntir/UI/ace_huntir_monitor_off.paa differ diff --git a/addons/huntir/UI/ace_huntir_monitor_on.paa b/addons/huntir/UI/ace_huntir_monitor_on.paa new file mode 100644 index 0000000000..a2941a8b94 Binary files /dev/null and b/addons/huntir/UI/ace_huntir_monitor_on.paa differ diff --git a/addons/huntir/UI/m_M1070_ca.paa b/addons/huntir/UI/m_M1070_ca.paa new file mode 100644 index 0000000000..e3d342ccf0 Binary files /dev/null and b/addons/huntir/UI/m_M1070_ca.paa differ diff --git a/addons/huntir/UI/w_huntir_monitor_ca.paa b/addons/huntir/UI/w_huntir_monitor_ca.paa new file mode 100644 index 0000000000..7ecb6f1338 Binary files /dev/null and b/addons/huntir/UI/w_huntir_monitor_ca.paa differ diff --git a/addons/huntir/XEH_postInit.sqf b/addons/huntir/XEH_postInit.sqf new file mode 100644 index 0000000000..c5526500ac --- /dev/null +++ b/addons/huntir/XEH_postInit.sqf @@ -0,0 +1,9 @@ +#include "script_component.hpp" + +GVAR(ZOOM) = 0; +GVAR(NV) = 0; +GVAR(IRON) = false; +GVAR(TI) = 0; +GVAR(cur_cam) = 0; +GVAR(ROTATE) = 0; +GVAR(ELEVAT) = 0.01; diff --git a/addons/huntir/XEH_preInit.sqf b/addons/huntir/XEH_preInit.sqf new file mode 100644 index 0000000000..0ae45c1540 --- /dev/null +++ b/addons/huntir/XEH_preInit.sqf @@ -0,0 +1,11 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(cam); +PREP(handleFired); +PREP(huntir); +PREP(huntirCompass); +PREP(keypressed); + +ADDON = true; diff --git a/addons/huntir/config.cpp b/addons/huntir/config.cpp new file mode 100644 index 0000000000..5fb106ad2d --- /dev/null +++ b/addons/huntir/config.cpp @@ -0,0 +1,21 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_HuntIR", "ACE_HuntIRBox"}; + weapons[] = {"ACE_HuntIR_monitor"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"Norrin", "Rocko", "Ruthberg"}; + VERSION_CONFIG; + }; +}; + +#include "CfgEventhandlers.hpp" +#include "CfgCloudlets.hpp" +#include "CfgAmmo.hpp" +#include "CfgMagazines.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "Dialog.hpp" +#include "RscTitles.hpp" diff --git a/addons/huntir/data/ace_huntir_monitor.p3d b/addons/huntir/data/ace_huntir_monitor.p3d new file mode 100644 index 0000000000..059e7050ed Binary files /dev/null and b/addons/huntir/data/ace_huntir_monitor.p3d differ diff --git a/addons/huntir/data/ace_huntirbox.p3d b/addons/huntir/data/ace_huntirbox.p3d new file mode 100644 index 0000000000..d26bd85c22 Binary files /dev/null and b/addons/huntir/data/ace_huntirbox.p3d differ diff --git a/addons/huntir/data/ace_m1070.p3d b/addons/huntir/data/ace_m1070.p3d new file mode 100644 index 0000000000..e110e6291d Binary files /dev/null and b/addons/huntir/data/ace_m1070.p3d differ diff --git a/addons/huntir/data/ace_m1070_armed.p3d b/addons/huntir/data/ace_m1070_armed.p3d new file mode 100644 index 0000000000..cf4da73533 Binary files /dev/null and b/addons/huntir/data/ace_m1070_armed.p3d differ diff --git a/addons/huntir/data/bedna_ammo2.rvmat b/addons/huntir/data/bedna_ammo2.rvmat new file mode 100644 index 0000000000..b56d21c650 --- /dev/null +++ b/addons/huntir/data/bedna_ammo2.rvmat @@ -0,0 +1,31 @@ +ambient[] = {1.0, 1.0, 1.0, 1.0}; +diffuse[] = {1.0, 1.0, 1.0, 1.0}; +forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0}; +emmisive[] = {0.0, 0.0, 0.0, 1.0}; +specular[] = {1.0, 1.0, 1.0, 1.0}; +specularPower = 71.9; +PixelShaderID = "NormalMapSpecularDIMap"; +VertexShaderID = "NormalMap"; +class Stage1 { + texture = "z\ace\addons\huntir\data\bedna_ammo2_nohq.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class Stage2 { + texture = "z\ace\addons\huntir\data\bedna_ammo2_smdi.paa"; + uvSource = "tex"; + class uvTransform { + aside[] = {1.0, 0.0, 0.0}; + up[] = {0.0, 1.0, 0.0}; + dir[] = {0.0, 0.0, 0.0}; + pos[] = {0.0, 0.0, 0.0}; + }; +}; +class StageTI { + texture = "z\ace\addons\apl\data\default_vehicle_ti_ca.paa"; +}; diff --git a/addons/huntir/data/bedna_ammo2_co.paa b/addons/huntir/data/bedna_ammo2_co.paa new file mode 100644 index 0000000000..fa759b6140 Binary files /dev/null and b/addons/huntir/data/bedna_ammo2_co.paa differ diff --git a/addons/huntir/data/bedna_ammo2_nohq.paa b/addons/huntir/data/bedna_ammo2_nohq.paa new file mode 100644 index 0000000000..4df88e4b91 Binary files /dev/null and b/addons/huntir/data/bedna_ammo2_nohq.paa differ diff --git a/addons/huntir/data/bedna_ammo2_smdi.paa b/addons/huntir/data/bedna_ammo2_smdi.paa new file mode 100644 index 0000000000..60fc404720 Binary files /dev/null and b/addons/huntir/data/bedna_ammo2_smdi.paa differ diff --git a/addons/huntir/data/camchute_co.paa b/addons/huntir/data/camchute_co.paa new file mode 100644 index 0000000000..9d927ccce1 Binary files /dev/null and b/addons/huntir/data/camchute_co.paa differ diff --git a/addons/huntir/data/huntir.p3d b/addons/huntir/data/huntir.p3d new file mode 100644 index 0000000000..ebf349672e Binary files /dev/null and b/addons/huntir/data/huntir.p3d differ diff --git a/addons/huntir/data/huntir_monitor_co.paa b/addons/huntir/data/huntir_monitor_co.paa new file mode 100644 index 0000000000..7ecb6f1338 Binary files /dev/null and b/addons/huntir/data/huntir_monitor_co.paa differ diff --git a/addons/huntir/functions/fnc_cam.sqf b/addons/huntir/functions/fnc_cam.sqf new file mode 100644 index 0000000000..af229bfe75 --- /dev/null +++ b/addons/huntir/functions/fnc_cam.sqf @@ -0,0 +1,148 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * Handles HuntIR camera + * + * Arguments: + * 0: HuntIR + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_1(_huntIR); + +GVAR(huntIR) = _huntIR; +GVAR(pos) = getPosVisual GVAR(huntIR); + +GVAR(ZOOM) = 0; +GVAR(NV) = 0; +GVAR(TI) = 0; +GVAR(cur_cam) = 0; +GVAR(ROTATE) = 0; +GVAR(ELEVAT) = 0.01; + +HUNTIR_BACKGROUND_LAYER_ID cutText["","PLAIN"]; + +closedialog 0; +createDialog "ace_huntir_cam_dialog"; +uiNameSpace setVariable ["ace_huntir_monitor", findDisplay 18880]; +(uiNameSpace getVariable "ace_huntir_monitor") displaySetEventHandler ["Keydown", QUOTE(_this call FUNC(keyPressed))]; + +ctrlSetText [4, "0X"]; + +GVAR(logic) = "Logic" createVehicleLocal [0, 0, 0]; +GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); +GVAR(logic) setVectorUp [0.001, 0.001, 1]; + +GVAR(cam) = "camera" camCreate GVAR(pos); +GVAR(cam) camSetTarget GVAR(logic); +GVAR(cam) cameraEffect ["internal", "BACK"]; +GVAR(cam) camSetRelPos [0, 0, 2]; +GVAR(cam) camCommit 0; +showCinemaBorder false; +camUseNVG false; + +GVAR(pphandle) = ppEffectCreate ["colorCorrections", 135522]; +GVAR(pphandle) ppEffectAdjust [1, 1, 0, [0.01, 0.02, 0.04, 0.01], [0.87, 1.08, 1.196, 0.3], [0.399, 0.287, 0.014, 0.0]]; +GVAR(pphandle) ppEffectCommit 0; +GVAR(pphandle) ppEffectEnable true; + +GVAR(stop) = false; +call FUNC(huntirCompass); + +GVAR(no_cams) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; +{ + GVAR(no_cams) set [_forEachIndex, [(getPosVisual ACE_player) vectorDistance (getPosVisual _x), _x]]; +} forEach GVAR(no_cams); +GVAR(no_cams) sort true; +{ + GVAR(no_cams) set [_forEachIndex, _x select 1]; +} forEach GVAR(no_cams); +[{ + GVAR(nearHuntIRs) = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; + { + if (((getPosVisual _x) select 2) > 20 && {!(_x in GVAR(no_cams))}) then { + GVAR(no_cams) pushBack _x; + }; + } forEach GVAR(nearHuntIRs); + { + if (((getPosVisual _x) select 2) <= 20 || {!(_x in GVAR(nearHuntIRs))}) then { + GVAR(no_cams) deleteAt _forEachIndex; + if (_forEachIndex < GVAR(cur_cam)) then { + GVAR(cur_cam) = GVAR(cur_cam) - 1; + }; + }; + } forEach GVAR(no_cams); + + GVAR(cur_cam) = 0 max GVAR(cur_cam) min ((count GVAR(no_cams)) - 1); + if (count GVAR(no_cams) > 0) then { + GVAR(huntIR) = GVAR(no_cams) select GVAR(cur_cam); + }; + + GVAR(pos) = getPosVisual GVAR(huntIR); + + if ((!dialog) || (count GVAR(no_cams) == 0) || ((GVAR(pos) select 2) <= 20)) exitWith { + [_this select 1] call cba_fnc_removePerFrameHandler; + + GVAR(stop) = true; + + GVAR(pphandle) ppEffectEnable true; + ppEffectDestroy GVAR(pphandle); + + GVAR(NV) = 0; + setAperture -1; + closedialog 0; + titletext [" ", "BLACK IN", 4]; + ACE_player switchCamera "INTERNAL"; + GVAR(cam) CameraEffect ["Terminate", "Back"]; + CamDestroy GVAR(cam); + deleteVehicle GVAR(logic); + if (player != ACE_player) then { + player remoteControl ACE_player; + }; + }; + + switch (GVAR(ZOOM)) do { + case 0: { + GVAR(cam) camsetFOV 0.7; + GVAR(cam) camSetFocus [GVAR(pos) select 2, 1]; + }; + case 1: { + GVAR(cam) camsetFOV 0.35; + GVAR(cam) camSetFocus [(GVAR(pos) select 2)/2, 1]; + }; + case 2: { + GVAR(cam) camsetFOV 0.17; + GVAR(cam) camSetFocus [(GVAR(pos) select 2)/4, 1]; + }; + case 3: { + GVAR(cam) camsetFOV 0.1; + GVAR(cam) camSetFocus [(GVAR(pos) select 2)/8, 1]; + }; + }; + + private ["_cam_coord_y", "_cam_coord_x", "_speed", "_cam_time", "_cam_pos"]; + + GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]); + GVAR(logic) setDir GVAR(ROTATE); + GVAR(logic) setVectorUp [0.0001, 0.0001, 1]; + GVAR(cam) CameraEffect ["internal", "BACK"]; + _cam_coord_y = GVAR(ELEVAT) * cos(GVAR(ROTATE)); + _cam_coord_x = GVAR(ELEVAT) * sin(GVAR(ROTATE)); + GVAR(cam) camSetRelPos [_cam_coord_x, _cam_coord_y, 2]; + GVAR(cam) camCommit 0; + + ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]]; + ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]]; + _speed = 1 max abs((velocity GVAR(huntIR)) select 2); + _cam_time = ((GVAR(pos) select 2) - 20) / _speed; + ctrlSetText [3, format["%1 s", round(_cam_time)]]; + _cam_pos = getPosVisual GVAR(huntIR); + _cam_pos = format ["X = %1, Y = %2", round (_cam_pos select 0), round (_cam_pos select 1)]; + ctrlSetText [5, _cam_pos]; + ctrlSetText [6, ""]; +}, 0, []] call CBA_fnc_addPerFrameHandler; diff --git a/addons/huntir/functions/fnc_handleFired.sqf b/addons/huntir/functions/fnc_handleFired.sqf new file mode 100644 index 0000000000..16afd17546 --- /dev/null +++ b/addons/huntir/functions/fnc_handleFired.sqf @@ -0,0 +1,46 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * Handles HuntIR projectiles + * + * Arguments: + * 0: unit - Object the event handler is assigned to + * 1: weapon - Fired weapon + * 2: muzzle - Muzzle that was used + * 3: mode - Current mode of the fired weapon + * 4: ammo - Ammo used + * 5: magazine - magazine name which was used + * 6: projectile - Object of the projectile that was shot + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +PARAMS_7(_unit,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile); + +if (_ammo != "F_HuntIR") exitWith {}; + +private ["_dir", "_pos", "_dirDegree", "_b", "_a", "_y", "_x"]; +_dir = ACE_player weaponDirection _weapon; +_pos = getPosATL ACE_player; + +_dirDegree = (_dir select 0) atan2 (_dir select 1); +_b = 500 / (tan((asin(_dir select 2)) + 10)); +_a = _b * sin(_dirDegree); +_b = _a / tan(_dirDegree); +_x = (_pos select 0) + _a; +_y = (_pos select 1) + _b; + +[{ + PARAMS_3(_projectile,_x,_y); + "ACE_HuntIR_Propell" createVehicle (getPosATL _projectile); + [{ + PARAMS_3(_x,_y,_z); + private ["_huntir"]; + _huntir = createVehicle ["ACE_HuntIR", [_x, _y, _z], [], 0, "FLY"]; + _huntir setPosATL [_x, _y, _z]; + }, [_x, _y, ((getPosATL _projectile) select 2) + 400], 5, 0] call EFUNC(common,waitAndExecute); +}, [_projectile, _x, _y], 5, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/huntir/functions/fnc_huntir.sqf b/addons/huntir/functions/fnc_huntir.sqf new file mode 100644 index 0000000000..585a49a6ac --- /dev/null +++ b/addons/huntir/functions/fnc_huntir.sqf @@ -0,0 +1,93 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * HuntIR monitor system + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +#define __TYPE_WRITER_DELAY 0.05 + +if ((ACE_player call CBA_fnc_getUnitAnim) select 0 == "stand") then { + ACE_player playMove "AmovPercMstpSrasWrflDnon_diary"; +}; + +HUNTIR_BACKGROUND_LAYER_ID cutText ["", "BLACK", 0]; +createDialog "ace_huntir_cam_dialog_off"; + +[{ + if (!dialog) exitWith { + HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN", 0]; + }; + closeDialog 0; + createDialog "ace_huntir_cam_dialog_inactive"; + uiNameSpace setVariable ["ace_huntir_monitor", findDisplay 18881]; + [{ + GVAR(startTime) = ACE_time; + GVAR(done) = false; + GVAR(connectionDelay) = 5; + GVAR(state) = "searching"; + GVAR(message) = []; + GVAR(messageSearching) = toArray "Searching....."; + GVAR(messageConnecting) = toArray "Connecting....."; + [{ + private ["_elapsedTime", "_nearestHuntIRs"]; + _elapsedTime = ACE_time - GVAR(startTime); + _nearestHuntIRs = ACE_player nearEntities ["ACE_HuntIR", HUNTIR_MAX_TRANSMISSION_RANGE]; + + if ((!dialog) || GVAR(done)) exitWith { + [_this select 1] call cba_fnc_removePerFrameHandler; + + if (dialog && GVAR(state) == "connected") then { + [_nearestHuntIRs select 0] call FUNC(cam); + } else { + HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + }; + }; + switch (GVAR(state)) do { + case "searching": { + if (count GVAR(message) < count GVAR(messageSearching)) then { + GVAR(message) pushBack (GVAR(messageSearching) select (count GVAR(message))); + ctrlSetText [1, toString GVAR(message)]; + } else { + GVAR(message) = []; + if (_elapsedTime > 10) then { + GVAR(state) = "noGDS"; + }; + if (_elapsedTime > 5 && {count _nearestHuntIRs > 0}) then { + GVAR(state) = "connecting"; + }; + }; + }; + case "connecting": { + if (count GVAR(message) < count GVAR(messageConnecting)) then { + GVAR(message) pushBack (GVAR(messageConnecting) select (count GVAR(message))); + ctrlSetText [1, toString GVAR(message)]; + } else { + GVAR(message) = []; + GVAR(connectionDelay) = GVAR(connectionDelay) - 1; + if (GVAR(connectionDelay) <= 0) then { + GVAR(done) = true; + GVAR(state) = "connected"; + }; + }; + }; + case "noGDS": { + ctrlSetText [1, "No GDS System detected"]; + [{ + GVAR(done) = true; + closedialog 0; + HUNTIR_BACKGROUND_LAYER_ID cutText ["", "PLAIN"]; + }, [], 3, 0] call EFUNC(common,waitAndExecute); + }; + }; + }, __TYPE_WRITER_DELAY, []] call CBA_fnc_addPerFrameHandler; + }, [], 0.5, 0] call EFUNC(common,waitAndExecute); +}, [], 1, 0] call EFUNC(common,waitAndExecute); diff --git a/addons/huntir/functions/fnc_huntirCompass.sqf b/addons/huntir/functions/fnc_huntirCompass.sqf new file mode 100644 index 0000000000..30fcf45900 --- /dev/null +++ b/addons/huntir/functions/fnc_huntirCompass.sqf @@ -0,0 +1,88 @@ +/* + * Author: Norrin, Rocko, Ruthberg + * + * HuntIR monitor compass + * + * Arguments: + * Nothing + * + * Return Value: + * Nothing + * + * Public: No + */ +#include "script_component.hpp" + +disableSerialization; + +#define __DSP (uiNamespace getVariable "ace_huntir_cam_rose") +#define __CHAR_N (__DSP displayCtrl 64432) +#define __CHAR_E (__DSP displayCtrl 64433) +#define __CHAR_S (__DSP displayCtrl 64434) +#define __CHAR_W (__DSP displayCtrl 64435) + +#define __OFFSET_X 0.003 +#define __OFFSET_Y 0.003 +#define __WIDTH 0.1 +#define __HEIGHT 0.1 +#define __RADIUS 0.05 +#define __CENTER_X 0.70 +#define __CENTER_Y 0.65 + +private ["_fnc_correctIt"]; + +_fnc_correctIt = { + PARAMS_2(_pos,_dir); + if (_dir >= 270 || {_dir <= 90}) then { + _pos set [1, (_pos select 1) + __OFFSET_Y] + }; + if (_dir >= 0 && {_dir <= 180}) then { + _pos set [0, (_pos select 0) - __OFFSET_X] + }; + if (_dir >= 90 && {_dir <= 270}) then { + _pos set [1, (_pos select 1) - __OFFSET_Y] + }; + if (_dir >= 180 && {_dir <= 360}) then { + _pos set [0, (_pos select 0) + __OFFSET_X] + }; + _pos +}; + +HUNTIR_CAM_ROSE_LAYER_ID cutRsc ["ace_huntir_cam_rose", "PLAIN"]; + +[{ + EXPLODE_1_PVT(_this select 0,_fnc_correctIt); + + if (GVAR(stop)) exitWith { + HUNTIR_CAM_ROSE_LAYER_ID cutText ["", "PLAIN"]; + [_this select 1] call CBA_fnc_removePerFrameHandler; + }; + + private ["_dir", "_x1", "_y1", "_pos"]; + _dir = getDir GVAR(cam); // direction player; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir)); + _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + __CHAR_N ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_N ctrlCommit 0; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir + 90)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir + 90)); + _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + __CHAR_W ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_W ctrlCommit 0; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir + 180)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir + 180)); + _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + __CHAR_S ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_S ctrlCommit 0; + + _x1 = __CENTER_X - (__RADIUS * sin(_dir + 270)); + _y1 = __CENTER_Y - (__RADIUS * cos(_dir + 270)); + _pos = [[_x1, _y1], _dir] call _fnc_correctIt; + __CHAR_E ctrlSetPosition [_pos select 0, _pos select 1, __WIDTH, __HEIGHT]; + __CHAR_E ctrlCommit 0; + +}, 0.01, [_fnc_correctIt]] call CBA_fnc_addPerFrameHandler; diff --git a/addons/huntir/functions/fnc_keyPressed.sqf b/addons/huntir/functions/fnc_keyPressed.sqf new file mode 100644 index 0000000000..509dcb9de5 --- /dev/null +++ b/addons/huntir/functions/fnc_keyPressed.sqf @@ -0,0 +1,113 @@ +/* + * Author: Norrin, Rocko + * Handles the HuntIR monitor key interaction + * + * Arguments: + * 0: ? + * 1: keycode + * + * Return Value: + * handled? + * + * Example: + * [] call ace_huntir_fnc_keyPressed + * + * Public: No + */ +#include "script_component.hpp" + +private ["_ret"]; +_ret = false; + +switch (_this select 1) do { + // A = Lower zoom level + case 30: { + if (GVAR(ZOOM) > 0) then { + GVAR(ZOOM) = GVAR(ZOOM) - 1; + }; + switch (GVAR(ZOOM)) do { + case 0: { ctrlSetText [4, "0X"];}; + case 1: { ctrlSetText [4, "2X"];}; + case 2: { ctrlSetText [4, "4X"];}; + case 3: { ctrlSetText [4, "8X"];}; + }; + _ret = true; + }; + // D = Increase zoom level + case 32: { + if (GVAR(ZOOM) < 3) then { + GVAR(ZOOM) = GVAR(ZOOM) + 1; + }; + switch (GVAR(ZOOM)) do { + case 0: { ctrlSetText [4, "0X"];}; + case 1: { ctrlSetText [4, "2X"];}; + case 2: { ctrlSetText [4, "4X"];}; + case 3: { ctrlSetText [4, "8X"];}; + }; + _ret = true; + }; + //N key ( Toggle NV and TI modes ) + case 49: { + if (GVAR(NV) == 0) then { + setAperture -1; + camUseNVG true; + GVAR(NV) = 1; + if (!GVAR(IRON)) then { + GVAR(IRON) = true; + }; + } else { + setAperture -1; + camUseNVG false; + GVAR(NV) = 0; + GVAR(IRON) = false; + }; + _ret = true; + }; + // S = Next camera + case 31: { + GVAR(cur_cam) = GVAR(cur_cam) + 1; + _ret = true; + }; + // W = Previous camera + case 17: { + GVAR(cur_cam) = GVAR(cur_cam) - 1; + _ret = true; + }; + // Rotate camera anticlockwise + case 203: { + GVAR(ROTATE) = GVAR(ROTATE) - 3; + _ret = true; + }; + // Rotate camera clockwise + case 205: { + GVAR(ROTATE) = GVAR(ROTATE) + 3; + _ret = true; + }; + // Raise camera + case 200: { + if (GVAR(ELEVAT) < 4.01) then { + GVAR(ELEVAT) = GVAR(ELEVAT) + 0.12; + }; + _ret = true; + }; + // Lower camera + case 208: { + if (GVAR(ELEVAT) > -3.99) then { + GVAR(ELEVAT) = GVAR(ELEVAT) - 0.12; + }; + _ret = true; + }; + // Reset camera + case 19: { + GVAR(ROTATE) = 0; + GVAR(ELEVAT) = 0.01; + GVAR(ZOOM) = 0; + ctrlSetText [4, "0X"]; + GVAR(NV) = 0; + camUseNVG false; + setAperture -1; + _ret = true; + }; +}; + +_ret diff --git a/addons/huntir/functions/script_component.hpp b/addons/huntir/functions/script_component.hpp new file mode 100644 index 0000000000..29e0fbff41 --- /dev/null +++ b/addons/huntir/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\huntir\script_component.hpp" \ No newline at end of file diff --git a/addons/huntir/script_component.hpp b/addons/huntir/script_component.hpp new file mode 100644 index 0000000000..9f99437f67 --- /dev/null +++ b/addons/huntir/script_component.hpp @@ -0,0 +1,17 @@ +#define COMPONENT huntir +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_HUNTIR + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_HUNTIR + #define DEBUG_SETTINGS DEBUG_SETTINGS_HUNTIR +#endif + +#include "\z\ace\addons\main\script_macros.hpp" + +#define HUNTIR_BACKGROUND_LAYER_ID 13521 +#define HUNTIR_CAM_ROSE_LAYER_ID 13522 + +#define HUNTIR_MAX_TRANSMISSION_RANGE 1600 diff --git a/addons/huntir/stringtable.xml b/addons/huntir/stringtable.xml new file mode 100644 index 0000000000..41b36e3377 --- /dev/null +++ b/addons/huntir/stringtable.xml @@ -0,0 +1,181 @@ + + + + + HuntIR Transport Box + HuntIR Transportkiste + HuntIR Transport Box + Trasnportní bedna HuntIR + Ящик с HuntIR + HuntIR Transport Box + Skrzynia HuntIR + HuntIR Transport Box + HuntIR Transport Box + + + HuntIR Round + HuntIR Granate + HuntIR Round + HuntIR Round + HuntIR снаряд + HuntIR Round + Nabój HuntIR + Munition HuntIR + HuntIR lövedék + + + HuntIR monitor + HuntIR Monitor + HuntIR monitor + HuntIR monitor + HuntIR монитор + HuntIR monitor + Odbiornik HuntIR + Ecran HuntIR + HuntIR monitor + + + Activate HuntIR monitor + HuntIR Monitor aktivieren + Activate HuntIR monitor + Zapnout HuntIR monitor + Включить HuntIR монитор + Activate HuntIR monitor + Włącz odbiornik HuntIR + Allumer écran HuntIR + HuntIR monitor aktiválása + + + Camera: + Kamera: + Camera: + Kamera: + Камера: + Camera: + Kamera: + Caméra: + Kamera: + + + Altitude: + Höhe: + Altitude: + Výška: + Высота: + Altitude: + Wysokość: + Altitude: + Magasság: + + + Recording Time: + Aufnahmezeit: + Recording Time: + Čas nahrávání: + Время записи: + Recording Time: + Czas nagrywania: + Temps d'enregistrement: + Felvételi idő: + + + Press ESC to quit camera + Zum Verlassen ESC drücken + Press ESC to quit camera + Stiskni ESC pro opustění kamery + Нажмите ESC чтобы выйти из режима камеры + Press ESC to quit camera + Wciśnij ESC by wyjść z widoku kamery + Appuyer sur ESC pour quitter camera + Nyomj ESC-ket a kamerából való kilépéshez + + + Help + Hilfe + Help + Pomoc + Помощь + Help + Pomoc + Aide + Súgó + + + A/D - Cycle zoom + A/D - Zoom + A/D - Cycle zoom + A/D - Změna přiblížení + A/D - Приближение + A/D - Cycle zoom + A/D - powiększenie + A/D - Changement zoom + A/D - Nagyítás + + + W/S - Select camera + W/S - Wähle Kamera + W/S - Select camera + W/S - Výběr kamery + W/S - Выбрать камеру + W/S - Select camera + W/S - wybór kamery + W/S - Sélectionner caméra + W/S - Kamera váltás + + + Left/Right - Rotate camera + Links/Rechts - Rotiere Kamera + Left/Right - Rotate camera + Levá/Pravá - Rotace kamery + Влево/Вправо - Вращать камеру + Left/Right - Rotate camera + Lewo/Prawo - obrót kamery w poziomie + Gauche/Droite - Rotation caméra + Jobb/Bal - Kamera forgatás + + + Up/Down - Elevate/lower camera + Hoch/Runter - Neige Kamera + Up/Down - Elevate/lower camera + Nahoru/Dolu - Zvýšít/snížit úhel pohledu kamery + Вверх/Вниз - Поднять/Опустить камеру + Up/Down - Elevate/lower camera + Góra/Dół - obrót kamery w pionie + Haut/Bas - Monter/descendre caméra + Fel/Le - Kamera döntése/süllyesztése + + + N - Cycle IT modes + N - Sichtmodi + N - Cycle IT modes + N - Změna režimů kamery + N - Режимы камеры + N - Cycle IT modes + N - wybór trybu IT + N - Changement de modes IT + N - Hőkép módok + + + R - Reset camera + R - Reset + R - Reset camera + R - Reset kamery + R - Сбросить настройки камеры + R - Reset camera + R - resetuj kamerę + R - Reset caméra + R - Kamera visszaállítása + + + Esc - Exit help + ESC - Hilfe verlassen + Esc - Exit help + Esc - Ukončit Pomoc + Esc - Выйти из помощи + Esc - Exit help + Esc - wyjście z ekranu Pomocy + Esc - Sortir de l'aide + Exit - Kilépés a súgóból + + + \ No newline at end of file