Merge remote-tracking branch 'origin/master'

This commit is contained in:
KoffeinFlummi 2015-01-27 23:17:17 +01:00
commit 9b062b3665
867 changed files with 26158 additions and 8298 deletions

View File

@ -1,25 +0,0 @@
class CfgFunctions{
class AGM_Goggles{
class AGM_Goggles{
file="AGM_Goggles\functions";
class Init{postInit = 1;};
class ApplyGlassesEffect;
class RemoveGlassesEffect;
class ApplyDirtEffect;
class RemoveDirtEffect;
class isGogglesVisible;
class isDivingGoggles;
class ClearGlasses;
class CheckGoggles;
class GetExplosionIndex;
class RainEffect;
class RemoveRainEffect;
class DustHandler;
class ExternalCamera;
class isInRotorWash;
class OnEachFrame;
class ApplyDust;
class RemoveDustEffect;
};
};
};

View File

@ -1,295 +0,0 @@
#define COLOUR 8.0
class CfgPatches {
class AGM_Goggles {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"Garth 'L-H' de Wet"};
authorUrl = "https://github.com/CorruptedHeart";
};
};
#include "CfgFunctions.hpp"
#define COMBAT_GOGGLES AGM_Overlay="AGM_Goggles\textures\HUD\CombatGoggles.paa"; \
AGM_OverlayCracked = "AGM_Goggles\textures\HUD\CombatGogglesCracked.paa"; \
AGM_Resistance = 2; \
AGM_Protection = 1;
class CfgGlasses {
class None {
AGM_Color[] = {0,0,0};
AGM_TintAmount=0;
AGM_Overlay = "";
AGM_OverlayDirt = "A3\Ui_f\data\igui\rsctitles\HealthTextures\dust_upper_ca.paa";
AGM_OverlayCracked = "AGM_Goggles\textures\HUD\Cracked.paa";
AGM_Resistance = 0;
AGM_Protection = 0;
AGM_DustPath = "AGM_Goggles\textures\fx\dust\%1.paa";
};
class G_Combat:None {
COMBAT_GOGGLES
};
class G_Diving {
AGM_Overlay="AGM_Goggles\textures\HUD\DivingGoggles.paa";
AGM_OverlayCracked = "AGM_Goggles\textures\HUD\DivingGogglesCracked.paa";
AGM_Resistance = 2;
AGM_Protection = 1;
};
class G_Lowprofile:None {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 2;
AGM_Protection = 1;
};
class G_Shades_Black:None {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Shades_Blue:None{
AGM_Color[] = {0,0,1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Shades_Green:None{
AGM_Color[] = {0,1,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Shades_Red:None{
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Spectacles:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Spectacles_Tinted:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Blackred:None{
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Sport_BlackWhite:None{
AGM_Color[] = {0,0,1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Sport_Blackyellow:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Checkered:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Greenblack:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Sport_Red:None{
AGM_TintAmount=COLOUR*2;
AGM_Color[] = {0,0,0};
AGM_Resistance = 1;
};
class G_Squares:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Squares_Tinted:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Tactical_Black:None{
AGM_TintAmount=COLOUR;
AGM_Color[] = {0,0,-1.5};
AGM_Resistance = 1;
};
class G_Tactical_Clear:None{
AGM_TintAmount=COLOUR;
AGM_Color[] = {0,0,-1};
AGM_Resistance = 1;
};
class G_Aviator:None{
AGM_Color[] = {0,0,-1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Lady_Blue:None{
AGM_Color[] = {0,0,1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Lady_Red:None{
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class G_Lady_Dark:None{
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
};
class G_Lady_Mirror:None{
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
};
class AV_ESS_blk:None{
COMBAT_GOGGLES
};
class G_Balaclava_blk;
class G_Balaclava_combat:G_Balaclava_blk {
COMBAT_GOGGLES
};
class G_Balaclava_lowprofile:G_Balaclava_blk {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 2;
AGM_Protection = 1;
};
class G_Bandanna_blk;
class G_Bandanna_shades:G_Bandanna_blk {
AGM_TintAmount=COLOUR*2;
AGM_Resistance = 1;
AGM_Protection = 1;
};
class G_Bandanna_sport:G_Bandanna_blk {
AGM_Color[] = {1,0,0};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
AGM_Protection = 1;
};
class G_Bandanna_aviator:G_Bandanna_blk {
AGM_Color[] = {0,0,-1};
AGM_TintAmount=COLOUR;
AGM_Resistance = 1;
AGM_Protection = 1;
};
};
#include "RscTitles.hpp"
class CfgMovesBasic
{
class ManActions
{
GestureWipeFace[] = {"GestureWipeFace", "gesture"};
};
};
class CfgGesturesMale
{
class States
{
class GestureFreezeStand;
class GestureWipeFace: GestureFreezeStand
{
file = "\AGM_Goggles\anim\WipeGlasses.rtm";
canPullTrigger = 0;
};
};
};
class CfgWeapons{
class H_HelmetB;
class H_CrewHelmetHeli_B:H_HelmetB {
AGM_Protection = 1;
};
class H_PilotHelmetHeli_B:H_HelmetB {
AGM_Protection = 1;
};
class H_PilotHelmetFighter_B:H_HelmetB {
AGM_Protection = 1;
};
};
class RifleAssaultCloud {
AGM_Goggles_BulletCount = 4;
};
class MachineGunCloud {
AGM_Goggles_BulletCount = 3;
};
class SniperCloud {
AGM_Goggles_BulletCount = 1;
};
class AGM_Core_Default_Keys {
class wipeGlasses {
displayName = $STR_AGM_Goggles_WipeGlasses;
condition = "!(player getVariable['AGM_isUnconscious', false])";
statement = "call AGM_Goggles_fnc_ClearGlasses;";
key = 20; // T
shift = 1;
control = 1;
alt = 0;
};
};
class AGM_Core_Options {
class showInThirdPerson {
displayName = $STR_AGM_Goggles_ShowInThirdPerson;
default = 0;
};
};
class CfgCloudlets {
class Default;
class AGMRainEffect:Default {
interval = 0.001;
particleShape = "\A3\data_f\ParticleEffects\Universal\Refract";
particleFSNtieth = 1;
particleFSIndex = 0;
particleFSFrameCount = 1;
particleFSLoop = 1;
particleType = "Billboard";
lifeTime = 0.5;
rotationVelocity = 1;
weight = 100;
volume = 0.000;
rubbing = 1.7;
size[] = {0.1};
color[] = {{1,1,1,1}};
animationSpeed[] = {0,1};
randomDirectionPeriod = 0.2;
randomDirectionIntensity = 1.2;
positionVar[] = {2, 2, 2.5};
sizeVar = 0.01;
colorVar[] = {0, 0, 0, 0.1};
destroyOnWaterSurface = 1;
};
};

View File

@ -1,27 +0,0 @@
// Control types
#define CT_STATIC 0
#define ST_PICTURE 0x30
////////////////
//Base Classes//
////////////////
class RscPicture
{
access = 0;
idc = -1;
type = CT_STATIC;
style = ST_PICTURE;
colorBackground[] = {0,0,0,0};
colorText[] = {1,1,1,1};
font = "puristaMedium";
sizeEx = 0;
lineSpacing = 0;
fixedWidth = 0;
shadow = 0;
text = "";
x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH;
};

View File

@ -1,32 +0,0 @@
/*
Name: AGM_Goggles_fnc_ApplyDirtEffect
Author: Garth de Wet (LH)
Description:
Adds dirt effect to the glasses.
Parameters:
Nothing
Returns:
BOOLEAN - True if succeeded false if not
Example:
call AGM_Goggles_fnc_ApplyDirtEffect;
*/
#include "\AGM_Goggles\script.sqf"
if (cameraOn != player || call AGM_Goggles_fnc_ExternalCamera) exitWith{false};
private "_dirtImage";
AGM_Goggles_Effects set [DIRT, true];
if (player call AGM_Goggles_fnc_isGogglesVisible) then{
_dirtImage = getText(ConfigFile >> "CfgGlasses" >> goggles player >> "AGM_OverlayDirt");
if (_dirtImage != "") then {
100 cutRsc["RscAGM_GogglesEffects", "PLAIN",0.1, false];
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText _dirtImage;
};
};
true

View File

@ -1,69 +0,0 @@
/*
Name: AGM_Goggles_fnc_ApplyDust
Author: Garth de Wet (LH)
Description:
Applies dust to screen.
Parameters:
Nothing
Returns:
Nothing
Example 1:
call AGM_Goggles_fnc_ApplyDust;
*/
#include "\AGM_Goggles\script.sqf"
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {};
if (player call AGM_Goggles_fnc_isGogglesVisible) exitWith {
100 cutRsc["RscAGM_GogglesEffects", "PLAIN",2,false];
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText format[getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_DustPath"), GETDUSTT(DAMOUNT)+1];
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,1));
SETDUST(DBULLETS,0);
};
if (player getVariable ["AGM_EyesDamaged", false]) exitWith {SETDUST(DACTIVE,false);SETDUST(DBULLETS,0);SETDUST(DAMOUNT,0);};
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)+1,0,2));
private "_amount";
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 1;
AGM_Goggles_PostProcessEyes ppEffectEnable true;
if !(scriptDone AGM_Goggles_DustHandler) then {
terminate AGM_Goggles_DustHandler;
};
SETDUST(DBULLETS,0);
AGM_Goggles_DustHandler = [3] spawn {
private ["_loop", "_timeToSleep"];
_timeToSleep = _this select 0;
_loop = true;
while {_loop} do {
sleep _timeToSleep;
_timeToSleep = GETDUSTT(DTIME);
if(_timeToSleep >= (time - 2.5)) then {
_timeToSleep = time - _timeToSleep;
} else {
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
private "_amount";
_amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
if !(player getVariable ["AGM_EyesDamaged", false]) then {
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [_amount,_amount,_amount,_amount],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 1;
sleep 1;
};
if (GETDUSTT(DAMOUNT) <= 0) then {
AGM_Goggles_PostProcessEyes ppEffectEnable false;
SETDUST(DACTIVE,false);
SETDUST(DBULLETS,0);
_loop = false;
};
SETDUST(DTIME,time);
_timeToSleep = 3;
};
};
};

View File

@ -1,52 +0,0 @@
/*
Author: Garth de Wet (LH)
Description:
Performs rain checks and checks to see whether glasses effects have been applied or not.
Checks for external camera and removes effects.
Parameters:
Nothing
Returns:
Nothing
Example:
[] execVM "AGM_Goggles\functions\fn_CheckGoggles.sqf";
*/
#include "\AGM_Goggles\script.sqf"
waitUntil {sleep 0.46;alive player};
call AGM_Goggles_fnc_CheckGlasses;
["AGM_Goggles_RotorWash", "OnEachFrame", {call AGM_Goggles_fnc_OnEachFrame;}] call BIS_fnc_addStackedEventHandler;
[] spawn AGM_Goggles_fnc_RainEffect;
while {alive player} do {
sleep 1;
if (true) then {
// Detect if curator interface is open and disable effects
if (!isNull(findDisplay 312)) exitWith {
if (AGM_Goggles_EffectsActive) then {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
};
call AGM_Goggles_fnc_CheckGlasses;
if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith {
if (AGM_Goggles_EffectsActive) then {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
};
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {
if (AGM_Goggles_EffectsActive) then {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
};
if !(AGM_Goggles_EffectsActive) then {
(goggles player) call AGM_Goggles_fnc_ApplyGlassesEffect;
} else {
if ((goggles player) call AGM_Goggles_fnc_isDivingGoggles && {underwater player}) then {
call AGM_Goggles_fnc_RemoveRainEffect;
call AGM_Goggles_fnc_RemoveDirtEffect;
call AGM_Goggles_fnc_RemoveDustEffect;
};
};
};
};

View File

@ -1,39 +0,0 @@
/*
Name: AGM_Goggles_fnc_ClearGlasses
Author: Garth de Wet (LH)
Description:
Clears all dirt, rain, dust from glasses.
Removes glasses effect (PP, overlay) and then puts it back.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_ClearGlasses;
*/
#include "\AGM_Goggles\script.sqf"
private "_broken";
_broken = GETBROKEN;
AGM_Goggles_Effects = GLASSESDEFAULT;
AGM_Goggles_Effects set [BROKEN, _broken];
if ((stance player) != "PRONE") then {
player playActionNow "gestureWipeFace";
};
null = [] spawn {
sleep 0.3;
if (cameraView == "INTERNAL") then {
addCamShake [5, 1.75, 2];
};
};
call AGM_Goggles_fnc_RemoveDirtEffect;
call AGM_Goggles_fnc_RemoveRainEffect;
call AGM_Goggles_fnc_RemoveDustEffect;

View File

@ -1,19 +0,0 @@
/*
Name: AGM_Goggles_fnc_ExternalCamera
Author: Garth de Wet (LH)
Description:
Returns if the camera is external or not.
Parameters:
Nothing
Returns:
Boolean - whether the camera is in external view or not.
Example:
call AGM_Goggles_fnc_ExternalCamera;
*/
if (profileNamespace getVariable ["AGM_showInThirdPerson", false]) exitWith { false };
(cameraView == "External")

View File

@ -1,28 +0,0 @@
/*
Name: AGM_Goggles_fnc_GetExplosionIndex
Author: Garth de Wet (LH)
Description:
Turns 0-1 damage into a rating system of 0-3
Parameters:
0: NUMBER - The amount of damage
Returns:
NUMBER (the rating) [0-3]
Example:
_rating = 0.05 call AGM_Goggles_fnc_GetExplosionIndex
*/
private ["_effect", "_effectIndex"];
_effect = _this;
_effectIndex = switch true do {
case (_effect <= 0.04): {0};
case (_effect <= 0.06): {1};
case (_effect <= 0.09): {2};
default {3};
};
_effectIndex

View File

@ -1,111 +0,0 @@
/*
Name: AGM_Goggles_fnc_Init
Author: Garth de Wet (LH)
Description:
Sets up the glasses mod for usage. Initialises variables and event handlers.
Shouldn't be called by a user/modder ever. Done by the engine.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_Init;
*/
if (!hasInterface) exitWith {};
#include "\AGM_Goggles\script.sqf"
if isNil("AGM_Goggles_UsePP") then {
AGM_Goggles_UsePP = true;
};
AGM_Goggles_PostProcess = ppEffectCreate ["ColorCorrections", 1995];
AGM_Goggles_PostProcessEyes = ppEffectCreate ["ColorCorrections", 1992];
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 0;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
AGM_Goggles_EffectsActive = false;
AGM_Goggles_Effects = GLASSESDEFAULT;
AGM_Goggles_Current = "None";
AGM_Goggles_EyesDamageScript = 0 spawn {};
AGM_Goggles_FrameEvent = [false, [false,20]];
AGM_Goggles_PostProcessEyes_Enabled = false;
AGM_Goggles_DustHandler = 0 spawn {};
AGM_Goggles_RainDrops = objNull;
AGM_Goggles_fnc_CheckGlasses = {
if (AGM_Goggles_Current != (goggles player)) then {
AGM_Goggles_Current = (goggles player);
["GlassesChanged",[AGM_Goggles_Current]] call CBA_fnc_localEvent;
};
};
player addEventHandler ["Explosion", {
if (alive player) then {
call AGM_Goggles_fnc_ApplyDirtEffect;
if (GETBROKEN) exitWith {};
if (((_this select 1) call AGM_Goggles_fnc_GetExplosionIndex) < getNumber(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_Resistance")) exitWith {};
if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith {["GlassesCracked",[player]] call CBA_fnc_localEvent;};
AGM_Goggles_Effects set [BROKEN, true];
if (getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_OverlayCracked") != "" && {cameraOn == player}) then {
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {};
if (isNull(GLASSDISPLAY)) then {
150 cutRsc["RscAGM_Goggles", "PLAIN",1, false];
};
(GLASSDISPLAY displayCtrl 10650) ctrlSetText getText(ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_OverlayCracked");
};
["GlassesCracked",[player]] call CBA_fnc_localEvent;
};
}];
player addEventHandler ["Killed",{
[] spawn {
sleep 2;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
AGM_Goggles_Effects = GLASSESDEFAULT;
call AGM_Goggles_fnc_RemoveGlassesEffect;
AGM_Goggles_EffectsActive=false;
player setVariable ["AGM_EyesDamaged", false];
terminate AGM_Goggles_EyesDamageScript;
terminate AGM_Goggles_MainLoop;
terminate AGM_Goggles_DustHandler;
AGM_Goggles_MainLoop = [] spawn AGM_Goggles_fnc_CheckGoggles;
};
}];
player addEventHandler ["Fired",{[_this select 0, _this select 1] call AGM_Goggles_fnc_DustHandler;}];
player AddEventHandler ["Take",{call AGM_Goggles_fnc_CheckGlasses;}];
player AddEventHandler ["Put", {call AGM_Goggles_fnc_CheckGlasses;}];
["GlassesChanged",{
AGM_Goggles_Effects = GLASSESDEFAULT;
if (call AGM_Goggles_fnc_ExternalCamera) exitWith {call AGM_Goggles_fnc_RemoveGlassesEffect};
if (player call AGM_Goggles_fnc_isGogglesVisible) then {
(_this select 0) call AGM_Goggles_fnc_ApplyGlassesEffect;
} else {
call AGM_Goggles_fnc_RemoveGlassesEffect;
};
}] call CBA_fnc_addEventHandler;
["GlassesCracked",{
if (_this select 0 != player) exitWith {};
player setVariable ["AGM_EyesDamaged", true];
if !(scriptDone AGM_Goggles_EyesDamageScript) then {
terminate AGM_Goggles_EyesDamageScript;
};
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [0.5,0.5,0.5,0.5],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 0;
AGM_Goggles_PostProcessEyes ppEffectEnable true;
AGM_Goggles_EyesDamageScript = [] spawn {
sleep 25;
AGM_Goggles_PostProcessEyes ppEffectAdjust[1, 1, 0, [0,0,0,0], [1,1,1,1],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 5;
sleep 5;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
player setVariable ["AGM_EyesDamaged", false];
};
}] call CBA_fnc_addEventHandler;
AGM_Goggles_MainLoop = [] spawn AGM_Goggles_fnc_CheckGoggles;

View File

@ -1,80 +0,0 @@
/*
Name: AGM_Goggles_fnc_OnEachFrame
Author: Garth de Wet (LH)
Description:
Runs every frame checking for helicopters.
Parameters:
Nothing
Returns:
Nothing
Example:
["AGM_Goggles_RotorWash", "OnEachFrame", "call AGM_Goggles_fnc_OnEachFrame;"] call BIS_fnc_addStackedEventHandler;
*/
#include "\AGM_Goggles\script.sqf"
if (isNull(player)) then {
["AGM_Goggles_RotorWash", "OnEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
AGM_Goggles_FrameEvent set [0, !(AGM_Goggles_FrameEvent select 0)];
if (AGM_Goggles_FrameEvent select 0) exitWith {
if (vehicle player != player && {!([player] call AGM_Core_fnc_isTurnedOut)}) exitWith {(AGM_Goggles_FrameEvent select 1) set [0, false]; };
AGM_Goggles_FrameEvent set [1, ([player] call AGM_Goggles_fnc_isInRotorWash)];
};
private ["_rotorWash","_safe"];
_rotorWash = AGM_Goggles_FrameEvent select 1;
_safe = false;
if !(_rotorWash select 0) exitWith {
if (AGM_Goggles_PostProcessEyes_Enabled) then {
AGM_Goggles_PostProcessEyes_Enabled = false;
if (!scriptDone (AGM_Goggles_DustHandler)) then {
terminate AGM_Goggles_DustHandler;
};
AGM_Goggles_DustHandler = [] spawn {
AGM_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [0,0,0,1],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 2;
sleep 2;
AGM_Goggles_PostProcessEyes ppEffectEnable false;
};
};
};
if ((headgear player) != "") then {
_safe = (getNumber (ConfigFile >> "CfgWeapons" >> (headgear player) >> "AGM_Protection") == 1);
};
if !(_safe) then {
if !(player call AGM_Goggles_fnc_isGogglesVisible) exitWith{};
if (GETDUSTT(DAMOUNT) < 2) then {
if (!GETDUSTT(DACTIVE)) then {
SETDUST(DACTIVE,true);
call AGM_Goggles_fnc_ApplyDust;
} else {
if ((_rotorWash select 1) > 0.5) then {
call AGM_Goggles_fnc_ApplyDust;
};
};
};
_safe = (getNumber (ConfigFile >> "CfgGlasses" >> AGM_Goggles_Current >> "AGM_Protection") == 1);
};
if (_safe) exitWith {};
if ((_rotorWash select 1) <= 15) then {
private "_scale";
_scale = 0.7;
if ((_rotorWash select 1) != 0) then {
_scale = CLAMP(0.3*(_rotorWash select 1),0.1,0.3);
} else {
_scale = 0.1;
};
_scale = 1 - _scale;
if (!scriptDone (AGM_Goggles_DustHandler)) then {
terminate AGM_Goggles_DustHandler;
};
if !(player getVariable ["AGM_EyesDamaged", false]) then {
AGM_Goggles_PostProcessEyes_Enabled = true;
AGM_Goggles_PostProcessEyes ppEffectAdjust [1, 1, 0, [0,0,0,0], [_scale,_scale,_scale,_scale],[1,1,1,0]];
AGM_Goggles_PostProcessEyes ppEffectCommit 0.5;
AGM_Goggles_PostProcessEyes ppEffectEnable true;
};
};

View File

@ -1,61 +0,0 @@
/*
Name: AGM_Goggles_fnc_RainEffect
Author: Garth de Wet (LH)
Description:
Parameters:
Nothing
Returns:
Nothing
Example:
[] spawn AGM_Goggles_fnc_RainEffect;
*/
#include "\AGM_Goggles\script.sqf"
AGM_Goggles_RainDrops = objNull;
AGM_Goggles_Rain_Active = false;
_fnc_underCover = {
private ["_pos", "_unit"];
_unit = (_this select 0);
if (vehicle _unit != _unit && {!([_unit] call AGM_Core_fnc_isTurnedOut)}) exitWith {true};
_pos = eyePos _unit;
((positionCameraToWorld [0,0,1] select 2) < ((positionCameraToWorld [0,0,0] select 2) - 0.4)) || {(lineIntersects [_pos, _pos vectorAdd [0,0,15], _unit])}
};
private ["_lastRain"];
_lastRain = 0;
while {alive player} do {
sleep 0.5;
if (isNull(findDisplay 312)) then {
// Ignore if player is under water
if (!AGM_Goggles_EffectsActive || {underwater player}) exitWith{call AGM_Goggles_fnc_RemoveRainEffect;};
if (_lastRain != rain) then {
call AGM_Goggles_fnc_RemoveRainEffect;
_lastRain = rain;
// Rain is happening
if (_lastRain > 0.05 && {!([player] call _fnc_underCover)}) then {
AGM_Goggles_Rain_Active = true;
AGM_Goggles_RainDrops = "#particlesource" createVehicleLocal GetPos player;
AGM_Goggles_RainDrops setParticleClass "AGMRainEffect";
AGM_Goggles_RainDrops setDropInterval (0.07 * (1.1 - _lastRain));
AGM_Goggles_RainDrops attachTo [vehicle player,[0,0,0]];
};
}else{
if (_lastRain > 0.05) then {
if (AGM_Goggles_Rain_Active && {[player] call _fnc_underCover}) exitWith {
call AGM_Goggles_fnc_RemoveRainEffect;
};
if (!AGM_Goggles_Rain_Active) then {
_lastRain = -1;
};
};
};
}else{
if (AGM_Goggles_Rain_Active) then {
call AGM_Goggles_fnc_RemoveRainEffect;
};
};
};

View File

@ -1,20 +0,0 @@
/*
Name: AGM_Goggles_fnc_RemoveDirtEffect
Author: Garth de Wet (LH)
Description:
Removes dirt from the glasses.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_RemoveDirtEffect;
*/
if (!isNull(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull])) then {
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10660) ctrlSetText "";
};

View File

@ -1,20 +0,0 @@
/*
Name: AGM_Goggles_fnc_RemoveDustEffect
Author: Garth de Wet (LH)
Description:
Removes dust from the glasses.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_RemoveDustEffect;
*/
if (!isNull(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull])) then {
(uiNamespace getVariable ["AGM_Goggles_DisplayEffects", displayNull] displayCtrl 10662) ctrlSetText "";
};

View File

@ -1,29 +0,0 @@
/*
Name: AGM_Goggles_fnc_RemoveGlassesEffect
Author: Garth de Wet (LH)
Description:
Removes the glasses effect from the screen, removes dirt effect, removes rain effect,
removes dust effect. Does not reset array (glasses will still be broken, dirty, ect.)
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_RemoveGlassesEffect;
*/
#include "\AGM_Goggles\script.sqf"
AGM_Goggles_EffectsActive = false;
AGM_Goggles_PostProcess ppEffectEnable false;
if (!isNull(GLASSDISPLAY)) then {
GLASSDISPLAY closeDisplay 0;
};
call AGM_Goggles_fnc_RemoveDirtEffect;
call AGM_Goggles_fnc_RemoveRainEffect;
call AGM_Goggles_fnc_RemoveDustEffect;

View File

@ -1,21 +0,0 @@
/*
Name: AGM_Goggles_fnc_RemoveRainEffect
Author: Garth de Wet (LH)
Description:
Removes rain effects from the screen. Resets the rain array.
Parameters:
Nothing
Returns:
Nothing
Example:
call AGM_Goggles_fnc_RemoveRainEffect;
*/
if (!isNull (AGM_Goggles_RainDrops)) then {
deleteVehicle (AGM_Goggles_RainDrops);
};
AGM_Goggles_Rain_Active = false;

View File

@ -1,21 +0,0 @@
#define GLASSESDEFAULT [false,[false,0,0,0],false]
#define DIRT 0
#define DUST 1
#define BROKEN 2
#define GETDIRT (AGM_Goggles_Effects select DIRT)
#define GETDUST (AGM_Goggles_Effects select DUST)
#define GETBROKEN (AGM_Goggles_Effects select BROKEN)
#define GETDUSTT(type) ((AGM_Goggles_Effects select DUST) select type)
#define SETDUST(type,value) (AGM_Goggles_Effects select DUST) set [type, value]
#define DACTIVE 0
#define DTIME 1
#define DBULLETS 2
#define DAMOUNT 3
#define GLASSDISPLAY (uiNamespace getVariable ["AGM_Goggles_Display", displayNull])
#define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}})

View File

@ -1,136 +0,0 @@
class RscDisplayInsertMarker {
onLoad = "_this call compile preprocessFileLineNumbers 'AGM_Markers\scripts\initInsertMarker.sqf'";
onUnload = "_this call compile preprocessFileLineNumbers 'AGM_Markers\scripts\placeMarker.sqf'";
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 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 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 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)";
};
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 SizeX: RscEdit {
idc = 1200;
text = "10";
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 = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class SizeY: RscEdit {
idc = 1201;
text = "10";
x = "19 * ( ((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 = "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)";
};
};
};

View File

@ -1,7 +0,0 @@
// by commy2
// request marker data for JIP
if (isMultiplayer && {!isServer}) then {
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
[_logic, "AGM_Markers_fnc_sendMarkersJIP", 1] call AGM_Core_fnc_execRemoteFnc;
};

View File

@ -1,47 +0,0 @@
class CfgPatches {
class AGM_Markers {
units[] = {};
weapons[] = {};
requiredVersion = 0.60;
requiredAddons[] = {AGM_Core};
version = "0.95";
versionStr = "0.95";
versionAr[] = {0,95,0};
author[] = {"commy2"};
authorUrl = "https://github.com/commy2/";
};
};
class CfgFunctions {
class AGM_Markers {
class AGM_Markers {
file = "AGM_Markers\functions";
class onLBSelChangedColor;
class onLBSelChangedShape;
class onSliderPosChangedAngle;
class sendMarkersJIP;
class setMarker;
class setMarkerJIP;
class setMarkerNetwork;
};
};
};
class Extended_PostInit_EventHandlers {
class AGM_Markers {
clientInit = "call compile preprocessFileLineNumbers 'AGM_Markers\clientInit.sqf'";
};
};
class RscPicture;
class RscText;
class RscStructuredText;
class RscButtonMenuOK;
class RscButtonMenuCancel;
class RscButtonMenu;
class RscEdit;
class RscCombo;
class RscSlider;
class RscXSliderH;
#include <InsertMarker.hpp>

View File

@ -1,15 +0,0 @@
// by commy2
private "_logic";
_logic = _this;
[
[
missionNamespace getVariable ["AGM_allMapMarkers", []],
missionNamespace getVariable ["AGM_allMapMarkersProperties", []],
_logic
],
"AGM_Markers_fnc_setMarkerJIP",
_logic
] call AGM_Core_fnc_execRemoteFnc;

View File

@ -1,15 +0,0 @@
// by commy2
private ["_marker", "_data", "_config"];
_marker = _this select 0;
_data = _this select 1;
_config = (configfile >> "CfgMarkers") select (_data select 0);
[[_marker, configName _config], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerTypeLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
[[_marker, configName _config], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerColorLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
[[_marker, _data select 2], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerPosLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
[[_marker, _data select 3], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerDirLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;

View File

@ -1,26 +0,0 @@
// by commy2
private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"];
_allMapMarkers = _this select 0;
_allMapMarkersProperties = _this select 1;
_logic = _this select 2;
{
_index = _allMapMarkers find _x;
if (_index != -1) then {
_data = _allMapMarkersProperties select _index;
_config = (configfile >> "CfgMarkers") select (_data select 0);
_x setMarkerTypeLocal configName _config;
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
_x setMarkerColorLocal configName _config;
_x setMarkerPosLocal (_data select 2);
_x setMarkerDirLocal (_data select 3);
};
} forEach allMapMarkers;
deleteVehicle _logic;

View File

@ -1,36 +0,0 @@
// by commy2
private ["_marker", "_data", "_config"];
_marker = _this select 0;
_data = _this select 1;
_config = (configfile >> "CfgMarkers") select (_data select 0);
_marker setMarkerTypeLocal configName _config;
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
_marker setMarkerColorLocal configName _config;
_marker setMarkerPosLocal (_data select 2);
_marker setMarkerDirLocal (_data select 3);
// save properties on server machine for JIP, marker editing ready
if (isMultiplayer && {isServer}) then {
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
_allMapMarkers = missionNamespace getVariable ["AGM_allMapMarkers", []];
_allMapMarkersProperties = missionNamespace getVariable ["AGM_allMapMarkersProperties", []];
_index = _allMapMarkers find _marker;
if (_index == -1) then {
_allMapMarkers pushBack _marker;
_allMapMarkersProperties pushBack _data;
} else {
_allMapMarkers set [_index, _marker];
_allMapMarkersProperties set [_index, _data];
};
AGM_allMapMarkers = _allMapMarkers;
AGM_allMapMarkersProperties = _allMapMarkersProperties;
};

View File

@ -1,51 +0,0 @@
// by commy2
if (_this select 1 == 1) then {
disableserialization;
_display = _this select 0;
_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;
};
};
_pos spawn {
/*[
allMapMarkers select (count allMapMarkers - 1),
[
uiNamespace getVariable ['AGM_Markers_currentMarkerShape', 0],
uiNamespace getVariable ['AGM_Markers_currentMarkerColor', 0],
_this,
uiNamespace getVariable ['AGM_Markers_currentMarkerAngle', 0]
]
] call AGM_Markers_fnc_setMarker;*/
[
[
allMapMarkers select (count allMapMarkers - 1),
[
uiNamespace getVariable ['AGM_Markers_currentMarkerShape', 0],
uiNamespace getVariable ['AGM_Markers_currentMarkerColor', 0],
_this,
uiNamespace getVariable ['AGM_Markers_currentMarkerAngle', 0]
]
], "AGM_Markers_fnc_setMarkerNetwork", 2
] call AGM_Core_fnc_execRemoteFnc;
};
};

View File

@ -1,31 +0,0 @@
class CfgFunctions {
class CSE {
class Configuration {
file = "cse\cse_f_configuration\functions";
class addKeyBindingForMenu_f { recompile = 1; };
class addKeyBindingForAction_f { recompile = 1; };
class onKeyPressed_f { recompile = 1; };
class onKeyReleased_f { recompile = 1; };
class getKeyBindingFromProfile_f { recompile = 1; };
class saveKeyBindingToProfile_f { recompile = 1; };
class updateActionKeyBinding_f { recompile = 1; };
class updateMenuKeyBinding_f { recompile = 1; };
class updateAllKeyBindings_f { recompile = 1; };
class settingsMenuUpdateKeyBinding_f { recompile = 1; };
class onSettingsMenuOpen { recompile = 1; };
class settingsMenuUpdateList { recompile = 1; };
class onListBoxShowSelectionChanged { recompile = 1; };
class settingsMenuUpdateKeyView { recompile = 1; };
class settingsDefineDetails_f { recompile = 1; };
class getSettingDetails_f { recompile = 1; };
class onListBoxKeyBindingChanged { recompile = 1; };
class onListBoxSettingsChanged { recompile = 1; };
class getClientSideOptionFromProfile_f { recompile = 1; };
class addClientSideOptions_f { recompile = 1; };
class saveClientSideOptionToProfile_f { recompile = 1; };
class updateClientSideOption_f { recompile = 1; };
class parseConfigForConfigurations { recompile = 1; };
class parseModuleForConfigurations { recompile = 1; };
};
};
};

View File

@ -1,51 +0,0 @@
class CfgHints
{
class Combat_Space_Enhancement
{
displayName = "Combat Space Enhancement";
class Cse_configure {
displayName = "Configuration";
displayNameShort = "Configuration";
description = "You can configure CSE keybindings and settings through the configuration menu.";
tip = "Keybindings and settings are stored in your profile.";
arguments[] = {};
image = "";
noImage = true;
};
class menuKeyBindings_subHint
{
displayName = "Menu Keybindings";
displayNameShort = "Menu Keybindings";
description = "Menu %11 will when their key is pressed open a menu.";
tip = "You can hold down the key for a longer period and when released, the menu will close.";
arguments[] = {
{"Keybindings"}
};
image = "";
noImage = true;
};
class actionKeyBindings_subHint
{
displayName = "Action Keybindings";
displayNameShort = "Action Keybindings";
description = "Action %11 are used for specific actions performed by the player character.";
tip = "Use Ctrl, Alt or Shift combinations to increase the amount of actions you can bind.";
arguments[] = {
{"Keybindings"}
};
image = "";
noImage = true;
};
class clientSettings
{
displayName = "Client Settings";
displayNameShort = "Client Settings";
description = "Client settings do not affect MP gameplay but allows players to customize their gameplay to their likings.";
tip = "If you are having low frames, try turning off some client settings..";
arguments[] = {};
image = "";
noImage = true;
};
};
};

View File

@ -1,9 +0,0 @@
class Combat_Space_Enhancement {
class EventHandlers {
class PostInit_EventHandlers {
class cse_f_configuration_handleKeys {
init = " call compile preprocessFile 'cse\cse_f_configuration\displayEventHandler_keys.sqf';"; // [configFile] call cse_fnc_parseConfigForConfigurations;
};
};
};
};

View File

@ -1,3 +0,0 @@
#include "gui\define.h"
#include "gui\settingsMenu.h"
#include "gui\pauseMenu.h"

View File

@ -1,26 +0,0 @@
#define _ARMA_
class CfgPatches
{
class cse_f_configuration
{
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"a3_ui_f", "cse_gui"};
version = "0.10.0_rc";
author[] = {"Combat Space Enhancement"};
authorUrl = "http://csemod.com";
};
};
class CfgAddons {
class PreloadAddons {
class cse_f_configuration {
list[] = {"cse_f_configuration"};
};
};
};
#include "CfgFunctions.h"
#include "CfgHints.h"
#include "Combat_Space_Enhancement.h"
#include "GUI.h"

View File

@ -1,23 +0,0 @@
if (isnil "CSE_F_KEYBINDINGS_MENUS") then {
CSE_F_KEYBINDINGS_MENUS = [];
};
if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then {
CSE_F_KEYBINDINGS_ACTIONS = [];
};
if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then {
CSE_F_CLIENT_SIDE_SETTINGS = [];
};
CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false;
CSE_DISPLAY_MENU = false;
CSE_KEY_RELEASED = false;
CSE_DISABLE_KEY_INPUT_F = false;
CSE_KEY_COMBINATION_PRESSED = [0,0,0,0];
if (hasInterface) then {
[] spawn {
waitUntil {!isNull player && (player == player) && !(isNull (findDisplay 46))};
sleep 3;
cse_displayEventHandler_config_keyPressed_f = findDisplay 46 displayAddEventHandler ["keyDown", cse_fnc_onKeyPressed_f ];
cse_displayEventHandler_config_keyReleaded_f = findDisplay 46 displayAddEventHandler ["keyUp", cse_fnc_onKeyReleased_f];
};
};

View File

@ -1,25 +0,0 @@
/**
* fn_addClientSideOptions_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name", "_possibleValues", "_defaultValue"];
_name = _this select 0;
_possibleValues = _this select 1;
_defaultValue = _this select 2;
_onChange = _this select 3;
if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then {
CSE_F_CLIENT_SIDE_SETTINGS = [];
};
// missionNamespace setvariable[_name, _defaultValue];
CSE_F_CLIENT_SIDE_SETTINGS pushBack [ _name, _possibleValues, _defaultValue, _onChange];
[_name, _defaultValue] call _onChange;

View File

@ -1,25 +0,0 @@
/**
* fn_addKeyBindingForAction_f.sqf
* @Descr: Add a new action keybinding
* @Author: Glowbal
*
* @Arguments: [name STRING, keybinding ARRAY, action CODE]
* @Return: void
* @PublicAPI: true
*/
private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"];
_name = _this select 0;
_keyBinding = _this select 1;
_action = _this select 2;
_keyCodePressed = _keyBinding select 0;
_shiftPressed = _keyBinding select 1;
_ctrlPressed = _keyBinding select 2;
_altPressed = _keyBinding select 3;
if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then {
CSE_F_KEYBINDINGS_ACTIONS = [];
};
CSE_F_KEYBINDINGS_ACTIONS pushBack [ _name, _keyBinding, _action ];
[_name, "action"] call cse_fnc_saveKeyBindingToProfile_f;

View File

@ -1,26 +0,0 @@
/**
* fn_addKeyBindingForMenu_f.sqf
* @Descr: Add a new menu keybinding
* @Author: Glowbal
*
* @Arguments: [name STRING, keybinding ARRAY, action CODE]
* @Return: void
* @PublicAPI: true
*/
private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"];
_name = _this select 0;
_keyBinding = _this select 1;
_action = _this select 2;
_idd = _this select 3;
_keyCodePressed = _keyBinding select 0;
_shiftPressed = _keyBinding select 1;
_ctrlPressed = _keyBinding select 2;
_altPressed = _keyBinding select 3;
if (isnil "CSE_F_KEYBINDINGS_MENUS") then {
CSE_F_KEYBINDINGS_MENUS = [];
};
CSE_F_KEYBINDINGS_MENUS pushBack [_name, _keyBinding, _action, _idd, [false, false] ];
[_name, "menu"] call cse_fnc_saveKeyBindingToProfile_f;

View File

@ -1,17 +0,0 @@
/**
* fn_getClientSideOptionFromProfile_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name","_default","_settingValue"];
_name = _this select 0;
_default = _this select 1;
_settingValue = profileNamespace getvariable ["cse_f_clientSideSetting_"+_name, _default];
_settingValue

View File

@ -1,18 +0,0 @@
/**
* fn_getKeyBindingFromProfile_f.sqf
* @Descr: Grab a keybinding settings saved in the profile.
* @Author: Glowbal
*
* @Arguments: [name STRING, type STRING (Can be: Action or Menu), defaultValue ARRAY (Format: [keyCode, shift, ctrl], alt)]
* @Return: ARRAY Format: [keyCode, shift, ctrl, alt]
* @PublicAPI: true
*/
private ["_name","_default","_keyBinding"];
_name = _this select 0;
_type = _this select 1;
_default = _this select 2;
_keyBinding = profileNamespace getvariable ["cse_f_keybinding_"+_type+"_"+_name, _default];
_keyBinding

View File

@ -1,44 +0,0 @@
/**
* fn_getSettingDetails_f.sqf
* @Descr: Returns the details of current setting
* @Author: Glowbal
*
* @Arguments: [name STRING, type STRING]
* @Return: ARRAY Array with the current settings
* @PublicAPI: false
*/
private ["_name","_type", "_title","_desc", "_return"];
_name = _this select 0;
_type = _this select 1;
_return = [_name,""];
if (isnil "CSE_SETTINGS_MENUS_DETAILS_F") then {
CSE_SETTINGS_MENUS_DETAILS_F = [];
CSE_SETTINGS_ACTIONS_DETAILS_F = [];
CSE_SETTINGS_CLIENTSIDE_DETAILS_F = [];
};
if (_type == "menu") then {
{
if (_name == (_x select 0)) exitwith {
_return = [_x select 1, _x select 2];
};
}foreach CSE_SETTINGS_MENUS_DETAILS_F;
} else {
if (_type == "action") then {
{
if (_name == (_x select 0)) exitwith {
_return = [_x select 1, _x select 2];
};
}foreach CSE_SETTINGS_ACTIONS_DETAILS_F;
} else {
{
if (_name == (_x select 0)) exitwith {
_return = [_x select 1, _x select 2, _x select 3];
};
}foreach CSE_SETTINGS_CLIENTSIDE_DETAILS_F;
};
};
_return

View File

@ -1,105 +0,0 @@
/**
* fn_onKeyPressed_f.sqf
* @Descr: Executed on a key pressed. Handles all CSE keybindings
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
// Returns the control, the keyboard code and the state of Shift, Ctrl and Alt.
private ["_control","_var","_keyBinding","_keyCodePressed","_shiftPressed","_ctrlPressed","_altPressed","_name","_onPressed","_idd", "_state","_STARTINGTIME","_handle", "_returnOnPressed"];
_control = _this select 0;
_keyCodePressed = _this select 1;
_shiftPressed = _this select 2;
_ctrlPressed = _this select 3;
_altPressed = _this select 4;
if (missionNamespace getVariable ['CSE_SETTINGS_MENU_OPEN', false]) exitwith {
false;
};
_returnOnPressed = false;
if ((findDisplay 46) == _control && _keyCodePressed != 0) then {
if ([player] call cse_fnc_canInteract) then {
{
_name = _x select 0;
_keyBinding = _x select 1;
_onPressed = _x select 2;
_idd = _x select 3;
_state = _x select 4;
_shiftBinding = _keyBinding select 1;
_ctrlBinding = _keyBinding select 2;
_altBinding = _keyBinding select 3;
if ((_keyBinding select 0) == _keyCodePressed) then {
if ((_shiftBinding == 0) && _shiftPressed) exitwith {};
if ((_shiftBinding == 1) && !_shiftPressed) exitwith {};
if ((_ctrlBinding == 0) && _ctrlPressed) exitwith {};
if ((_ctrlBinding == 1) && !_ctrlPressed) exitwith {};
if ((_altBinding == 0) && _altPressed) exitwith {};
if ((_altBinding == 1) && !_altPressed) exitwith {};
if (CSE_DISPLAY_MENU && !CSE_KEY_RELEASED) exitwith {};
if (CSE_DISPLAY_MENU && CSE_KEY_RELEASED) exitwith { closeDialog _idd;};
if (dialog) exitwith { closeDialog 0; };
_state set [ 0, true]; // activated/open , not released
_state set [ 1, false];
CSE_KEY_COMBINATION_PRESSED = _keyBinding;
CSE_DISPLAY_MENU = true;
CSE_KEY_RELEASED = false;
_handle = [_forEachIndex, time] spawn {
_menu = CSE_F_KEYBINDINGS_MENUS select (_this select 0);
_state = _menu select 4;
waituntil{CSE_KEY_RELEASED || (time - ((_this select 1) ) > (0.25 * accTime))};
if (!CSE_KEY_RELEASED) then {
waituntil {CSE_KEY_RELEASED};
closeDialog (_menu select 3);
} else {
CSE_KEY_RELEASED = true;
};
waituntil {!dialog};
_state set [ 0, false];
CSE_DISPLAY_MENU = false;
};
_returnOnPressed = _this call _onPressed;
};
}foreach CSE_F_KEYBINDINGS_MENUS;
if (isNil "_returnOnPressed") then {
{
_name = _x select 0;
_keyBinding = _x select 1;
_onPressed = _x select 2;
_shiftBinding = _keyBinding select 1;
_ctrlBinding = _keyBinding select 2;
_altBinding = _keyBinding select 3;
if ((_keyBinding select 0) == _keyCodePressed) then {
if ((_shiftBinding == 0) && _shiftPressed) exitwith {};
if ((_shiftBinding == 1) && !_shiftPressed) exitwith {};
if ((_ctrlBinding == 0) && _ctrlPressed) exitwith {};
if ((_ctrlBinding == 1) && !_ctrlPressed) exitwith {};
if ((_altBinding == 0) && _altPressed) exitwith {};
if ((_altBinding == 1) && !_altPressed) exitwith {};
CSE_KEY_COMBINATION_PRESSED = _keyBinding;
_returnOnPressed = _this call _onPressed;
};
}foreach CSE_F_KEYBINDINGS_ACTIONS;
};
};
};
if (isnil "_returnOnPressed") exitwith {false};
//_returnOnPressed
false;

View File

@ -1,33 +0,0 @@
/**
* fn_onKeyReleased_f.sqf
* @Descr: Handles all keyreleased from CSE
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
// _this = the control, the keyboard code and the state of Shift, Ctrl and Alt.
if (CSE_DISABLE_KEY_INPUT_F) exitwith {
(( _this select 1) > 0);
};
if ((findDisplay 46) == (_this select 0)) then {
_keyCodePressed = _this select 1;
{
_keyBinding = _x select 1;
_state = _x select 4;
if ((_keyBinding select 0) == _keyCodePressed) then {
if (!(_state select 0) ) exitwith {};
_state set [ 0, false];
CSE_KEY_RELEASED = true;
};
}foreach CSE_F_KEYBINDINGS_MENUS;
} else {
false;
};
false;

View File

@ -1,54 +0,0 @@
/**
* fn_onListBoxKeyBindingChanged.sqf
* @Descr: called when the listbox keybinding has changed. Updates the configuration menu with new information.
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_settingsMenu","_ctrlSelected","_ctrlPressed","_ctrlTextLabel","_keyCodePressed","_shiftSelected","_shiftPressed","_altSelected","_altPressed","_possibleOptions",'_keyBinding',"_fnc","_collection"];
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_shiftSelected = lbCurSel 400;
_ctrlSelected = lbCurSel 401;
_altSelected = lbCurSel 402;
_possibleOptions = [0,1,2];
if (_shiftSelected < 0) then {
_shiftSelected = 0;
};
if (_ctrlSelected < 0) then {
_ctrlSelected = 0;
};
if (_altSelected < 0) then {
_altSelected = 0;
};
_func = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "menu": {cse_fnc_updateMenuKeyBinding_F};
case "action": {cse_fnc_updateActionKeyBinding_F};
default {{}};
};
_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "menu": {CSE_F_KEYBINDINGS_MENUS};
case "action": {CSE_F_KEYBINDINGS_ACTIONS};
default {[]};
};
if (count _collection > 0) then {
_selectedSetting = (lbCurSel (_settingsMenu displayCtrl 200));
if (_selectedSetting > (count _collection)) then {
_selectedSetting = count _collection - 1;
};
if (_selectedSetting < 0) then {
_selectedSetting = 0;
};
_nameOfSetting = (_collection select _selectedSetting) select 0;
_keyBinding = [_nameOfSetting,CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F,[0,0,0,0]] call cse_fnc_getKeyBindingFromProfile_F;
_keyBinding = [_keyBinding select 0, _possibleOptions select _shiftSelected, _possibleOptions select _ctrlSelected, _possibleOptions select _altSelected];
[_nameOfSetting,_keyBinding] call _func;
[false] call cse_fnc_settingsMenuUpdateList;
};

View File

@ -1,40 +0,0 @@
/**
* fn_onListBoxSettingsChanged.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_settingsMenu", "_ctrlTextLabel", "_optionSelected", "_func", "_collection", "_selectedSetting", "_nameOfSetting"];
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_optionSelected = lbCurSel 400;
if (_optionSelected < 0) then {
_optionSelected = 0;
};
_func = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "option": {cse_fnc_updateClientSideOption_F};
default {{}};
};
_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "option": {CSE_F_CLIENT_SIDE_SETTINGS};
default {[]};
};
if !(_collection isEqualTo []) then {
_selectedSetting = (lbCurSel (_settingsMenu displayCtrl 200));
if (_selectedSetting > (count _collection)) then {
_selectedSetting = count _collection - 1;
};
if (_selectedSetting < 0) then {
_selectedSetting = 0;
};
_nameOfSetting = (_collection select _selectedSetting) select 0;
[_nameOfSetting, _optionSelected] call _func;
[_nameOfSetting, _optionSelected] call ((_collection select _selectedSetting) select 3);
[false] call cse_fnc_settingsMenuUpdateList;
};

View File

@ -1,55 +0,0 @@
/**
* fn_onListBoxShowSelectionChanged.sqf
* @Descr: called when the listbox selection has changed. Updates configuration menu information
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_first", "_settingsMenu", "_ctrlLb", "_ctrlLbShow"];
_first = (_this select 0);
disableSerialization;
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_ctrlLbShow = _settingsMenu displayCtrl 100;
if (isnil "_first") then {
_ctrlLbShow lbSetCurSel (_this select 1);
};
if ((_this select 1) > -1) then {
private ["_options"];
_options = ["menu","action", "option", "color"];
CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F = _options select (_this select 1);
[true] call cse_fnc_settingsMenuUpdateList;
_textOptions = ["Menu Keybindings", "Action Keybindings", "Client Settings"];
ctrlSetText [13, ("Current selected settings list: " + (_textOptions select (_this select 1)))];
if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F == "color") exitwith {};
if ((_this select 1) > 1) then {
(_settingsMenu displayCtrl 400) ctrlShow true;
lbClear 400;
(_settingsMenu displayCtrl 401) ctrlShow false;
(_settingsMenu displayCtrl 402) ctrlShow false;
(_settingsMenu displayCtrl 301) ctrlSetText "Value:";
(_settingsMenu displayCtrl 302) ctrlSetText "";
(_settingsMenu displayCtrl 303) ctrlSetText "";
} else {
(_settingsMenu displayCtrl 400) ctrlShow true;
LbClear 400;
_ctrlLb = _settingsMenu displayCtrl 400;
_ctrlLb lbadd "No";
_ctrlLb lbadd "Yes";
_ctrlLb lbadd "Ignore";
(_settingsMenu displayCtrl 401) ctrlShow true;
(_settingsMenu displayCtrl 402) ctrlShow true;
(_settingsMenu displayCtrl 301) ctrlSetText "Shift:";
(_settingsMenu displayCtrl 302) ctrlSetText "Ctrl:";
(_settingsMenu displayCtrl 303) ctrlSetText "Alt:";
};
};

View File

@ -1,104 +0,0 @@
/**
* fn_onSettingsMenuOpen.sqf
* @Descr: called when the settings or configuration menu has opened. Do not use anywhere else.
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_ctrlLbShow = _settingsMenu displayCtrl 100;
_ctrlLbShow lbadd "Menu Keybindings";
_ctrlLbShow lbadd "Action Keybindings";
_ctrlLbShow lbadd "Client Settings";
_ctrlLbShow lbadd "Colors";
_ctrlLbShow lbSetCurSel 0;
(_settingsMenu displayCtrl 1003) ctrlEnable false;
//lbadd[100,"Other settings"];
CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false;
_settingsMenu displayAddEventHandler ["KeyDown", {
_keyCodePressed = _this select 1;
_shiftPressed = _this select 2;
_ctrlPressed = _this select 3;
_altPressed = _this select 4;
_var = uiNamespace getVariable 'cse_settingsMenu';
if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then {
if !(isnil "_var") then {
if (CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F) then {
if (_keyCodePressed > 1) then {
[_keyCodePressed,_shiftPressed, _ctrlPressed, _altPressed] call cse_fnc_settingsMenuUpdateKeyBinding_F;
true;
} else {
false;
};
} else {
false;
};
} else {
false;
};
} else {
false;
};
}];
_settingsMenu displayAddEventHandler ["KeyUp", {
_keyCodePressed = _this select 1;
_shiftPressed = _this select 2;
_ctrlPressed = _this select 3;
_altPressed = _this select 4;
_var = uiNamespace getVariable 'cse_settingsMenu';
if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then {
if !(isnil "_var") then {
if (CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F) then {
if (_keyCodePressed > 1) then {
CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false;
true;
} else {
false;
};
} else {
false;
};
} else {
false;
};
} else {
false;
};
}];
(_settingsMenu displayCtrl 200) ctrlSetEventHandler ["LBSelChanged", "_this call cse_fnc_settingsMenuUpdateKeyView;"];
_textOptions = ["Menu Keybindings", "Action Keybindings"];
(_settingsMenu displayCtrl 13) ctrlSetText ("Current selected settings list: " + (_textOptions select 0));
_ctrlLb = _settingsMenu displayCtrl 400;
_ctrlLb lbadd "No";
_ctrlLb lbadd "Yes";
_ctrlLb lbadd "Ignore";
_ctrlLb ctrlSetEventHandler ["LBSelChanged", "if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != 'option') then { _this call cse_fnc_onListBoxKeyBindingChanged; } else { _this call cse_fnc_onListBoxSettingsChanged; };"];
_ctrlLb = _settingsMenu displayCtrl 401;
_ctrlLb lbadd "No";
_ctrlLb lbadd "Yes";
_ctrlLb lbadd "Ignore";
_ctrlLb ctrlSetEventHandler ["LBSelChanged", " _this call cse_fnc_onListBoxKeyBindingChanged;"];
_ctrlLb = _settingsMenu displayCtrl 402;
_ctrlLb lbadd "No";
_ctrlLb lbadd "Yes";
_ctrlLb lbadd "Ignore";
_ctrlLb ctrlSetEventHandler ["LBSelChanged", " _this call cse_fnc_onListBoxKeyBindingChanged;"];
CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false;
CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F = "menu";
[true] call cse_fnc_settingsMenuUpdateList;
(_settingsMenu displayCtrl 200) lbSetCurSel 0;

View File

@ -1,22 +0,0 @@
/**
* fn_parseConfigForConfigurations.sqf
* @Descr: Collect all configurations defined in CfgModules
* @Author: Glowbal
*
* @Arguments: [config CONFIG]
* @Return: nil
* @PublicAPI: false
*/
#define MENU_KEYBINDING 1
#define ACTION_KEYBINDING 2
#define CLIENT_SETTING 3
private ["_config","_cfgRoot","_amountOfClasses","_i","_moduleName","_configurationClass","_nOfConfgClasses","_j","_configuration","_configurationName","_title","_desc","_defaultValue","_code","_idd","_availableSettings","_valuesCfg","_nOfValues","_k"];
_config = _this select 0;
_cfgRoot = (_config >> "Combat_Space_Enhancement" >> "CfgModules");
_amountOfClasses = count _cfgRoot;
for [{_i=0}, {_i < _amountOfClasses}, {_i=_i+1}] do {
[ConfigName (_cfgRoot select _i)] call cse_fnc_parseModuleForConfigurations;
};

View File

@ -1,63 +0,0 @@
/**
* fn_parseModuleForConfigurations.sqf
* @Descr: Collects all configurations defined in the CfgModules entry
* @Author: Glowbal
*
* @Arguments: [cfgModulesName STRING (Name of the module defined in CfgModules)]
* @Return: nil
* @PublicAPI: false
*/
#define MENU_KEYBINDING 1
#define ACTION_KEYBINDING 2
#define CLIENT_SETTING 3
private ["_config","_cfgRoot","_amountOfClasses","_i","_moduleName","_configurationClass","_nOfConfgClasses","_j","_configuration","_configurationName","_title","_desc","_defaultValue","_code","_idd","_availableSettings","_valuesCfg","_nOfValues","_k"];
_moduleName = _this select 0;
_cfgRoot = (configFile >> "Combat_Space_Enhancement" >> "CfgModules" >> _moduleName);
if (isClass (_cfgRoot >> "Configurations")) then {
_configurationClass = (_cfgRoot >> "Configurations");
_nOfConfgClasses = count _configurationClass;
for [{_j=0}, {_j < _nOfConfgClasses}, {_j=_j+1}] do {
_configuration = _configurationClass select _j;
_configurationName = ConfigName _configuration;
_title = [_configuration, "title", ""] call BIS_fnc_returnConfigEntry;
_desc = [_configuration, "description", ""] call BIS_fnc_returnConfigEntry;
switch (getNumber(_configuration >> "type")) do {
case MENU_KEYBINDING: {
_defaultValue = [_configuration, "value", [0,0,0,0]] call BIS_fnc_returnConfigEntry;
_code = compile (format["disableSerialization; if (['%1'] call cse_fnc_isModuleEnabled_F) then {", _moduleName] + ([_configuration, "onPressed", ""] call BIS_fnc_returnConfigEntry) + "};");
_idd = [_configuration, "idd", 0] call BIS_fnc_returnConfigEntry;
[format["name: %1, default %2, code %3, idd %4, title %5, desc %6",_configurationName, _defaultValue, _code, _idd, _title, _desc]] call cse_fnc_debug;
[_configurationName, ([_configurationName,"menu",_defaultValue] call cse_fnc_getKeyBindingFromProfile_F), _code, _idd] call cse_fnc_addKeyBindingForMenu_F;
[_configurationName,"menu", _title, _desc] call cse_fnc_settingsDefineDetails_F;
};
case ACTION_KEYBINDING: {
_defaultValue = [_configuration, "value", [0,0,0,0]] call BIS_fnc_returnConfigEntry;
_code = compile (format["disableSerialization; if (['%1'] call cse_fnc_isModuleEnabled_F) then {", _moduleName] + ([_configuration, "onPressed", ""] call BIS_fnc_returnConfigEntry) + "};");
[format["name: %1, default %2, code %3, title %4, desc %5",_configurationName, _defaultValue, _code, _title, _desc]] call cse_fnc_debug;
[_configurationName, ([_configurationName,"action",_defaultValue] call cse_fnc_getKeyBindingFromProfile_F), _code] call cse_fnc_addKeyBindingForAction_F;
[_configurationName,"action", _title, _desc] call cse_fnc_settingsDefineDetails_F;
};
case CLIENT_SETTING: {
_defaultValue = [_configuration, "value", 0] call BIS_fnc_returnConfigEntry;
_code = compile (format["disableSerialization; if (['%1'] call cse_fnc_isModuleEnabled_F) then {", _moduleName] + ([_configuration, "onChanged", ""] call BIS_fnc_returnConfigEntry) + "};");
_availableSettings = [];
_valuesCfg = (_configuration >> "Values");
if (isClass _valuesCfg) then {
_nOfValues = count _valuesCfg;
for [{_k=0}, {_k < _amountOfClasses}, {_k=_k+1}] do {
if (isClass (_valuesCfg select _k)) then {
_availableSettings pushback (configName (_valuesCfg select _k));
};
};
};
};
default {}; // invalid, do nothing
};
};
};

View File

@ -1,25 +0,0 @@
/**
* fn_saveClientSideOptionToProfile_f.sqf
* @Descr: Save the clientside option to the profile.
* @Author: Glowbal
*
* @Arguments: [name STRING (Name of setting)]
* @Return: BOOL True if saved.
* @PublicAPI: false
*/
private ["_name","_nameSelected", "_saved"];
_name = _this select 0;
if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then {
CSE_F_CLIENT_SIDE_SETTINGS = [];
};
_saved = false;
{
_nameSelected = _x select 0;
if (_nameSelected == _name) exitwith {
profileNamespace setvariable ["cse_f_clientSideSetting_"+_name, _x select 2];
_saved = true;
};
}foreach CSE_F_CLIENT_SIDE_SETTINGS;
_saved

View File

@ -1,41 +0,0 @@
/**
* fn_saveKeyBindingToProfile_f.sqf
* @Descr: Saves a keybinding to the profile
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name","_nameSelected", "_saved", "_type"];
_name = _this select 0;
_type = _this select 1;
if (isnil "CSE_F_KEYBINDINGS_MENUS") then {
CSE_F_KEYBINDINGS_MENUS = [];
};
if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then {
CSE_F_KEYBINDINGS_ACTIONS = [];
};
_saved = false;
if (_type == "menu") then {
{
_nameSelected = _x select 0;
if (_nameSelected == _name) exitwith {
profileNamespace setvariable ["cse_f_keybinding_menu_"+_name, _x select 1];
_saved = true;
};
}foreach CSE_F_KEYBINDINGS_MENUS;
} else {
if (_type == "action") then {
{
_nameSelected = _x select 0;
if (_nameSelected == _name) exitwith {
profileNamespace setvariable ["cse_f_keybinding_action_"+_name, _x select 1];
_saved = true;
};
}foreach CSE_F_KEYBINDINGS_ACTIONS;
};
};
_saved

View File

@ -1,33 +0,0 @@
/**
* fn_settingsDefineDetails_f.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name","_type", "_title","_descr"];
_name = _this select 0;
_type = _this select 1;
_title = _this select 2;
_descr = _this select 3;
if (isnil "CSE_SETTINGS_MENUS_DETAILS_F") then {
CSE_SETTINGS_MENUS_DETAILS_F = [];
CSE_SETTINGS_ACTIONS_DETAILS_F = [];
CSE_SETTINGS_CLIENTSIDE_DETAILS_F = [];
};
if (_type == "menu") then {
CSE_SETTINGS_MENUS_DETAILS_F pushback [_name, _title, _descr];
} else {
if (_type == "action") then {
CSE_SETTINGS_ACTIONS_DETAILS_F pushback [_name, _title, _descr];
} else {
if (_type == "option") then {
CSE_SETTINGS_CLIENTSIDE_DETAILS_F pushback [_name, _title, _descr];
};
};
};

View File

@ -1,65 +0,0 @@
/**
* fn_settingsMenuUpdateKeyBinding_f.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_settingsMenu","_ctrlSelected","_ctrlPressed","_ctrlTextLabel","_keyCodePressed","_shiftSelected","_shiftPressed","_altSelected","_altPressed","_possibleOptions",'_keyBinding',"_fnc","_collection"];
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_ctrlTextLabel = (_settingsMenu displayCtrl 300);
_keyCodePressed = _this select 0;
_shiftPressed = _this select 1;
_ctrlPressed = _this select 2;
_altPressed = _this select 3;
ctrlSetText [252, ''];
//(_settingsMenu displayCtrl 300) ctrlSetText ("Key: " + (keyName _keyCodePressed));
_shiftSelected = lbCurSel 400;
_ctrlSelected = lbCurSel 401;
_altSelected = lbCurSel 402;
_possibleOptions = [0,1,2];
if (_shiftSelected < 0) then {
_shiftSelected = 0;
};
if (_ctrlSelected < 0) then {
_ctrlSelected = 0;
};
if (_altSelected < 0) then {
_altSelected = 0;
};
_keyBinding = [_keyCodePressed, _possibleOptions select _shiftSelected, _possibleOptions select _ctrlSelected, _possibleOptions select _altSelected];
//CSE_CURRENT_KEYBINDING_SETTING_NAME_F = ["cse_sys_weaponRestAction","action"];
_func = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "menu": {cse_fnc_updateMenuKeyBinding_F};
case "action": {cse_fnc_updateActionKeyBinding_F};
case "option": {{}};
default {{}};
};
_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "menu": {CSE_F_KEYBINDINGS_MENUS};
case "action": {CSE_F_KEYBINDINGS_ACTIONS};
case "option": {CSE_F_CLIENT_SIDE_SETTINGS};
default {[]};
};
if (count _collection > 0) then {
_selectedSetting = (lbCurSel 200);
if (_selectedSetting > (count _collection)) then {
_selectedSetting = count _collection - 1;
};
if (_selectedSetting < 0) then {
_selectedSetting = 0;
};
_nameOfSetting = (_collection select _selectedSetting) select 0;
[_nameOfSetting,_keyBinding] call _func;
[true] call cse_fnc_settingsMenuUpdateList;
};

View File

@ -1,74 +0,0 @@
/**
* fn_settingsMenuUpdateKeyView.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_setting","_ctrlList","_collection","_settingsMenu", "_keybinding","_keyCode","_shiftPressed","_altPressed","_ctrlPressed"];
disableSerialization;
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_ctrlList = _settingsMenu displayCtrl 200;
_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "menu": {CSE_F_KEYBINDINGS_MENUS};
case "action": {CSE_F_KEYBINDINGS_ACTIONS};
case "option": {CSE_F_CLIENT_SIDE_SETTINGS};
default {[]};
};
if (count _collection > 0) then {
_selectedSetting = (lbCurSel _ctrlList);
if (_selectedSetting > (count _collection)) then {
_selectedSetting = count _collection - 1;
};
if (_selectedSetting < 0) exitwith {
_selectedSetting = 0;
};
_setting = _collection select _selectedSetting;
_details = [_setting select 0, CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F] call cse_fnc_getSettingDetails_F;
(_settingsMenu displayCtrl 250) ctrlSetText (_details select 0);
(_settingsMenu displayCtrl 251) ctrlSetText (_details select 1);
if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then {
_keybinding = _setting select 1;
_keyCode = _keybinding select 0;
_shiftPressed = _keybinding select 1;
_ctrlPressed = _keybinding select 2;
_altPressed = _keybinding select 3;
_keyBindingText = keyName _keyCode;
if (_keyBindingText == '""') then {
_keyBindingText = "No key assigned";
};
(_settingsMenu displayCtrl 300) ctrlSetText ("Key: " + _keyBindingText);
lbClear 400;
lbadd [400, "No"];
lbadd [400, "Yes"];
lbadd [400, "Ignore"];
(_settingsMenu displayCtrl 400) lbSetCurSel _shiftPressed;
(_settingsMenu displayCtrl 401) lbSetCurSel _ctrlPressed;
(_settingsMenu displayCtrl 402) lbSetCurSel _altPressed;
} else {
_possibleValues = _setting select 1;
_settingsValue = _setting select 2;
lbClear 400;
_settingsText = (_possibleValues select _settingsValue); // expecting: value [[any, TEXT (DESCRIPTION)]]
(_settingsMenu displayCtrl 300) ctrlSetText ("Setting: " + _settingsText);
{
lbAdd [400, _x];
}foreach _possibleValues;
(_settingsMenu displayCtrl 400) lbSetCurSel _settingsValue;
};
};

View File

@ -1,56 +0,0 @@
/**
* fn_settingsMenuUpdateList.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_settingsMenu","_ctrlList","_collection","_keyBindingText","_keybinding", "_updateKeyView"];
disableSerialization;
_updateKeyView = [_this, 0, true, [true]] call BIS_fnc_Param;
_settingsMenu = uiNamespace getVariable 'cse_settingsMenu';
_ctrlList = _settingsMenu displayCtrl 200;
_collection = switch (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F) do {
case "menu": {CSE_F_KEYBINDINGS_MENUS};
case "action": {CSE_F_KEYBINDINGS_ACTIONS};
case "option": {CSE_F_CLIENT_SIDE_SETTINGS};
default {[]};
};
lbclear _ctrlList;
if (CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F != "option") then {
{
_keybinding = (_x select 1);
_keyBindingText = keyName (_keybinding select 0);
if (_keyBindingText == '""') then {
_keyBindingText = "";
} else {
if ((_keybinding select 1) == 1) then {
_keyBindingText = _keyBindingText + " + shift";
};
if ((_keybinding select 2) == 1) then {
_keyBindingText = _keyBindingText + " + ctrl";
};
if ((_keybinding select 3) == 1) then {
_keyBindingText = _keyBindingText + " + alt";
};
};
_ctrlList lbadd (([_x select 0, CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F] call cse_fnc_getSettingDetails_F) select 0);
_ctrlList lbadd (_keyBindingText);
}foreach _collection;
} else {
{
_settingsText = ((_x select 1) select (_x select 2));
_ctrlList lbadd (([_x select 0, CSE_SETTINGS_MENU_CURRENT_SETTING_LIST_F] call cse_fnc_getSettingDetails_F) select 0);
_ctrlList lbadd (_settingsText);
}foreach _collection;
};
if (_updateKeyView) then {
[] call cse_fnc_settingsMenuUpdateKeyView;
};

View File

@ -1,24 +0,0 @@
/**
* fn_updateActionKeybinding_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"];
_name = _this select 0;
_keyBinding = _this select 1;
if (isnil "CSE_F_KEYBINDINGS_ACTIONS") then {
CSE_F_KEYBINDINGS_ACTIONS = [];
};
{
if ((_x select 0) == _name) exitwith {
_x set [ 1, _keyBinding];
};
}foreach CSE_F_KEYBINDINGS_ACTIONS;
[_name,"action"] call cse_fnc_saveKeyBindingToProfile_F;

View File

@ -1,23 +0,0 @@
/**
* fn_updateAllKeyBindings_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name","_currentKeyBinding"];
{
_name = _x select 0;
_currentKeyBinding = _x select 1;
_x set [1,([_name, _currentKeyBinding, "menu"] call cse_fnc_getKeyBindingFromProfile_F)];
}foreach CSE_F_KEYBINDINGS_MENUS;
{
_name = _x select 0;
_currentKeyBinding = _x select 1;
_x set [1,([_name, _currentKeyBinding, "action"] call cse_fnc_getKeyBindingFromProfile_F)];
}foreach CSE_F_KEYBINDINGS_ACTIONS;

View File

@ -1,24 +0,0 @@
/**
* fn_updateClientSideOption_f.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: true
*/
private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"];
_name = _this select 0;
_keyBinding = _this select 1;
if (isnil "CSE_F_CLIENT_SIDE_SETTINGS") then {
CSE_F_CLIENT_SIDE_SETTINGS = [];
};
{
if ((_x select 0) == _name) exitwith {
_x set [ 2, _keyBinding];
};
}foreach CSE_F_CLIENT_SIDE_SETTINGS;
[_name] spawn cse_fnc_saveClientSideOptionToProfile_F;

View File

@ -1,24 +0,0 @@
/**
* fn_updateMenuKeyBinding_f.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_name","_keyBinding","_action","_idd","_keyCodePressed","_shiftPressed","_altPressed","_ctrlPressed"];
_name = _this select 0;
_keyBinding = _this select 1;
if (isnil "CSE_F_KEYBINDINGS_MENUS") then {
CSE_F_KEYBINDINGS_MENUS = [];
};
{
if ((_x select 0) == _name) exitwith {
_x set [ 1, _keyBinding];
};
}foreach CSE_F_KEYBINDINGS_MENUS;
[_name,"menu"] call cse_fnc_saveKeyBindingToProfile_F;

View File

@ -1,797 +0,0 @@
#ifndef CSE_DEFINE_H
#define CSE_DEFINE_H
// define.hpp
#define true 1
#define false 0
#define CT_STATIC 0
#define CT_BUTTON 1
#define CT_EDIT 2
#define CT_SLIDER 3
#define CT_COMBO 4
#define CT_LISTBOX 5
#define CT_TOOLBOX 6
#define CT_CHECKBOXES 7
#define CT_PROGRESS 8
#define CT_HTML 9
#define CT_STATIC_SKEW 10
#define CT_ACTIVETEXT 11
#define CT_TREE 12
#define CT_STRUCTURED_TEXT 13
#define CT_CONTEXT_MENU 14
#define CT_CONTROLS_GROUP 15
#define CT_SHORTCUTBUTTON 16
#define CT_XKEYDESC 40
#define CT_XBUTTON 41
#define CT_XLISTBOX 42
#define CT_XSLIDER 43
#define CT_XCOMBO 44
#define CT_ANIMATED_TEXTURE 45
#define CT_OBJECT 80
#define CT_OBJECT_ZOOM 81
#define CT_OBJECT_CONTAINER 82
#define CT_OBJECT_CONT_ANIM 83
#define CT_LINEBREAK 98
#define CT_ANIMATED_USER 99
#define CT_MAP 100
#define CT_MAP_MAIN 101
#define CT_LISTNBOX 102
// Static styles
#define ST_POS 0x0F
#define ST_HPOS 0x03
#define ST_VPOS 0x0C
#define ST_LEFT 0x00
#define ST_RIGHT 0x01
#define ST_CENTER 0x02
#define ST_DOWN 0x04
#define ST_UP 0x08
#define ST_VCENTER 0x0c
#define ST_TYPE 0xF0
#define ST_SINGLE 0
#define ST_MULTI 16
#define ST_TITLE_BAR 32
#define ST_PICTURE 48
#define ST_FRAME 64
#define ST_BACKGROUND 80
#define ST_GROUP_BOX 96
#define ST_GROUP_BOX2 112
#define ST_HUD_BACKGROUND 128
#define ST_TILE_PICTURE 144
#define ST_WITH_RECT 160
#define ST_LINE 176
#define ST_SHADOW 0x100
#define ST_NO_RECT 0x200 // this style works for CT_STATIC in conjunction with ST_MULTI
#define ST_KEEP_ASPECT_RATIO 0x800
#define ST_TITLE ST_TITLE_BAR + ST_CENTER
// Slider styles
#define SL_DIR 0x400
#define SL_VERT 0
#define SL_HORZ 0x400
#define SL_TEXTURES 0x10
// Listbox styles
#define LB_TEXTURES 0x10
#define LB_MULTI 0x20
#define FontCSE "PuristaMedium"
class cse_gui_backgroundBase {
type = CT_STATIC;
idc = -1;
style = ST_PICTURE;
colorBackground[] = {0,0,0,0};
colorText[] = {1, 1, 1, 1};
font = FontCSE;
text = "";
sizeEx = 0.032;
};
class cse_gui_editBase
{
access = 0;
type = 2;
x = 0;
y = 0;
h = 0.04;
w = 0.2;
colorBackground[] =
{
0,
0,
0,
1
};
colorText[] =
{
0.95,
0.95,
0.95,
1
};
colorSelection[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])",
1
};
autocomplete = "";
text = "";
size = 0.2;
style = "0x00 + 0x40";
font = "PuristaMedium";
shadow = 2;
sizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorDisabled[] =
{
1,
1,
1,
0.25
};
};
class cse_gui_buttonBase {
idc = -1;
type = 16;
style = ST_LEFT;
text = "";
action = "";
x = 0.0;
y = 0.0;
w = 0.25;
h = 0.04;
size = 0.03921;
sizeEx = 0.03921;
color[] = {1.0, 1.0, 1.0, 1};
color2[] = {1.0, 1.0, 1.0, 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.5])"};
colorbackground2[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.4};
colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25};
colorFocused[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])", 0.8};
colorBackgroundFocused[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.8};
*/
colorBackground[] = {1,1,1,0.95};
colorbackground2[] = {1,1,1,0.95};
colorDisabled[] = {1,1,1,0.6};
colorFocused[] = {1,1,1,1};
colorBackgroundFocused[] = {1,1,1,1};
periodFocus = 1.2;
periodOver = 0.8;
default = false;
class HitZone {
left = 0.00;
top = 0.00;
right = 0.00;
bottom = 0.00;
};
class ShortcutPos {
left = 0.00;
top = 0.00;
w = 0.00;
h = 0.00;
};
class TextPos {
left = 0.002;
top = 0.0004;
right = 0.0;
bottom = 0.00;
};
textureNoShortcut = "";
animTextureNormal = "cse\cse_gui\data\buttonNormal_gradient_top.paa";
animTextureDisabled = "cse\cse_gui\data\buttonDisabled_gradient.paa";
animTextureOver = "cse\cse_gui\data\buttonNormal_gradient_top.paa";
animTextureFocused = "cse\cse_gui\data\buttonNormal_gradient_top.paa";
animTexturePressed = "cse\cse_gui\data\buttonNormal_gradient_top.paa";
animTextureDefault = "cse\cse_gui\data\buttonNormal_gradient_top.paa";
period = 0.5;
font = FontCSE;
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.0,0};
soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.07,1};
soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
class Attributes {
font = FontCSE;
color = "#E5E5E5";
align = "center";
shadow = "true";
};
class AttributesImage {
font = FontCSE;
color = "#E5E5E5";
align = "left";
shadow = "true";
};
};
class cse_gui_RscProgress {
type = 8;
style = 0;
colorFrame[] = {1,1,1,0.7};
colorBar[] = {1,1,1,0.7};
texture = "#(argb,8,8,3)color(1,1,1,0.7)";
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "0.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class cse_gui_staticBase {
idc = -1;
type = CT_STATIC;
x = 0.0;
y = 0.0;
w = 0.183825;
h = 0.104575;
style = ST_LEFT;
font = FontCSE;
sizeEx = 0.03921;
colorText[] = {0.95, 0.95, 0.95, 1.0};
colorBackground[] = {0, 0, 0, 0};
text = "";
};
class RscListBox;
class cse_gui_listBoxBase : RscListBox{
type = CT_LISTBOX;
style = ST_MULTI;
font = FontCSE;
sizeEx = 0.03921;
color[] = {1, 1, 1, 1};
colorText[] = {0.543, 0.5742, 0.4102, 1.0};
colorScrollbar[] = {0.95, 0.95, 0.95, 1};
colorSelect[] = {0.95, 0.95, 0.95, 1};
colorSelect2[] = {0.95, 0.95, 0.95, 1};
colorSelectBackground[] = {0, 0, 0, 1};
colorSelectBackground2[] = {0.543, 0.5742, 0.4102, 1.0};
colorDisabled[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])", 0.25};
period = 1.2;
rowHeight = 0.03;
colorBackground[] = {0, 0, 0, 1};
maxHistoryDelay = 1.0;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
soundSelect[] = {"",0.1,1};
soundExpand[] = {"",0.1,1};
soundCollapse[] = {"",0.1,1};
class ListScrollBar {
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
autoScrollDelay = 5;
autoScrollEnabled = 0;
autoScrollRewind = 0;
autoScrollSpeed = -1;
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
height = 0;
scrollSpeed = 0.06;
shadow = 0;
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
width = 0;
};
class ScrollBar {
color[] = {1, 1, 1, 0.6};
colorActive[] = {1, 1, 1, 1};
colorDisabled[] = {1, 1, 1, 0.3};
thumb = "";
arrowFull = "";
arrowEmpty = "";
border = "";
};
};
class cse_gui_listNBox {
access = 0;
type = CT_LISTNBOX;// 102;
style =ST_MULTI;
w = 0.4;
h = 0.4;
font = FontCSE;
sizeEx = 0.031;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
columns[] = {0.0};
color[] = {1, 1, 1, 1};
rowHeight = 0.03;
colorBackground[] = {0, 0, 0, 0.2};
colorText[] = {1,1, 1, 1.0};
colorScrollbar[] = {0.95, 0.95, 0.95, 1};
colorSelect[] = {0.95, 0.95, 0.95, 1};
colorSelect2[] = {0.95, 0.95, 0.95, 1};
colorSelectBackground[] = {0, 0, 0, 0.0};
colorSelectBackground2[] = {0.0, 0.0, 0.0, 0.5};
colorActive[] = {0,0,0,1};
colorDisabled[] = {0,0,0,0.3};
rows = 1;
drawSideArrows = 0;
idcLeft = -1;
idcRight = -1;
maxHistoryDelay = 1;
soundSelect[] = {"", 0.1, 1};
period = 1;
shadow = 2;
class ScrollBar {
arrowEmpty = "#(argb,8,8,3)color(1,1,1,1)";
arrowFull = "#(argb,8,8,3)color(1,1,1,1)";
border = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "#(argb,8,8,3)color(1,1,1,1)";
};
class ListScrollBar {
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
autoScrollDelay = 5;
autoScrollEnabled = 0;
autoScrollRewind = 0;
autoScrollSpeed = -1;
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
color[] = {1,1,1,0.6};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
height = 0;
scrollSpeed = 0.06;
shadow = 0;
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
width = 0;
};
};
class RscCombo;
class cse_gui_comboBoxBase: RscCombo {
idc = -1;
type = 4;
style = "0x10 + 0x200";
x = 0;
y = 0;
w = 0.3;
h = 0.035;
color[] = {0,0,0,0.6};
colorActive[] = {1,0,0,1};
colorBackground[] = {0,0,0,1};
colorDisabled[] = {1,1,1,0.25};
colorScrollbar[] = {1,0,0,1};
colorSelect[] = {0,0,0,1};
colorSelectBackground[] = {1,1,1,0.7};
colorText[] = {1,1,1,1};
arrowEmpty = "";
arrowFull = "";
wholeHeight = 0.45;
font = FontCSE;
sizeEx = 0.031;
soundSelect[] = {"\A3\ui_f\data\sound\RscCombo\soundSelect",0.1,1};
soundExpand[] = {"\A3\ui_f\data\sound\RscCombo\soundExpand",0.1,1};
soundCollapse[] = {"\A3\ui_f\data\sound\RscCombo\soundCollapse",0.1,1};
maxHistoryDelay = 1.0;
class ScrollBar
{
color[] = {0.3,0.3,0.3,0.6};
colorActive[] = {0.3,0.3,0.3,1};
colorDisabled[] = {0.3,0.3,0.3,0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
border = "";
};
class ComboScrollBar {
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
autoScrollDelay = 5;
autoScrollEnabled = 0;
autoScrollRewind = 0;
autoScrollSpeed = -1;
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
color[] = {0.3,0.3,0.3,0.6};
colorActive[] = {0.3,0.3,0.3,1};
colorDisabled[] = {0.3,0.3,0.3,0.3};
height = 0;
scrollSpeed = 0.06;
shadow = 0;
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
width = 0;
};
};
class cse_gui_mapBase {
moveOnEdges = 1;
x = "SafeZoneXAbs";
y = "SafeZoneY + 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "SafeZoneWAbs";
h = "SafeZoneH - 1.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
type = 100; // Use 100 to hide markers
style = 48;
shadow = 0;
ptsPerSquareSea = 5;
ptsPerSquareTxt = 3;
ptsPerSquareCLn = 10;
ptsPerSquareExp = 10;
ptsPerSquareCost = 10;
ptsPerSquareFor = 9;
ptsPerSquareForEdge = 9;
ptsPerSquareRoad = 6;
ptsPerSquareObj = 9;
showCountourInterval = 0;
scaleMin = 0.001;
scaleMax = 1.0;
scaleDefault = 0.16;
maxSatelliteAlpha = 0.85;
alphaFadeStartScale = 0.35;
alphaFadeEndScale = 0.4;
colorBackground[] = {0.969,0.957,0.949,1.0};
colorSea[] = {0.467,0.631,0.851,0.5};
colorForest[] = {0.624,0.78,0.388,0.5};
colorForestBorder[] = {0.0,0.0,0.0,0.0};
colorRocks[] = {0.0,0.0,0.0,0.3};
colorRocksBorder[] = {0.0,0.0,0.0,0.0};
colorLevels[] = {0.286,0.177,0.094,0.5};
colorMainCountlines[] = {0.572,0.354,0.188,0.5};
colorCountlines[] = {0.572,0.354,0.188,0.25};
colorMainCountlinesWater[] = {0.491,0.577,0.702,0.6};
colorCountlinesWater[] = {0.491,0.577,0.702,0.3};
colorPowerLines[] = {0.1,0.1,0.1,1.0};
colorRailWay[] = {0.8,0.2,0.0,1.0};
colorNames[] = {0.1,0.1,0.1,0.9};
colorInactive[] = {1.0,1.0,1.0,0.5};
colorOutside[] = {0.0,0.0,0.0,1.0};
colorTracks[] = {0.84,0.76,0.65,0.15};
colorTracksFill[] = {0.84,0.76,0.65,1.0};
colorRoads[] = {0.7,0.7,0.7,1.0};
colorRoadsFill[] = {1.0,1.0,1.0,1.0};
colorMainRoads[] = {0.9,0.5,0.3,1.0};
colorMainRoadsFill[] = {1.0,0.6,0.4,1.0};
colorGrid[] = {0.1,0.1,0.1,0.6};
colorGridMap[] = {0.1,0.1,0.1,0.6};
colorText[] = {1, 1, 1, 0.85};
font = "PuristaMedium";
sizeEx = 0.0270000;
stickX[] = {0.20, {"Gamma", 1.00, 1.50} };
stickY[] = {0.20, {"Gamma", 1.00, 1.50} };
onMouseButtonClick = "";
onMouseButtonDblClick = "";
fontLabel = "PuristaMedium";
sizeExLabel = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontGrid = "TahomaB";
sizeExGrid = 0.02;
fontUnits = "TahomaB";
sizeExUnits = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontNames = "PuristaMedium";
sizeExNames = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8) * 2";
fontInfo = "PuristaMedium";
sizeExInfo = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
fontLevel = "TahomaB";
sizeExLevel = 0.02;
text = "#(argb,8,8,3)color(1,1,1,1)";
class ActiveMarker {
color[] = {0.30, 0.10, 0.90, 1.00};
size = 50;
};
class Legend
{
x = "SafeZoneX + ( ((safezoneW / safezoneH) min 1.2) / 40)";
y = "SafeZoneY + safezoneH - 4.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "3.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
font = "PuristaMedium";
sizeEx = "( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.8)";
colorBackground[] = {1,1,1,0.5};
color[] = {0,0,0,1};
};
class Task
{
icon = "\A3\ui_f\data\map\mapcontrol\taskIcon_CA.paa";
iconCreated = "\A3\ui_f\data\map\mapcontrol\taskIconCreated_CA.paa";
iconCanceled = "\A3\ui_f\data\map\mapcontrol\taskIconCanceled_CA.paa";
iconDone = "\A3\ui_f\data\map\mapcontrol\taskIconDone_CA.paa";
iconFailed = "\A3\ui_f\data\map\mapcontrol\taskIconFailed_CA.paa";
color[] = {"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])","(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])","(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])"};
colorCreated[] = {1,1,1,1};
colorCanceled[] = {0.7,0.7,0.7,1};
colorDone[] = {0.7,1,0.3,1};
colorFailed[] = {1,0.3,0.2,1};
size = 27;
importance = 1;
coefMin = 1;
coefMax = 1;
};
class Waypoint
{
icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa";
color[] = {0,0,0,1};
size = 20;
importance = "1.2 * 16 * 0.05";
coefMin = 0.900000;
coefMax = 4;
};
class WaypointCompleted
{
icon = "\A3\ui_f\data\map\mapcontrol\waypointCompleted_ca.paa";
color[] = {0,0,0,1};
size = 20;
importance = "1.2 * 16 * 0.05";
coefMin = 0.900000;
coefMax = 4;
};
class CustomMark
{
icon = "\A3\ui_f\data\map\mapcontrol\custommark_ca.paa";
size = 24;
importance = 1;
coefMin = 1;
coefMax = 1;
color[] = {0,0,0,1};
};
class Command
{
icon = "\A3\ui_f\data\map\mapcontrol\waypoint_ca.paa";
size = 18;
importance = 1;
coefMin = 1;
coefMax = 1;
color[] = {1,1,1,1};
};
class Bush
{
icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa";
color[] = {0.45,0.64,0.33,0.4};
size = "14/2";
importance = "0.2 * 14 * 0.05 * 0.05";
coefMin = 0.25;
coefMax = 4;
};
class Rock
{
icon = "\A3\ui_f\data\map\mapcontrol\rock_ca.paa";
color[] = {0.1,0.1,0.1,0.8};
size = 12;
importance = "0.5 * 12 * 0.05";
coefMin = 0.25;
coefMax = 4;
};
class SmallTree
{
icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa";
color[] = {0.45,0.64,0.33,0.4};
size = 12;
importance = "0.6 * 12 * 0.05";
coefMin = 0.25;
coefMax = 4;
};
class Tree
{
icon = "\A3\ui_f\data\map\mapcontrol\bush_ca.paa";
color[] = {0.45,0.64,0.33,0.4};
size = 12;
importance = "0.9 * 16 * 0.05";
coefMin = 0.25;
coefMax = 4;
};
class busstop
{
icon = "\A3\ui_f\data\map\mapcontrol\busstop_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class fuelstation
{
icon = "\A3\ui_f\data\map\mapcontrol\fuelstation_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class hospital
{
icon = "\A3\ui_f\data\map\mapcontrol\hospital_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class church
{
icon = "\A3\ui_f\data\map\mapcontrol\church_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class lighthouse
{
icon = "\A3\ui_f\data\map\mapcontrol\lighthouse_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class power
{
icon = "\A3\ui_f\data\map\mapcontrol\power_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class powersolar
{
icon = "\A3\ui_f\data\map\mapcontrol\powersolar_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class powerwave
{
icon = "\A3\ui_f\data\map\mapcontrol\powerwave_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class powerwind
{
icon = "\A3\ui_f\data\map\mapcontrol\powerwind_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class quay
{
icon = "\A3\ui_f\data\map\mapcontrol\quay_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class shipwreck
{
icon = "\A3\ui_f\data\map\mapcontrol\shipwreck_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class transmitter
{
icon = "\A3\ui_f\data\map\mapcontrol\transmitter_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class watertower
{
icon = "\A3\ui_f\data\map\mapcontrol\watertower_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {1,1,1,1};
};
class Cross
{
icon = "\A3\ui_f\data\map\mapcontrol\Cross_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {0,0,0,1};
};
class Chapel
{
icon = "\A3\ui_f\data\map\mapcontrol\Chapel_CA.paa";
size = 24;
importance = 1;
coefMin = 0.85;
coefMax = 1.0;
color[] = {0,0,0,1};
};
class Bunker
{
icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa";
size = 14;
importance = "1.5 * 14 * 0.05";
coefMin = 0.25;
coefMax = 4;
color[] = {0,0,0,1};
};
class Fortress
{
icon = "\A3\ui_f\data\map\mapcontrol\bunker_ca.paa";
size = 16;
importance = "2 * 16 * 0.05";
coefMin = 0.25;
coefMax = 4;
color[] = {0,0,0,1};
};
class Fountain
{
icon = "\A3\ui_f\data\map\mapcontrol\fountain_ca.paa";
size = 11;
importance = "1 * 12 * 0.05";
coefMin = 0.25;
coefMax = 4;
color[] = {0,0,0,1};
};
class Ruin
{
icon = "\A3\ui_f\data\map\mapcontrol\ruin_ca.paa";
size = 16;
importance = "1.2 * 16 * 0.05";
coefMin = 1;
coefMax = 4;
color[] = {0,0,0,1};
};
class Stack
{
icon = "\A3\ui_f\data\map\mapcontrol\stack_ca.paa";
size = 20;
importance = "2 * 16 * 0.05";
coefMin = 0.9;
coefMax = 4;
color[] = {0,0,0,1};
};
class Tourism
{
icon = "\A3\ui_f\data\map\mapcontrol\tourism_ca.paa";
size = 16;
importance = "1 * 16 * 0.05";
coefMin = 0.7;
coefMax = 4;
color[] = {0,0,0,1};
};
class ViewTower
{
icon = "\A3\ui_f\data\map\mapcontrol\viewtower_ca.paa";
size = 16;
importance = "2.5 * 16 * 0.05";
coefMin = 0.5;
coefMax = 4;
color[] = {0,0,0,1};
};
};
#endif

View File

@ -1,46 +0,0 @@
class CSE_Open_SettingsMenu_BtnBase : cse_gui_buttonBase {
idc = -1;
text = "Configure [CSE]";
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + safezoneY";
w = "14 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)";
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1, 1, 1, 1};
color2[] = {0,0,0, 1};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground[] = {1,1,1,1};
colorbackground2[] = {1,1,1,1};
colorDisabled[] = {0.5,0.5,0.5,0.8};
colorFocused[] = {0,0,0,1};
periodFocus = 1;
periodOver = 1;
action = "(findDisplay 49) closeDisplay 0; createDialog 'cse_settingsMenu';";
};
class RscStandardDisplay;
class RscDisplayMPInterrupt: RscStandardDisplay {
class controls {
class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {};
};
};
class RscDisplayInterruptEditorPreview: RscStandardDisplay {
class controls {
class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {};
};
};
class RscDisplayInterrupt: RscStandardDisplay {
class controls {
class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {};
};
};
class RscDisplayInterruptEditor3D: RscStandardDisplay {
class controls {
class cse_Open_settingsMenu_Btn : CSE_Open_SettingsMenu_BtnBase {};
};
};

View File

@ -1,259 +0,0 @@
class cse_settingsMenu {
idd = 145246;
movingEnable = false;
onLoad = "uiNamespace setVariable ['cse_settingsMenu', _this select 0]; [] call cse_fnc_onSettingsMenuOpen; ['cse_settingsMenu', true] call cse_fnc_gui_blurScreen;missionNamespace setVariable ['CSE_SETTINGS_MENU_OPEN', true];";
onUnload = "uiNamespace setVariable ['cse_settingsMenu', nil]; saveProfileNamespace; ['cse_settingsMenu', false] call cse_fnc_gui_blurScreen; missionNamespace setVariable ['CSE_SETTINGS_MENU_OPEN', nil];";
class controlsBackground {
class HeaderBackground: cse_gui_backgroundBase{
idc = -1;
type = CT_STATIC;
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_LEFT + ST_SHADOW;
font = "PuristaMedium";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.95, 0.95, 0.95, 0.75};
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.9])"};
text = "";
};
class CenterBackground: HeaderBackground {
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
h = "2.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "";
colorText[] = {0, 0, 0, "(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
colorBackground[] = {0,0,0,"(profilenamespace getvariable ['GUI_BCG_RGB_A',0.9])"};
};
class LeftBackground: CenterBackground {
y = "4.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
h = "12.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
w = "25 * (((safezoneW / safezoneH) min 1.2) / 40)";
};
class RightBackground: LeftBackground {
x = "26.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
w = "12.9 * (((safezoneW / safezoneH) min 1.2) / 40)";
};
};
class controls {
class HeaderName {
idc = 1;
type = CT_STATIC;
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
style = ST_LEFT + ST_SHADOW;
font = "PuristaMedium";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.95, 0.95, 0.95, 0.75};
colorBackground[] = {0,0,0,0};
text = "Configure [CSE]";
};
class actionClose : cse_gui_buttonBase {
idc = 10;
text = "Close";
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.8)";
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.5)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1, 1, 1, 1};
color2[] = {0,0,0, 1};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground[] = {1,1,1,1};
colorbackground2[] = {1,1,1,1};
colorDisabled[] = {0.5,0.5,0.5,0.8};
colorFocused[] = {0,0,0,1};
periodFocus = 1;
periodOver = 1;
action = "closedialog 0;";
};
class actionUnassign: actionClose {
idc = 11;
text = "Unassign";
x = "33 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
action = "[0, 0, 0, 0] call cse_fnc_settingsMenuUpdateKeyBinding_F;";
};
class labelShow : cse_gui_staticBase {
idc = 12;
x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "2.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "4 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "Show:";
};
class labelShow2: cse_gui_staticBase {
idc = 13;
x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "3.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "30 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "";
};
class selectionAction_1 : cse_gui_buttonBase {
idc = 1000;
text = "Menus";
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "2.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "9.5 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)";
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
color[] = {1, 1, 1, 1};
color2[] = {0,0,0, 1};
colorBackgroundFocused[] = {1,1,1,1};
colorBackground[] = {1,1,1,1};
colorbackground2[] = {1,1,1,1};
colorDisabled[] = {0.5,0.5,0.5,0.8};
colorFocused[] = {0,0,0,1};
periodFocus = 1;
periodOver = 1;
action = "[nil, 0] call cse_fnc_onListBoxShowSelectionChanged;";
};
class selectionAction_2 : selectionAction_1 {
idc = 1001;
text = "Actions";
x = "10.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = "[nil, 1] call cse_fnc_onListBoxShowSelectionChanged;";
};
class selectionAction_3 : selectionAction_1 {
idc = 1002;
text = "Settings";
x = "20 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = "[nil, 2] call cse_fnc_onListBoxShowSelectionChanged;";
};
class selectionAction_4 : selectionAction_1 {
idc = 1003;
text = "Colors";
x = "29.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
action = "[nil, 3] call cse_fnc_onListBoxShowSelectionChanged;";
};
class listBoxSettingsList: cse_gui_listNBox {
idc = 200;
x = "2 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "5.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "23 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "10 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 0.7)";
colorBackground[] = {0, 0, 0, 0.9};
colorSelectBackground[] = {0, 0, 0, 0.9};
columns[] = {0.0, 0.5};
};
class labelTitle: cse_gui_staticBase {
idc = 250;
x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "5.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
};
class labelKey: cse_gui_staticBase {
idc = 300;
x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "6.2 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "10 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "Key:";
};
class Label2: labelKey {
idc = 301;
y = "7.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "Shift:";
};
class Label3: labelKey {
idc = 302;
y = "8.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "Ctrl:";
};
class Label4: labelKey {
idc = 303;
y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
text = "Alt:";
};
class comboBox1: cse_gui_comboBoxBase {
idc = 400;
x = "32.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "7.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class comboBox2: comboBox1 {
idc = 401;
y = "8.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
};
class comboBox3: comboBox1 {
idc = 402;
y = "9.5 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
};
class labelDesc: cse_gui_staticBase {
idc = 251;
x = "27.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "11 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "11 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "";
style = ST_LEFT + ST_MULTI;
lineSpacing = 1;
sizeEx = 0.03;
};
class actionEdit: actionClose {
idc = 150;
text = "Edit";
x = "26.1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
action = "if (!CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F) then{ ctrlSetText [252, 'Press the key you want to assign to this action..']; CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = true; };";
};
class actionCancel: actionClose {
idc = 151;
text = "Cancel";
x = "20 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
action = "ctrlSetText [252, '']; CSE_SETTINGS_MENU_EDIT_CURRENT_SETTING_F = false; ";
};
class notificationDesc: cse_gui_staticBase {
idc = 252;
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "18 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "6 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "";
style = ST_CENTER + ST_SHADOW;
sizeEx = 0.05;
};
class selectionAction_5 : selectionAction_1 {
idc = 1100;
text = "Fix Animation";
x = "7.5 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "17.3 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "6 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
action = "if ([player] call cse_fnc_canInteract && {animationState player == 'deadState' || animationState player == 'unconscious'} && {(vehicle player == player)}) then { [player, 'amovppnemstpsnonwnondnon'] call cse_fnc_broadcastAnim; };";
};
};
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
class cfgFunctions {
class cse_AB_ballistics
{
class advancedBallistics {
file = "cse\cse_sys_ballistics\advancedBallistics\functions";
class adjust_parallax { recompile = 1; };
class adjust_turret { recompile = 1; };
class advanced_ballistics { recompile = 1; };
class advanced_ballistics_extension { recompile = 1; };
class ammo_temperature_muzzle_velocity { recompile = 1; };
class apply_turret_adjustments { recompile = 1; };
class barrel_length_muzzle_velocity { recompile = 1; };
class calculate_air_density { recompile = 1; };
class calculate_atmospheric_correction { recompile = 1; };
class calculate_hellmann_exponent { recompile = 1; };
class calculate_retardation { recompile = 1; };
class calculate_roughness_length { recompile = 1; };
class calculate_stability_factor { recompile = 1; };
class calculate_wind_speed { recompile = 1; };
class climate_simulation { recompile = 1; };
class display_protractor { recompile = 1; };
class display_wind_info { recompile = 1; };
class get_humidity_at_height { recompile = 1; };
class get_temperature_at_height { recompile = 1; };
class initialize_terrain_extension { recompile = 1; };
class mirage_simulation { recompile = 1; };
class synchronize_scope_zero { recompile = 1; };
};
};
};

View File

@ -0,0 +1,165 @@
class CfgMagazines
{
class 7Rnd_408_Mag;
class 16Rnd_9x21_Mag;
class 30Rnd_556x45_Stanag;
class 30Rnd_556x45_Stanag_Tracer_Red;
class 200Rnd_65x39_cased_Box;
class 200Rnd_65x39_cased_Box_Tracer;
class 10Rnd_762x51_Mag;
class 20Rnd_762x51_Mag;
class 100Rnd_127x99_mag;
class 8Rnd_mas_9x18_Mag: 16Rnd_9x21_Mag
{
ammo="B_mas_9x18_Ball_57N181S";
count=8;
displayName="8rnd 9mm Mag";
picture="\A3\weapons_f\data\ui\M_16Rnd_9x21_CA.paa";
descriptionshort="Caliber: 9x18 mm Makarov<br />Rounds: 8<br />Used in: Makarov";
};
class 64Rnd_mas_9x18_mag: 30Rnd_556x45_Stanag
{
ammo="B_mas_9x18_Ball_57N181S";
count=64;
displayName="64rnds 9x18 Bizon";
picture="\mas_us_rifle\ui\m_bizon_ca.paa";
descriptionshort="Caliber: 9x18 mm cal<br />Rounds: 64<br />Used in: Bizon";
};
class 30Rnd_mas_545x39_mag: 30Rnd_556x45_Stanag
{
ammo="M_mas_545x39_Ball_7N6M";
count=30;
descriptionshort="Caliber: 5.45x39 mm<br />Rounds: 30<br />Used in: AK74M,AKS74,AKSU";
displayname="30rnd 5.45mm Mag";
};
class 30Rnd_mas_545x39_T_mag: 30Rnd_556x45_Stanag_Tracer_Red
{
ammo="M_mas_545x39_Ball_7T3M";
count=30;
descriptionshort="Caliber: 5.45x39 mm Tracer<br />Rounds: 30<br />Used in: AK74M,AKS74,AKSU";
displayname="30rnd 5.45mm Mag(Tracer)";
};
class 100Rnd_mas_545x39_mag: 200Rnd_65x39_cased_Box
{
ammo="M_mas_545x39_Ball_7N6M";
count=100;
descriptionshort="Caliber: 5.45x39 mm<br />Rounds: 100<br />Used in: RPK74";
displayname="100rnd 5.45mm Drum";
mass=25;
};
class 100Rnd_mas_545x39_T_mag: 200Rnd_65x39_cased_Box_Tracer
{
ammo="M_mas_545x39_Ball_7T3M";
count=100;
descriptionshort="Caliber: 5.45x39 mm Tracer<br />Rounds: 100<br />Used in: RPK74";
displayname="100rnd 5.45mm Drum(Tracer)";
mass=25;
};
class 30Rnd_mas_556x45_Mk262_Stanag: 30Rnd_556x45_Stanag
{
ammo="B_mas_556x45_Ball_Mk262";
count=30;
descriptionshort="Caliber: 5.56x45 mm STANAG Mk262<br />Rounds: 30<br />Used in: M4,HK416,M16,SCAR-L";
displayname="30rnd 5.56mm STANAG(Mk262)";
};
class 20Rnd_mas_762x51_M118LR_Stanag: 30Rnd_556x45_Stanag
{
ammo="B_mas_762x51_Ball_M118LR";
count=20;
descriptionshort="Caliber: 7.62x51 mm STANAG M118LR<br />Rounds: 20<br />Used in: HK417,SR25,SCAR-H,EBR";
displayname="20rnd 7.62mm Mag(M118LR)";
picture="\A3\weapons_f\data\UI\M_20Rnd_762x51_CA.paa";
};
class 5Rnd_mas_762x51_M118LR_Stanag: 30Rnd_556x45_Stanag
{
ammo="B_mas_762x51_Ball_M118LR";
count=5;
descriptionshort="Caliber: 7.62x51 mm STANAG M118LR<br />Rounds: 5<br />Used in: M24";
displayname="5rnd 7.62mm Mag(M118LR)";
picture="\A3\weapons_f\data\UI\m_M24_CA.paa";
};
class Trixie_30x556_Mk262_Mag: 30Rnd_556x45_Stanag
{
scope=2;
author="Trixie";
count=30;
descriptionshort="Caliber: 5.56x45mm<br />Rounds: 30<br />Used in: Mk12 SPR";
displayname="30Rnd Mk262 5.56x45mm";
ammo="cse_AB_556x45_Ball_Mk262";
lastroundstracer=0;
tracersevery=0;
};
class Trixie_20x762_M118LR_Mag: 20Rnd_762x51_Mag
{
scope=2;
author="Trixie";
count=20;
descriptionshort="Caliber: 7.62x51mm<br />Rounds: 20<br />Used in: M110 SASS";
displayname="20Rnd 7.62x51mm M118LR";
ammo="cse_AB_762x51_Ball_M118LR";
picture="\Trixie_recon\UI\20x762_mag.paa";
lastroundstracer=0;
tracersevery=0;
};
class Trixie_10x762_M118LR_Mag: 10Rnd_762x51_Mag
{
scope=2;
author="Trixie";
count=10;
descriptionshort="Caliber: 7.62x51mm<br />Rounds: 10<br />Used in: CZ750";
displayname="10Rnd 7.62x51mm M118LR";
ammo="cse_AB_762x51_Ball_M118LR";
picture="\Trixie_recon\UI\5x762_mag.paa";
lastroundstracer=0;
tracersevery=0;
};
class Trixie_5x762_M118LR_Mag: 10Rnd_762x51_Mag
{
scope=2;
author="Trixie";
count=5;
descriptionshort="Caliber: 7.62x51mm<br />Rounds: 5<br />Used in: M40A3";
displayname="5Rnd 7.62x51mm M118LR";
ammo="cse_AB_762x51_Ball_M118LR";
picture="\Trixie_recon\UI\5x762_mag.paa";
lastroundstracer=0;
tracersevery=0;
};
class Trixie_10x127_Mag: 100Rnd_127x99_mag
{
scope=2;
author="Trixie";
count=10;
descriptionshort="Caliber: 12.7x99mm<br />Rounds: 10<br />Used in: Barret M107";
displayname="10Rnd 12.7x99mm";
ammo="B_127x99_Ball";
picture="\Trixie_recon\UI\50BMGx10_mag.paa";
lastroundstracer=0;
tracersevery=0;
};
class Trixie_10x105_Mag: 100Rnd_127x99_mag
{
scope=2;
author="Trixie";
count=10;
descriptionshort="Caliber: .416 Barrett<br />Rounds: 10<br />Used in: Barret M107";
displayname="10Rnd 10.5x83mm";
ammo="AB_106x83mm_Ball";
picture="\Trixie_recon\UI\50BMGx10_mag.paa";
lastroundstracer=0;
tracersevery=0;
};
class Trixie_10x127_Amax_Mag: 100Rnd_127x99_mag
{
scope=2;
author="Trixie";
count=10;
descriptionshort="Caliber: .50 BMG 750 gr A-MAX<br />Rounds: 10<br />Used in: Barret M107";
displayname="10Rnd 12.7x99mm A-MAX";
ammo="AB_127x99_Ball_AMAX";
picture="\Trixie_recon\UI\50BMGx10_mag.paa";
lastroundstracer=0;
tracersevery=0;
};
};

View File

@ -0,0 +1,9 @@
class CfgSounds
{
class cse_AB_scope_click
{
name="cse_AB_scope_click";
sound[]={"cse\cse_sys_ballistics\advancedballistics\sound\scope_click.wav",1,1};
titles[]={};
};
};

View File

@ -0,0 +1,167 @@
class CfgVehicles {
class Logic;
class Module_F: Logic {
class ArgumentsBaseUnits {
};
};
class cse_AB_moduleAdvancedBallistics: Module_F {
scope = 2;
displayName = "Advanced Ballistics [CSE]";
icon = "\cse\cse_main\data\cse_backblast_module.paa";
category = "cseModules";
function = "cse_fnc_initalizeModule_F";
author = "Ruthberg";
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
class Arguments {
class FORCE_CLIENT_SETTINGS_OVERRIDE {
displayName = "Force Client Settings override";
description = "Force Client Settings override";
typeName = "BOOL";
defaultValue = 1;
};
class WIND_ENABLED {
displayName = "Wind drift";
description = "Add wind drift";
typeName = "BOOL";
defaultValue = 1;
};
class SPIN_DRIFT_ENABLED {
displayName = "Spin drift";
description = "add spin drift";
typeName = "BOOL";
defaultValue = 1;
};
class CORIOLIS_ENABLED {
displayName = "Horizontal Coriolis drift";
description = "Horizontal Coriolis drift";
typeName = "BOOL";
defaultValue = 1;
};
class EOETVOES_ENABLED {
displayName = "Vertical Coriolis drift";
description = "Vertical Coriolis drift";
typeName = "BOOL";
defaultValue = 1;
};
class ADVANCED_AIR_DRAG_ENABLED {
displayName = "Advanced air drag";
description = "Enabled the advanced air drag model (only availible with compatible 3rd party ammunition)";
typeName = "BOOL";
defaultValue = 1;
};
class ATMOSPHERIC_DENSITY_SIMULATION_ENABLED {
displayName = "Ambient air density ";
description = "The bullets ability to cut through air becomes affected by the ambient air density";
typeName = "BOOL";
defaultValue = 1;
};
class TRANSONIC_REGION_ENABLED {
displayName = "Dispersion beyond supersonic";
description = "Adds dispersion beyond supersonic flight of rifle bullets";
typeName = "BOOL";
defaultValue = 1;
};
class MIL_TURRETS_ENABLED {
displayName = "Zero scope in 1/10 mil";
description = "Adds the ability to zero your scope in 1/10 Mil steps";
typeName = "BOOL";
defaultValue = 1;
};
class AMMO_TEMPERATURE_ENABLED {
displayName = "Ammo temperature";
description = "Muzzle velocity changes with ammo temperature";
typeName = "BOOL";
defaultValue = 1;
};
class DISABLED_IN_FULL_AUTO_MODE {
displayName = "Disabled during full auto";
description = "Disables the advanced ballistics during full auto fire";
typeName = "BOOL";
defaultValue = 0;
};
class BULLET_TRACE_ENABLED {
displayName = "Bullet trace effect";
description = "Adds a bullet trace effect to high caliber bullets";
typeName = "BOOL";
defaultValue = 1;
};
class MIRAGE_ENABLED {
displayName = "Mirage and scope parallax";
description = "Adds mirage and scope parallax adjustment";
typeName = "BOOL";
defaultValue = 1;
};
class BARREL_LENGTH_INFLUENCE {
displayName = "Barrel length dependent";
description = "Enables barrel length dependent muzzle velocity";
typeName = "BOOL";
defaultValue = 1;
};
class VEHICLE_GUNNER_ENABLED {
displayName = "Vehicle Gunners";
description = "Enables the advanced ballistics for rounds fired as vehicle gunner";
typeName = "BOOL";
defaultValue = 1;
};
class EXTENSIONS_ENABLED {
displayName = "Extension allowed";
description = "Allows the use of the DLL extension";
typeName = "BOOL";
defaultValue = 1;
};
class INIT_MESSAGE_ENABLED {
displayName = "Initialization message";
description = "Prints a system chat message once the terrain initialization is finished";
typeName = "BOOL";
defaultValue = 0;
};
class ONLY_ACTIVE_FOR_LOCAL_PLAYER {
displayName = "Local only";
description = "Disables the advanced ballistics for bullets coming from other players";
typeName = "BOOL";
defaultValue = 0;
};
class ONLY_ACTIVE_FOR_PLAYER_GROUP {
displayName = "Group only";
description = "Disables the advanced ballistics for bullets coming from players in other groups";
typeName = "BOOL";
defaultValue = 0;
};
class DISABLED_BY_DEFAULT {
displayName = "Disabled by default";
description = "Allows you to enable the advanced ballistics selectively in the unit initialization";
typeName = "BOOL";
defaultValue = 0;
};
class PRECISION {
displayName = "Calculation precision";
description = "Allows to reduces the calculation precision to avoid frame drops (1 - maximum precision, 2 - medium precision, 3 - minimal precision)";
typeName = "NUMBER";
defaultValue = 1;
};
};
};
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
class Combat_Space_Enhancement {
class cfgModules {
class cse_AB_moduleAdvancedBallistics {
init = "call compile preprocessFile 'cse\cse_sys_ballistics\advancedballistics\init.sqf';";
name = "Advanced Ballistics";
class EventHandlers {
class AllVehicles {
fired = "call cse_ab_ballistics_fnc_advanced_ballistics; false";
};
class CAManBase {
take = "call cse_ab_ballistics_fnc_synchronize_scope_zero; false";
};
};
};
};
};

View File

@ -0,0 +1 @@
#include "ui\rscTitles.h"

View File

@ -0,0 +1,44 @@
#define ST_LEFT 0
#define ST_RIGHT 1
#define ST_CENTER 2
class CfgPatches
{
class cse_ab_advancedballistics
{
units[]={};
weapons[]={};
requiredVersion=1.26;
requiredAddons[]=
{
};
version="2.7";
author[]=
{
"Ruthberg"
};
};
};
class CfgAddons
{
class PreloadAddons
{
class cse_ab_advancedballistics
{
list[]=
{
"cse_ab_advancedballistics"
};
};
};
};
#include "CfgAmmo.h"
#include "CfgMagazines.h"
#include "CfgWeapons.h"
#include "CfgSounds.h"
#include "CfgVehicles.h"
#include "CfgFunctions.h"
#include "Combat_Space_Enhancement.h"
#include "UI.h"

View File

@ -0,0 +1,11 @@
#define GRAVITY 9.80665
#define ABSOLUTE_ZERO_IN_CELSIUS -273.15
#define KELVIN(t) (t - ABSOLUTE_ZERO_IN_CELSIUS)
#define CELSIUS(t) (t + ABSOLUTE_ZERO_IN_CELSIUS)
#define UNIVERSAL_GAS_CONSTANT 8.314
#define WATER_VAPOR_MOLAR_MASS 0.018016
#define DRY_AIR_MOLAR_MASS 0.028964
#define SPECIFIC_GAS_CONSTANT_DRY_AIR 287.058
#define STD_AIR_DENSITY_ICAO 1.22498
#define STD_AIR_DENSITY_ASM 1.20885
#define GET_TEMPERATURE_AT_HEIGHT(h) (cse_AB_Temperature - 0.0065 * (h))

View File

@ -0,0 +1,72 @@
/**
* fn_adjust_parralax.sqf
* @Descr: N/A
* @Author: Ruthberg
*
* @Arguments: []
* @Return: []
* @PublicAPI: false
*/
#include "defines.h"
#define __dsp (uiNamespace getVariable "RscTurretDial")
#define __ctrl (__dsp displayCtrl 132949)
private ["_direction", "_opticsName", "_opticType", "_parallax"];
_direction = _this;
_opticsName = currentWeapon player;
_opticType = 0;
if (!cse_AB_MirageEnabled) exitWith { false };
if (!(weaponLowered player) && currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then {
_opticsName = (primaryWeaponItems player) select 2;
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
};
if (_opticType != 2 && !(currentWeapon player in ["Binocular", "Rangefinder", "Laserdesignator"])) exitWith { false };
_parallax = player getVariable [format["cse_AB_Parallax:%1", _opticsName], 0];
switch (_direction) do
{
case 0:
{
if (_parallax > 0) then {
_parallax = _parallax + 100;
};
if (_parallax > 1000) then {
_parallax = 0;
};
};
case 1:
{
if (_parallax > 100) then {
_parallax = _parallax - 100;
};
if (_parallax == 0) then {
_parallax = 1000;
};
};
};
cse_AB_WindInfo = false;
0 cutText ["", "PLAIN"];
cse_AB_Protractor = false;
1 cutText ["", "PLAIN"];
2 cutRsc ["RscTurretDial", "PLAIN"];
if (_parallax > 0) then {
__ctrl ctrlSetText format["%1 m", round(_parallax)];
} else {
__ctrl ctrlSetText "infinity";
};
__ctrl ctrlSetTextColor [0.8, 0.0, 0.0, 1.0];
if (_parallax != player getVariable [format["cse_AB_Parallax:%1", _opticsName], 0]) then {
player setVariable [format["cse_AB_Parallax:%1", _opticsName], _parallax, false];
PlaySound "cse_AB_scope_click";
};
true

View File

@ -0,0 +1,91 @@
#include "defines.h"
#define __dsp (uiNamespace getVariable "RscTurretDial")
#define __ctrl (__dsp displayCtrl 132949)
private ["_opticsName", "_opticType", "_scopeStep", "_turretAndDirection", "_majorStep", "_elevation", "_windage", "_zero"];
_turretAndDirection = _this select 0;
_majorStep = _this select 1;
if (!cse_AB_MilTurretsEnabled) exitWith { false };
if (weaponLowered player) exitWith { false };
if (vehicle player != player) exitWith { false };
if (currentWeapon player != primaryWeapon player) exitWith { false };
if (count primaryWeaponItems player < 3) exitWith { false };
_opticsName = (primaryWeaponItems player) select 2;
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
if (_opticType != 2) exitWith { false };
_elevation = player getVariable [format["cse_AB_Elevation:%1", _opticsName], 0];
_windage = player getVariable [format["cse_AB_Windage:%1", _opticsName], 0];
_zero = player getVariable [format["cse_AB_Zero:%1", _opticsName], profileNamespace getVariable [format["cse_AB_Zero:%1", _opticsName], 0]];
_scopeStep = 0.1;
switch (_turretAndDirection) do
{
case 0: { _elevation = _elevation + _scopeStep };
case 1: { _elevation = _elevation - _scopeStep };
case 2: { _windage = _windage - _scopeStep };
case 3: { _windage = _windage + _scopeStep };
case 4: { _zero = _zero + _scopeStep };
case 5: { _zero = _zero - _scopeStep };
};
if (_majorStep) then {
switch (_turretAndDirection) do
{
case 0: { _elevation = ceil(_elevation) };
case 1: { _elevation = floor(_elevation) };
case 2: { _windage = floor(_windage) };
case 3: { _windage = ceil(_windage) };
};
};
_zero = -4 max _zero min 30;
_elevation = (-4 - _zero) max _elevation min (30 - _zero);
_windage = -20 max _windage min 20;
cse_AB_WindInfo = false;
0 cutText ["", "PLAIN"];
cse_AB_Protractor = false;
1 cutText ["", "PLAIN"];
2 cutRsc ["RscTurretDial", "PLAIN"];
switch (_turretAndDirection) do
{
case 0;
case 1: {
__ctrl ctrlSetText format["%1 Mil", round(_elevation * 10) / 10];
__ctrl ctrlSetTextColor [1.0, 1.0, 0.5, 1.0];
};
case 2;
case 3: {
__ctrl ctrlSetText format["%1 Mil", round(_windage * 10) / 10];
__ctrl ctrlSetTextColor [0.8, 0.8, 1.0, 1.0];
};
case 4;
case 5: {
__ctrl ctrlSetText format["%1 Mil", round(_zero * 10) / 10];
__ctrl ctrlSetTextColor [0, 0.5, 0.0, 1.0];
};
};
if (_elevation != player getVariable [format["cse_AB_Elevation:%1", _opticsName], 0]) then {
player setVariable [format["cse_AB_Elevation:%1", _opticsName], _elevation, true];
PlaySound "cse_AB_scope_click";
};
if (_windage != player getVariable [format["cse_AB_Windage:%1", _opticsName], 0]) then {
player setVariable [format["cse_AB_Windage:%1", _opticsName], _windage, true];
PlaySound "cse_AB_scope_click";
};
if (_zero != player getVariable [format["cse_AB_Zero:%1", _opticsName], 0]) then {
profileNamespace setVariable [format["cse_AB_Zero:%1", _opticsName], _zero];
player setVariable [format["cse_AB_Zero:%1", _opticsName], _zero, true];
PlaySound "cse_AB_scope_click";
};
true

View File

@ -0,0 +1,345 @@
#include "defines.h"
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_cse_AB_Elevation", "_cse_AB_Windage", "_ID"];
_unit = _this select 0;
_weapon = _this select 1;
_mode = _this select 3;
_ammo = _this select 4;
_bullet = _this select 5;
_magazine = _this select 6;
if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then {
_bullet = _this select 6;
_magazine = _this select 5;
};
if (isDedicated) exitWith {};
if (!alive _bullet) exitWith {};
if (!(isPlayer _unit)) exitWith {};
if (underwater _unit) exitWith {};
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (_unit distanceSqr player > 9000000) exitWith {};
if (cse_AB_OnlyActiveForLocalPlayer && !(local _unit)) exitWith {};
if (cse_AB_OnlyActiveForPlayerGroup && (group _unit != group player)) exitWith {};
if (!cse_AB_VehicleGunnerEnabled && !(_unit isKindOf "Man")) exitWith {};
if (cse_AB_DisabledInFullAutoMode && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) exitWith {};
if (!isServer && !((gunner _unit) getVariable ["cse_enabled_AdvancedBallistics", false])) exitWith {};
_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction");
_muzzleVelocity = getNumber(configFile >> "cfgMagazines" >> _magazine >> "initSpeed");
_muzzleAccessory = (primaryWeaponItems _unit) select 0;
if (_muzzleAccessory != "" && isNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed")) then {
_initSpeedCoef = getNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed");
_muzzleVelocity = _muzzleVelocity * _initSpeedCoef;
};
if (cse_AB_BarrelLengthInfluenceEnabled) then {
_muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call cse_ab_ballistics_fnc_barrel_length_muzzle_velocity;
if (_muzzleVelocityShift != 0) then {
_bulletVelocity = velocity _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity)));
_bullet setVelocity _bulletVelocity;
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
};
};
if (cse_AB_AmmoTemperatureEnabled) then {
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
_muzzleVelocityShift = [_ammo, _temperature] call cse_ab_ballistics_fnc_ammo_temperature_muzzle_velocity;
if (_muzzleVelocityShift != 0) then {
_bulletVelocity = velocity _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity)));
_bullet setVelocity _bulletVelocity;
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
};
};
_bulletTraceVisible = false;
if (cse_AB_BulletTraceEnabled && currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then {
_opticsName = (primaryWeaponItems player) select 2;
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
_bulletTraceVisible = (_opticType == 2 || currentWeapon player in ["Binocular", "Rangefinder", "Laserdesignator"]) && cameraView == "GUNNER";
};
if (cse_AB_MilTurretsEnabled) then {
[_bullet, _unit] call cse_ab_ballistics_fnc_apply_turret_adjustments;
};
_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_caliber");
_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletLength");
_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletMass");
_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_barrelTwist");
_stabilityFactor = 1.5;
if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
_barometricPressure = 1013.25 * exp(-(cse_AB_Altitude + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast;
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call cse_ab_ballistics_fnc_calculate_stability_factor;
};
_twistDirection = 1;
if (isNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection")) then {
_twistDirection = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection");
if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then {
_twistDirection = 1;
};
};
_transonicStabilityCoef = 0.5;
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef")) then {
_transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef");
};
_dragModel = 1;
_ballisticCoefficients = [];
_velocityBoundaries = [];
_atmosphereModel = "ICAO";
if (cse_AB_AdvancedAirDragEnabled) then {
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel")) then {
_dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel");
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
_dragModel = 1;
};
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients")) then {
_ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients");
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries")) then {
_velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries");
};
if (isText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere")) then {
_atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere");
};
};
_index = count cse_AB_bulletDatabase;
if (count cse_AB_bulletDatabaseFreeIndices > 0) then {
_index = cse_AB_bulletDatabaseFreeIndices select 0;
cse_AB_bulletDatabaseFreeIndices = cse_AB_bulletDatabaseFreeIndices - [_index];
};
cse_AB_bulletDatabase set[_index, [_bullet, _caliber, _airFriction, _muzzleVelocity, _stabilityFactor, _transonicStabilityCoef, _twistDirection, _unit, _bulletTraceVisible, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _index]];
cse_AB_bulletDatabaseStartTime set[_index, time];
cse_AB_bulletDatabaseSpeed set[_index, 0];
cse_AB_bulletDatabaseFrames set[_index, 1];
cse_AB_bulletDatabaseLastFrame set[_index, time];
cse_AB_bulletDatabaseHDeflect set[_index, 0];
cse_AB_bulletDatabaseSpinDrift set[_index, 0];
if ((cse_AB_bulletDatabaseOccupiedIndices pushBack _index) == 0) then {
["AdvancedBallistics", "onEachFrame", {
private ["_bulletDatabaseEntry", "_bullet", "_caliber", "_muzzleVelocity", "_frames", "_speed", "_airFriction", "_airFrictionRef", "_dragModel", "_atmosphereModel", "_ballisticCoefficient", "_ballisticCoefficients", "_velocityBoundaries", "_airDensity", "_stabilityFactor", "_transonicStabilityCoef", "_twistDirection", "_unit", "_bulletTraceVisible", "_index", "_temperature", "_humidity", "_deltaT", "_TOF", "_bulletPosition", "_bulletVelocity", "_bulletSpeed", "_trueVelocity", "_trueSpeed", "_bulletSpeedAvg", "_wind", "_drag", "_dragRef", "_vect", "_accel", "_accelRef", "_centripetalAccel", "_pressure", "_pressureDeviation", "_windSourceObstacle", "_windSourceTerrain", "_height", "_roughnessLength"];
{
_bullet = (cse_AB_bulletDatabase select _x) select 0;
_index = (cse_AB_bulletDatabase select _x) select 13;
if (!alive _bullet) then {
cse_AB_bulletDatabaseOccupiedIndices = cse_AB_bulletDatabaseOccupiedIndices - [_index];
cse_AB_bulletDatabaseFreeIndices pushBack _index;
};
true
} count cse_AB_bulletDatabaseOccupiedIndices;
if (count cse_AB_bulletDatabaseOccupiedIndices == 0) exitWith {
cse_AB_bulletDatabase = [];
cse_AB_bulletDatabaseStartTime = [];
cse_AB_bulletDatabaseSpeed = [];
cse_AB_bulletDatabaseFrames = [];
cse_AB_bulletDatabaseLastFrame = [];
cse_AB_bulletDatabaseHDeflect = [];
cse_AB_bulletDatabaseSpinDrift = [];
cse_AB_bulletDatabaseOccupiedIndices = [];
cse_AB_bulletDatabaseFreeIndices = [];
["AdvancedBallistics", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
{
_bulletDatabaseEntry = (cse_AB_bulletDatabase select _x);
_bullet = _bulletDatabaseEntry select 0;
_caliber = _bulletDatabaseEntry select 1;
_airFriction = _bulletDatabaseEntry select 2;
_muzzleVelocity = _bulletDatabaseEntry select 3;
_stabilityFactor = _bulletDatabaseEntry select 4;
_transonicStabilityCoef = _bulletDatabaseEntry select 5;
_twistDirection = _bulletDatabaseEntry select 6;
_unit = _bulletDatabaseEntry select 7;
_bulletTraceVisible = _bulletDatabaseEntry select 8;
_ballisticCoefficients = _bulletDatabaseEntry select 9;
_velocityBoundaries = _bulletDatabaseEntry select 10;
_atmosphereModel = _bulletDatabaseEntry select 11;
_dragModel = _bulletDatabaseEntry select 12;
_index = _bulletDatabaseEntry select 13;
_TOF = time - (cse_AB_bulletDatabaseStartTime select _index);
_bulletVelocity = velocity _bullet;
_bulletPosition = getPosASL _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
_bulletDir = (_bulletVelocity select 0) atan2 (_bulletVelocity select 1);
_speed = (cse_AB_bulletDatabaseSpeed select _index);
cse_AB_bulletDatabaseSpeed set[_index, _speed + _bulletSpeed];
_frames = (cse_AB_bulletDatabaseFrames select _index);
cse_AB_bulletDatabaseFrames set[_index, _frames + 1];
_bulletSpeedAvg = (_speed / _frames);
if ((cse_AB_Precision < 2) || {_frames % cse_AB_Precision == _index % cse_AB_Precision}) then {
_deltaT = time - (cse_AB_bulletDatabaseLastFrame select _index);
cse_AB_bulletDatabaseLastFrame set[_index, time];
_trueVelocity = _bulletVelocity;
_trueSpeed = _bulletSpeed;
_wind = [0, 0, 0];
if (cse_AB_WindEnabled && (vectorMagnitude wind) > 0) then {
_windSourceObstacle = _bulletPosition vectorDiff ((vectorNormalized wind) vectorMultiply 10);
_windSourceTerrain = _bulletPosition vectorDiff ((vectorNormalized wind) vectorMultiply 100);
if (!(lineIntersects [_bulletPosition, _windSourceObstacle]) && !(terrainIntersectASL [_bulletPosition, _windSourceTerrain])) then {
_wind = wind;
_height = ASLToATL(_bulletPosition) select 2;
_height = 0 max _height min 20;
if (_height < 20) then {
_roughnessLength = _bulletPosition call cse_ab_ballistics_fnc_calculate_roughness_length;
_wind = _wind vectorMultiply (ln(_height / _roughnessLength) / ln(20 / _roughnessLength));
};
_trueVelocity = _bulletVelocity vectorDiff _wind;
_trueSpeed = vectorMagnitude _trueVelocity;
};
};
_airFrictionRef = _airFriction;
if (cse_AB_AdvancedAirDragEnabled && (count _ballisticCoefficients) == (count _velocityBoundaries) + 1) then {
_dragRef = _deltaT * _airFrictionRef * _bulletSpeed * _bulletSpeed;
_accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef);
_bulletVelocity = _bulletVelocity vectorDiff _accelRef;
_ballisticCoefficient = (_ballisticCoefficients select 0);
for "_i" from (count _velocityBoundaries) - 1 to 0 step -1 do {
if (_bulletSpeed < (_velocityBoundaries select _i)) exitWith {
_ballisticCoefficient = (_ballisticCoefficients select (_i + 1));
};
};
if (cse_AB_AtmosphericDensitySimulationEnabled) then {
_pressure = 1013.25 * exp(-(cse_AB_Altitude + (_bulletPosition select 2)) / 7990) - 10 * overcast;
_temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2);
_humidity = cse_AB_Humidity;
if (cse_AB_Humidity < 1 && fog > 0) then {
private ["_fogValue", "_fogDecay", "_fogBase"];
_fogValue = fogParams select 0;
_fogDecay = fogParams select 1;
_fogBase = fogParams select 2;
_fogDensity = 1 - 0.05 * (_fogDecay / _fogValue * (_height - _fogBase))^2;
if (_fogDensity > 0) then {
_humidity = 1;
} else {
_humidity = cse_AB_Humidity + (1 - cse_AB_Humidity) * (0 max (1 + _fogDensity));
};
};
_airDensity = STD_AIR_DENSITY_ICAO;
if (_humidity > 0) then {
private ["_pSat", "_vaporPressure", "_partialPressure"];
// Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm
_pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3));
_vaporPressure = _humidity * _pSat;
_partialPressure = (_pressure * 100)- _vaporPressure;
_airDensity = (_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature));
} else {
_airDensity = (_pressure * 100) / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature));
};
if (_atmosphereModel == "ICAO") then {
_ballisticCoefficient = (STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient;
} else {
_ballisticCoefficient = (STD_AIR_DENSITY_ASM / _airDensity) * _ballisticCoefficient;
};
};
_drag = _deltaT * ([_dragModel, _ballisticCoefficient, _trueSpeed] call cse_ab_ballistics_fnc_calculate_retardation);
_accel = (vectorNormalized _trueVelocity) vectorMultiply (_drag);
_bulletVelocity = _bulletVelocity vectorDiff _accel;
} else {
if (cse_AB_AtmosphericDensitySimulationEnabled) then {
_pressureDeviation = 1013.25 * exp(-(cse_AB_Altitude + (_bulletPosition select 2)) / 7990) - 1013.25 - 10 * overcast;
_temperature = GET_TEMPERATURE_AT_HEIGHT(_bulletPosition select 2);
_humidity = cse_AB_Humidity;
if (cse_AB_Humidity < 1 && fog > 0) then {
private ["_fogValue", "_fogDecay", "_fogBase"];
_fogValue = fogParams select 0;
_fogDecay = fogParams select 1;
_fogBase = fogParams select 2;
_fogDensity = 1 - 0.05 * (_fogDecay / _fogValue * (_height - _fogBase))^2;
if (_fogDensity > 0) then {
_humidity = 1;
} else {
_humidity = cse_AB_Humidity + (1 - cse_AB_Humidity) * (0 max (1 + _fogDensity));
};
};
_airFriction = _airFriction + ((_temperature - 15) * 0.0000015 + _humidity * 0.0000040 + _pressureDeviation * -0.0000009);
};
if (_airFriction != _airFrictionRef || vectorMagnitude _wind > 0) then {
_dragRef = _deltaT * _airFrictionRef * _bulletSpeed * _bulletSpeed;
_accelRef = (vectorNormalized _bulletVelocity) vectorMultiply (_dragRef);
_bulletVelocity = _bulletVelocity vectorDiff _accelRef;
_drag = _deltaT * _airFriction * _trueSpeed * _trueSpeed;
_accel = (vectorNormalized _trueVelocity) vectorMultiply (_drag);
_bulletVelocity = _bulletVelocity vectorAdd _accel;
};
};
if (cse_AB_CoriolisEnabled && _bulletSpeedAvg > 0) then {
_horizontalDeflection = 0.0000729 * (_unit distanceSqr _bullet) * sin(cse_AB_Latitude) / _bulletSpeedAvg;
_horizontalDeflectionPartial = _horizontalDeflection - (cse_AB_bulletDatabaseHDeflect select _index);
cse_AB_bulletDatabaseHDeflect set[_index, _horizontalDeflection];
_vect = [sin(_bulletDir + 90) * _horizontalDeflectionPartial, cos(_bulletDir + 90) * _horizontalDeflectionPartial, 0];
_bulletPosition = _bulletPosition vectorAdd _vect;
};
if (cse_AB_EoetvoesEnabled) then {
_centripetalAccel = 2 * 0.0000729 * (_muzzleVelocity / -32.2) * cos(cse_AB_Latitude) * sin(_bulletDir);
_accel = [0, 0, -(_centripetalAccel * _deltaT)];
_bulletVelocity = _bulletVelocity vectorAdd _accel;
};
if (cse_AB_SpinDriftEnabled) then {
_spinDrift = _twistDirection * 0.0254 * 1.25 * (_stabilityFactor + 1.2) * _TOF ^ 1.83;
_spinDriftPartial = _spinDrift - (cse_AB_bulletDatabaseSpinDrift select _index);
cse_AB_bulletDatabaseSpinDrift set[_index, _spinDrift];
_vect = [sin(_bulletDir + 90) * _spinDriftPartial, cos(_bulletDir + 90) * _spinDriftPartial, 0];
_bulletPosition = _bulletPosition vectorAdd _vect;
};
};
if (cse_AB_TransonicRegionEnabled && _transonicStabilityCoef < 1) then {
if (_bulletSpeed < 345 && _bulletSpeedAvg > 340 && _bulletSpeed > 335) then {
_accel = [(random 0.8) - 0.4, (random 0.8) - 0.4, (random 0.8) - 0.4];
_accel = _accel vectorMultiply (1 - _transonicStabilityCoef);
_bulletVelocity = _bulletVelocity vectorAdd _accel;
};
};
if (_bulletTraceVisible && _bulletSpeed > 600 && _bullet distanceSqr _unit > 400) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""];
};
_bullet setVelocity _bulletVelocity;
_bullet setPosASL _bulletPosition;
true
} count cse_AB_bulletDatabaseOccupiedIndices;
}] call BIS_fnc_addStackedEventHandler;
};

View File

@ -0,0 +1,171 @@
#include "defines.h"
private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_bulletTranslation", "_airFriction", "_dragModel", "_velocityBoundaryData", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_bulletWeight", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_cse_AB_Elevation", "_cse_AB_Windage", "_ID"];
_unit = _this select 0;
_weapon = _this select 1;
_mode = _this select 3;
_ammo = _this select 4;
_bullet = _this select 5;
_magazine = _this select 6;
if (!isClass (configFile >> 'CfgPatches' >> 'CBA_main')) then {
_bullet = _this select 6;
_magazine = _this select 5;
};
if (isDedicated) exitWith {};
if (!alive _bullet) exitWith {};
if (!(isPlayer _unit)) exitWith {};
if (underwater _unit) exitWith {};
if (!(_ammo isKindOf "BulletBase")) exitWith {};
if (_unit distanceSqr player > 9000000) exitWith {};
if (cse_AB_OnlyActiveForLocalPlayer && !(local _unit)) exitWith {};
if (cse_AB_OnlyActiveForPlayerGroup && (group _unit != group player)) exitWith {};
if (!cse_AB_VehicleGunnerEnabled && !(_unit isKindOf "Man")) exitWith {};
if (cse_AB_DisabledInFullAutoMode && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) exitWith {};
if (!isServer && !((gunner _unit) getVariable ["cse_enabled_AdvancedBallistics", false])) exitWith {};
_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction");
_muzzleVelocity = getNumber(configFile >> "cfgMagazines" >> _magazine >> "initSpeed");
_muzzleAccessory = (primaryWeaponItems _unit) select 0;
if (_muzzleAccessory != "" && isNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed")) then {
_initSpeedCoef = getNumber(configFile >> "cfgWeapons" >> _muzzleAccessory >> "ItemInfo" >> "MagazineCoef" >> "initSpeed");
_muzzleVelocity = _muzzleVelocity * _initSpeedCoef;
};
if (cse_AB_BarrelLengthInfluenceEnabled) then {
_muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call cse_ab_ballistics_fnc_barrel_length_muzzle_velocity;
if (_muzzleVelocityShift != 0) then {
_bulletVelocity = velocity _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity)));
_bullet setVelocity _bulletVelocity;
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
};
};
if (cse_AB_AmmoTemperatureEnabled) then {
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
_muzzleVelocityShift = [_ammo, _temperature] call cse_ab_ballistics_fnc_ammo_temperature_muzzle_velocity;
if (_muzzleVelocityShift != 0) then {
_bulletVelocity = velocity _bullet;
_bulletSpeed = vectorMagnitude _bulletVelocity;
_bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift * (_bulletSpeed / _muzzleVelocity)));
_bullet setVelocity _bulletVelocity;
_muzzleVelocity = _muzzleVelocity + _muzzleVelocityShift;
};
};
_opticsName = "";
_opticType = 0;
if (currentWeapon player == primaryWeapon player && count primaryWeaponItems player > 2) then {
_opticsName = (primaryWeaponItems player) select 2;
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
};
_bulletTraceVisible = (_opticType == 2 || currentWeapon player in ["Binocular", "Rangefinder", "Laserdesignator"]) && cameraView == "GUNNER";
if (cse_AB_MilTurretsEnabled) then {
[_bullet, _unit] call cse_ab_ballistics_fnc_apply_turret_adjustments;
};
_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_caliber");
_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletLength");
_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_bulletMass");
_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_barrelTwist");
_stabilityFactor = 1.5;
if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then {
_temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2);
_barometricPressure = 1013.25 * exp(-(cse_AB_Altitude + ((getPosASL _bullet) select 2)) / 7990) - 10 * overcast;
_stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call cse_ab_ballistics_fnc_calculate_stability_factor;
};
_twistDirection = 1;
if (isNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection")) then {
_twistDirection = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_twistDirection");
if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then {
_twistDirection = 1;
};
};
_transonicStabilityCoef = 0.5;
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef")) then {
_transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_transonicStabilityCoef");
};
_dragModel = 1;
_ballisticCoefficients = [];
_velocityBoundaries = [];
_atmosphereModel = "ICAO";
if (cse_AB_AdvancedAirDragEnabled) then {
if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel")) then {
_dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "AB_dragModel");
if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then {
_dragModel = 1;
};
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients")) then {
_ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ballisticCoefficients");
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries")) then {
_velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_velocityBoundaries");
};
if (isText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere")) then {
_atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "AB_standardAtmosphere");
};
};
_index = count cse_AB_bulletDatabase;
if (count cse_AB_bulletDatabaseFreeIndices > 0) then {
_index = cse_AB_bulletDatabaseFreeIndices select 0;
cse_AB_bulletDatabaseFreeIndices = cse_AB_bulletDatabaseFreeIndices - [_index];
};
"AdvancedBallistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", _index, _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, cse_AB_Latitude, cse_AB_Temperature, cse_AB_Altitude, cse_AB_Humidity, overcast, floor(time), time - floor(time)];
cse_AB_bulletDatabase set[_index, [_bullet, _caliber, _bulletTraceVisible, _index]];
if ((cse_AB_bulletDatabaseOccupiedIndices pushBack _index) == 0) then {
["AdvancedBallistics", "onEachFrame", {
private ["_bulletDatabaseEntry", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition", "_bulletVelocityShift", "_bulletPositionShift"];
{
_bulletDatabaseEntry = (cse_AB_bulletDatabase select _x);
_bullet = _bulletDatabaseEntry select 0;
_index = _bulletDatabaseEntry select 3;
if (!alive _bullet) then {
cse_AB_bulletDatabaseOccupiedIndices = cse_AB_bulletDatabaseOccupiedIndices - [_index];
cse_AB_bulletDatabaseFreeIndices pushBack _index;
};
true
} count cse_AB_bulletDatabaseOccupiedIndices;
if (count cse_AB_bulletDatabaseOccupiedIndices == 0) exitWith {
cse_AB_bulletDatabase = [];
cse_AB_bulletDatabaseOccupiedIndices = [];
cse_AB_bulletDatabaseFreeIndices = [];
["AdvancedBallistics", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
};
{
_bulletDatabaseEntry = (cse_AB_bulletDatabase select _x);
_bullet = _bulletDatabaseEntry select 0;
_caliber = _bulletDatabaseEntry select 1;
_bulletTraceVisible = _bulletDatabaseEntry select 2;
_index = _bulletDatabaseEntry select 3;
_bulletVelocity = velocity _bullet;
_bulletPosition = getPosASL _bullet;
if (_bulletTraceVisible && vectorMagnitude _bulletVelocity > 600) then {
drop ["\A3\data_f\ParticleEffects\Universal\Refract","","Billboard",1,0.1,getPos _bullet,[0,0,0],0,1.275,1,0,[0.4*_caliber,0.2*_caliber],[[0,0,0,0.6],[0,0,0,0.4]],[1,0],0,0,"","",""];
};
call compile ("AdvancedBallistics" callExtension format["simulate:%1:%2:%3:%4:%5:%6:%7", _index, _bulletVelocity, _bulletPosition, wind, ASLToATL(_bulletPosition) select 2, floor(time), time - floor(time)]);
true
} count cse_AB_bulletDatabaseOccupiedIndices;
}] call BIS_fnc_addStackedEventHandler;
};

View File

@ -0,0 +1,38 @@
/**
* fn_ammo_temperature_muzzle_velocity.sqf
* @Descr: ?
* @Author: Ruthberg
*
* @Arguments: [Ammo Class Name, Temperature in C]
* @Return: [Muzzle Velocity Shift in m/s]
* @PublicAPI: true
*/
#include "defines.h"
private ["_ammo", "_temperature", "_muzzleVelocityTable", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"];
_ammo = _this select 0;
_temperature = _this select 1;
_muzzleVelocityTable = [];
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ammoTempMuzzleVelocityShifts")) then {
_muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_ammoTempMuzzleVelocityShifts");
};
if (count _muzzleVelocityTable != 11) exitWith { 0 };
_temperatureIndexA = floor((_temperature + 15) / 5);
_temperatureIndexA = 0 max _temperatureIndexA;
_temperatureIndexA = _temperatureIndexA min 10;
_temperatureIndexB = ceil((_temperature + 15) / 5);
_temperatureIndexB = 0 max _temperatureIndexB;
_temperatureIndexB = _temperatureIndexB min 10;
_temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5);
_muzzleVelocityShift = (_muzzleVelocityTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityTable select _temperatureIndexB) * _temperatureRatio;
_muzzleVelocityShift

View File

@ -0,0 +1,37 @@
#include "defines.h"
private ["_bullet", "_unit", "_opticsName", "_opticType", "_windage", "_elevation", "_zero", "_bulletVelocity", "_dir", "_elev", "_mag3D", "_mag2D"];
_bullet = _this select 0;
_unit = _this select 1;
_opticsName = "";
_opticType = 0;
if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then {
_opticsName = (primaryWeaponItems _unit) select 2;
_opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType");
};
if (_opticType == 2) then {
_windage = _unit getVariable [format["cse_AB_Windage:%1", _opticsName], 0];
_elevation = _unit getVariable [format["cse_AB_Elevation:%1", _opticsName], 0];
_zero = _unit getVariable [format["cse_AB_Zero:%1", _opticsName], 0];
_elevation = _elevation + _zero;
if (_windage != 0 || _elevation != 0) then {
_windage = _windage * 3.47 / 60;
_elevation = _elevation * 3.47 / 60;
_bulletVelocity = (velocity _bullet);
_mag3D = vectorMagnitude _bulletVelocity;
_dir = (_bulletVelocity select 0) atan2 (_bulletVelocity select 1);
_elev = asin((_bulletVelocity select 2) / _mag3D);
_dir = _dir + _windage;
_elev = _elev + _elevation;
_mag2D = _mag3D * cos(_elev);
_bullet setVelocity [_mag2D * sin(_dir), _mag2D * cos(_dir), _mag3D * sin(_elev)];
};
};

View File

@ -0,0 +1,61 @@
/**
* fn_barrel_length_muzzle_velocity.sqf
* @Descr: ?
* @Author: Ruthberg
*
* @Arguments: [Ammo Class Name, Weapon Class Name, Muzzle Velocity in m/s]
* @Return: [Muzzle Velocity in m/s]
* @PublicAPI: true
*/
#include "defines.h"
private ["_ammo", "_weapon", "_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"];
_ammo = _this select 0;
_weapon = _this select 1;
_muzzleVelocity = _this select 2;
_barrelLength = getNumber(configFile >> "cfgWeapons" >> _weapon >> "AB_barrelLength");
if (_barrelLength == 0) exitWith { 0 };
_muzzleVelocityTable = [];
_barrelLengthTable = [];
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_muzzleVelocities")) then {
_muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_muzzleVelocities");
};
if (isArray(configFile >> "cfgAmmo" >> _ammo >> "AB_barrelLengths")) then {
_barrelLengthTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "AB_barrelLengths");
};
if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 };
if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 };
if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity };
_lowerIndex = 0;
_upperIndex = (count _barrelLengthTable) - 1;
if (_barrelLength <= (_barrelLengthTable select _lowerIndex)) exitWith { (_muzzleVelocityTable select _lowerIndex) - _muzzleVelocity };
if (_barrelLength >= (_barrelLengthTable select _upperIndex)) exitWith { (_muzzleVelocityTable select _upperIndex) - _muzzleVelocity };
for "_i" from 0 to (count _barrelLengthTable) - 1 do {
if (_barrelLength >= _barrelLengthTable select _i) then {
_lowerIndex = _i;
};
};
for "_i" from (count _barrelLengthTable) - 1 to 0 step -1 do {
if (_barrelLength <= _barrelLengthTable select _i) then {
_upperIndex = _i;
};
};
_barrelLengthRatio = 0;
if ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex) > 0) then {
_barrelLengthRatio = ((_barrelLengthTable select _upperIndex) - _barrelLength) / ((_barrelLengthTable select _upperIndex) - (_barrelLengthTable select _lowerIndex));
};
_muzzleVelocityNew = (_muzzleVelocityTable select _lowerIndex) + ((_muzzleVelocityTable select _upperIndex) - (_muzzleVelocityTable select _lowerIndex)) * (1 - _barrelLengthRatio);
_muzzleVelocityNew - _muzzleVelocity

