Merge pull request #306 from KoffeinFlummi/optics

Taosenai's Animated Optics req 1.42
This commit is contained in:
commy2 2015-04-08 21:41:12 +02:00
commit 7346c194f4
66 changed files with 1165 additions and 934 deletions

View File

@ -1,25 +0,0 @@
// TMR: Optics initialization and functions
// (C) 2013 Ryan Schultz. See LICENSE.
// Request a resource layer from the game engine.
AGM_Optics_scopeRSC = ["AGM_Optics_Scope"] call BIS_fnc_rscLayer;
// Set global variables
AGM_Optics_inScope = false; // Is the scope up?
AGM_Optics_currentOptic = ""; // What optic is attached right now?
0 = 0 spawn {
waituntil {!isNull (findDisplay 46)};
[] call AGM_Optics_fnc_initScope;
// PiP technique by BadBenson
AGM_Optics_Camera = "camera" camCreate (positioncameratoworld [0,0,0]);
AGM_Optics_Camera camSetFov 0.7;
AGM_Optics_Camera camSetTarget player;
AGM_Optics_Camera camCommit 1;
"agm_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
AGM_Optics_Camera cameraEffect ["INTERNAL", "BACK","agm_optics_rendertarget0"];
waitUntil {[] call AGM_Optics_fnc_mainLoop; False};
};

View File

