mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' of github.com:KoffeinFlummi/ACE3
Conflicts: addons/scopes/XEH_postInit.sqf
This commit is contained in:
commit
6447b39d1a
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
release/*
|
||||
*.cache
|
||||
*.pbo
|
||||
texHeaders.bin
|
||||
*.swp
|
||||
|
Binary file not shown.
@ -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};
|
||||
};
|
@ -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 = "*";
|
||||
};
|
||||
};
|
||||
};
|
@ -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;
|
||||
};
|
@ -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;
|
@ -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
|
@ -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;
|
BIN
ace_fcs.dll
BIN
ace_fcs.dll
Binary file not shown.
@ -100,7 +100,7 @@ class CfgVehicles {
|
||||
transportMaxWeapons = 9001;
|
||||
transportMaxMagazines = 9001;
|
||||
transportMaxItems = 9001;
|
||||
maximumload = 2000;
|
||||
maximumload = 9001;
|
||||
|
||||
class TransportWeapons {};
|
||||
class TransportMagazines {};
|
||||
|
@ -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););
|
||||
};
|
||||
};
|
||||
|
||||
@ -25,6 +109,20 @@ class RscDisplayInventory {
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayInventory"",'IGUI')] call compile preprocessfilelinenumbers ""A3\ui_f\scripts\initDisplay.sqf""; [ARR_2('inventoryDisplayLoaded', _this)] call FUNC(localEvent););
|
||||
};
|
||||
|
||||
class RscDisplayChannel {
|
||||
onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
|
||||
// map
|
||||
class RscDisplayMainMap {
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Ingame')])] call FUNC(localEvent););
|
||||
};
|
||||
|
||||
class RscDisplayGetReady: RscDisplayMainMap {
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'Briefing')])] call FUNC(localEvent););
|
||||
};
|
||||
|
||||
class RscDisplayServerGetReady: RscDisplayGetReady {
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ServerBriefing')])] call FUNC(localEvent););
|
||||
};
|
||||
|
||||
|
||||
class RscDisplayClientGetReady: RscDisplayGetReady {
|
||||
onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDiary"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); uiNamespace setVariable [ARR_2('ACE_dlgMap', _this select 0)]; [ARR_2('mapDisplayLoaded', [ARR_2(_this select 0, 'ClientBriefing')])] call FUNC(localEvent););
|
||||
};
|
||||
|
@ -126,7 +126,6 @@ PREP(numberToDigits);
|
||||
PREP(numberToDigitsString);
|
||||
PREP(numberToString);
|
||||
PREP(onAnswerRequest);
|
||||
PREP(onLoadRscDisplayChannel);
|
||||
PREP(owned);
|
||||
PREP(player);
|
||||
PREP(playerSide);
|
||||
@ -273,10 +272,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
|
||||
|
@ -7,11 +7,20 @@
|
||||
* NONE.
|
||||
*
|
||||
* Return value:
|
||||
* The current channel. Can be "group", "side", "global", "command", "vehicle" or "direct" (String)
|
||||
* The current channel. Can be "group", "side", "global", "command", "vehicle", "direct" or "custom_X" (String)
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"]
|
||||
#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"]
|
||||
#define CHANNELS ["global", "side", "command", "group", "vehicle", "direct"]
|
||||
#define CHANNELS_LOCALIZED [localize "str_channel_global", localize "str_channel_side", localize "str_channel_command", localize "str_channel_group", localize "str_channel_vehicle", localize "str_channel_direct"]
|
||||
|
||||
CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable [QGVAR(currentChannel), ""])) max 0
|
||||
private "_currentChannel";
|
||||
_currentChannel = currentChannel;
|
||||
|
||||
if (_currentChannel < count CHANNELS) then {
|
||||
_currentChannel = CHANNELS select _currentChannel;
|
||||
} else {
|
||||
_currentChannel = format ["custom_%1", _currentChannel - count CHANNELS - 1];
|
||||
};
|
||||
|
||||
_currentChannel
|
||||
|
@ -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
|
||||
]
|
||||
|
@ -63,7 +63,7 @@ if (_lightSource isKindOf "CAManBase") then {
|
||||
_lightLevel = (linearConversion [0, 30, _distance, 1, 0, true]) * (linearConversion [_innerAngle, _outerAngle, _angle, 1, 0, true]);
|
||||
|
||||
} else {
|
||||
// handle any object, strcutures, cars, tanks, etc.
|
||||
// handle any object, strcutures, cars, tanks, etc. @todo campfires, burning vehicles
|
||||
|
||||
private "_lights";
|
||||
_lights = [_lightSource] call FUNC(getTurnedOnLights);
|
||||
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* Author: Pabst Mirror, commy2
|
||||
* When the RscDisplayChannel is loaded, this will constantly uiNamespace variable ace_common_currentChannel
|
||||
* with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: The RscDisplayChannel Display <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
uiNamespace setVariable [QGVAR(currentChannelControl), ((_this select 0) displayCtrl 101)];
|
||||
|
||||
["ACE_currentChannel", "onEachFrame", {
|
||||
if (isNull (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull])) then {
|
||||
["ACE_currentChannel", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
|
||||
} else {
|
||||
private "_localizedChannelText";
|
||||
_localizedChannelText = ctrlText (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull]);
|
||||
uiNamespace setVariable [QGVAR(currentChannel), _localizedChannelText];
|
||||
};
|
||||
}] call BIS_fnc_addStackedEventhandler;
|
@ -27,6 +27,9 @@ _versions = [];
|
||||
_versions set [_forEachIndex, _version];
|
||||
} forEach _files;
|
||||
|
||||
_versionFull = getText (configFile >> "CfgPatches" >> QUOTE(ADDON) >> "versionStr");
|
||||
diag_log text format ["[ACE] Full Version Number: %1", _versionFull];
|
||||
|
||||
if (isServer) then {
|
||||
diag_log text format ["[ACE] Server: ACE_Common is Version %1.", _versionMain];
|
||||
|
||||
|
@ -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
|
||||
|
@ -139,14 +139,6 @@ class CfgVehicles {
|
||||
};*/
|
||||
};
|
||||
|
||||
class Offroad_01_base_F: Car_F {};
|
||||
|
||||
class Offroad_01_armed_base_F: Offroad_01_base_F {
|
||||
/*class Turrets: Turrets {
|
||||
class M2_Turret: MainTurret {};
|
||||
};*/
|
||||
};
|
||||
|
||||
class APC_Wheeled_01_base_F: Wheeled_APC_F {
|
||||
/*class Turrets: Turrets {
|
||||
class MainTurret: MainTurret {
|
||||
|
@ -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);
|
||||
|
@ -32,7 +32,7 @@ GVAR(openedMenuType) = _menuType;
|
||||
|
||||
GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) ||
|
||||
visibleMap ||
|
||||
(GVAR(AlwaysUseCursorSelfInteraction) && _menuType == 1);
|
||||
{(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction)}};
|
||||
if (GVAR(useCursorMenu)) then {
|
||||
createDialog QGVAR(cursorMenu);
|
||||
// The dialog sets:
|
||||
|
@ -39,14 +39,14 @@ class RscDisplayInventory {
|
||||
x = X_PART(1);
|
||||
y = Y_PART(1);
|
||||
w = W_PART(12);
|
||||
h = H_PART(22.5);
|
||||
h = H_PART(22.5); //default 23
|
||||
};
|
||||
class CA_PlayerBackground: RscText {
|
||||
//center player's container: decrease height because of progressbar height decrease
|
||||
x = X_PART(14.6);
|
||||
y = Y_PART(2);
|
||||
w = W_PART(24.4);
|
||||
h = H_PART(21.5);
|
||||
h = H_PART(21.5); //default 22
|
||||
};
|
||||
class TitleBackground: RscText {
|
||||
x = X_PART(14.6);
|
||||
@ -87,25 +87,31 @@ class RscDisplayInventory {
|
||||
class BackgroundSlotPrimaryMuzzle: BackgroundSlotPrimary {
|
||||
x = X_PART(26.6);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotPrimaryUnderBarrel: BackgroundSlotPrimary {
|
||||
x = X_PART(29);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotPrimaryFlashlight: BackgroundSlotPrimary {
|
||||
x = X_PART(29.6);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
x = X_PART(31.4);
|
||||
y = Y_PART(9.2); //not sure why different (double check release)
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotPrimaryOptics: BackgroundSlotPrimary {
|
||||
x = X_PART(32.6);
|
||||
x = X_PART(33.8);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotPrimaryMagazine: BackgroundSlotPrimary {
|
||||
x = X_PART(35.6);
|
||||
x = X_PART(36.2);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotSecondary: BackgroundSlotPrimary {
|
||||
@ -117,25 +123,31 @@ class RscDisplayInventory {
|
||||
class BackgroundSlotSecondaryMuzzle: BackgroundSlotPrimary {
|
||||
x = X_PART(26.6);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotSecondaryUnderBarrel: BackgroundSlotPrimary {
|
||||
x = X_PART(29);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotSecondaryFlashlight: BackgroundSlotPrimary {
|
||||
x = X_PART(29.6);
|
||||
x = X_PART(31.4);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotSecondaryOptics: BackgroundSlotPrimary {
|
||||
x = X_PART(32.6);
|
||||
x = X_PART(33.8);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotSecondaryMagazine: BackgroundSlotPrimary {
|
||||
x = X_PART(35.6);
|
||||
x = X_PART(36.2);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotHandgun: BackgroundSlotPrimary {
|
||||
@ -147,25 +159,31 @@ class RscDisplayInventory {
|
||||
class BackgroundSlotHandgunMuzzle: BackgroundSlotPrimary {
|
||||
x = X_PART(26.6);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotHandgunUnderBarrel: BackgroundSlotPrimary {
|
||||
x = X_PART(29);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotHandgunFlashlight: BackgroundSlotPrimary {
|
||||
x = X_PART(29.6);
|
||||
x = X_PART(31.4);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotHandgunOptics: BackgroundSlotPrimary {
|
||||
x = X_PART(32.6);
|
||||
x = X_PART(33.8);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotHandgunMagazine: BackgroundSlotPrimary {
|
||||
x = X_PART(35.6);
|
||||
x = X_PART(36.2);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class BackgroundSlotHeadgear: BackgroundSlotPrimary {
|
||||
@ -263,7 +281,7 @@ class RscDisplayInventory {
|
||||
x = X_PART(1.5);
|
||||
y = Y_PART(22.5);
|
||||
w = W_PART(11);
|
||||
h = H_PART(0.5);
|
||||
h = H_PART(0.5); //Default 1
|
||||
};
|
||||
class SlotPrimary: GroundTab {
|
||||
x = X_PART(26.6);
|
||||
@ -274,31 +292,31 @@ class RscDisplayInventory {
|
||||
class SlotPrimaryMuzzle: SlotPrimary {
|
||||
x = X_PART(26.6);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotPrimaryGrip: SlotPrimary {
|
||||
w = 0;
|
||||
h = 0;
|
||||
x = X_PART(39);
|
||||
y = Y_PART(9);
|
||||
class SlotPrimaryUnderBarrel: SlotPrimary {
|
||||
x = X_PART(29);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotPrimaryFlashlight: SlotPrimary {
|
||||
x = X_PART(29.6);
|
||||
x = X_PART(31.4);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotPrimaryOptics: SlotPrimary {
|
||||
x = X_PART(32.6);
|
||||
x = X_PART(33.8);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotPrimaryMagazine: SlotPrimary {
|
||||
x = X_PART(35.6);
|
||||
x = X_PART(36.2);
|
||||
y = Y_PART(9.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotSecondary: SlotPrimary {
|
||||
@ -310,31 +328,31 @@ class RscDisplayInventory {
|
||||
class SlotSecondaryMuzzle: SlotPrimary {
|
||||
x = X_PART(26.6);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotSecondaryGrip: SlotPrimary {
|
||||
w = 0;
|
||||
h = 0;
|
||||
x = X_PART(39);
|
||||
y = Y_PART(14.5);
|
||||
class SlotSecondaryUnderBarrel: SlotPrimary {
|
||||
x = X_PART(29);
|
||||
y = Y_PART(14.59); //Why is this different? (check release)
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotSecondaryFlashlight: SlotPrimary {
|
||||
x = X_PART(29.6);
|
||||
x = X_PART(31.4);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotSecondaryOptics: SlotPrimary {
|
||||
x = X_PART(32.6);
|
||||
x = X_PART(33.8);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotSecondaryMagazine: SlotPrimary {
|
||||
x = X_PART(35.6);
|
||||
x = X_PART(36.2);
|
||||
y = Y_PART(14.6);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotHandgun: SlotPrimary {
|
||||
@ -346,31 +364,31 @@ class RscDisplayInventory {
|
||||
class SlotHandgunMuzzle: SlotPrimary {
|
||||
x = X_PART(26.6);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotHandgunGrip: SlotPrimary {
|
||||
w = 0;
|
||||
h = 0;
|
||||
x = X_PART(39);
|
||||
y = Y_PART(20);
|
||||
class SlotHandgunUnderBarrel: SlotPrimary {
|
||||
x = X_PART(29);
|
||||
y = Y_PART(20.1);
|
||||
W = W_PART(2.3);
|
||||
H = H_PART(2);
|
||||
};
|
||||
class SlotHandgunFlashlight: SlotPrimary {
|
||||
x = X_PART(29.6);
|
||||
x = X_PART(31.4);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotHandgunOptics: SlotPrimary {
|
||||
x = X_PART(32.6);
|
||||
x = X_PART(33.8);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotHandgunMagazine: SlotPrimary {
|
||||
x = X_PART(35.6);
|
||||
x = X_PART(36.2);
|
||||
y = Y_PART(20.1);
|
||||
w = W_PART(2.9);
|
||||
w = W_PART(2.3);
|
||||
h = H_PART(2);
|
||||
};
|
||||
class SlotHeadgear: SlotPrimary {
|
||||
@ -492,7 +510,7 @@ class RscDisplayInventory {
|
||||
x = X_PART(15.1);
|
||||
y = Y_PART(22.5);
|
||||
w = W_PART(23.4);
|
||||
h = H_PART(0.5);
|
||||
h = H_PART(0.5); //Default 1
|
||||
};
|
||||
class ContainerMarker: GroundTab {
|
||||
x = X_PART(0);
|
||||
|
@ -51,6 +51,7 @@ class CfgPatches {
|
||||
"a3_anims_f_epc",
|
||||
"a3_anims_f_heli",
|
||||
"a3_anims_f_kart",
|
||||
"a3_anims_f_mark_deployment",
|
||||
"a3_armor_f",
|
||||
"a3_armor_f_amv",
|
||||
"a3_armor_f_apc_wheeled_03",
|
||||
@ -93,6 +94,7 @@ class CfgPatches {
|
||||
"a3_characters_f_heads",
|
||||
"a3_characters_f_indep",
|
||||
"a3_characters_f_kart",
|
||||
"a3_characters_f_mark",
|
||||
"a3_characters_f_opfor",
|
||||
"a3_characters_f_proxies",
|
||||
"a3_data_f",
|
||||
@ -108,6 +110,7 @@ class CfgPatches {
|
||||
"a3_data_f_hook",
|
||||
"a3_data_f_kart",
|
||||
"a3_data_f_kart_particleeffects",
|
||||
"a3_data_f_mark",
|
||||
"a3_data_f_particleeffects",
|
||||
"a3_dubbing_radio_f",
|
||||
"a3_editor_f",
|
||||
@ -117,6 +120,8 @@ class CfgPatches {
|
||||
"a3_functions_f_epa",
|
||||
"a3_functions_f_epc",
|
||||
"a3_functions_f_heli",
|
||||
"a3_functions_f_mark",
|
||||
"a3_functions_f_mp_mark",
|
||||
"a3_language_f",
|
||||
"a3_language_f_beta",
|
||||
"a3_language_f_bootcamp",
|
||||
@ -127,10 +132,13 @@ class CfgPatches {
|
||||
"a3_language_f_gamma",
|
||||
"a3_language_f_heli",
|
||||
"a3_language_f_kart",
|
||||
"a3_language_f_mark",
|
||||
"a3_language_f_mp_mark",
|
||||
"a3_languagemissions_f",
|
||||
"a3_languagemissions_f_beta",
|
||||
"a3_languagemissions_f_gamma",
|
||||
"a3_languagemissions_f_kart",
|
||||
"a3_languagemissions_f_mp_mark",
|
||||
"a3_map_altis",
|
||||
"a3_map_altis_scenes",
|
||||
"a3_map_data",
|
||||
@ -149,6 +157,8 @@ class CfgPatches {
|
||||
"a3_missions_f_gamma",
|
||||
"a3_missions_f_heli",
|
||||
"a3_missions_f_kart",
|
||||
"a3_missions_f_mark",
|
||||
"a3_missions_f_mp_mark",
|
||||
"a3_modules_f",
|
||||
"a3_modules_f_beta",
|
||||
"a3_modules_f_beta_firingdrills",
|
||||
@ -184,8 +194,12 @@ class CfgPatches {
|
||||
"a3_modules_f_kart",
|
||||
"a3_modules_f_kart_timetrials",
|
||||
"a3_modules_f_livefeed",
|
||||
"a3_modules_f_mark",
|
||||
"a3_modules_f_mark_firingdrills",
|
||||
"a3_modules_f_mark_objectives",
|
||||
"a3_modules_f_marta",
|
||||
"a3_modules_f_misc",
|
||||
"a3_modules_f_mp_mark",
|
||||
"a3_modules_f_multiplayer",
|
||||
"a3_modules_f_objectmodifiers",
|
||||
"a3_modules_f_sites",
|
||||
@ -199,6 +213,7 @@ class CfgPatches {
|
||||
"a3_music_f_epb",
|
||||
"a3_music_f_epc",
|
||||
"a3_music_f_heli",
|
||||
"a3_music_f_mark",
|
||||
"a3_plants_f_bush",
|
||||
"a3_roads_f",
|
||||
"a3_rocks_f",
|
||||
@ -244,6 +259,8 @@ class CfgPatches {
|
||||
"a3_static_f_gamma_aa",
|
||||
"a3_static_f_gamma_at",
|
||||
"a3_static_f_gamma_mortar_01",
|
||||
"a3_static_f_mark_designator_01",
|
||||
"a3_static_f_mark_designator_02",
|
||||
"a3_static_f_mortar_01",
|
||||
"a3_structures_f",
|
||||
"a3_structures_f_bootcamp_civ_camping",
|
||||
@ -385,6 +402,13 @@ class CfgPatches {
|
||||
"a3_structures_f_kart_civ_sportsgrounds",
|
||||
"a3_structures_f_kart_mil_flags",
|
||||
"a3_structures_f_kart_signs_companies",
|
||||
"a3_structures_f_mark_items_military",
|
||||
"a3_structures_f_mark_items_sport",
|
||||
"a3_structures_f_mark_mil_flags",
|
||||
"a3_structures_f_mark_training",
|
||||
"a3_structures_f_mark_vr_helpers",
|
||||
"a3_structures_f_mark_vr_shapes",
|
||||
"a3_structures_f_mark_vr_targets",
|
||||
"a3_structures_f_mil",
|
||||
"a3_structures_f_mil_bagbunker",
|
||||
"a3_structures_f_mil_bagfence",
|
||||
@ -416,6 +440,7 @@ class CfgPatches {
|
||||
"a3_supplies_f_heli_cargonets",
|
||||
"a3_supplies_f_heli_fuel",
|
||||
"a3_supplies_f_heli_slingload",
|
||||
"a3_supplies_f_mark",
|
||||
"a3_uav_f_characters_f_gamma",
|
||||
"a3_uav_f_weapons_f_gamma_ammoboxes",
|
||||
"a3_ui_f",
|
||||
@ -423,6 +448,8 @@ class CfgPatches {
|
||||
"a3_ui_f_curator",
|
||||
"a3_ui_f_heli",
|
||||
"a3_ui_f_kart",
|
||||
"a3_ui_f_mark",
|
||||
"a3_ui_f_mp_mark",
|
||||
"a3_uifonts_f",
|
||||
"a3_weapons_f",
|
||||
"a3_weapons_f_aaf",
|
||||
@ -474,6 +501,28 @@ class CfgPatches {
|
||||
"a3_weapons_f_longrangerifles_m320",
|
||||
"a3_weapons_f_machineguns_m200",
|
||||
"a3_weapons_f_machineguns_zafir",
|
||||
"a3_weapons_f_mark",
|
||||
"a3_weapons_f_mark_acc",
|
||||
"a3_weapons_f_mark_ebr",
|
||||
"a3_weapons_f_mark_longrangerifles_dmr_01",
|
||||
"a3_weapons_f_mark_longrangerifles_dmr_02",
|
||||
"a3_weapons_f_mark_longrangerifles_dmr_03",
|
||||
"a3_weapons_f_mark_longrangerifles_dmr_04",
|
||||
"a3_weapons_f_mark_longrangerifles_dmr_05",
|
||||
"a3_weapons_f_mark_longrangerifles_dmr_06",
|
||||
"a3_weapons_f_mark_longrangerifles_gm6",
|
||||
"a3_weapons_f_mark_longrangerifles_gm6_camo",
|
||||
"a3_weapons_f_mark_longrangerifles_m320",
|
||||
"a3_weapons_f_mark_longrangerifles_m320_camo",
|
||||
"a3_weapons_f_mark_machineguns_m200",
|
||||
"a3_weapons_f_mark_machineguns_mmg_01",
|
||||
"a3_weapons_f_mark_machineguns_mmg_02",
|
||||
"a3_weapons_f_mark_machineguns_zafir",
|
||||
"a3_weapons_f_mark_rifles_khaybar",
|
||||
"a3_weapons_f_mark_rifles_mk20",
|
||||
"a3_weapons_f_mark_rifles_mx",
|
||||
"a3_weapons_f_mark_rifles_sdar",
|
||||
"a3_weapons_f_mark_rifles_trg20",
|
||||
"a3_weapons_f_nato",
|
||||
"a3_weapons_f_pistols_acpc2",
|
||||
"a3_weapons_f_pistols_p07",
|
||||
|
@ -36,6 +36,15 @@ class CfgVehicles {
|
||||
class No { name = "No"; value = 0; default = 1;};
|
||||
};
|
||||
};
|
||||
class MapShowCursorCoordinates {
|
||||
displayName = "Show cursor coordinates?";
|
||||
description = "Show the grid coordinates on the mouse pointer?";
|
||||
typeName = "BOOL";
|
||||
class values {
|
||||
class Yes { name = "Yes"; value = 1; };
|
||||
class No { name = "No"; value = 0; default = 1;};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -8,6 +8,7 @@ PREP(blueForceTrackingUpdate);
|
||||
PREP(determineMapLight);
|
||||
PREP(determineZoom);
|
||||
PREP(moduleMap);
|
||||
PREP(onDrawMap);
|
||||
PREP(updateMapEffects);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -48,6 +48,10 @@ class ACE_Settings {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
};
|
||||
class GVAR(mapShowCursorCoordinates) {
|
||||
value = 0;
|
||||
typeName = "BOOL";
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
@ -85,7 +89,8 @@ class RscMapControl {
|
||||
class RscDisplayMainMap {
|
||||
// Tweak map styling
|
||||
class controlsBackground {
|
||||
class CA_Map : RscMapControl {
|
||||
class CA_Map: RscMapControl {
|
||||
onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawMap));
|
||||
#include "MapTweaks.hpp"
|
||||
};
|
||||
};
|
||||
@ -143,6 +148,13 @@ class RscDisplayDiary {
|
||||
|
||||
// BRIEFING SCREEN
|
||||
class RscDisplayGetReady: RscDisplayMainMap {
|
||||
// Tweak map styling
|
||||
class controlsBackground {
|
||||
class CA_Map: RscMapControl {
|
||||
onDraw = QUOTE([ctrlParent (_this select 0)] call DFUNC(onDrawMap));
|
||||
//#include "MapTweaks.hpp" @todo Shouldn't this apply to briefing too?
|
||||
};
|
||||
};
|
||||
// get rid of the "center to player position" - button (as it works even on elite)
|
||||
class controls {
|
||||
class TopRight: RscControlsGroup {
|
||||
|
@ -66,10 +66,13 @@ if (_lightLevel > 0.95) exitWith {
|
||||
[false, [0.5,0.5,0.5,0]]
|
||||
};
|
||||
|
||||
private "_vehicle";
|
||||
_vehicle = vehicle _unit;
|
||||
|
||||
// Do not obscure the map if the player is on a enclosed vehicle (assume internal illumination)
|
||||
if (vehicle _unit != _unit) then {
|
||||
if (_vehicle != _unit) then {
|
||||
// Player is in a vehicle
|
||||
if ((vehicle _unit) isKindOf "Tank") then {
|
||||
if (isTurnedOut _unit && {_vehicle isKindOf "Tank" || {_vehicle isKindOf "Wheeled_APC"}}) then {
|
||||
_isEnclosed = true;
|
||||
};
|
||||
};
|
||||
@ -81,32 +84,10 @@ if (_isEnclosed) exitWith {
|
||||
// Player is not in a vehicle
|
||||
TRACE_1("Player is on foot or in an open vehicle","");
|
||||
|
||||
// Check if player is near a campfires, lights or vehicles with lights on - 15m
|
||||
_nearObjects = [nearestObjects [_unit, ["All"], 15], {(inflamed _this) || (isLightOn _this)}] call EFUNC(common,filter);
|
||||
if (count (_nearObjects) > 0) then {
|
||||
_light = _nearObjects select 0;
|
||||
|
||||
_ll = (1 - (((((_unit distance _light) - 5)/10) max 0) min 1));
|
||||
if (_ll > _lightLevel) then {
|
||||
_lightLevel = _ll;
|
||||
TRACE_1("player near campfire","");
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Gun with light
|
||||
_nearObjects = [nearestObjects [_unit, ["CAManBase"], 10], { _this isFlashlightOn (currentWeapon _this)}] call EFUNC(common,filter);
|
||||
if (count (_nearObjects) > 0) then {
|
||||
_light = (_nearObjects select 0);
|
||||
_flashlight = (_light weaponAccessories currentMuzzle _light) select 1;
|
||||
|
||||
// Check if it's a day laser
|
||||
if (_flashlight == "ACE_acc_pointer_red") exitWith {};
|
||||
if (_flashlight == "ACE_acc_pointer_green") exitWith {};
|
||||
|
||||
_lightLevel = _lightLevel max (1 - (((((_unit distance _light) - 2)/8) max 0) min 1));
|
||||
TRACE_1("Using gun light","");
|
||||
};
|
||||
// Check if player is near a campfires, streetlamps, units with flashlights, vehicles with lights on, etc. - 40m
|
||||
{
|
||||
_lightLevel = _lightLevel max ([_unit, _x] call EFUNC(common,lightIntensityFromObject));
|
||||
} forEach nearestObjects [_unit, ["All"], 40];
|
||||
|
||||
|
||||
// @todo: Illumination flares (timed)
|
||||
|
@ -15,8 +15,9 @@ _activated = _this select 2;
|
||||
|
||||
if !(_activated) exitWith {};
|
||||
|
||||
[_logic, QGVAR(mapIllumination), "MapIllumination"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(mapIllumination), "MapIllumination" ] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(mapShake), "MapShake" ] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(mapLimitZoom), "MapLimitZoom" ] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(mapShowCursorCoordinates), "MapShowCursorCoordinates"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
diag_log text "[ACE]: Interaction Module Initialized.";
|
||||
|
4
addons/map/functions/fnc_onDrawMap.sqf
Normal file
4
addons/map/functions/fnc_onDrawMap.sqf
Normal file
@ -0,0 +1,4 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
((_this select 0) displayCtrl 1016) ctrlShow GVAR(mapShowCursorCoordinates);
|
@ -1,4 +1,3 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class RscStructuredText;
|
||||
@ -13,91 +12,34 @@ class RscXSliderH;
|
||||
class RscDisplayInsertMarker {
|
||||
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
|
||||
onUnload = QUOTE(_this call DFUNC(placeMarker););
|
||||
idd = 54;
|
||||
// idd = 54;
|
||||
movingEnable = 1;
|
||||
class controlsBackground {
|
||||
class RscText_1000: RscText {
|
||||
idc = 1000;
|
||||
/*x = "0 * GUI_GRID_INSERTMARKER_W + GUI_GRID_INSERTMARKER_X";
|
||||
y = "0 * GUI_GRID_INSERTMARKER_H + GUI_GRID_INSERTMARKER_Y";
|
||||
w = "8 * GUI_GRID_INSERTMARKER_W";
|
||||
h = "2.5 * GUI_GRID_INSERTMARKER_H";
|
||||
colorBackground[] = {0,0,0,0.5};*/
|
||||
};
|
||||
class Description: RscStructuredText {
|
||||
colorBackground[] = {0,0,0,0.7};
|
||||
idc = 1100;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "9.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
// class RscText_1000: RscText {idc = 1000;};
|
||||
};
|
||||
class controls {
|
||||
//delete ButtonOK;
|
||||
class ButtonMenuOK: RscButtonMenuOK {
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "8.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
// size = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
// sizeEx = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
text = "";
|
||||
// class ButtonMenuOK: RscButtonMenuOK {idc = 1;};
|
||||
// class ButtonMenuCancel: RscButtonMenuCancel {idc = 2;};
|
||||
// class Title: RscText {idc = 1001;};
|
||||
// class Description: RscStructuredText {idc = 1100;};
|
||||
// class DescriptionChannel: RscStructuredText {idc = 1101;};
|
||||
// class MarkerPicture: RscPicture {idc = 102;};
|
||||
// class MarkerText: RscEdit {idc = 101;};
|
||||
// class MarkerChannel: RscCombo {idc = 103;};
|
||||
|
||||
class MarkerShape: RscCombo {
|
||||
idc = 1210;
|
||||
};
|
||||
class ButtonMenuCancel: RscButtonMenuCancel {
|
||||
x = "23 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "1.1 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
|
||||
text = "X";
|
||||
colorBackground[] = {0.75,0,0,0.5};
|
||||
colorBackgroundFocused[] = {0.75,0,0,0.5};
|
||||
colorBackground2[] = {1,0,0,0.5};
|
||||
class MarkerColor: RscCombo {
|
||||
idc = 1211;
|
||||
};
|
||||
/*class ButtonMenuInfo: RscButtonMenu {
|
||||
idc = 2400;
|
||||
text = "$STR_A3_RscDisplayInsertMarker_ButtonMenuInfo";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
delete ButtonMenuInfo;
|
||||
class Title: RscText {
|
||||
moving = 1;
|
||||
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"};
|
||||
idc = 1001;
|
||||
text = "$STR_A3_RscDisplayInsertMarker_Title";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "8.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
class MarkerAngle: RscXSliderH {
|
||||
idc = 1220;
|
||||
};
|
||||
delete Description;
|
||||
/*class Info: RscStructuredText {
|
||||
colorBackground[] = {0,0,0,0.7};
|
||||
idc = 1101;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
delete Info;
|
||||
class Picture: RscPicture {
|
||||
idc = 102;
|
||||
x = 0.259984;
|
||||
y = 0.4;
|
||||
w = 0.05;
|
||||
h = 0.0666667;
|
||||
};
|
||||
class Text: RscEdit {
|
||||
idc = 101;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "10.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
class MarkerAngleText: RscText {
|
||||
idc = 1221;
|
||||
};
|
||||
|
||||
/*class SizeX: RscEdit {
|
||||
idc = 1200;
|
||||
text = "10";
|
||||
@ -114,34 +56,5 @@ class RscDisplayInsertMarker {
|
||||
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
class MarkerShape: RscCombo {
|
||||
idc = 1210;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerColor: RscCombo {
|
||||
idc = 1211;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerAngle: RscXSliderH {
|
||||
idc = 1220;
|
||||
text = "10";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerAngleText: RscText {
|
||||
idc = 1221;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "14.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -11,6 +11,12 @@
|
||||
if (isMultiplayer && {!isServer} && {hasInterface}) then {
|
||||
private "_logic";
|
||||
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
||||
|
||||
[QGVAR(sendMarkersJIP), _logic] call EFUNC(common,serverEvent);
|
||||
[QGVAR(sendMarkersJIP), [_logic]] call EFUNC(common,serverEvent);
|
||||
};
|
||||
|
||||
|
||||
GVAR(mapDisplaysWithDrawEHs) = [];
|
||||
GVAR(currentMarkerPosition) = [];
|
||||
GVAR(currentMarkerAngle) = 0;
|
||||
GVAR(currentMarkerColorConfigName) = "";
|
||||
GVAR(currentMarkerConfigName) = "";
|
@ -3,6 +3,7 @@
|
||||
ADDON = false;
|
||||
|
||||
PREP(initInsertMarker);
|
||||
PREP(mapDrawEH);
|
||||
PREP(onLBSelChangedColor);
|
||||
PREP(onLBSelChangedShape);
|
||||
PREP(onSliderPosChangedAngle);
|
||||
@ -14,25 +15,15 @@ PREP(setMarkerNetwork);
|
||||
// init marker types
|
||||
if (isNil QGVAR(MarkersCache)) then {
|
||||
_config = configfile >> "CfgMarkers";
|
||||
_index = 0;
|
||||
|
||||
GVAR(MarkersCache) = [];
|
||||
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
_marker = _config select _a;
|
||||
|
||||
_scope = getNumber (_marker >> "scope");
|
||||
_name = getText (_marker >> "name");
|
||||
_icon = getText (_marker >> "icon");
|
||||
|
||||
if (_scope == 2) then {
|
||||
_shape lbAdd _name;
|
||||
_shape lbSetValue [_index, _a];
|
||||
_shape lbSetPicture [_index, _icon];
|
||||
|
||||
_name = getText (_marker >> "name");
|
||||
_icon = getText (_marker >> "icon");
|
||||
GVAR(MarkersCache) pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -40,39 +31,27 @@ if (isNil QGVAR(MarkersCache)) then {
|
||||
// init marker colors
|
||||
if (isNil QGVAR(MarkerColorsCache)) then {
|
||||
_config = configfile >> "CfgMarkerColors";
|
||||
_index = 0;
|
||||
|
||||
GVAR(MarkerColorsCache) = [];
|
||||
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
_marker = _config select _a;
|
||||
|
||||
_scope = getNumber (_marker >> "scope");
|
||||
_name = getText (_marker >> "name");
|
||||
|
||||
if (_scope == 2) then {
|
||||
_color lbAdd _name;
|
||||
_color lbSetValue [_index, _a];
|
||||
|
||||
_name = getText (_marker >> "name");
|
||||
_rgba = getArray (_marker >> "color");
|
||||
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_rgba set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _rgba;
|
||||
|
||||
_icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _rgba select 0, _rgba select 1, _rgba select 2, _rgba select 3];
|
||||
|
||||
_color lbSetPicture [_index, _icon];
|
||||
|
||||
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Server Sync JIP markers:
|
||||
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -1,87 +1,84 @@
|
||||
// stuff taken from bohemia, edited by commy2
|
||||
/*
|
||||
* Author: BIS, commy2
|
||||
* Sets up the marker placement
|
||||
* Run instead of \a3\ui_f\scripts\GUI\RscDisplayInsertMarker.sqf
|
||||
*
|
||||
* Arguments:
|
||||
* 0: RscDisplayInsertMarker <DISPLAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [onLoad] call ace_markers_fnc_initInsertMarker;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define BORDER 0.005
|
||||
|
||||
[{
|
||||
disableserialization;
|
||||
_display = _this select 0;
|
||||
PARAMS_1(_display);
|
||||
|
||||
//Prevent Captive Players from placing markers
|
||||
/*if (ACE_player getVariable ["ACE_isCaptive", false]) exitWith {
|
||||
//Can't place markers when can't interact
|
||||
if (!([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {
|
||||
_display closeDisplay 2; //emulate "Cancel" button
|
||||
};*/
|
||||
|
||||
// prevent vanilla key input
|
||||
_display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}];
|
||||
};
|
||||
|
||||
//BIS Controls:
|
||||
_text = _display displayctrl 101;
|
||||
_picture = _display displayctrl 102;
|
||||
_channel = _display displayctrl 103;
|
||||
_buttonOK = _display displayctrl 1;
|
||||
_buttonCancel = _display displayctrl 2;
|
||||
_description = _display displayctrl 1100;
|
||||
_title = _display displayctrl 1001;
|
||||
_sizeX = _display displayctrl 1200;
|
||||
_sizeY = _display displayctrl 1201;
|
||||
_shape = _display displayctrl 1210;
|
||||
_color = _display displayctrl 1211;
|
||||
_angle = _display displayctrl 1220;
|
||||
_angleText = _display displayctrl 1221;
|
||||
_descriptionChannel = _display displayctrl 1101;
|
||||
|
||||
//ACE Controls:
|
||||
// _sizeX = _display displayctrl 1200;
|
||||
// _sizeY = _display displayctrl 1201;
|
||||
_aceShapeLB = _display displayctrl 1210;
|
||||
_aceColorLB = _display displayctrl 1211;
|
||||
_aceAngleSlider = _display displayctrl 1220;
|
||||
_aceAngleSliderText = _display displayctrl 1221;
|
||||
|
||||
|
||||
//Install MapDrawEH on current map
|
||||
_mapIDD = -1;
|
||||
{
|
||||
if (!isNull (findDisplay _x)) exitWith {_mapIDD = _x};
|
||||
} forEach [12, 37, 52, 53, 160];
|
||||
if (_mapIDD == -1) exitWith {ERROR("No Map?");};
|
||||
if (!(_mapIDD in GVAR(mapDisplaysWithDrawEHs))) then {
|
||||
GVAR(mapDisplaysWithDrawEHs) pushBack _mapIDD;
|
||||
((finddisplay _mapIDD) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(mapDrawEH)}];
|
||||
};
|
||||
|
||||
//Calculate center position of the marker placement ctrl
|
||||
_pos = ctrlPosition _picture;
|
||||
_pos = [(_pos select 0) + (_pos select 2) / 2, (_pos select 1) + (_pos select 3) / 2];
|
||||
GVAR(currentMarkerPosition) = ((findDisplay _mapIDD) displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
|
||||
//Hide the bis picture:
|
||||
_picture ctrlShow false;
|
||||
|
||||
// prevent vanilla key input
|
||||
_display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}];
|
||||
|
||||
|
||||
//Focus on the text input
|
||||
ctrlSetFocus _text;
|
||||
|
||||
//Change ok button's text based on current channel
|
||||
[{
|
||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
||||
EXPLODE_1_PVT(_params,_buttonOK);
|
||||
|
||||
if (isNull _buttonOK) exitWith {
|
||||
[_pfhId] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
_channel = "";
|
||||
_textColor = [1,1,1,1];
|
||||
switch (call EFUNC(common,currentChannel)) do {
|
||||
case ("global"): {
|
||||
_channel = localize "str_channel_global";
|
||||
_textColor = [(216/255),(216/255),(216/255),1];
|
||||
};
|
||||
case ("side"): {
|
||||
_channel = localize "str_channel_side";
|
||||
_textColor = [(70/255),(211/255),(252/255),1];
|
||||
};
|
||||
case ("group"): {
|
||||
_channel = localize "str_channel_group";
|
||||
_textColor = [(181/255),(248/255),(98/255),1];
|
||||
};
|
||||
case ("vehicle"): {
|
||||
_channel = localize "str_channel_vehicle";
|
||||
_textColor = [(255/255),(208/255),(0/255),1];
|
||||
};
|
||||
case ("direct"): {
|
||||
_channel = localize "str_channel_direct";
|
||||
_textColor = [(255/255),(255/255),(255/255),1];
|
||||
};
|
||||
case ("command"): {
|
||||
_channel = localize "str_channel_command";
|
||||
_textColor = [(255/255),(255/255),(70/255),1];
|
||||
};
|
||||
};
|
||||
|
||||
//If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text)
|
||||
if (_channel != "") then {
|
||||
_buttonOK ctrlSetTextColor _textColor;
|
||||
_buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel];
|
||||
};
|
||||
}, 0, [_buttonOK]] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
//--- Background
|
||||
_pos = ctrlposition _text;
|
||||
_posX = (_pos select 0) + 0.01;
|
||||
_posY = _pos select 1;
|
||||
_posW = _pos select 2;
|
||||
_posH = _pos select 3;
|
||||
_posY = _posY min ((safeZoneH + safeZoneY) - (6 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen
|
||||
_posY = _posY min ((safeZoneH + safeZoneY) - (8 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen
|
||||
_pos set [0,_posX];
|
||||
_pos set [1,_posY];
|
||||
_text ctrlsetposition _pos;
|
||||
@ -96,46 +93,67 @@
|
||||
//--- Description
|
||||
_pos set [1,_posY - 1*_posH];
|
||||
_pos set [3,6*_posH + 6 * BORDER];
|
||||
_description ctrlenable false;
|
||||
_description ctrlsetposition _pos;
|
||||
_description ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>","Description:"]; //--- ToDo: Localze
|
||||
_description ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>", (localize "str_lib_label_description")];
|
||||
_description ctrlcommit 0;
|
||||
|
||||
_activeColor = (["IGUI","WARNING_RGB"] call bis_fnc_displaycolorget) call bis_fnc_colorRGBtoHTML;
|
||||
|
||||
//--- Shape
|
||||
_pos set [1,_posY + 1 * _posH + 2 * BORDER];
|
||||
_pos set [2,_posW];
|
||||
_pos set [3,_posH];
|
||||
_shape ctrlsetposition _pos;
|
||||
_shape ctrlcommit 0;
|
||||
_aceShapeLB ctrlsetposition _pos;
|
||||
_aceShapeLB ctrlcommit 0;
|
||||
|
||||
//--- Color
|
||||
_pos set [1,_posY + 2 * _posH + 3 * BORDER];
|
||||
_pos set [2,_posW];
|
||||
_color ctrlsetposition _pos;
|
||||
_color ctrlcommit 0;
|
||||
_aceColorLB ctrlsetposition _pos;
|
||||
_aceColorLB ctrlcommit 0;
|
||||
|
||||
//--- Angle
|
||||
_pos set [1,_posY + 3 * _posH + 4 * BORDER];
|
||||
_pos set [2,_posW];
|
||||
_angle ctrlsetposition _pos;
|
||||
_angle ctrlcommit 0;
|
||||
_aceAngleSlider ctrlsetposition _pos;
|
||||
_aceAngleSlider ctrlcommit 0;
|
||||
|
||||
//--- Angle Text
|
||||
_pos set [1,_posY + 4 * _posH + 5 * BORDER];
|
||||
_pos set [2,_posW];
|
||||
_angleText ctrlsetposition _pos;
|
||||
_angleText ctrlcommit 0;
|
||||
_aceAngleSliderText ctrlsetposition _pos;
|
||||
_aceAngleSliderText ctrlcommit 0;
|
||||
|
||||
_offsetButtons = 0;
|
||||
if (isMultiplayer) then {
|
||||
_pos set [1,_posY + 5 * _posH + 7 * BORDER];
|
||||
_pos set [3,_posH];
|
||||
_descriptionChannel ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>", (localize "str_a3_cfgvehicles_modulerespawnposition_f_arguments_marker_0") + ":"];
|
||||
_descriptionChannel ctrlsetposition _pos;
|
||||
_descriptionChannel ctrlcommit 0;
|
||||
|
||||
_pos set [1,_posY + 6 * _posH + 7 * BORDER];
|
||||
_pos set [3,_posH];
|
||||
_channel ctrlsetposition _pos;
|
||||
_channel ctrlcommit 0;
|
||||
_offsetButtons = 7 * _posH + 8 * BORDER;
|
||||
} else {
|
||||
_descriptionChannel ctrlshow false;
|
||||
_channel ctrlshow false;
|
||||
_offsetButtons = 5 * _posH + 7 * BORDER;
|
||||
};
|
||||
|
||||
//--- ButtonOK
|
||||
_pos set [1,_posY + 5 * _posH + 7 * BORDER];
|
||||
_pos set [2,_posW * (8.9/10) - BORDER];
|
||||
_pos set [1,_posY + _offsetButtons];
|
||||
_pos set [2,_posW / 2 - BORDER];
|
||||
_pos set [3,_posH];
|
||||
_buttonOk ctrlsetposition _pos;
|
||||
_buttonOk ctrlcommit 0;
|
||||
|
||||
//--- ButtonCancel
|
||||
_pos set [0,_posX + _posW * (8.9 / 10)];
|
||||
_pos set [2,_posW * (1.1 / 10)];
|
||||
_pos set [0,_posX + _posW / 2];
|
||||
_pos set [1,_posY + _offsetButtons];
|
||||
_pos set [2,_posW / 2];
|
||||
_pos set [3,_posH];
|
||||
_buttonCancel ctrlsetposition _pos;
|
||||
_buttonCancel ctrlcommit 0;
|
||||
|
||||
@ -151,56 +169,41 @@
|
||||
|
||||
|
||||
// init marker shape lb
|
||||
lbClear _aceShapeLB;
|
||||
{
|
||||
_shape lbAdd (_x select 0);
|
||||
_shape lbSetValue [_forEachIndex, _x select 1];
|
||||
_shape lbSetPicture [_forEachIndex, _x select 2];
|
||||
_aceShapeLB lbAdd (_x select 0);
|
||||
_aceShapeLB lbSetValue [_forEachIndex, _x select 1];
|
||||
_aceShapeLB lbSetPicture [_forEachIndex, _x select 2];
|
||||
} forEach GVAR(MarkersCache);
|
||||
|
||||
_shape ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}];
|
||||
|
||||
_curSelShape = GETGVAR(curSelMarkerShape,0);
|
||||
_shape lbSetCurSel _curSelShape;
|
||||
_data = _shape lbValue _curSelShape;
|
||||
_config = (configfile >> "CfgMarkers") select _data;
|
||||
_icon = getText (_config >> "icon");
|
||||
_picture ctrlSetText _icon;
|
||||
_aceShapeLB lbSetCurSel _curSelShape;
|
||||
|
||||
//Update now and add eventHandler:
|
||||
[_aceShapeLB, _curSelShape] call FUNC(onLBSelChangedShape);
|
||||
_aceShapeLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}];
|
||||
|
||||
|
||||
// init marker color lb
|
||||
lbClear _aceColorLB;
|
||||
{
|
||||
_color lbAdd (_x select 0);
|
||||
_color lbSetValue [_forEachIndex, _x select 1];
|
||||
_color lbSetPicture [_forEachIndex, _x select 2];
|
||||
_aceColorLB lbAdd (_x select 0);
|
||||
_aceColorLB lbSetValue [_forEachIndex, _x select 1];
|
||||
_aceColorLB lbSetPicture [_forEachIndex, _x select 2];
|
||||
} forEach GVAR(MarkerColorsCache);
|
||||
|
||||
_color ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}];
|
||||
|
||||
_curSelColor = GETGVAR(curSelMarkerColor,0);
|
||||
_color lbSetCurSel _curSelColor;
|
||||
_data = _color lbValue _curSelColor;
|
||||
_config = (configfile >> "CfgMarkerColors") select _data;
|
||||
_rgba = getArray (_config >> "color");
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_rgba set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _rgba;
|
||||
_picture ctrlSetTextColor _rgba;
|
||||
_aceColorLB lbSetCurSel _curSelColor;
|
||||
|
||||
//Update now and add eventHandler:
|
||||
[_aceColorLB, _curSelColor] call FUNC(onLBSelChangedColor);
|
||||
_aceColorLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}];
|
||||
|
||||
|
||||
// init marker angle slider
|
||||
_angle sliderSetRange [-180, 180];
|
||||
_angle ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
||||
|
||||
_curSelAngle = GETGVAR(curSelMarkerAngle,0);
|
||||
_angle sliderSetPosition _curSelAngle;
|
||||
|
||||
_curSelAngle = round _curSelAngle;
|
||||
if (_curSelAngle < 0) then {
|
||||
_curSelAngle = _curSelAngle + 360;
|
||||
};
|
||||
|
||||
_angleText ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _curSelAngle];
|
||||
_aceAngleSlider sliderSetRange [-180, 180];
|
||||
_curSelAngle = GETGVAR(currentMarkerAngle,0);
|
||||
_aceAngleSlider sliderSetPosition _curSelAngle;
|
||||
//Update now and add eventHandler:
|
||||
[_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle);
|
||||
_aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
||||
|
||||
}, _this] call EFUNC(common,execNextFrame);
|
||||
|
45
addons/markers/functions/fnc_mapDrawEH.sqf
Normal file
45
addons/markers/functions/fnc_mapDrawEH.sqf
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Draws the current temp marker. Allows rotation.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: TheMap <Control>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [theMapControl] call ace_markers_fnc_mapDrawEH;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_theMap", "_sizeX", "_sizeY", "_textureConfig", "_texture", "_markerSize", "_markerShadow", "_colorConfig", "_drawColor"];
|
||||
|
||||
PARAMS_1(_theMap);
|
||||
|
||||
//Only show if marker place is open:
|
||||
if (isNull (findDisplay 54)) exitWith {};
|
||||
//Error checking:
|
||||
if ((GVAR(currentMarkerConfigName) == "") || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith {ERROR("Bad Data");};
|
||||
|
||||
_sizeX = 1;
|
||||
_sizeY = 1;
|
||||
|
||||
_textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName);
|
||||
_texture = getText (_textureConfig >> "icon");
|
||||
_markerSize = getNumber (_textureConfig >> "size");
|
||||
_markerShadow = getNumber (_textureConfig >> "shadow");
|
||||
_colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName));
|
||||
_drawColor = getArray (_colorConfig >> "color");
|
||||
|
||||
//Convert possible code into numbers
|
||||
{
|
||||
if (typeName _x == "STRING") then {
|
||||
_drawColor set [_forEachIndex, (call compile _x)];
|
||||
};
|
||||
} forEach _drawColor;
|
||||
_drawColor set [3, ((_drawColor select 3) * 0.875)]; //Arma adds a slight transparency
|
||||
|
||||
_theMap drawIcon [_texture, _drawColor, GVAR(currentMarkerPosition), (_sizeX * _markerSize), (_sizeY * _markerSize), GVAR(currentMarkerAngle), "", _markerShadow];
|
@ -1,23 +1,28 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* When the color list box is changed.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Color ListBox (idc 1211) <CONTROL>
|
||||
* 1: Selected Index <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [ColorLB, 5] call ace_markers_fnc_onLBSelChangedColor;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ctrl", "_data", "_config", "_color"];
|
||||
private ["_data", "_config"];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_data = _ctrl lbValue (_this select 1);
|
||||
PARAMS_2(_ctrl,_index);
|
||||
_data = _ctrl lbValue _index;
|
||||
|
||||
GVAR(curSelMarkerColor) = _this select 1;
|
||||
GVAR(curSelMarkerColor) = _index;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select _data;
|
||||
|
||||
_color = getArray (_config >> "color");
|
||||
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_color set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _color;
|
||||
|
||||
((ctrlParent _ctrl) displayCtrl 102) ctrlSetTextColor _color;
|
||||
|
||||
GVAR(currentMarkerColorConfigName) = (configName _config);
|
||||
|
@ -1,17 +1,28 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* When the shape list box is changed.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Shape ListBox (idc 1210) <CONTROL>
|
||||
* 1: Selected Index <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [ColorLB, 5] call ace_markers_fnc_onLBSelChangedShape;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ctrl", "_data", "_config", "_icon"];
|
||||
private ["_data", "_config"];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_data = _ctrl lbValue (_this select 1);
|
||||
PARAMS_2(_ctrl,_index);
|
||||
_data = _ctrl lbValue _index;
|
||||
|
||||
GVAR(curSelMarkerShape) = _this select 1;
|
||||
GVAR(curSelMarkerShape) = _index;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select _data;
|
||||
|
||||
_icon = getText (_config >> "icon");
|
||||
|
||||
((ctrlParent _ctrl) displayCtrl 102) ctrlSetText _icon;
|
||||
|
||||
GVAR(currentMarkerConfigName) = (configName _config);
|
||||
|
@ -1,12 +1,24 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Angle Slider Pos changed
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Slider (idc 1210) <CONTROL>
|
||||
* 1: Slider Data (angle: -180..180) <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [Slider, 2] call ace_markers_fnc_onSliderPosChangedAngle;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ctrl", "_data", "_direction"];
|
||||
private ["_direction"];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_data = _this select 1;
|
||||
|
||||
GVAR(curSelMarkerAngle) = _data;
|
||||
PARAMS_2(_ctrl,_data);
|
||||
|
||||
_direction = round _data;
|
||||
if (_direction < 0) then {
|
||||
|
@ -1,46 +1,36 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* MarkerPlacement closed
|
||||
*
|
||||
* Arguments:
|
||||
* 0: RscDisplayInsertMarker <DISPLAY>
|
||||
* 1: CloseNumber (1 = ButtonOk) <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [onUnloadEvent] call ace_markers_fnc_placeMarker;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (_this select 1 == 1) then {
|
||||
disableserialization;
|
||||
_display = _this select 0;
|
||||
disableserialization;
|
||||
PARAMS_2(_display,_closeNum);
|
||||
|
||||
_pos = ctrlPosition (_display displayCtrl 102);
|
||||
_pos = [
|
||||
(_pos select 0) + (_pos select 2) / 2,
|
||||
(_pos select 1) + (_pos select 3) / 2
|
||||
];
|
||||
|
||||
switch (true) do {
|
||||
case (!isNull findDisplay 12): {
|
||||
_pos = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 37): {
|
||||
_pos = (findDisplay 37 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 52): {
|
||||
_pos = (findDisplay 52 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 53): {
|
||||
_pos = (findDisplay 53 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
};
|
||||
if (_closeNum == 1) then {
|
||||
|
||||
// set and send marker data the next frame. the actual marker isn't created yet
|
||||
[
|
||||
{
|
||||
|
||||
[QGVAR(setMarkerNetwork), [
|
||||
allMapMarkers select (count allMapMarkers - 1), [
|
||||
GETGVAR(currentMarkerConfigName,""),
|
||||
GETGVAR(currentMarkerColorConfigName,""),
|
||||
_this,
|
||||
GETGVAR(currentMarkerAngle,0)
|
||||
]
|
||||
]] call EFUNC(common,globalEvent);
|
||||
|
||||
},
|
||||
_pos
|
||||
] call EFUNC(common,execNextFrame);
|
||||
[{
|
||||
[QGVAR(setMarkerNetwork), [
|
||||
allMapMarkers select (count allMapMarkers - 1), [
|
||||
GETGVAR(currentMarkerConfigName,""),
|
||||
GETGVAR(currentMarkerColorConfigName,""),
|
||||
GETGVAR(currentMarkerPosition,[]),
|
||||
GETGVAR(currentMarkerAngle,0)
|
||||
]
|
||||
]] call EFUNC(common,globalEvent);
|
||||
|
||||
}, []] call EFUNC(common,execNextFrame);
|
||||
};
|
||||
|
@ -1,13 +1,25 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Server: Recives a dummy logic, sends marker data back to the owner.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Logic <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [onUnloadEvent] call ace_markers_fnc_sendMarkerJIP;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_logic";
|
||||
PARAMS_1(_logic);
|
||||
|
||||
_logic = _this;
|
||||
|
||||
[QGVAR(setMarkerJIP), _logic, [
|
||||
GETGVAR(allMapMarkers,[]),
|
||||
GETGVAR(allMapMarkersProperties,[]),
|
||||
_logic
|
||||
]
|
||||
[QGVAR(setMarkerJIP), [_logic], [
|
||||
GETGVAR(allMapMarkers,[]),
|
||||
GETGVAR(allMapMarkersProperties,[]),
|
||||
_logic
|
||||
]
|
||||
] call EFUNC(common,targetEvent);
|
||||
|
@ -1,35 +1,49 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Client: Recives a marker data from server.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Array of map marker names <ARRAY>
|
||||
* 1: Array of map marker data <ARRAY>
|
||||
* 2: Logic <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [[],[],dummyLogic] call ace_markers_fnc_setMarkerJIP;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"];
|
||||
private ["_index", "_data", "_config"];
|
||||
|
||||
_allMapMarkers = _this select 0;
|
||||
_allMapMarkersProperties = _this select 1;
|
||||
_logic = _this select 2;
|
||||
PARAMS_3(_allMapMarkers,_allMapMarkersProperties,_logic);
|
||||
|
||||
{
|
||||
_index = _allMapMarkers find _x;
|
||||
_index = _allMapMarkers find _x;
|
||||
|
||||
if (_index != -1) then {
|
||||
_data = _allMapMarkersProperties select _index;
|
||||
if (_index != -1) then {
|
||||
_data = _allMapMarkersProperties select _index;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") >> (_data select 0);
|
||||
if (!isClass _config) then {
|
||||
WARNING("CfgMarker not found, changed to milDot");
|
||||
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
||||
_config = (configfile >> "CfgMarkers") >> (_data select 0);
|
||||
if (!isClass _config) then {
|
||||
WARNING("CfgMarker not found, changed to milDot");
|
||||
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
||||
};
|
||||
_x setMarkerTypeLocal (configName _config);
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
|
||||
if (!isClass _config) then {
|
||||
WARNING("CfgMarkerColors not found, changed to Default");
|
||||
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
||||
};
|
||||
_x setMarkerColorLocal (configName _config);
|
||||
|
||||
_x setMarkerPosLocal (_data select 2);
|
||||
_x setMarkerDirLocal (_data select 3);
|
||||
};
|
||||
_x setMarkerTypeLocal (configName _config);
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
|
||||
if (!isClass _config) then {
|
||||
WARNING("CfgMarkerColors not found, changed to Default");
|
||||
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
||||
};
|
||||
_x setMarkerColorLocal (configName _config);
|
||||
|
||||
_x setMarkerPosLocal (_data select 2);
|
||||
_x setMarkerDirLocal (_data select 3);
|
||||
};
|
||||
} forEach allMapMarkers;
|
||||
|
||||
deleteVehicle _logic;
|
||||
|
@ -1,45 +1,61 @@
|
||||
// by commy2
|
||||
/*
|
||||
* Author: commy2
|
||||
* Sets newly placed marker
|
||||
* Handles the QGVAR(setMarkerNetwork) event.
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Markername <STRING>
|
||||
* 1: Marker Data <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [[],[],dummyLogic] call ace_markers_fnc_setMarkerJIP;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_marker", "_data", "_config"];
|
||||
private ["_config"];
|
||||
|
||||
_marker = _this select 0;
|
||||
_data = _this select 1;
|
||||
PARAMS_2(_marker,_data);
|
||||
EXPLODE_4_PVT(_data,_markerClassname,_colorClassname,_markerPos,_markerDir);
|
||||
|
||||
_config = (configfile >> "CfgMarkers") >> (_data select 0);
|
||||
_config = (configfile >> "CfgMarkers") >> _markerClassname;
|
||||
if (!isClass _config) then {
|
||||
WARNING("CfgMarker not found, changed to milDot");
|
||||
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
||||
WARNING("CfgMarker not found, changed to milDot");
|
||||
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
||||
};
|
||||
_marker setMarkerTypeLocal (configName _config);
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
|
||||
_config = (configfile >> "CfgMarkerColors") >> _colorClassname;
|
||||
if (!isClass _config) then {
|
||||
WARNING("CfgMarkerColors not found, changed to Default");
|
||||
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
||||
WARNING("CfgMarkerColors not found, changed to Default");
|
||||
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
||||
};
|
||||
_marker setMarkerColorLocal configName _config;
|
||||
|
||||
_marker setMarkerPosLocal (_data select 2);
|
||||
_marker setMarkerDirLocal (_data select 3);
|
||||
_marker setMarkerPosLocal _markerPos;
|
||||
_marker setMarkerDirLocal _markerDir;
|
||||
|
||||
// save properties on server machine for JIP, marker editing ready
|
||||
if (isMultiplayer && {isServer}) then {
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
|
||||
|
||||
_allMapMarkers = GETMVAR(allMapMarkers,[]);
|
||||
_allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]);
|
||||
_allMapMarkers = GETGVAR(allMapMarkers,[]);
|
||||
_allMapMarkersProperties = GETGVAR(allMapMarkersProperties,[]);
|
||||
|
||||
_index = _allMapMarkers find _marker;
|
||||
_index = _allMapMarkers find _marker;
|
||||
|
||||
if (_index == -1) then {
|
||||
_allMapMarkers pushBack _marker;
|
||||
_allMapMarkersProperties pushBack _data;
|
||||
} else {
|
||||
_allMapMarkers set [_index, _marker];
|
||||
_allMapMarkersProperties set [_index, _data];
|
||||
};
|
||||
if (_index == -1) then {
|
||||
_allMapMarkers pushBack _marker;
|
||||
_allMapMarkersProperties pushBack _data;
|
||||
} else {
|
||||
_allMapMarkers set [_index, _marker];
|
||||
_allMapMarkersProperties set [_index, _data];
|
||||
};
|
||||
|
||||
GVAR(allMapMarkers) = _allMapMarkers;
|
||||
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
|
||||
GVAR(allMapMarkers) = _allMapMarkers;
|
||||
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
|
||||
};
|
||||
|
@ -11,13 +11,5 @@
|
||||
<Spanish>Dirección: %1°</Spanish>
|
||||
<Russian>Направление: %1</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Markers_PlaceIn">
|
||||
<English>Place in: %1</English>
|
||||
<German>Platz in: %1</German>
|
||||
<Spanish>Colocar en: %1</Spanish>
|
||||
<Polish>Umieść na: %1</Polish>
|
||||
<Czech>Umístit do: %1</Czech>
|
||||
<Russian>Место в: %1</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -440,6 +440,7 @@ class CfgVehicles {
|
||||
statement = QUOTE([ARR_3(_target, true, 0)] call DFUNC(displayPatientInformation));
|
||||
icon = PATHTOF(UI\icons\medical_cross.paa);
|
||||
|
||||
#undef EXCEPTIONS
|
||||
#define EXCEPTIONS exceptions[] = {"isNotInside"};
|
||||
#include "ACE_Medical_Actions.hpp"
|
||||
};
|
||||
|
@ -25,9 +25,9 @@ GVAR(heartBeatSounds_Slow) = ["ACE_heartbeat_slow_1", "ACE_heartbeat_slow_2"];
|
||||
} else {
|
||||
_unit setVariable ["tf_globalVolume", 1];
|
||||
_unit setVariable ["tf_voiceVolume", 1, true];
|
||||
_unit setVariable ["tf_unable_to_use_radio", true, true];
|
||||
_unit setVariable ["tf_unable_to_use_radio", false, true];
|
||||
|
||||
_unit setVariable ["acre_sys_core_isDisabled", true, true];
|
||||
_unit setVariable ["acre_sys_core_isDisabled", false, true];
|
||||
_unit setVariable ["acre_sys_core_globalVolume", 1];
|
||||
};
|
||||
};
|
||||
|
1
addons/optics/$PBOPREFIX$
Normal file
1
addons/optics/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\optics
|
20
addons/optics/CfgEventHandlers.hpp
Normal file
20
addons/optics/CfgEventHandlers.hpp
Normal 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)};);
|
||||
};
|
||||
};
|
||||
};
|
8
addons/optics/CfgOpticsEffect.hpp
Normal file
8
addons/optics/CfgOpticsEffect.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
class CfgOpticsEffect {
|
||||
class ACE_OpticsRadBlur1 {
|
||||
type = "radialblur";
|
||||
params[] = {0.015,0,0.14,0.2};
|
||||
priority = 950;
|
||||
};
|
||||
};
|
50
addons/optics/CfgPreloadTextures.hpp
Normal file
50
addons/optics/CfgPreloadTextures.hpp
Normal 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;
|
||||
};
|
||||
};
|
||||
};
|
188
addons/optics/CfgRscTitles.hpp
Normal file
188
addons/optics/CfgRscTitles.hpp
Normal file
@ -0,0 +1,188 @@
|
||||
|
||||
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 = "";
|
||||
};
|
||||
|
||||
#undef SIZEX
|
||||
#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
|
||||
|
||||
*/
|
19
addons/optics/CfgVehicles.hpp
Normal file
19
addons/optics/CfgVehicles.hpp
Normal 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);
|
||||
};
|
||||
};
|
||||
};
|
303
addons/optics/CfgWeapons.hpp
Normal file
303
addons/optics/CfgWeapons.hpp
Normal 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"
|
||||
};
|
||||
};
|
24
addons/optics/XEH_postInit.sqf
Normal file
24
addons/optics/XEH_postInit.sqf
Normal 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);
|
@ -2,7 +2,8 @@
|
||||
|
||||
ADDON = false;
|
||||
|
||||
PREP(burstDispersion);
|
||||
PREP(camShake);
|
||||
PREP(handleFired);
|
||||
PREP(onDrawScope);
|
||||
PREP(onDrawScope2D);
|
||||
|
||||
ADDON = true;
|
34
addons/optics/config.cpp
Normal file
34
addons/optics/config.cpp
Normal 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"
|
111
addons/optics/functions/fnc_handleFired.sqf
Normal file
111
addons/optics/functions/fnc_handleFired.sqf
Normal 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;
|
29
addons/optics/functions/fnc_onDrawScope.sqf
Normal file
29
addons/optics/functions/fnc_onDrawScope.sqf
Normal 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;
|
56
addons/optics/functions/fnc_onDrawScope2D.sqf
Normal file
56
addons/optics/functions/fnc_onDrawScope2D.sqf
Normal 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;
|
1
addons/optics/functions/script_component.hpp
Normal file
1
addons/optics/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\optics\script_component.hpp"
|
BIN
addons/optics/models/ace_optics_pip.p3d
Normal file
BIN
addons/optics/models/ace_optics_pip.p3d
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
27
addons/optics/script_component.hpp
Normal file
27
addons/optics/script_component.hpp
Normal 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
|
135
addons/optics/stringtable.xml
Normal file
135
addons/optics/stringtable.xml
Normal 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>
|
@ -94,4 +94,13 @@ class RscDisplayInterruptEditor3D: RscStandardDisplay {
|
||||
class controls {
|
||||
class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {};
|
||||
};
|
||||
};
|
||||
};
|
||||
class RscDisplayMain: RscStandardDisplay {
|
||||
class controls {
|
||||
class ACE_Open_settingsMenu_Btn : ACE_Open_SettingsMenu_BtnBase {
|
||||
action = "if (missionName != '') then {createDialog 'ACE_settingsMenu';};";
|
||||
y = "4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -234,7 +234,7 @@ class V_PlateCarrierIA2_dgtl: V_PlateCarrierIA1_dgtl { // heavy
|
||||
};
|
||||
};
|
||||
class V_PlateCarrierIAGL_dgtl: V_PlateCarrierIA2_dgtl { // heavy (gl)
|
||||
class ItemInfo: VestItem {
|
||||
class ItemInfo: ItemInfo {
|
||||
containerClass = "Supply140"; //"Supply120";
|
||||
mass = 100; //80;
|
||||
armor = 12; //100;
|
||||
|
@ -1,43 +0,0 @@
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_FiredBis_EventHandlers {
|
||||
class CAManBase {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == ACE_player) then {_this call FUNC(camShake); _this call FUNC(burstDispersion);};);
|
||||
};
|
||||
};
|
||||
class Tank {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Car {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Helicopter {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Plane {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class Ship_F {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
class StaticWeapon {
|
||||
class ADDON {
|
||||
clientFiredBis = QUOTE(if (_this select 0 == vehicle ACE_player) then {_this call FUNC(camShake);};);
|
||||
};
|
||||
};
|
||||
};
|
@ -6,14 +6,12 @@ class CfgPatches {
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"KoffeinFlummi", "TaoSensai", "commy2"};
|
||||
author[] = {"KoffeinFlummi","TaoSensai","commy2"};
|
||||
authorUrl = "https://github.com/Taosenai/tmr";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
|
||||
// DOC: http://forums.bistudio.com/showthread.php?94464-explaining-the-cfgRecoils-array
|
||||
class CfgRecoils {
|
||||
#define KICKBACK 0.07
|
||||
@ -114,17 +112,18 @@ class CfgRecoils {
|
||||
recoil_single_titan[] = {0,0,0};
|
||||
};
|
||||
|
||||
class CfgCameraShake {
|
||||
/*class CfgCameraShake {
|
||||
// Seems to be ignored by Arma
|
||||
defaultCaliberCoefWeaponFire = 0;
|
||||
};
|
||||
};*/
|
||||
|
||||
// Completely disable BI's camshake on fire.
|
||||
class CfgMovesBasic {
|
||||
/*class CfgMovesBasic {
|
||||
class Default {
|
||||
camShakeFire = 0;
|
||||
};
|
||||
};
|
||||
|
||||
class CfgMovesMaleSdr : CfgMovesBasic {
|
||||
class States {
|
||||
class AmovPercMstpSlowWrflDnon;
|
||||
@ -183,128 +182,4 @@ class CfgMovesMaleSdr : CfgMovesBasic {
|
||||
camShakeFire = 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// Ammo
|
||||
class CfgAmmo {
|
||||
class MissileCore;
|
||||
class MissileBase: MissileCore {
|
||||
GVAR(shakeMultiplier) = 2;
|
||||
};
|
||||
|
||||
class BombCore;
|
||||
class LaserBombCore: BombCore {
|
||||
GVAR(shakeMultiplier) = 2;
|
||||
};
|
||||
class Bo_Mk82: BombCore {
|
||||
GVAR(shakeMultiplier) = 2;
|
||||
};
|
||||
|
||||
class RocketCore;
|
||||
class ArtilleryRocketCore: RocketCore {
|
||||
GVAR(shakeMultiplier) = 1.4;
|
||||
};
|
||||
class RocketBase: RocketCore {
|
||||
GVAR(shakeMultiplier) = 1.4;
|
||||
};
|
||||
|
||||
class BulletCore;
|
||||
class BulletBase: BulletCore {
|
||||
GVAR(shakeMultiplier) = 1;
|
||||
};
|
||||
|
||||
class ShotgunCore;
|
||||
class ShotgunBase: ShotgunCore {
|
||||
GVAR(shakeMultiplier) = 1.1;
|
||||
};
|
||||
|
||||
class ShellCore;
|
||||
class ShellBase: ShellCore {
|
||||
GVAR(shakeMultiplier) = 3;
|
||||
};
|
||||
|
||||
class SubmunitionCore;
|
||||
class SubmunitionBase: SubmunitionCore {
|
||||
GVAR(shakeMultiplier) = 3;
|
||||
};
|
||||
|
||||
class ShotDeployCore;
|
||||
class ShotDeployBase: ShotDeployCore {
|
||||
GVAR(shakeMultiplier) = 3;
|
||||
};
|
||||
};
|
||||
|
||||
// Weapons
|
||||
// 1. Set the recoil profiles for all fire modes.
|
||||
// 2. Set the shake multiplier. This determines the camshake for the weapon.
|
||||
// Ex: GVAR(shakeMultiplier) = 1; (disabled currently)
|
||||
|
||||
class CfgWeapons {
|
||||
class CannonCore;
|
||||
class autocannon_Base_F: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class autocannon_35mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class cannon_120mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class mortar_155mm_AMOS: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class mortar_82mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
|
||||
// No camshake for gatlings
|
||||
class gatling_20mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class gatling_25mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class gatling_30mm: CannonCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
|
||||
class MGunCore;
|
||||
class MGun: MGunCore {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
// No camshake for smoke launchers
|
||||
class SmokeLauncher: MGun {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
|
||||
// No camshake for coax machine guns
|
||||
class LMG_RCWS;
|
||||
class LMG_M200: LMG_RCWS {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class LMG_coax: LMG_RCWS {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
class LMG_Minigun: LMG_RCWS {
|
||||
GVAR(shakeMultiplier) = 0;
|
||||
};
|
||||
};
|
||||
|
||||
// Vehicles
|
||||
class CfgVehicles {
|
||||
class LandVehicle;
|
||||
class Tank: LandVehicle {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
class Car: LandVehicle {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
class StaticWeapon: LandVehicle {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
|
||||
class Allvehicles;
|
||||
class Air: Allvehicles {
|
||||
GVAR(enableCamshake) = 1;
|
||||
};
|
||||
};
|
||||
};*/
|
||||
|
@ -1,62 +0,0 @@
|
||||
// TMR: Small Arms - Recoil initialization and functions
|
||||
// (C) 2013 Ryan Schultz. See LICENSE.
|
||||
// Edited for compatability in ACE by KoffeinFlummi
|
||||
// Edited by commy2
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_unit", "_weapon", "_projectile"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_projectile = _this select 6;
|
||||
|
||||
if (_weapon in ["Throw", "Put"]) exitWith {};
|
||||
|
||||
private ["_lastFired", "_burst"];
|
||||
|
||||
_lastFired = _unit getVariable [QUOTE(GVAR(lastFired)), -1];
|
||||
_burst = _unit getVariable [QUOTE(GVAR(burst)), 0];
|
||||
|
||||
if (time - _lastFired < 0.45) then {
|
||||
private "_startDisperse";
|
||||
_burst = _burst + 1;
|
||||
_unit setVariable [QUOTE(GVAR(burst)), _burst, false];
|
||||
|
||||
_startDisperse = [1, 3] select (cameraView == "GUNNER");
|
||||
|
||||
if (_burst > _startDisperse) then {
|
||||
// Reset burst size for calcs
|
||||
_burst = _burst - _startDisperse;
|
||||
|
||||
// Increase dispersion cap if player is not using sights
|
||||
_sightsBurst = [30, 0] select (cameraView == "GUNNER");
|
||||
|
||||
// Increase initial dispersion and cap if player is moving
|
||||
if (speed _unit > 0.5) then {
|
||||
_sightsBurst = 25;
|
||||
_burst = _burst + 15;
|
||||
};
|
||||
|
||||
// Maximum possible dispersion (without _sightsBurst mod)
|
||||
_maxBurst = 50;
|
||||
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,weaponRested)), false]) then {_maxBurst = 25};
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,bipodDeployed)), false]) then {_maxBurst = 18};
|
||||
|
||||
// Cap the dispersion
|
||||
_burst = (_burst min _maxBurst) + _sightsBurst;
|
||||
|
||||
// Add random variance
|
||||
_elevAngle = (_burst / 300) - random (_burst / 300) * 2;
|
||||
_travAngle = (_burst / 260) - random (_burst / 260) * 2;
|
||||
|
||||
[_projectile, _travAngle, _elevAngle] call EFUNC(common,changeProjectileDirection);
|
||||
};
|
||||
} else {
|
||||
|
||||
// Long enough delay, reset burst
|
||||
_unit setVariable [QUOTE(GVAR(burst)), 0, false];
|
||||
};
|
||||
|
||||
_unit setVariable [QUOTE(GVAR(lastFired)), time, false];
|
@ -1,61 +0,0 @@
|
||||
// TMR: Small Arms - Recoil initialization and functions
|
||||
// (C) 2013 Ryan Schultz. See LICENSE.
|
||||
// Edited for compatability in ACE by KoffeinFlummi
|
||||
// Edited by commy2
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define BASE_POWER 0.40
|
||||
#define BASE_TIME 0.19
|
||||
#define BASE_FREQ 13
|
||||
#define RECOIL_COEF 40
|
||||
|
||||
private ["_unit", "_weapon", "_muzzle", "_ammo"];
|
||||
|
||||
_unit = _this select 0;
|
||||
_weapon = _this select 1;
|
||||
_muzzle = _this select 2;
|
||||
_ammo = _this select 4;
|
||||
|
||||
if (_weapon in [handgunWeapon _unit, "Throw", "Put"]) exitWith {};
|
||||
|
||||
private ["_powerMod", "_timeMod", "_freqMod", "_powerCoef"];
|
||||
|
||||
_powerMod = ([0, -0.1, -0.1, 0, -0.2] select (["STAND", "CROUCH", "PRONE", "UNDEFINED", ""] find stance _unit)) + ([0, -1, 0, -1] select (["INTERNAL", "EXTERNAL", "GUNNER", "GROUP"] find cameraView));
|
||||
_timeMod = 0;
|
||||
_freqMod = 0;
|
||||
|
||||
_powerCoef = 0;
|
||||
if (_unit != vehicle _unit) then {
|
||||
_powerCoef = getNumber (configFile >> "CfgWeapons" >> _weapon >> QUOTE(GVAR(shakeMultiplier)));
|
||||
_powerCoef = _powerCoef * getNumber (configFile >> "CfgAmmo" >> _ammo >> QUOTE(GVAR(shakeMultiplier)));
|
||||
} else {
|
||||
private ["_type", "_config", "_recoil"];
|
||||
|
||||
_type = ["recoil", "recoilProne"] select (stance _unit == "PRONE");
|
||||
|
||||
_config = configFile >> "CfgWeapons" >> _weapon;
|
||||
_recoil = if (_muzzle == _weapon) then {
|
||||
getText (_config >> _type)
|
||||
} else {
|
||||
getText (_config >> _muzzle >> _type)
|
||||
};
|
||||
|
||||
_recoil = getArray (configFile >> "CfgRecoils" >> _recoil);
|
||||
if (count _recoil < 2) exitWith {};
|
||||
|
||||
_powerCoef = _recoil select 1;
|
||||
_powerCoef = (call compile format ["%1", _powerCoef]) * RECOIL_COEF;
|
||||
};
|
||||
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,weaponRested)), false]) then {_powerMod = _powerMod - 0.07};
|
||||
if (_unit getVariable [QUOTE(EGVAR(resting,bipodDeployed)), false]) then {_powerMod = _powerMod - 0.11};
|
||||
|
||||
private "_camshake";
|
||||
_camshake = [
|
||||
_powerCoef * (BASE_POWER + _powerMod) max 0,
|
||||
BASE_TIME + _timeMod max 0,
|
||||
BASE_FREQ + _freqMod max 0
|
||||
];
|
||||
|
||||
addCamShake _camshake;
|
@ -1,12 +0,0 @@
|
||||
#define COMPONENT recoil
|
||||
#include "\z\ace\Addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_RECOIL
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_RECOIL
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_RECOIL
|
||||
#endif
|
||||
|
||||
#include "\z\ace\Addons\main\script_macros.hpp"
|
@ -1 +0,0 @@
|
||||
z\ace\addons\resting
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user