View File

@ -0,0 +1,31 @@
/**
* fn_calculate_air_density.sqf
* @Descr: Calculates air density based on atmospheric pressure, temperature and rel.humidity
* @Author: Ruthberg
*
* @Arguments: [Temperature in C, Pressure in hPa, Relative Humidity as ratio 0.0-1.0]
* @Return: [Air Density in kg/m^3]
* @PublicAPI: true
*/
#include "defines.h"
private ["_temperature", "_pressure", "_relativeHumidity"];
_temperature = _this select 0; // in C
_pressure = _this select 1; // in hPa
_relativeHumidity = _this select 2; // as ratio 0-1
_pressure = _pressure * 100;
if (_relativeHumidity > 0) then {
private ["_pSat", "_vaporPressure", "_partialPressure"];
// Saturation vapor pressure calculated according to: http://wahiduddin.net/calc/density_algorithms.htm
_pSat = 6.1078 * 10 ^ ((7.5 * _temperature) / (_temperature + 237.3));
_vaporPressure = _relativeHumidity * _pSat;
_partialPressure = _pressure - _vaporPressure;
(_partialPressure * DRY_AIR_MOLAR_MASS + _vaporPressure * WATER_VAPOR_MOLAR_MASS) / (UNIVERSAL_GAS_CONSTANT * KELVIN(_temperature))
} else {
_pressure / (SPECIFIC_GAS_CONSTANT_DRY_AIR * KELVIN(_temperature))
};