@ -1,454 +0,0 @@
class CfgPatches {
class AGM_Optics {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = 0.1;
author[] = {"Taosenai"};
authorUrl = "http://www.ryanschultz.org/tmr/";
};
};
class CfgFunctions {
class AGM_Optics {
class AGM_Optics {
file = "AGM_Optics\functions";
class firedEH;
class hideScope;
class initScope;
class mainLoop;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_Optics {
clientInit = "call compile preProcessFileLineNumbers '\AGM_Optics\clientInit.sqf'";
};
};
class Extended_FiredBIS_EventHandlers {
class CAManBase {
class AGM_Optics {
clientFiredBIS = "_this call AGM_Optics_fnc_firedEH;";
};
};
};
class CfgOpticsEffect {
class AGM_OpticsRadBlur1 {
type = "radialblur";
params[] = {0.015, 0, 0.14, 0.2};
priority = 950;
};
};
class CfgWeapons {
class ItemCore;
class InventoryItem_Base_F;
class InventoryMuzzleItem_Base_F;
class InventoryOpticsItem_Base_F;
class optic_Hamr : ItemCore {
displayName = "HAMR 4x";
descriptionShort = "High Accuracy Multi-Range Optic<br />Magnification: 4x<br />Reticle: CM-RW 6.5mm";
scope = 2;
weaponInfoType = "AGM_RscWeapon";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\hamr\hamr-reticle65_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\hamr\hamr-reticle65Illum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\hamr\hamr-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\hamr\hamr-bodyNight_ca.paa";
model = "\A3\weapons_f\acc\acco_hamr_F";
class ItemInfo : InventoryOpticsItem_Base_F {
mass = 4;
optics = 1;
optictype = 1;
rmbhint = "HAMR";
modeloptics = "\AGM_Optics\agm_optics_pip.p3d";
class OpticsModes {
class Hamr2Collimator {
AGM_Optics_enhanced = 0;
opticsID = 1;
useModelOptics = 0;
opticsppeffects[] = {};
opticsFlare = 0;
opticsDisablePeripherialVision = 0;
opticsZoomMin = 0.375;
opticsZoomMax = 1;
opticsZoomInit = 0.75;
memoryPointCamera = "eye";
visionMode[] = {};
distanceZoomMin = 300;
distanceZoomMax = 300;
};
class Hamr2Scope {
cameradir = "";
distanceZoomMin = 300;
distanceZoomMax = 300;
memorypointcamera = "opticView";
opticsdisableperipherialvision = 0;
opticsdisplayname = "IHAMR";
opticsflare = 1;
opticsid = 2;
opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur1", "AGM_OpticsRadBlur1"};
opticszoominit = 0.0872664626;
opticszoommax = 0.0872664626;
opticszoommin = 0.0872664626;
discretefov[] = {0.0872664626};
discreteinitindex = 0;
usemodeloptics = 1;
modeloptics = "\AGM_Optics\agm_optics_pip.p3d";
visionmode[] = {"Normal", "NVG"};
};
};
};
};
class optic_Arco : ItemCore {
descriptionshort = "Advanced Rifle Combat Optic<br />Magnification: 4x<br />Reticle: SpecterDR 6.5mm";
displayname = "ARCO 4x";
picture = "\A3\weapons_F\Data\UI\gear_acco_Arco_CA.paa";
scope = 2;
weaponInfoType = "AGM_RscWeapon";
model = "\A3\weapons_f\acc\acco_Arco_F";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\arco\arco-reticle65_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\arco\arco-reticle65Illum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\arco\arco-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\arco\arco-bodyNight_ca.paa";
class ItemInfo: InventoryOpticsItem_Base_F {
mass = 4;
optics = 1;
optictype = 1;
rmbhint = "ARCO";
class OpticsModes {
class ARCO2collimator {
AGM_Optics_enhanced = 0;
cameradir = "";
distancezoommax = 300;
distancezoommin = 300;
memorypointcamera = "eye";
opticsdisableperipherialvision = 0;
opticsdisplayname = "CQB";
opticsflare = 0;
opticsid = 1;
opticsppeffects[] = {};
opticszoominit = 0.75;
opticszoommax = 1.1;
opticszoommin = 0.375;
usemodeloptics = 0;
visionmode[] = {};
};
class ARCO2scope: ARCO2collimator {
cameradir = "";
distanceZoomMin = 300;
distanceZoomMax = 300;
memorypointcamera = "opticView";
opticsdisableperipherialvision = 0;
opticsdisplayname = "ARCO";
opticsflare = 1;
opticsid = 2;
opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur1", "AGM_OpticsRadBlur1"};
opticszoominit = 0.0872664626; // 0.0872664626 rad = 5 degrees
opticszoommax = 0.0872664626; // SpecterDR 4x is 6 degrees
opticszoommin = 0.0872664626; // Scope graphic in game covers 1 degree
discretefov[] = {0.0872664626};
discreteinitindex = 0;
usemodeloptics = 1;
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
visionmode[] = {"Normal"};
};
};
};
};
class optic_MRCO : ItemCore {
displayName = "MRCO 1x/4x";
descriptionShort = "Medium Range Combat Optic<br />Magnification: 1x/4x<br />Reticle: Pitbull Gen II 5.56mm";
scope = 2;
weaponInfoType = "AGM_RscWeapon";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\mrco\mrco-reticle556_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\mrco\mrco-reticle556Illum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\mrco\mrco-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\mrco\mrco-bodyNight_ca.paa";
class ItemInfo : InventoryOpticsItem_Base_F {
opticType = 1;
mass = 4;
optics = 1;
modelOptics = "\A3\Weapons_f_beta\acc\reticle_MRCO_F";
class OpticsModes {
class MRCOcq {
AGM_Optics_enhanced = 0;
opticsID = 1;
useModelOptics = 0;
opticsPPEffects[] = {};
opticsFlare = 0;
opticsDisablePeripherialVision = 0;
opticsZoomMin = 0.375;
opticsZoomMax = 1;
opticsZoomInit = 0.75;
memoryPointCamera = "eye";
visionMode[] = {};
distanceZoomMin = 100;
distanceZoomMax = 100;
};
class MRCOscope {
cameradir = "";
distanceZoomMin = 300;
distanceZoomMax = 300;
memorypointcamera = "eye";
opticsdisableperipherialvision = 0;
opticsdisplayname = "MRCO";
opticsflare = 1;
opticsid = 2;
opticsppeffects[] = {"OpticsCHAbera2", "OpticsBlur2", "AGM_OpticsRadBlur1"};
opticszoominit = 0.0872664626;
opticszoommax = 0.0872664626;
opticszoommin = 0.0872664626;
discretefov[] = {0.0872664626};
discreteinitindex = 0;
usemodeloptics = 1;
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
visionmode[] = {"Normal"};
};
};
};
};
class optic_Nightstalker : ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class NCTALKEP {};
class Iron : NCTALKEP {
opticsppeffects[] = {}; // Fix Arma 3 bug
};
};
};
};
class optic_SOS: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
modelOptics = "\AGM_Optics\agm_optics_pip.p3d";
class OpticsModes {
class Snip {
visionMode[] = {"Normal","TI","NVG"};
thermalMode[] = {5,6};
opticsPPEffects[] = {"OpticsCHAbera1","radblur"};
modelOptics[] = {"\AGM_Optics\agm_optics_pip.p3d","\AGM_Optics\agm_optics_pip.p3d"};
};
};
};
};
class optic_DMS : ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class Snip {};
class Iron : Snip {
opticsppeffects[] = {}; // Fix Arma 3 bug
};
};
};
};
class optic_LRPS : ItemCore {
descriptionshort = "Nightforce NXS Riflescope<br />Magnification: 5.5-22x";
displayname = "NXS 5.5-22x";
weaponinfotype = "AGM_RscWeapon";
AGM_Optics_enhanced = 1;
AGM_Optics_reticle = "\AGM_Optics\data\sos\sos-reticleMLR_ca.paa";
AGM_Optics_reticleIllum = "\AGM_Optics\data\sos\sos-reticleMLRIllum_ca.paa";
AGM_Optics_body = "\AGM_Optics\data\sos\sos-body_ca.paa";
AGM_Optics_bodyNight = "\AGM_Optics\data\sos\sos-bodyNight_ca.paa";
class ItemInfo: InventoryOpticsItem_Base_F {
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
weaponinfotype = "RscWeaponRangeZeroingFOV";
opticType = 2; // Sniper optics
class OpticsModes {
// Based on Nightforce NXS 5.5-22 scope
class Snip {
cameradir = "";
discretedistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000, 2100, 2200, 2300};
discretedistanceinitindex = 0;
discreteinitindex = 0;
distancezoommax = 2300;
distancezoommin = 100;
memorypointcamera = "opticView";
modeloptics = "\AGM_Optics\data\AGM_Optics_reticle90.p3d";
opticsdisableperipherialvision = 1;
opticsdisplayname = "SOS";
opticsflare = 1;
opticsid = 1;
opticsppeffects[] = {"OpticsCHAbera1", "OpticsBlur1", "AGM_OpticsRadBlur1"};
// How to determine opticszoom
// First do the basic math based on the listed FOV of the scope to
// get a baseline FOV
// 0.1 meter at 100 meters = 1 mrad
//
// 5.5x FOV -- 5.3 m at 100 m = 53 mrad
// = 0.053 rad = 3.037 deg FOV
// 22x FOV -- 1.4 m at 100m = 14 mrad
// = 0.014 rad = 0.802 deg
// The FOV you give the engine is based on a rather larger scope outline, so we
// have to do this extra work ourselves.
// At 1680x1050
// The width of a TMR optic viewfield is 864px
// The engine viewport width (which is what the below FOV is based on) is 980
// (864/980) = (FOV to give engine / true FOV of optic)
// 864/980 * 0.053 = 0.04673
// 864/980 * 0.014 = 0.01234
// Measured experimentally, these values seem quite right.
// Certainly they're close enough after you account for pixel density, etc.
opticszoominit = 0.01234;
opticszoommax = 0.04673;
opticszoommin = 0.01234;
discretefov[] = {};
usemodeloptics = 1;
visionmode[] = {"Normal"};
};
};
};
};
class optic_Yorris : ItemCore {
descriptionshort = "Burris FastFire II Red Dot Sight<br />Magnification: 1x";
displayname = "FastFire II";
};
class optic_MRD : ItemCore {
descriptionshort = "Eotech MRDS Red Dot Sight<br />Magnification: 1x";
displayname = "MRDS";
};
class optic_Holosight : ItemCore {
descriptionshort = "Eotech XPS3 Holographic Sight<br />Magnification: 1x";
displayname = "XPS3 Holo";
};
};
class RscOpticsText;
class RscOpticsValue;
class RscInGameUI {
class RscUnitInfo;
class RscWeaponZeroing;
class AGM_RscWeapon : RscWeaponZeroing {
idd = -1;
controls[] = {"CA_Zeroing", "CA_FOVMode"};
onLoad ="with uiNameSpace do { AGM_OpticsIGUI = _this select 0 }";
class CA_FOVMode : RscOpticsValue {
idc = 154;
style = 2;
colorText[] = {0, 0, 0, 0};
x = 0;
y = 0;
w = 0;
h = 0;
};
};
};
class RscTitles {
class AGM_Optics_Scope {
idd = -1;
onLoad = "with uiNameSpace do { AGM_Optics_Scope = _this select 0 };";
onUnload = "";
movingEnable = 1;
duration = 10000;
controls[] = {"Reticle", "ReticleNight", "BodyNight", "Body"};
class Reticle {
colorBackground[] = {0,0,0, 0};
colorText[] = {1,1,1, 1};
fade = 0;
font = "PuristaMedium";
h = SafeZoneH;
idc = 1;
lineSpacing = 1.0;
movingEnable = 1;
size = 0;
sizeEx = 1;
style = 48;
text = "";
type = 0;
w = SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1));
x = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1)))/2);
y = SafeZoneY;
};
class ReticleNight : Reticle {
idc = 2;
text = "";
};
class Body : Reticle {
idc = 6;
text = "";
x = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1))));
y = SafeZoneY - (SafeZoneH/2);
w = SafeZoneWAbs / ((getResolution select 0) / (getResolution select 1)) * 2;
h = SafeZoneH * 2;
};
class BodyNight : Body {
idc = 5;
text = "";
};
};
};
class PreloadTextures {
class CfgWeapons {
class optic_hamr {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
class optic_arco {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
class optic_mrco {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
class optic_LRPS {
AGM_Optics_body= "*";
AGM_Optics_bodyNight = "*";
AGM_Optics_reticle = "*";
AGM_Optics_reticleIllum = "*";
};
};
};

View File

@ -1,149 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Animates the scope when firing.
*
* Arguments:
* 0: Unit
* 1: Weapon
* 2: Muzzle
* 3: Mode
* 4: Ammo
* 5: Magazine
* 6: Projectile
*
* Return Value:
* None
*/
if (_this select 0 != AGM_player) exitwith {}; // Sanity check
0 = _this spawn {
disableSerialization;
_weaponType = _this select 1;
_config = configFile >> "CfgWeapons" >> _weaponType;
_scope = uiNameSpace getVariable "AGM_Optics_Scope";
// @todo
_recoilMulti = getNumber (_config >> "tmr_smallarms_recoil_shakeMultiplier"); // Will be 0 if undefined
if (_recoilMulti == 0) then {
_recoilMulti = 1;
};
if (_recoilMulti > 2.6) then {
_recoilMulti = 2.6; // Don't get too high
};
// Reduce the reticle movement as the player drops into lower, supported stances.
_detectStance = (player selectionPosition "Neck" select 2);
if (_detectStance < 1.3) then {
_recoilMulti = _recoilMulti - 0.10;
};
if (_detectStance < 0.7) then {
_recoilMulti = _recoilMulti - 0.20;
};
// Reduce reticle movement if the player is rested (tmr_autorest).
if (player getVariable ["tmr_autorest_rested", false]) then {
_recoilMulti = _recoilMulti - 0.20;
};
// Reduce reticle movement if the player is deployed (tmr_autorest).
if (player getVariable ["tmr_autorest_deployed", false]) then {
_recoilMulti = _recoilMulti - 0.30;
};
_recoilMulti = 1;
// @endtodo
// Constants which determine how the scope recoils
_recoilScope = 0.03 * _recoilMulti + random 0.0015;
_recoilRing = 0.03 * _recoilMulti + random 0.0015;
_randomScopeShiftX = 0.005 * _recoilMulti - random 0.011;
_randomReticleShiftX = 0.0036 * _recoilMulti + random 0.0045; // Always tend up and right;
_randomReticleShiftY = -0.0046 * _recoilMulti - random 0.0055;
/////////
// Center everything
// getResolution select 4 should return the aspect ratio, but it's totally wrong
// for triple head displays. We'll compute it manually.
_aspectRatio = (getResolution select 0) / (getResolution select 1);
_reticleX = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / _aspectRatio)/2);
_reticleY = SafeZoneY;
_reticleW = SafeZoneWAbs / _aspectRatio;
_reticleH = SafeZoneH;
// Reticle
(_scope displayCtrl 1) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
// Reticle night (illum)
(_scope displayCtrl 2) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
_bodyX = (SafeZoneXAbs + SafeZoneWAbs/2 - (SafeZoneWAbs / _aspectRatio));
_bodyY = SafeZoneY - (SafeZoneH/2);
_bodyW = SafeZoneWAbs / _aspectRatio * 2;
_bodyH = SafeZoneH * 2;
// Body night
(_scope displayCtrl 5) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
// Body
(_scope displayCtrl 6) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
_centerDelay = 0.01;
(_scope displayCtrl 1) ctrlCommit _centerDelay;
(_scope displayCtrl 2) ctrlCommit _centerDelay;
(_scope displayCtrl 5) ctrlCommit _centerDelay;
(_scope displayCtrl 6) ctrlCommit _centerDelay;
/////////
// Create and commit recoil effect
// Move reticle
(_scope displayCtrl 1) ctrlSetPosition [_reticleX - (_recoilScope/2) + _randomReticleShiftX, _reticleY - (_recoilScope/2) + _randomReticleShiftY, _reticleW + _recoilScope, _reticleH + _recoilScope];
(_scope displayCtrl 2) ctrlSetPosition [_reticleX - (_recoilScope/2) + _randomReticleShiftX, _reticleY - (_recoilScope/2) + _randomReticleShiftY, _reticleW + _recoilScope, _reticleH + _recoilScope];
// Move body
(_scope displayCtrl 5) ctrlSetPosition [_bodyX - (_recoilScope/2) + _randomScopeShiftX, _bodyY - (_recoilScope/2), _bodyW + _recoilScope, _bodyH + _recoilScope];
(_scope displayCtrl 6) ctrlSetPosition [_bodyX - (_recoilScope/2) + _randomScopeShiftX, _bodyY - (_recoilScope/2), _bodyW + _recoilScope, _bodyH + _recoilScope];
_recoilDelay = 0.036;
_fa = false;
_cwm = currentWeaponMode player;
if (_cwm == "FullAuto" || _cwm == "manual" || _cwm == "Burst") then {
_recoilDelay = getNumber (_config >> _cwm >> "reloadTime")/2.2;
_fa = true;
};
(_scope displayCtrl 1) ctrlCommit _recoilDelay;
(_scope displayCtrl 2) ctrlCommit _recoilDelay;
(_scope displayCtrl 5) ctrlCommit _recoilDelay;
(_scope displayCtrl 6) ctrlCommit _recoilDelay;
//////////////
waituntil {sleep 0.01; ctrlCommitted (_scope displayCtrl 6)};
//////////////
//////
// Bring them all back
(_scope displayCtrl 1) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
(_scope displayCtrl 2) ctrlSetPosition [_reticleX, _reticleY, _reticleW, _reticleH];
(_scope displayCtrl 5) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
(_scope displayCtrl 6) ctrlSetPosition [_bodyX, _bodyY, _bodyW, _bodyH];
_recenterDelay = 0.09;
if (_fa) then {
_recenterDelay = getNumber (_config >> _cwm >> "reloadTime")/2.2;
};
(_scope displayCtrl 1) ctrlCommit _recenterDelay;
(_scope displayCtrl 2) ctrlCommit _recenterDelay;
(_scope displayCtrl 5) ctrlCommit _recenterDelay;
(_scope displayCtrl 6) ctrlCommit _recenterDelay;
};

View File

@ -1,19 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Hides the scope.
*
*/
private ["_scope"];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlCommit 0;

View File

@ -1,25 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Initializes the scope resources.
*
*/
private ["_display"];
// Make sure we only cutRsc when the resource isn't already available
if (isNil {uiNameSpace getVariable "AGM_Optics_Scope"} or {isNull (uiNameSpace getVariable "AGM_Optics_Scope")}) exitWith {
AGM_Optics_scopeRSC cutRsc ["AGM_Optics_Scope","PLAIN",0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlSetTextColor [1,1,1,0];
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 1) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 2) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 5) ctrlCommit 0;
((uiNameSpace getVariable "AGM_Optics_Scope") displayCtrl 6) ctrlCommit 0;
True
};
False