View File

@ -0,0 +1,27 @@
/**
* fn_calculate_atmospheric_correction.sqf
* @Descr: ?
* @Author: Ruthberg
*
* @Arguments: [Ballistic Coefficient, Temperature in C, Pressure in hPa, Relative Humidity as ratio in 0.0-1.0, Atm.Model = "ICAO" || "ASM"]
* @Return: [Corrected Ballistic Coefficient]
* @PublicAPI: true
*/
#include "defines.h"
private ["_ballisticCoefficient", "_temperature", "_pressure", "_relativeHumidity", "_atmosphereModel", "_airDensity"];
_ballisticCoefficient = _this select 0;
_temperature = _this select 1; // in C
_pressure = _this select 2; // in hPa
_relativeHumidity = _this select 3; // as ratio 0-1
_atmosphereModel = _this select 4; // "ICAO" or "ASM"
_airDensity = [_temperature, _pressure, _relativeHumidity] call cse_ab_ballistics_fnc_calculate_air_density;
if (_atmosphereModel == "ICAO") then {
(STD_AIR_DENSITY_ICAO / _airDensity) * _ballisticCoefficient
} else {
(STD_AIR_DENSITY_ASM / _airDensity) * _ballisticCoefficient
};

View File

@ -0,0 +1,38 @@
/**
* fn_calculate_hellmann_exponent.sqf
* @Descr: Wikipedia: The Hellmann exponent depends upon the coastal location and the shape of the terrain on the ground, and the stability of the air.
* @Author: Ruthberg
*
* @Arguments: [position in ASL format]
* @Return: [Hellmann Exponent]
* @PublicAPI: true
*/
#include "defines.h"
private ["_hellmann_exponents", "_hellmann_index", "_windSource", "_nearObjects", "_isWater"];
// Source: https://en.wikipedia.org/wiki/Wind_gradient
// Entries 0-2 -> open water surface; Entries 3-5 -> flat open coast; Entries 6-8 -> human inhabited areas
// Sorting: open water surface/flat open coast/human inhabited areas & stable air/neutral air/unstable air
_hellmann_exponents = [0.27, 0.10, 0.06, 0.40, 0.16, 0.11, 0.60, 0.34, 0.27];
_hellmann_exponent = 0.14;
_windSource = _this vectorDiff ((vectorNormalized wind) vectorMultiply 25);
_nearObjects = count (_windSource nearObjects ["Building", 50]);
_isWater = surfaceIsWater _this;
_hellmann_index = 0 max floor(overcast * 3) min 2;
if (_nearObjects >= 5) then {
_hellmann_exponent = _hellmann_exponents select (_hellmann_index + 6);
};
if (_nearObjects < 5) then {
_hellmann_exponent = _hellmann_exponents select (_hellmann_index + 3);
};
if (_nearObjects == 0 && _isWater) then {
_hellmann_exponent = _hellmann_exponents select (_hellmann_index + 0);
};
_hellmann_exponent