View File

@ -1,94 +0,0 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi
*
* Monitors the RscInGameUI and displays the overlays when needed.
*
* Arguments:
* None
*
* Return Value:
* None
*/
if !(cameraOn == AGM_player && {alive AGM_player} && {!visibleMap} && {ctrlShown ((uinamespace getVariable "AGM_OpticsIGUI") displayCtrl 154)}) exitWith {
// Failed the state check, hide the scope if it's up
if (AGM_Optics_inScope) then {
// Hide the scope
AGM_Optics_inScope = false;
AGM_Optics_inScope_FOV = ([] call cba_fnc_getFOV) select 0;
[] call AGM_Optics_fnc_hideScope;
};
};
AGM_Optics_Camera setposATL (positioncameratoworld [0,0,0.4]);
AGM_Optics_Camera camPrepareTarget (positioncameratoworld [0,0,50]);
AGM_Optics_Camera camCommitPrepared 0;
if (cameraView == "Gunner") then {
AGM_Optics_Camera camsetFOV 0.7;
AGM_Optics_Camera camcommit 0;
} else {
AGM_Optics_Camera camsetFOV 0.01;
AGM_Optics_Camera camcommit 0;
};
private ["_optic", "_scope"];
disableSerialization;
// Get the name of the attached optic
_optic = (primaryWeaponItems AGM_player) select 2;
_scope = uiNameSpace getVariable "AGM_Optics_Scope";
// Init the scope (if needed)
[] call AGM_Optics_fnc_initScope;
// Check if the optic has changed since we last drew it
_doUpdateAllLayers = false;
if (AGM_Optics_currentOptic != _optic) then {
AGM_Optics_currentOptic = _optic;
_doUpdateAllLayers = true;
};
// Check if Splendid Camera, unit switch, etc. has blanked out our displays for no good reason (grrr)
if (ctrlText (_scope displayCtrl 1) == "") then {
_doUpdateAllLayers = true;
};
// Draw the correct layers (don't show them)
if (_doUpdateAllLayers) then {
(_scope displayCtrl 1) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_reticle");
(_scope displayCtrl 2) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_reticleIllum");
(_scope displayCtrl 5) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_bodyNight");
(_scope displayCtrl 6) ctrlSetText getText (configFile >> "CfgWeapons" >> _optic >> "AGM_Optics_body");
};
// Stop processing if already in the scope view and FOV hasn't changed
if (AGM_Optics_inScope) exitwith {};
// Mark that we're in enhanced scope view
AGM_Optics_inScope = true;
// Calculate lighting
_lighting = sunOrMoon; // 1 is day, 0 is night
_nightOpacity = 1;
_dayOpacity = (0 max moonIntensity * (1 - (0 max overcast)))/5;
if (_lighting == 1) then {
_nightOpacity = 0;
_dayOpacity = 1;
};
// Apply lighting and make layers visible
(_scope displayCtrl 1) ctrlSetTextColor [1,1,1,1];
(_scope displayCtrl 2) ctrlSetTextColor [1,1,1,_nightOpacity];
(_scope displayCtrl 5) ctrlSetTextColor [1,1,1,_nightOpacity];
(_scope displayCtrl 6) ctrlSetTextColor [1,1,1,_dayOpacity];
(_scope displayCtrl 1) ctrlCommit 0;
(_scope displayCtrl 2) ctrlCommit 0;
(_scope displayCtrl 5) ctrlCommit 0;
(_scope displayCtrl 6) ctrlCommit 0;

View File