View File

@ -0,0 +1,129 @@
#include "defines.h"
// Source: GNU Exterior Ballistics
private ["_dragModel", "_dragCoefficient", "_velocity", "_A", "_M", "_result"];
_dragModel = _this select 0;
_dragCoefficient = _this select 1;
_velocity = (_this select 2) * 3.2808399;
_A = -1;
_M = -1;
_result = 0;
switch _dragModel do {
case 1:
{
switch true do {
case (_velocity > 4230) : { _A = 0.0001477404177730177; _M = 1.9565; };
case (_velocity > 3680) : { _A = 0.0001920339268755614; _M = 1.925 ; };
case (_velocity > 3450) : { _A = 0.0002894751026819746; _M = 1.875 ; };
case (_velocity > 3295) : { _A = 0.0004349905111115636; _M = 1.825 ; };
case (_velocity > 3130) : { _A = 0.0006520421871892662; _M = 1.775 ; };
case (_velocity > 2960) : { _A = 0.0009748073694078696; _M = 1.725 ; };
case (_velocity > 2830) : { _A = 0.001453721560187286; _M = 1.675 ; };
case (_velocity > 2680) : { _A = 0.002162887202930376; _M = 1.625 ; };
case (_velocity > 2460) : { _A = 0.003209559783129881; _M = 1.575 ; };
case (_velocity > 2225) : { _A = 0.003904368218691249; _M = 1.55 ; };
case (_velocity > 2015) : { _A = 0.003222942271262336; _M = 1.575 ; };
case (_velocity > 1890) : { _A = 0.002203329542297809; _M = 1.625 ; };
case (_velocity > 1810) : { _A = 0.001511001028891904; _M = 1.675 ; };
case (_velocity > 1730) : { _A = 0.0008609957592468259; _M = 1.75 ; };
case (_velocity > 1595) : { _A = 0.0004086146797305117; _M = 1.85 ; };
case (_velocity > 1520) : { _A = 0.0001954473210037398; _M = 1.95 ; };
case (_velocity > 1420) : { _A = 0.00005431896266462351; _M = 2.125 ; };
case (_velocity > 1360) : { _A = 0.000008847742581674416; _M = 2.375 ; };
case (_velocity > 1315) : { _A = 0.000001456922328720298; _M = 2.625 ; };
case (_velocity > 1280) : { _A = 0.0000002419485191895565; _M = 2.875 ; };
case (_velocity > 1220) : { _A = 0.00000001657956321067612; _M = 3.25 ; };
case (_velocity > 1185) : { _A = 0.0000000004745469537157371; _M = 3.75 ; };
case (_velocity > 1150) : { _A = 0.00000000001379746590025088; _M = 4.25 ; };
case (_velocity > 1100) : { _A = 0.0000000000004070157961147882; _M = 4.75 ; };
case (_velocity > 1060) : { _A = 0.00000000000002938236954847331; _M = 5.125 ; };
case (_velocity > 1025) : { _A = 0.00000000000001228597370774746; _M = 5.25 ; };
case (_velocity > 980) : { _A = 0.00000000000002916938264100495; _M = 5.125 ; };
case (_velocity > 945) : { _A = 0.0000000000003855099424807451; _M = 4.75 ; };
case (_velocity > 905) : { _A = 0.00000000001185097045689854; _M = 4.25 ; };
case (_velocity > 860) : { _A = 0.0000000003566129470974951; _M = 3.75 ; };
case (_velocity > 810) : { _A = 0.00000001045513263966272; _M = 3.25 ; };
case (_velocity > 780) : { _A = 0.0000001291159200846216; _M = 2.875 ; };
case (_velocity > 750) : { _A = 0.0000006824429329105383; _M = 2.625 ; };
case (_velocity > 700) : { _A = 0.000003569169672385163; _M = 2.375 ; };
case (_velocity > 640) : { _A = 0.00001839015095899579; _M = 2.125 ; };
case (_velocity > 600) : { _A = 0.00005711174688734240; _M = 1.950 ; };
case (_velocity > 550) : { _A = 0.00009226557091973427; _M = 1.875 ; };
case (_velocity > 250) : { _A = 0.00009337991957131389; _M = 1.875 ; };
case (_velocity > 100) : { _A = 0.00007225247327590413; _M = 1.925 ; };
case (_velocity > 65) : { _A = 0.00005792684957074546; _M = 1.975 ; };
case (_velocity > 0) : { _A = 0.00005206214107320588; _M = 2.000 ; };
};
};
case 2:
{
switch true do {
case (_velocity > 1674) : { _A = 0.0079470052136733; _M = 1.36999902851493; };
case (_velocity > 1172) : { _A = 0.00100419763721974; _M = 1.65392237010294; };
case (_velocity > 1060) : { _A = 0.0000000000000000000000715571228255369; _M = 7.91913562392361; };
case (_velocity > 949) : { _A = 0.000000000139589807205091; _M = 3.81439537623717; };
case (_velocity > 670) : { _A = 0.000234364342818625; _M = 1.71869536324748; };
case (_velocity > 335) : { _A = 0.000177962438921838; _M = 1.76877550388679; };
case (_velocity > 0) : { _A = 0.0000518033561289704; _M = 1.98160270524632; };
};
};
case 5:
{
switch true do {
case (_velocity > 1730) : { _A = 0.00724854775171929; _M = 1.41538574492812; };
case (_velocity > 1228) : { _A = 0.0000350563361516117; _M = 2.13077307854948; };
case (_velocity > 1116) : { _A = 0.000000000000184029481181151; _M = 4.81927320350395; };
case (_velocity > 1004) : { _A = 0.000000000000000000000134713064017409; _M = 7.8100555281422 ; };
case (_velocity > 837) : { _A = 0.000000103965974081168; _M = 2.84204791809926; };
case (_velocity > 335) : { _A = 0.0001093015938698234; _M = 1.81096361579504; };
case (_velocity > 0) : { _A = 0.0000351963178524273; _M = 2.00477856801111; };
};
};
case 6:
{
switch true do {
case (_velocity > 3236) : { _A = 0.0455384883480781; _M = 1.15997674041274; };
case (_velocity > 2065) : { _A = 0.07167261849653769; _M = 1.10704436538885; };
case (_velocity > 1311) : { _A = 0.00166676386084348; _M = 1.60085100195952; };
case (_velocity > 1144) : { _A = 0.000000101482730119215; _M = 2.9569674731838 ; };
case (_velocity > 1004) : { _A = 0.00000000000000000431542773103552; _M = 6.34106317069757; };
case (_velocity > 670) : { _A = 0.0000204835650496866; _M = 2.11688446325998; };
case (_velocity > 0) : { _A = 0.0000750912466084823; _M = 1.92031057847052; };
};
};
case 7:
{
switch true do {
case (_velocity > 4200) : { _A = 0.00000000129081656775919; _M = 3.24121295355962; };
case (_velocity > 3000) : { _A = 0.0171422231434847; _M = 1.27907168025204; };
case (_velocity > 1470) : { _A = 0.00233355948302505; _M = 1.52693913274526; };
case (_velocity > 1260) : { _A = 0.000797592111627665; _M = 1.67688974440324; };
case (_velocity > 1110) : { _A = 0.00000000000571086414289273; _M = 4.3212826264889 ; };
case (_velocity > 960) : { _A = 0.0000000000000000302865108244904; _M = 5.99074203776707; };
case (_velocity > 670) : { _A = 0.00000752285155782535; _M = 2.1738019851075 ; };
case (_velocity > 540) : { _A = 0.0000131766281225189; _M = 2.08774690257991; };
case (_velocity > 0) : { _A = 0.0000134504843776525; _M = 2.08702306738884; };
};
};
case 8:
{
switch true do {
case (_velocity > 3571) : { _A = 0.0112263766252305; _M = 1.33207346655961; };
case (_velocity > 1841) : { _A = 0.0167252613732636; _M = 1.28662041261785; };
case (_velocity > 1120) : { _A = 0.00220172456619625; _M = 1.55636358091189; };
case (_velocity > 1088) : { _A = 0.00000000000000020538037167098; _M = 5.80410776994789; };
case (_velocity > 976) : { _A = 0.00000000000592182174254121; _M = 4.29275576134191; };
case (_velocity > 0) : { _A = 0.000043917343795117; _M = 1.99978116283334; };
};
};
};
if (_A != -1 && _M != -1 && _velocity > 0 && _velocity < 10000) then {
_result = _A * (_velocity ^ _M) / _dragCoefficient;
_result = _result / 3.2808399;
};
_result

View File

@ -0,0 +1,21 @@
#include "defines.h"
private ["_roughness_lengths", "_windSource", "_nearBuildings", "_isWater"];
// Source: http://es.ucsc.edu/~jnoble/wind/extrap/index.html
_roughness_lengths = [0.0002, 0.0005, 0.0024, 0.03, 0.055, 0.1, 0.2, 0.4, 0.8, 1.6];
_windSource = _this vectorDiff ((vectorNormalized wind) vectorMultiply 25);
_nearBuildings = count (_windSource nearObjects ["Building", 50]);
_isWater = surfaceIsWater _windSource;
if (_nearBuildings == 0 && _isWater) exitWith {
0.0005
};
if (_nearBuildings >= 10) exitWith {
1.6
};
_roughness_lengths select (2 + (_nearBuildings min 6))

View File

@ -0,0 +1,27 @@
#include "defines.h"
private ["_caliber", "_bulletLength", "_bulletMass", "_barrelTwist", "_muzzleVelocity", "_temperature", "_barometricPressure", "_l", "_t", "_stabilityFactor"];
_caliber = _this select 0;
_bulletLength = _this select 1;
_bulletMass = _this select 2;
_barrelTwist = _this select 3;
_muzzleVelocity = _this select 4;
_temperature = _this select 5;
_barometricPressure = _this select 6;
// Source: http://www.jbmballistics.com/ballistics/bibliography/articles/miller_stability_1.pdf
_t = _barrelTwist / _caliber;
_l = _bulletLength / _caliber;
_stabilityFactor = 30 * _bulletMass / (_t^2 * _caliber^3 * _l * (1 + _l^2));
_muzzleVelocity = _muzzleVelocity * 3.2808399;
if (_muzzleVelocity > 1120) then {
_stabilityFactor = _stabilityFactor * (_muzzleVelocity / 2800) ^ (1/3);
} else {
_stabilityFactor = _stabilityFactor * (_muzzleVelocity / 1120) ^ (1/3);
};
_stabilityFactor = _stabilityFactor * (_temperature + 273) / (15 + 273) * 1013.25 / _barometricPressure;
_stabilityFactor