@ -100,7 +100,7 @@ class CfgVehicles {
transportMaxWeapons = 9001;
transportMaxMagazines = 9001;
transportMaxItems = 9001;
maximumload = 2000;
maximumload = 9001;
class TransportWeapons {};
class TransportMagazines {};

View File

@ -1,23 +1,107 @@
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscUnitInfoNoHUD {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscUnitInfoSoldier: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSoldier', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Soldier')])] call FUNC(localEvent););
};
class RscUnitInfoTank: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgVehicle', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Vehicle')])] call FUNC(localEvent););
};
class RscUnitInfoAir: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
};
class RscUnitInfo_AH64D_gunner {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgAircraft', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Aircraft')])] call FUNC(localEvent););
};
class RscUnitInfoUAV {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgUAV', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'UAV')])] call FUNC(localEvent););
};
class RscUnitInfoSubmarine: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgSubmarine', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Submarine')])] call FUNC(localEvent););
};
class RscUnitInfoShip: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgShip', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Ship')])] call FUNC(localEvent););
};
class RscWeaponEmpty {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinder {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeArtillery {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent););
};
class RscWeaponRangeArtilleryAuto {
onLoad = QUOTE(uiNamespace setVariable [ARR_2('ACE_dlgArtillery', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Artillery')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderPAS13 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_LaserDesignator {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderMAAWS {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderAbramsCom {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderAbramsGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_strider_commander {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_titan {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_punisher {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_SDV_periscope {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscUnitInfoParachute: RscUnitInfo {
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent););
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscUnitInfo"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable [ARR_2('ACE_dlgParachute', _this select 0)]; [ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Parachute')])] call FUNC(localEvent););
};
class RscUnitVehicle {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
class RscOptics_LaserDesignator_02 {
onLoad = QUOTE([ARR_2('infoDisplayChanged', [ARR_2(_this select 0, 'Any')])] call FUNC(localEvent););
};
};

View File

@ -273,10 +273,10 @@ ACE_player = player;
if (hasInterface) then {
// PFH to update the ACE_player variable
[{
if !(ACE_player isEqualTo (missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player])) then {
if !(ACE_player isEqualTo (call FUNC(player))) then {
_oldPlayer = ACE_player;
ACE_player = missionNamespace getVariable ["BIS_fnc_moduleRemoteControl_unit", player];
ACE_player = call FUNC(player);
uiNamespace setVariable ["ACE_player", ACE_player];
// Raise ACE event

View File

@ -1,5 +1,5 @@
/*
* Author: bux578
* Author: bux578, commy2
*
* Returns an array containing all items of a given unit
*
@ -7,32 +7,45 @@
* 0: Unit (Object)
*
* Return value:
* Array with all the gear
* Array with all the gear, format:
* 0: headgear (String)
* 1: goggles (String)
* 2,3: uniform (String, Array)
* 4,5: vest (String, Array)
* 6,7: backpack (String, Array)
* 8-10: rifle (String, Array, Array)
* 11-13: launcher (String, Array, Array)
* 14-16: pistol (String, Array, Array)
* 17: map, compass, watch, etc. (Array)
* 18: binocluar (String)
*
*/
#include "script_component.hpp"
EXPLODE_1_PVT(_this,_unit);
if (isNull _unit) exitWith {[]};
if (isNull _unit) exitWith {[
"",
"",
"", [],
"", [],
"", [],
"", ["","","",""], [],
"", ["","","",""], [],
"", ["","","",""], [],
[],
""
]};
[
(headgear _unit),
(goggles _unit),
(uniform _unit),
(uniformItems _unit),
(vest _unit),
(vestItems _unit),
(backpack _unit),
(backpackItems _unit),
(primaryWeapon _unit),
(primaryWeaponItems _unit),
(primaryWeaponMagazine _unit),
(secondaryWeapon _unit),
(secondaryWeaponItems _unit),
(secondaryWeaponMagazine _unit),
(handgunWeapon _unit),
(handgunItems _unit),
(handgunMagazine _unit),
(assignedItems _unit),
(binocular _unit)
]
headgear _unit,
goggles _unit,
uniform _unit, uniformItems _unit,
vest _unit, vestItems _unit,
backpack _unit, backpackItems _unit,
primaryWeapon _unit, primaryWeaponItems _unit, primaryWeaponMagazine _unit,
secondaryWeapon _unit, secondaryWeaponItems _unit, secondaryWeaponMagazine _unit,
handgunWeapon _unit, handgunItems _unit, handgunMagazine _unit,
assignedItems _unit,
binocular _unit
]

View File

@ -17,22 +17,18 @@ class RscMapControl;
class RscInGameUI {
class RscUnitInfo;
class RscUnitInfo_AH64D_gunner {
onLoad = "";
controls[] = {"CA_Distance","ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinder {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance","ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderPAS13 {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
MACRO_RANGEFINDER
};
class RscOptics_Rangefinder: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -40,7 +36,6 @@ class RscInGameUI {
};
};
class RscOptics_LaserDesignator {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -48,7 +43,6 @@ class RscInGameUI {
};
};
class RscWeaponRangeFinderMAAWS {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -56,22 +50,18 @@ class RscInGameUI {
};
};
class RscWeaponRangeFinderAbramsCom {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance","ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderAbramsGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance","ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscWeaponRangeFinderStrykerMGSGun {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
controls[] = {"CA_Distance","ACE_CA_Distance"};
MACRO_RANGEFINDER
};
class RscOptics_crows: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -79,7 +69,6 @@ class RscInGameUI {
};
};
class RscOptics_strider_commander {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -88,12 +77,10 @@ class RscInGameUI {
};
class RscWeaponRangeZeroing: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
controls[] = {"CA_Zeroing", "CA_DistanceText", "CA_Distance","ACE_CA_Distance", "ACE_Rangehelper"};
MACRO_RANGEFINDER
};
class RscOptics_sos: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -101,7 +88,6 @@ class RscInGameUI {
};
};
class RscOptics_nightstalker: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -109,7 +95,6 @@ class RscInGameUI {
};
};
class RscOptics_tws: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -117,7 +102,6 @@ class RscInGameUI {
};
};
class RscOptics_punisher {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -125,7 +109,6 @@ class RscInGameUI {
};
};
class RscOptics_tws_sniper: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -133,7 +116,6 @@ class RscInGameUI {
};
};
class RscOptics_SDV_periscope {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0];";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -141,7 +123,6 @@ class RscInGameUI {
};
};
class RscOptics_Heli_Attack_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -157,7 +138,6 @@ class RscInGameUI {
};
};
class RscOptics_Heli_Attack_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -165,7 +145,6 @@ class RscInGameUI {
};
};
class RscOptics_UAV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -173,7 +152,6 @@ class RscInGameUI {
};
};
class RscOptics_UGV_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -181,7 +159,6 @@ class RscInGameUI {
};
};
class RscOptics_APC_Tracked_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -189,7 +166,6 @@ class RscInGameUI {
};
};
class RscOptics_APC_Tracked_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -197,7 +173,6 @@ class RscInGameUI {
};
};
class RscOptics_APC_Wheeled_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -205,7 +180,6 @@ class RscInGameUI {
};
};
class RscOptics_APC_Wheeled_03_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -213,7 +187,6 @@ class RscInGameUI {
};
};
class RscOptics_APC_Wheeled_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -221,7 +194,6 @@ class RscInGameUI {
};
};
class RscOptics_MBT_01_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -229,7 +201,6 @@ class RscInGameUI {
};
};
class RscOptics_MBT_01_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -237,7 +208,6 @@ class RscInGameUI {
};
};
class RscOptics_MBT_02_commander: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -245,7 +215,6 @@ class RscInGameUI {
};
};
class RscOptics_MBT_02_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
@ -253,7 +222,15 @@ class RscInGameUI {
};
};
class RscOptics_MBT_03_gunner: RscUnitInfo {
onLoad = "uiNamespace setVariable ['ACE_dlgRangefinder', _this select 0]; ((_this select 0) displayCtrl 151) ctrlSetTextColor [0, 0, 0, 0]; [""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""";
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER
};
};
};
// marksmen
class RscOptics_LaserDesignator_02 {
class CA_IGUI_elements_group: RscControlsGroup {
class controls {
MACRO_RANGEFINDER

View File

@ -6,5 +6,12 @@ GVAR(position) = [0,0,0];
#include "initKeybinds.sqf"
["infoDisplayChanged", {
if (!isNull ((_this select 0) displayCtrl 1713151)) then {
uiNamespace setVariable ["ACE_dlgRangefinder", _this select 0];
((_this select 0) displayCtrl 151) ctrlSetTextColor [0,0,0,0];
};
}] call EFUNC(common,addEventHandler);
// Register event for global updates
[QGVAR(forceUpdate), FUNC(onForceUpdate)] call ace_common_fnc_addEventHandler;
[QGVAR(forceUpdate), FUNC(onForceUpdate)] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1 @@
z\ace\addons\optics

View File

@ -0,0 +1,20 @@
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 AGM_Optics {
clientFiredBIS = QUOTE(if (_this select 0 == ACE_player) then {_this call DFUNC(handleFired)};);
};
};
};

View File

@ -0,0 +1,8 @@
class CfgOpticsEffect {
class ACE_OpticsRadBlur1 {
type = "radialblur";
params[] = {0.015,0,0.14,0.2};
priority = 950;
};
};

View File

@ -0,0 +1,50 @@
#define MACRO_PRELOAD \
GVAR(BodyDay) = "*"; \
GVAR(BodyNight) = "*"; \
GVAR(ReticleDay) = "*"; \
GVAR(ReticleNight) = "*"
class PreloadTextures {
class CfgWeapons {
class ACE_optic_Hamr_2D {
MACRO_PRELOAD;
};
class ACE_optic_Hamr_PIP {
MACRO_PRELOAD;
};
class ACE_optic_Arco_2D {
MACRO_PRELOAD;
};
class ACE_optic_Arco_PIP {
MACRO_PRELOAD;
};
class ACE_optic_MRCO_2D {
MACRO_PRELOAD;
};
class ACE_optic_MRCO_PIP {
MACRO_PRELOAD;
};
class ACE_optic_SOS_2D {
MACRO_PRELOAD;
};
class ACE_optic_SOS_PIP {
MACRO_PRELOAD;
};
class ACE_optic_LRPS_2D {
MACRO_PRELOAD;
};
class ACE_optic_LRPS_PIP {
MACRO_PRELOAD;
};
};
};

View File

@ -0,0 +1,187 @@
class RscOpticsValue;
class RscMapControl;
class RscText;
class RscInGameUI {
class RscUnitInfo;
class RscWeaponZeroing: RscUnitInfo {
class CA_Zeroing;
};
class ACE_RscWeaponZeroing: RscWeaponZeroing {
controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ACE_ScriptedReticle"};
class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used
idc = 154;
style = 2;
colorText[] = {0,0,0,0};
x = 0;
y = 0;
w = 0;
h = 0;
};
class ACE_DrawReticleHelper: RscMapControl {
onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawScope));
idc = -1;
w = 0;
h = 0;
};
class ACE_ScriptedReticle: RscText {
idc = 1713154;
style = 48;
size = 1;
sizeEx = 0;
text = QUOTE(PATHTOF(reticles\ace_shortdot_reticle_1.paa));
w = 0;
h = 0;
};
};
class ACE_RscWeapon_base: RscWeaponZeroing {
controls[] = {"CA_Zeroing","CA_FOVMode","ACE_DrawReticleHelper","ReticleDay","ReticleNight","BodyNight","BodyDay"}; // don't change this order
class CA_FOVMode: RscOpticsValue { // idea by Taosenai. Apparently this can be used via isNil check to determine wheter the scope or the kolimator is used
idc = 154;
style = 2;
colorText[] = {0,0,0,0};
x = 0;
y = 0;
w = 0;
h = 0;
};
class ACE_DrawReticleHelper: RscMapControl {
onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawScope2D));
idc = -1;
w = 0;
h = 0;
};
#define SIZEX 0.75/(getResolution select 5)
class ReticleDay: RscText {
idc = 1713001;
style = 48;
size = 0;
sizeEx = 1;
text = "";
colorText[] = {1,1,1,0};
colorBackground[] = {0,0,0,0};
x = safezoneX+0.5*safezoneW-0.5*SIZEX;
y = safezoneY+0.5*safezoneH-0.5*SIZEX*safezoneW/safezoneH;
w = SIZEX;
h = SIZEX*safezoneW/safezoneH;
};
class ReticleNight: ReticleDay {
idc = 1713002;
text = "";
};
#define SIZEX 2*0.75/(getResolution select 5)
class BodyDay: ReticleDay {
idc = 1713005;
text = "";
x = safezoneX+0.5*safezoneW-0.5*SIZEX;
y = safezoneY+0.5*safezoneH-0.5*SIZEX*safezoneW/safezoneH;
w = SIZEX;
h = SIZEX*safezoneW/safezoneH;
};
class BodyNight: BodyDay {
idc = 1713006;
text = "";
};
};
class ACE_RscWeapon_Hamr: ACE_RscWeapon_base {
class ReticleDay: ReticleDay {
text = QUOTE(PATHTOF(reticles\hamr-reticle65_ca.paa));
};
class ReticleNight: ReticleNight {
text = QUOTE(PATHTOF(reticles\hamr-reticle65Illum_ca.paa));
};
class BodyDay: BodyDay {
text = QUOTE(PATHTOF(reticles\hamr-body_ca.paa));
};
class BodyNight: BodyNight {
text = QUOTE(PATHTOF(reticles\hamr-bodyNight_ca.paa));
};
};
class ACE_RscWeapon_Arco: ACE_RscWeapon_base {
class ReticleDay: ReticleDay {
text = QUOTE(PATHTOF(reticles\arco-reticle65_ca.paa));
};
class ReticleNight: ReticleNight {
text = QUOTE(PATHTOF(reticles\arco-reticle65Illum_ca.paa));
};
class BodyDay: BodyDay {
text = QUOTE(PATHTOF(reticles\arco-body_ca.paa));
};
class BodyNight: BodyNight {
text = QUOTE(PATHTOF(reticles\arco-bodyNight_ca.paa));
};
};
class ACE_RscWeapon_MRCO: ACE_RscWeapon_base {
class ReticleDay: ReticleDay {
text = QUOTE(PATHTOF(reticles\mrco-reticle556_ca.paa));
};
class ReticleNight: ReticleNight {
text = QUOTE(PATHTOF(reticles\mrco-reticle556Illum_ca.paa));
};
class BodyDay: BodyDay {
text = QUOTE(PATHTOF(reticles\mrco-body_ca.paa));
};
class BodyNight: BodyNight {
text = QUOTE(PATHTOF(reticles\mrco-bodyNight_ca.paa));
};
};
class ACE_RscWeapon_SOS: ACE_RscWeapon_base {
class ReticleDay: ReticleDay {
text = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa));
};
class ReticleNight: ReticleNight {
text = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa));
};
class BodyDay: BodyDay {
text = QUOTE(PATHTOF(reticles\sos-body_ca.paa));
};
class BodyNight: BodyNight {
text = QUOTE(PATHTOF(reticles\sos-bodyNight_ca.paa));
};
};
};
/*
_ctrl = (D displayCtrl 1713006);
_sizeX = 1.54/(getResolution select 5);
_sizeY = _sizeX*safezoneW/safezoneH;
_ctrl ctrlSetPosition [
safezoneX+0.5*safezoneW-0.5*_sizeX,
safezoneY+0.5*safezoneH-0.5*_sizeY,
_sizeX,
_sizeY
];
_ctrl ctrlCommit 0
*/

View File

@ -0,0 +1,19 @@
class CfgVehicles {
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_optic_Hamr_2D,2);
MACRO_ADDITEM(ACE_optic_Hamr_PIP,2);
MACRO_ADDITEM(ACE_optic_Arco_2D,2);
MACRO_ADDITEM(ACE_optic_Arco_PIP,2);
MACRO_ADDITEM(ACE_optic_MRCO_2D,2);
//MACRO_ADDITEM(ACE_optic_MRCO_PIP,2);
MACRO_ADDITEM(ACE_optic_SOS_2D,2);
MACRO_ADDITEM(ACE_optic_SOS_PIP,2);
MACRO_ADDITEM(ACE_optic_LRPS_2D,2);
MACRO_ADDITEM(ACE_optic_LRPS_PIP,2);
MACRO_ADDITEM(ACE_optic_DMS,2);
};
};
};

View File

@ -0,0 +1,303 @@
class CfgWeapons {
class ItemCore;
class InventoryOpticsItem_Base_F;
// zooming reticle scopes
class optic_DMS: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class Snip;
class Iron;
};
};
};
class ACE_optic_DMS: optic_DMS {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_DMS";
scope = 1;
displayName = "LOCALIZE ACE DMS";
//descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1";
weaponInfoType = "ACE_RscWeaponZeroing";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_shortdot_optics.p3d));
class OpticsModes: OpticsModes {
class Snip: Snip {
opticsZoomMin = 0.05;
opticsZoomMax = 0.3;
opticsZoomInit = 0.3;
discretefov[] = {};
modelOptics[] = {};
};
class Iron: Iron {};
};
};
};
// PIP scopes
class optic_Hamr: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class Hamr2Collimator;
class Hamr2Scope;
};
};
};
class ACE_optic_Hamr_2D: optic_Hamr {
GVAR(BodyDay) = QUOTE(PATHTOF(reticles\hamr-body_ca.paa));
GVAR(BodyNight) = QUOTE(PATHTOF(reticles\hamr-bodyNight_ca.paa));
GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\hamr-reticle65_ca.paa));
GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\hamr-reticle65Illum_ca.paa));
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_Hamr_2D";
displayName = "$STR_ACE_optic_hamr";
weaponInfoType = "ACE_RscWeapon_Hamr";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_optics_reticle90.p3d));
class OpticsModes: OpticsModes {
class Hamr2Collimator: Hamr2Collimator {};
class Hamr2Scope: Hamr2Scope {
useModelOptics = 1;
opticsZoomInit = 0.0872664626;
opticsZoomMax = 0.0872664626;
opticsZoomMin = 0.0872664626;
opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"};
opticsDisablePeripherialVision = 0;
visionMode[] = {"Normal","NVG"};
};
};
};
};
class ACE_optic_Hamr_PIP: ACE_optic_Hamr_2D {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_Hamr_PIP";
scopeArsenal = 1;
displayName = "$STR_ACE_optic_hamr_pip";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_optics_pip.p3d));
};
};
class optic_Arco: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class ARCO2collimator;
class ARCO2scope: ARCO2collimator {};
};
};
};
class ACE_optic_Arco_2D: optic_Arco {
GVAR(BodyDay) = QUOTE(PATHTOF(reticles\arco-body_ca.paa));
GVAR(BodyNight) = QUOTE(PATHTOF(reticles\arco-bodyNight_ca.paa));
GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\arco-reticle65_ca.paa));
GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\arco-reticle65Illum_ca.paa));
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_Arco_2D";
displayName = "$STR_ACE_optic_arco";
weaponInfoType = "ACE_RscWeapon_Arco";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_optics_reticle90.p3d));
class OpticsModes: OpticsModes {
class ARCO2collimator: ARCO2collimator {};
class ARCO2scope: ARCO2scope {
useModelOptics = 1;
opticsZoomInit = 0.0872664626;
opticsZoomMax = 0.0872664626;
opticsZoomMin = 0.0872664626;
opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"};
opticsDisablePeripherialVision = 0;
visionMode[] = {"Normal"};
};
};
};
};
class ACE_optic_Arco_PIP: ACE_optic_Arco_2D {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_Arco_PIP";
scopeArsenal = 1;
displayName = "$STR_ACE_optic_arco_pip";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_optics_pip.p3d));
};
};
class optic_MRCO: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class MRCOcq;
class MRCOscope;
};
};
};
class ACE_optic_MRCO_2D: optic_MRCO {
GVAR(BodyDay) = QUOTE(PATHTOF(reticles\mrco-body_ca.paa));
GVAR(BodyNight) = QUOTE(PATHTOF(reticles\mrco-bodyNight_ca.paa));
GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\mrco-reticle556_ca.paa));
GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\mrco-reticle556Illum_ca.paa));
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_MRCO_2D";
displayName = "$STR_ACE_optic_valdada";
weaponInfoType = "ACE_RscWeapon_MRCO";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_optics_reticle90.p3d));
class OpticsModes: OpticsModes {
class MRCOcq: MRCOcq {};
class MRCOscope: MRCOscope {
useModelOptics = 1;
opticsZoomInit = 0.0872664626;
opticsZoomMax = 0.0872664626;
opticsZoomMin = 0.0872664626;
opticsPPEffects[] = {"OpticsCHAbera5","OpticsBlur5","ACE_OpticsRadBlur1"};
opticsDisablePeripherialVision = 0;
visionMode[] = {"Normal"};
};
};
};
};
class ACE_optic_MRCO_PIP: ACE_optic_MRCO_2D {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_MRCO_PIP";
scope = 1;
scopeArsenal = 1;
displayName = "$STR_ACE_optic_valdada_pip";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(models\ace_optics_pip.p3d));
};
};
class optic_SOS: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class Snip;
class Iron;
};
};
};
class ACE_optic_SOS_2D: optic_SOS {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_SOS_2D";
displayName = "$STR_ACE_optic_sos";
weaponInfoType = "ACE_RscWeapon_SOS";
class ItemInfo: ItemInfo {
class OpticsModes: OpticsModes {
class Snip: Snip {
modelOptics[] = {QUOTE(PATHTOF(models\ace_optics_reticle90.p3d)),QUOTE(PATHTOF(models\ace_optics_reticle90.p3d))};
opticsDisablePeripherialVision = 0;
};
class Iron: Iron {};
};
};
};
class ACE_optic_SOS_PIP: ACE_optic_SOS_2D {
GVAR(BodyDay) = QUOTE(PATHTOF(reticles\sos-body_ca.paa));
GVAR(BodyNight) = QUOTE(PATHTOF(reticles\sos-bodyNight_ca.paa));
GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa));
GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa));
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_SOS_PIP";
scopeArsenal = 1;
displayName = "$STR_ACE_optic_sos_pip";
class ItemInfo: ItemInfo {
class OpticsModes: OpticsModes {
class Snip: Snip {
modelOptics[] = {QUOTE(PATHTOF(models\ace_optics_pip.p3d)),QUOTE(PATHTOF(models\ace_optics_pip.p3d))};
};
};
};
};
class optic_LRPS: ItemCore {
class ItemInfo: InventoryOpticsItem_Base_F {
class OpticsModes {
class Snip;
};
};
};
class ACE_optic_LRPS_2D: optic_LRPS {
GVAR(BodyDay) = QUOTE(PATHTOF(reticles\sos-body_ca.paa));
GVAR(BodyNight) = QUOTE(PATHTOF(reticles\sos-bodyNight_ca.paa));
GVAR(ReticleDay) = QUOTE(PATHTOF(reticles\sos-reticleMLR_ca.paa));
GVAR(ReticleNight) = QUOTE(PATHTOF(reticles\sos-reticleMLRIllum_ca.paa));
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_LRPS_2D";
displayName = "$STR_ACE_optic_lrps";
weaponInfoType = "ACE_RscWeapon_SOS";
class ItemInfo: ItemInfo {
class OpticsModes: OpticsModes {
class Snip: Snip {
modelOptics[] = {QUOTE(PATHTOF(models\ace_optics_reticle90.p3d)),QUOTE(PATHTOF(models\ace_optics_reticle90.p3d))};
useModelOptics = 1;
opticsZoomInit = 0.01234;
opticsZoomMax = 0.04673;
opticsZoomMin = 0.01234;
discreteFOV[] = {};
opticsPPEffects[] = {"OpticsCHAbera1","OpticsBlur1","ACE_OpticsRadBlur1"};
opticsDisablePeripherialVision = 0;
};
};
};
};
class ACE_optic_LRPS_PIP: ACE_optic_LRPS_2D {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_LRPS_PIP";
scopeArsenal = 1;
displayName = "$STR_ACE_optic_lrps_pip";
class ItemInfo: ItemInfo {
class OpticsModes: OpticsModes {
class Snip: Snip {
modelOptics[] = {QUOTE(PATHTOF(models\ace_optics_pip.p3d)),QUOTE(PATHTOF(models\ace_optics_pip.p3d))};
};
};
};
};
};
class SlotInfo;
class CowsSlot: SlotInfo {
compatibleItems[] += {
"ACE_optic_Hamr_2D",
"ACE_optic_Hamr_PIP",
"ACE_optic_Arco_2D",
"ACE_optic_Arco_PIP",
"ACE_optic_MRCO_2D",
"ACE_optic_MRCO_PIP",
"ACE_optic_SOS_2D",
"ACE_optic_SOS_PIP",
"ACE_optic_LRPS_2D",
"ACE_optic_LRPS_PIP",
"ACE_optic_DMS"
};
};