View File

@ -0,0 +1,65 @@
#include "defines.h"
private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"];
fnc_polar2vect = {
private ["_mag2D"];
_mag2D = (_this select 0) * cos((_this select 2));
[_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))];
};
_windSpeed = vectorMagnitude wind;
_windDir = (wind select 0) atan2 (wind select 1);
// Wind gradient
if (_windSpeed > 0.05) then {
_height = (ASLToATL _this) select 2;
_height = 0 max _height min 20;
if (_height < 20) then {
_roughnessLength = _this call cse_ab_ballistics_fnc_calculate_roughness_length;
_windSpeed = _windSpeed * ln(_height / _roughnessLength) / ln(20 / _roughnessLength);
};
};
// Terrain effect on wind
if (_windSpeed > 0.05) then {
_newWindSpeed = 0;
{
_windSource = [100, _windDir + 180, _x] call fnc_polar2vect;
if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
_windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect;
if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
_windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect;
if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 9) * _windSpeed;
};
} forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
_windSpeed = _newWindSpeed;
};
// Obstacle effect on wind
if (_windSpeed > 0.05) then {
_newWindSpeed = 0;
{
_windSource = [20, _windDir + 180, _x] call fnc_polar2vect;
if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
_windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect;
if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
_windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect;
if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith {
_newWindSpeed = cos(_x * 2) * _windSpeed;
};
} forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45];
_windSpeed = _newWindSpeed;
};
_windSpeed = 0 max _windSpeed;
_windSpeed