View File

@ -0,0 +1,24 @@
// by commy2
#include "script_component.hpp"
if (!hasInterface) exitWith {};
0 = 0 spawn {
waituntil {!isNull ACE_player};
// PiP technique by BadBenson
GVAR(camera) = "camera" camCreate positioncameratoworld [0,0,0];
GVAR(camera) camSetFov 0.7;
GVAR(camera) camSetTarget ACE_player;
GVAR(camera) camCommit 1;
"ace_optics_rendertarget0" setPiPEffect [2, 1.0, 1.0, 1.0, 0.0, [0.0, 1.0, 0.0, 0.25], [1.0, 0.0, 1.0, 1.0], [0.199, 0.587, 0.114, 0.0]];
GVAR(camera) cameraEffect ["INTERNAL", "BACK", "ace_optics_rendertarget0"];
};
// save control for fired EH
["infoDisplayChanged", {
if (!isNull ((_this select 0) displayCtrl 1713001)) then {
uiNamespace setVariable [QGVAR(RscWeaponInfo2D), _this select 0];
};
}] call EFUNC(common,addEventHandler);

View File

@ -0,0 +1,9 @@
#include "script_component.hpp"
ADDON = false;
PREP(handleFired);
PREP(onDrawScope);
PREP(onDrawScope2D);
ADDON = true;

34
addons/optics/config.cpp Normal file
View File

@ -0,0 +1,34 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {
"ACE_optic_Hamr_2D",
"ACE_optic_Hamr_PIP",
"ACE_optic_Arco_2D",
"ACE_optic_Arco_PIP",
"ACE_optic_MRCO_2D",
//"ACE_optic_MRCO_PIP",
"ACE_optic_SOS_2D",
"ACE_optic_SOS_PIP",
"ACE_optic_LRPS_2D",
"ACE_optic_LRPS_PIP",
"ACE_optic_DMS"
};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Taosenai","KoffeinFlummi","commy2"};
authorUrl = "http://www.ryanschultz.org/tmr/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgOpticsEffect.hpp"
#include "CfgRscTitles.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "CfgPreloadTextures.hpp"

View File

@ -0,0 +1,111 @@
/*
* Original Author: Taosenai
* Adapted By: KoffeinFlummi, commy2
*
* Animates the scope when firing.
*
* Arguments:
* 0: Unit (Object)
* 1: Weapon (String)
* 2: Muzzle (String)
* 3: Mode (String)
* 4: Ammo (Object)
* 5: Magazine (String)
* 6: Projectile (Object)
*
* Return Value:
* None
*/
#include "script_component.hpp"
private ["_unit", "_weapon"];
_unit = _this select 0;
_weapon = _this select 1;
// check if compatible scope is used
private "_display";
_display = uiNamespace getVariable [QGVAR(RscWeaponInfo2D), displayNull];
if (isNull _display) exitWith {};
// Reduce the reticle movement as the player drops into lower, supported stances.
private "_recoilCoef";
_recoilCoef = switch (true) do {
case (isWeaponDeployed _unit): {0.1};
case (isWeaponRested _unit): {0.4};
default {1};
};
// Constants which determine how the scope recoils
private ["_recoilScope", "_reticleShiftX", "_reticleShiftY", "_scopeShiftX", "_scopeShiftY"];
_recoilScope = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_RECOIL_MIN, SCOPE_RECOIL_MAX, false];
_reticleShiftX = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_X_MIN, RETICLE_SHIFT_X_MAX, false];
_reticleShiftY = _recoilCoef * linearConversion [0, 1, random 1, RETICLE_SHIFT_Y_MIN, RETICLE_SHIFT_Y_MAX, false];
_scopeShiftX = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_X_MIN, SCOPE_SHIFT_X_MAX, false];
_scopeShiftY = _recoilCoef * linearConversion [0, 1, random 1, SCOPE_SHIFT_Y_MIN, SCOPE_SHIFT_Y_MAX, false];
// Create and commit recoil effect
private ["_sizeX", "_sizeY"];
_sizeX = (0.75+_recoilScope)/(getResolution select 5);
_sizeY = _sizeX*safezoneW/safezoneH;
private "_positionReticle";
_positionReticle = [
safezoneX+0.5*safezoneW-0.5*(_sizeX+_reticleShiftX),
safezoneY+0.5*safezoneH-0.5*(_sizeY+_reticleShiftY),
_sizeX,
_sizeY
];
(_display displayCtrl 1713001) ctrlSetPosition _positionReticle;
(_display displayCtrl 1713002) ctrlSetPosition _positionReticle;
private "_positionBody";
_positionBody = [
safezoneX+0.5*safezoneW-0.5*(2*_sizeX+_scopeShiftX),
safezoneY+0.5*safezoneH-0.5*(2*_sizeY+_scopeShiftY),
2*_sizeX,
2*_sizeY
];
(_display displayCtrl 1713005) ctrlSetPosition _positionBody;
(_display displayCtrl 1713006) ctrlSetPosition _positionBody;
(_display displayCtrl 1713001) ctrlCommit 0;
(_display displayCtrl 1713002) ctrlCommit 0;
(_display displayCtrl 1713005) ctrlCommit 0;
(_display displayCtrl 1713006) ctrlCommit 0;
// Bring them all back
_sizeX = 0.75/(getResolution select 5);
_sizeY = _sizeX*safezoneW/safezoneH;
_positionReticle = [
safezoneX+0.5*safezoneW-0.5*_sizeX,
safezoneY+0.5*safezoneH-0.5*_sizeY,
_sizeX,
_sizeY
];
(_display displayCtrl 1713001) ctrlSetPosition _positionReticle;
(_display displayCtrl 1713002) ctrlSetPosition _positionReticle;
_positionBody = [
safezoneX+0.5*safezoneW-0.5*2*_sizeX,
safezoneY+0.5*safezoneH-0.5*2*_sizeY,
2*_sizeX,
2*_sizeY
];
(_display displayCtrl 1713005) ctrlSetPosition _positionBody;
(_display displayCtrl 1713006) ctrlSetPosition _positionBody;
(_display displayCtrl 1713001) ctrlCommit RECENTER_TIME;
(_display displayCtrl 1713002) ctrlCommit RECENTER_TIME;
(_display displayCtrl 1713005) ctrlCommit RECENTER_TIME;
(_display displayCtrl 1713006) ctrlCommit RECENTER_TIME;

View File

@ -0,0 +1,29 @@
// by commy2
#include "script_component.hpp"
disableSerialization;
private ["_display", "_control"];
_display = _this select 0;
_control = _display displayCtrl 1713154;
if (!ctrlShown (_display displayCtrl 154)) exitWith {
_control ctrlShow false;
};
private ["_sizeX", "_sizeY"];
_sizeX = (call EFUNC(common,getZoom))/4;
_sizeY = _sizeX*safezoneW/safezoneH;
_control ctrlSetPosition [
safezoneX+0.5*safezoneW-0.5*_sizeX,
safezoneY+0.5*safezoneH-0.5*_sizeY,
_sizeX,
_sizeY
];
_control ctrlCommit 0;
_control ctrlShow true;

View File

@ -0,0 +1,56 @@
// by commy2
#include "script_component.hpp"
disableSerialization;
private "_display";
_display = _this select 0;
if (!ctrlShown (_display displayCtrl 154)) exitWith {
(_display displayCtrl 1713001) ctrlShow false;
(_display displayCtrl 1713002) ctrlShow false;
(_display displayCtrl 1713005) ctrlShow false;
(_display displayCtrl 1713006) ctrlShow false;
};
GVAR(camera) setposATL positioncameratoworld [0,0,0.4];
GVAR(camera) camPrepareTarget positioncameratoworld [0,0,50];
GVAR(camera) camCommitPrepared 0;
// @todo, check if that needs to be done at all
if (cameraView == "GUNNER") then {
GVAR(camera) camsetFOV 0.7;
GVAR(camera) camcommit 0;
} else {
GVAR(camera) camsetFOV 0.01;
GVAR(camera) camcommit 0;
};
// @todo, all weapon types
private "_optic";
_optic = (primaryWeaponItems ACE_player) select 2;
// calculate lighting
private ["_dayOpacity", "_nightOpacity"];
_dayOpacity = call EFUNC(common,ambientBrightness);
_nightOpacity = [1,0] select (_dayOpacity == 1);
// Apply lighting and make layers visible
(_display displayCtrl 1713001) ctrlSetTextColor [1,1,1,1];
(_display displayCtrl 1713002) ctrlSetTextColor [1,1,1,_nightOpacity];
(_display displayCtrl 1713005) ctrlSetTextColor [1,1,1,_dayOpacity];
(_display displayCtrl 1713006) ctrlSetTextColor [1,1,1,_nightOpacity];
/*
(_display displayCtrl 1713001) ctrlCommit 0;
(_display displayCtrl 1713002) ctrlCommit 0;
(_display displayCtrl 1713005) ctrlCommit 0;
(_display displayCtrl 1713006) ctrlCommit 0;
*/
(_display displayCtrl 1713001) ctrlShow true;
(_display displayCtrl 1713002) ctrlShow true;
(_display displayCtrl 1713005) ctrlShow true;
(_display displayCtrl 1713006) ctrlShow true;

View File

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

Binary file not shown.

View File

@ -0,0 +1,27 @@
#define COMPONENT optics
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_OPTICS
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_ENABLED_OPTICS
#define DEBUG_SETTINGS DEBUG_ENABLED_OPTICS
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define SCOPE_RECOIL_MIN 0.03
#define SCOPE_RECOIL_MAX 0.032
#define SCOPE_SHIFT_X_MIN 0.04
#define SCOPE_SHIFT_X_MAX 0.05
#define SCOPE_SHIFT_Y_MIN -0.02
#define SCOPE_SHIFT_Y_MAX -0.03
#define RETICLE_SHIFT_X_MIN 0.006
#define RETICLE_SHIFT_X_MAX 0.011
#define RETICLE_SHIFT_Y_MIN -0.009
#define RETICLE_SHIFT_Y_MAX -0.014
#define RECENTER_TIME 0.09