View File

@ -0,0 +1,117 @@
#include "defines.h"
private ["_time", "_timeRatio", "_month", "_avgTemperature", "_pS1", "_pS2", "_cse_AB_Day_Temperature", "_cse_AB_Night_Temperature", "_cse_AB_Humidity"];
_cse_AB_Day_Temperature = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2];
_cse_AB_Night_Temperature = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2];
_cse_AB_Humidity = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82];
// Climate graphs
if (toLower worldName in ["chernarus", "bootcamp_acr", "woodland_acr", "utes"]) then {
// Source: http://www.iten-online.ch/klima/europa/tschechien/prag.htm
_cse_AB_Day_Temperature = [1, 3, 9, 14, 19, 23, 25, 24, 21, 13, 7, 2];
_cse_AB_Night_Temperature = [-4, -3, 0, 4, 9, 12, 14, 14, 10, 6, 2, -2];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Prague,Czech-Republic
_cse_AB_Humidity = [82, 80, 78, 70, 71, 72, 70, 73, 78, 80, 83, 82];
};
if (toLower worldName in ["altis", "stratis"]) then {
// Source: http://www.iten-online.ch/klima/europa/griechenland/limnos.htm
_cse_AB_Day_Temperature = [10, 10, 12, 16, 21, 26, 29, 28, 25, 20, 15, 11];
_cse_AB_Night_Temperature = [4, 4, 6, 8, 13, 17, 20, 20, 16, 12, 8, 6];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Limnos,Greece
_cse_AB_Humidity = [78, 77, 78, 74, 71, 60, 59, 61, 65, 72, 79, 80];
};
if (toLower worldName in ["takistan", "zargabad", "mountains_acr", "shapur_baf", "provinggrounds_pmc"]) then {
// Source: http://www.iten-online.ch/klima/asien/afghanistan/kabul.htm
_cse_AB_Day_Temperature = [4.5, 5.5, 12.5, 19.2, 24.4, 30.2, 32.1, 32, 28.5, 22.4, 15, 8.3];
_cse_AB_Night_Temperature = [-7.1, -5.7, 0.7, 6, 8.8, 12.4, 15.3, 14.3, 9.4, 3.9, -1.2, -4.7];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Kabul,Afghanistan
_cse_AB_Humidity = [68, 69, 62, 60, 49, 37, 38, 39, 40, 41, 56, 61];
};
if (toLower worldName in ["fallujah"]) then {
// Source: http://www.iten-online.ch/klima/asien/irak/bagdad.htm
_cse_AB_Day_Temperature = [16, 19, 23, 29, 36, 41, 43, 43, 40, 33, 24, 17];
_cse_AB_Night_Temperature = [4, 6, 10, 15, 20, 23, 25, 25, 21, 16, 10, 5];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Bagdad,Iraq
_cse_AB_Humidity = [69, 60, 55, 50, 36, 23, 21, 22, 29, 38, 58, 68];
};
if (toLower worldName in ["fata", "Abbottabad"]) then {
// Source: http://www.iten-online.ch/klima/asien/pakistan/zhob.htm
_cse_AB_Day_Temperature = [12.4, 15.8, 20.8, 26.9, 32.8, 37, 36.8, 35.9, 33.8, 28.2, 22.2, 16.2];
_cse_AB_Night_Temperature = [-0.6, 2.4, 7.4, 13.1, 18.2, 22.8, 23.8, 22.9, 19.2, 12, 5.6, 1.2];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Zhob,Pakistan
_cse_AB_Humidity = [50, 40, 42, 40, 30, 30, 50, 49, 40, 32, 38, 41];
};
if (worldName in ["sfp_wamako"]) then {
// Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm
_cse_AB_Day_Temperature = [33.4, 35, 38.4, 41.5, 41.4, 40, 35.6, 32.9, 35.8, 38.2, 36.4, 33.1];
_cse_AB_Night_Temperature = [14.9, 16.3, 20.4, 23.7, 25.8, 24.8, 23.1, 22, 22.6, 21.6, 18.6, 15.3];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Tahoua,Niger
_cse_AB_Humidity = [68, 60, 57, 50, 32, 22, 20, 21, 25, 38, 58, 69];
};
if (worldName in ["sfp_sturko"]) then {
// Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm
_cse_AB_Day_Temperature = [2.2, 2.4, 5.1, 10.2, 16.1, 20.1, 21.1, 20.9, 17.2, 12.7, 7.4, 3.9];
_cse_AB_Night_Temperature = [-2, -2.3, -0.7, 2.6, 7.1, 11.4, 13.1, 12.7, 10, 6.9, 3.1, -0.1];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,karlskrona,Sweden
_cse_AB_Humidity = [86, 85, 80, 72, 68, 69, 74, 77, 79, 81, 86, 88];
};
if (worldName in ["Bornholm"]) then {
// Source: http://www.iten-online.ch/klima/afrika/niger/tahoua.htm
_cse_AB_Day_Temperature = [1.9, 1.7, 3.8, 8.1, 14, 18.1, 19.6, 19.8, 16.2, 11.9, 7.3, 3.9];
_cse_AB_Night_Temperature = [-1.6, -2.1, -0.7, 1.7, 6.2, 10.7, 13, 13.1, 10.6, 7.2, 3.5, 0.1];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,allinge,Denmark
_cse_AB_Humidity = [85, 84, 80, 76, 69, 69, 76, 77, 79, 81, 86, 86];
};
if (worldName in ["Imrali"]) then {
// Source: http://www.iten-online.ch/klima/europa/tuerkei/bursa.htm
_cse_AB_Day_Temperature = [9.3, 10.7, 13.6, 18.8, 23.5, 28.2, 30.3, 30.2, 27, 21.4, 16.5, 11.8];
_cse_AB_Night_Temperature = [1.4, 2.4, 3.7, 7.1, 10.9, 14.3, 16.5, 16.3, 13, 9.5, 6, 3.8];
// Source: http://www.weather-and-climate.com/average-monthly-Humidity-perc,Bursa,Turkey
_cse_AB_Humidity = [78, 75, 70, 70, 71, 61, 58, 59, 63, 69, 77, 76];
};
while {true} do
{
_time = daytime;
_month = date select 1;
// Temperature
_timeRatio = abs(_time - 12) / 12;
cse_AB_Temperature = (_cse_AB_Day_Temperature select (_month - 1)) * (1 - _timeRatio) + (_cse_AB_Night_Temperature select (_month - 1)) * _timeRatio;
cse_AB_Temperature = cse_AB_Temperature + cse_AB_temperatureShift - cse_AB_badWeatherShift * overcast;
cse_AB_Temperature = round(cse_AB_Temperature * 10) / 10;
// Humidity
cse_AB_Humidity = (_cse_AB_Humidity select _month) / 100;
cse_AB_Humidity = cse_AB_Humidity + cse_AB_humidityShift;
if (rain > 0 && overcast > 0.7) then {
cse_AB_Humidity = 1;
} else {
_avgTemperature = ((_cse_AB_Day_Temperature select (_month - 1)) + (_cse_AB_Night_Temperature select (_month - 1))) / 2;
_pS1 = 6.112 * exp((17.62 * _avgTemperature) / (243.12 + _avgTemperature));
_PS2 = 6.112 * exp((17.62 * cse_AB_Temperature) / (243.12 + cse_AB_Temperature));
cse_AB_Humidity = cse_AB_Humidity * _PS1 / _PS2;
};
cse_AB_Humidity = 0 max cse_AB_Humidity min 1;
sleep 60;
};