View File

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Edited with tabler - 2014-12-17 -->
<Project name="ACE">
<Package name="Optics">
<Key ID="STR_ACE_optic_hamr">
<Original>RCO (2D)</Original>
<English>RCO (2D)</English>
<Czech>RCO (2D)</Czech>
<French>RCO (2D)</French>
<German>RCO (2D)</German>
<Italian>RCO (2D)</Italian>
<Polish>RCO (2D)</Polish>
<Portuguese>RCO (2D)</Portuguese>
<Russian>RCO (2D)</Russian>
<Spanish>RCO (2D)</Spanish>
</Key>
<Key ID="STR_ACE_optic_hamr_pip">
<Original>RCO (PIP)</Original>
<English>RCO (PIP)</English>
<Czech>RCO (PIP)</Czech>
<French>RCO (PIP)</French>
<German>RCO (PIP)</German>
<Italian>RCO (PIP)</Italian>
<Polish>RCO (PIP)</Polish>
<Portuguese>RCO (PIP)</Portuguese>
<Russian>RCO (PIP)</Russian>
<Spanish>RCO (PIP)</Spanish>
</Key>
<Key ID="STR_ACE_optic_arco">
<Original>ARCO (2D)</Original>
<English>ARCO (2D)</English>
<Czech>ARCO (2D)</Czech>
<French>ARCO (2D)</French>
<German>ARCO (2D)</German>
<Italian>ARCO (2D)</Italian>
<Polish>ARCO (2D)</Polish>
<Portuguese>ARCO (2D)</Portuguese>
<Russian>ARCO (2D)</Russian>
<Spanish>ARCO (2D)</Spanish>
</Key>
<Key ID="STR_ACE_optic_arco_pip">
<Original>ARCO (PIP)</Original>
<English>ARCO (PIP)</English>
<Czech>ARCO (PIP)</Czech>
<French>ARCO (PIP)</French>
<German>ARCO (PIP)</German>
<Italian>ARCO (PIP)</Italian>
<Polish>ARCO (PIP)</Polish>
<Portuguese>ARCO (PIP)</Portuguese>
<Russian>ARCO (PIP)</Russian>
<Spanish>ARCO (PIP)</Spanish>
</Key>
<Key ID="STR_ACE_optic_valdada">
<Original>MRCO (2D)</Original>
<English>MRCO (2D)</English>
<Czech>MRCO (2D)</Czech>
<French>MRCO (2D)</French>
<German>MRCO (2D)</German>
<Italian>MRCO (2D)</Italian>
<Polish>MRCO (2D)</Polish>
<Portuguese>MRCO (2D)</Portuguese>
<Russian>Прицел MRCO (2D)</Russian>
<Spanish>MRCO (2D)</Spanish>
</Key>
<Key ID="STR_ACE_optic_valdada_pip">
<Original>MRCO (PIP)</Original>
<English>MRCO (PIP)</English>
<Czech>MRCO (PIP)</Czech>
<French>MRCO (PIP)</French>
<German>MRCO (PIP)</German>
<Italian>MRCO (PIP)</Italian>
<Polish>MRCO (PIP)</Polish>
<Portuguese>MRCO (PIP)</Portuguese>
<Russian>Прицел MRCO (PIP)</Russian>
<Spanish>MRCO (PIP)</Spanish>
</Key>
<Key ID="STR_ACE_optic_sos">
<Original>MOS (2D)</Original>
<English>MOS (2D)</English>
<Czech>MOS (2D)</Czech>
<French>MOS (2D)</French>
<German>MOS (2D)</German>
<Italian>MOS (2D)</Italian>
<Polish>MOS (2D)</Polish>
<Portuguese>MOS (2D)</Portuguese>
<Russian>MOS (2D)</Russian>
<Spanish>MOS (2D)</Spanish>
</Key>
<Key ID="STR_ACE_optic_sos_pip">
<Original>MOS (PIP)</Original>
<English>MOS (PIP)</English>
<Czech>MOS (PIP)</Czech>
<French>MOS (PIP)</French>
<German>MOS (PIP)</German>
<Italian>MOS (PIP)</Italian>
<Polish>MOS (PIP)</Polish>
<Portuguese>MOS (PIP)</Portuguese>
<Russian>MOS (PIP)</Russian>
<Spanish>MOS (PIP)</Spanish>
</Key>
<Key ID="STR_ACE_optic_lrps">
<Original>LRPS (2D)</Original>
<English>LRPS (2D)</English>
<Czech>LRPS (2D)</Czech>
<French>LRPS (2D)</French>
<German>LRPS (2D)</German>
<Italian>LRPS (2D)</Italian>
<Polish>LRPS (2D)</Polish>
<Portuguese>LRPS (2D)</Portuguese>
<Russian>LRPS (2D)</Russian>
<Spanish>MPLD (2D)</Spanish>
</Key>
<Key ID="STR_ACE_optic_lrps_pip">
<Original>LRPS (PIP)</Original>
<English>LRPS (PIP)</English>
<Czech>LRPS (PIP)</Czech>
<French>LRPS (PIP)</French>
<German>LRPS (PIP)</German>
<Italian>LRPS (PIP)</Italian>
<Polish>LRPS (PIP)</Polish>
<Portuguese>LRPS (PIP)</Portuguese>
<Russian>LRPS (PIP)</Russian>
<Spanish>MPLD (PIP)</Spanish>
</Key>
</Package>
</Project>

View File

@ -40,29 +40,4 @@ class CfgWeapons {
};
};
};
class ACE_optic_DMS: optic_DMS {
author = "$STR_ACE_Common_ACETeam";
_generalMacro = "ACE_optic_DMS";
displayName = "LOCALIZE ACE DMR";
//descriptionShort = "$STR_A3_CFGWEAPONS_ACC_DMS1";
class ItemInfo: ItemInfo {
modelOptics = QUOTE(PATHTOF(ace_shortdot_optics.p3d));
class OpticsModes: OpticsModes {
class Snip: Snip {
opticsZoomMin = 0.05;
opticsZoomMax = 0.3;
opticsZoomInit = 0.3;
discretefov[] = {};
modelOptics[] = {};
};
};
};
};
};
class SlotInfo;
class CowsSlot: SlotInfo {
compatibleItems[] += {"ACE_optic_DMS"};
};

View File

@ -68,32 +68,9 @@ class RscTitles {
};
};
};
class ACE_Shortdot_Reticle {
idd = -1;
onLoad = "uiNamespace setVariable ['ACE_ctrlShortdotReticle', (_this select 0) displayCtrl 1];";
duration = 999999;
fadeIn = 0;
fadeOut = 0;
name = "ACE_Shortdot_Reticle";
class controlsBackground {
class Debug_RscElement: RscText {
idc = 1;
style = 48;
size = 1;
sizeEx = 0;
font = "TahomaB";
text = "";
x = 0;
y = 0;
w = 0;
h = 0;
};
};
};
};
/*
class RscInGameUI {
class RscUnitInfo;
class RscWeaponZeroing : RscUnitInfo {
@ -101,3 +78,4 @@ class RscInGameUI {
//onLoad = "[""onLoad"",_this,""RscUnitInfo"",'IGUI'] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; uiNamespace setVariable ['ACE_dlgWeaponZeroing', _this select 0];";
};
};
*/

View File

@ -92,30 +92,3 @@ if !(hasInterface) exitWith {};
},
{false},
[201, [false, true, false]], false] call cba_fnc_addKeybind;
// init shortdot
GVAR(showShortdot) = false;
["playerInventoryChanged", {
if (_this select 1 isEqualTo []) exitWith {}; //@todo fix eh
private "_showShortdot";
_showShortdot = _this select 1 select 9 select 2 == "ACE_optic_DMS";
if (GVAR(showShortdot)) then {
if (!_showShortdot) then {
// hide control and turn onDraw handler off
(uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull]) ctrlShow false;
GVAR(showShortdot) = false;
};
} else {
if (_showShortdot) then {
// create control and turn onDraw handler on
([QGVAR(reticle)] call BIS_fnc_rscLayer) cutRsc ["ACE_Shortdot_Reticle", "PLAIN", 0, false];
(uiNamespace getVariable "ACE_ctrlShortdotReticle") ctrlSetText QUOTE(PATHTOF(data\reticles\ace_shortdot_reticle_1.paa));
GVAR(showShortdot) = true;
};
};
}] call EFUNC(common,addEventHandler);
addMissionEventHandler ["Draw3D", {if (GVAR(showShortdot)) then {call FUNC(onDrawShortdot)};}];

View File

@ -7,7 +7,6 @@ PREP(canAdjustScope);
PREP(firedEH);
PREP(getOptics);
PREP(inventoryCheck);
PREP(onDrawShortdot);
PREP(showZeroing);
GVAR(fadeScript) = scriptNull;

View File

@ -1,25 +0,0 @@
// by commy2
#include "script_component.hpp"
private "_control";
_control = uiNamespace getVariable ["ACE_ctrlShortdotReticle", controlNull];
if (cameraView != "GUNNER" || {currentWeapon ACE_player != primaryWeapon ACE_player}) exitWith {
_control ctrlShow false;
};
private ["_size", "_sizeX", "_sizeY"];
_size = call EFUNC(common,getZoom);
_sizeX = _size/4;
_sizeY = _sizeX*safezoneW/safezoneH;
_control ctrlSetPosition [
safezoneX+0.5*safezoneW-0.5*_sizeX,
safezoneY+0.5*safezoneH-0.5*_sizeY,
_sizeX,
_sizeY
];
_control ctrlCommit 0;
_control ctrlShow true;

View File

@ -13,6 +13,8 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
#include "RscInGameUI.hpp"