View File

@ -0,0 +1,50 @@
#include "defines.h"
#define __dsp (uiNamespace getVariable "RscProtractor")
#define __ctrl1 (__dsp displayCtrl 132950)
#define __ctrl2 (__dsp displayCtrl 132951)
private ["_inclinationAngle", "_refPosition"];
if (cse_AB_Protractor) exitWith {
cse_AB_Protractor = false;
1 cutText ["", "PLAIN"];
true
};
if (weaponLowered player) exitWith { true };
if (vehicle player != player) exitWith { true };
if (currentWeapon player != primaryWeapon player) exitWith { true };
[] spawn {
2 cutText ["", "PLAIN"];
cse_AB_WindInfo = false;
0 cutText ["", "PLAIN"];
cse_AB_Protractor = true;
while {cse_AB_Protractor && !(weaponLowered player) && currentWeapon player == primaryWeapon player} do {
_refPosition = [SafeZoneX + 0.001, SafeZoneY + 0.001, 0.2, 0.2 * 4/3];
_inclinationAngle = asin((player weaponDirection currentWeapon player) select 2);
_inclinationAngle = -58 max _inclinationAngle min 58;
1 cutRsc ["RscProtractor", "PLAIN", 1, false];
__ctrl1 ctrlSetScale 0.75;
__ctrl1 ctrlCommit 0;
__ctrl1 ctrlSetText "cse\cse_sys_ballistics\advancedballistics\data\protractor.paa";
__ctrl1 ctrlSetTextColor [1, 1, 1, 1];
__ctrl2 ctrlSetScale 0.75;
__ctrl2 ctrlSetPosition [(_refPosition select 0), (_refPosition select 1) - 0.0012 * _inclinationAngle, (_refPosition select 2), (_refPosition select 3)];
__ctrl2 ctrlCommit 0;
__ctrl2 ctrlSetText "cse\cse_sys_ballistics\advancedballistics\data\protractor_marker.paa";
__ctrl2 ctrlSetTextColor [1, 1, 1, 1];
sleep 0.1;
};
cse_AB_Protractor = false;
1 cutText ["", "PLAIN"];
};
true

View File

@ -0,0 +1,64 @@
#include "defines.h"
#define __dsp (uiNamespace getVariable "RscWindIntuitive")
#define __ctrl (__dsp displayCtrl 132948)
private ["_windSpeed", "_windDir", "_playerDir", "_windIndex", "_windColor", "_newWindSpeed", "_windSource", "_height"];
if (cse_AB_WindInfo) exitWith {
cse_AB_WindInfo = false;
0 cutText ["", "PLAIN"];
true
};
if (underwater player) exitWith { true };
if (vehicle player != player) exitWith { true };
[] spawn {
2 cutText ["", "PLAIN"];
cse_AB_Protractor = false;
1 cutText ["", "PLAIN"];
cse_AB_WindInfo = true;
while {cse_AB_WindInfo && !(underwater player) && vehicle player == player} do {
_windIndex = 12;
_windColor = [1, 1, 1, 1];
_windSpeed = (eyePos player) call cse_ab_ballistics_fnc_calculate_wind_speed;
if (_windSpeed > 0.2) then {
_playerDir = getDir player;
_windDir = (wind select 0) atan2 (wind select 1);
_windIndex = round(((_playerDir - _windDir + 360) % 360) / 30);
_windIndex = _windIndex % 12;
};
// Color Codes from https://en.wikipedia.org/wiki/Beaufort_scale#Modern_scale
if (_windSpeed > 0.3) then { _windColor = [0.796, 1, 1, 1]; };
if (_windSpeed > 1.5) then { _windColor = [0.596, 0.996, 0.796, 1]; };
if (_windSpeed > 3.3) then { _windColor = [0.596, 0.996, 0.596, 1]; };
if (_windSpeed > 5.4) then { _windColor = [0.6, 0.996, 0.4, 1]; };
if (_windSpeed > 7.9) then { _windColor = [0.6, 0.996, 0.047, 1]; };
if (_windSpeed > 10.7) then { _windColor = [0.8, 0.996, 0.059, 1]; };
if (_windSpeed > 13.8) then { _windColor = [1, 0.996, 0.067, 1]; };
if (_windSpeed > 17.1) then { _windColor = [1, 0.796, 0.051, 1]; };
if (_windSpeed > 20.7) then { _windColor = [1, 0.596, 0.039, 1]; };
if (_windSpeed > 24.4) then { _windColor = [1, 0.404, 0.031, 1]; };
if (_windSpeed > 28.4) then { _windColor = [1, 0.22, 0.027, 1]; };
if (_windSpeed > 32.6) then { _windColor = [1, 0.078, 0.027, 1]; };
0 cutRsc ["RscWindIntuitive", "PLAIN", 1, false];
__ctrl ctrlSetScale 0.75;
__ctrl ctrlCommit 0;
__ctrl ctrlSetText format["cse\cse_sys_ballistics\advancedballistics\data\wind%1.paa", _windIndex];
__ctrl ctrlSetTextColor _windColor;
sleep 0.5;
};
cse_AB_WindInfo = false;
0 cutText ["", "PLAIN"];
};
true

Some files were not shown because too many files have changed in this diff Show More