Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Situational Awareness Cue #29

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@
} // function that will be executed once on mission start and every time the setting is changed.
] call CBA_Settings_fnc_init;

[
"Fat_Lurch_ShowSituationalAwarenessCue", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting.
"CHECKBOX", // setting type. CHECKBOX, EDITBOX, SLIDER, LIST or COLOR
"Show Situational Awareness Cue", // Pretty name shown inside the ingame settings menu. Can be stringtable entry.
"Turret Enhanced", // Pretty name of the category where the setting can be found. Can be stringtable entry.
TRUE, // data for this setting: [min, max, default, number of shown trailing decimals]
nil, // "_isGlobal" flag. Set this to true to always have this setting synchronized between all clients in multiplayer
{
//params ["_value"];
//setViewDistance _value;
} // function that will be executed once on mission start and every time the setting is changed.
] call CBA_Settings_fnc_init;

[
"Fat_Lurch_ShowTarget", // Internal setting name, should always contain a tag! This will be the global variable which takes the value of the setting.
"CHECKBOX", // setting type. CHECKBOX, EDITBOX, SLIDER, LIST or COLOR
Expand Down
26 changes: 26 additions & 0 deletions config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,32 @@ class Extended_Init_EventHandlers

class RscTitles
{
class SituationalAwarenessCue
{
idd=706;
fadein=0;
fadeout=0;
duration=0.1;
onLoad="uiNameSpace setVariable ['gui_saCue', (_this select 0) displayCtrl 653];";
class controls
{
class SituationalAwarenessCue
{
idc=707;
type=0;
style=2;
x="uiNamespace getVariable 'SituationalAwarenessCue_pos' select 0";
y="uiNamespace getVariable 'SituationalAwarenessCue_pos' select 1";
w=1;
h=1;
font="EtelkaNarrowMediumPro";
sizeEx=0.15;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
text=".";
};
};
};
class North
{
idd = 710;
Expand Down
46 changes: 39 additions & 7 deletions functions/North_Ind.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,52 @@ while{alive _unit} do

_posx = (radius * sin _Az)/(4/3);
_posy = ((radius * cos _Az)*(sin _El))-0.0325; //good solution if marker allowed in box


_newPosition = [_posx, _posy];

uiNamespace setVariable ["newPosition",_newPosition];


uiNamespace setVariable ["newPosition",_newPosition];



// Situational awareness cue
_R = (90 - abs(_turretEl)) / 90 * radius;
_offset = - 0.125;
_SituationalAwarenessCue_pos = [-_R * (sin -_turretAz), -_R * (cos -_turretAz) + _offset];
uiNamespace setVariable ["SituationalAwarenessCue_pos", _SituationalAwarenessCue_pos];

// symbol flash
_SituationalAwarenessCueVisibile = true;
if (hasPilotCamera vehicle player) then
{
getPilotCameraTarget vehicle player params ["_pilotCamTracking", "_pilotCamTargetPos", "_pilotCamTarget"];

if (_pilotCamTracking) then
{
_currentLOS = AGLToASL (screenToWorld [0.5, 0.5]);
_targetLOS = _pilotCamTargetPos;
if (_currentLOS distance _targetLOS > 20) then
{
_PAM_timer = 0;
if (!(isNil {uiNameSpace getVariable "PAM_flashingTimer"})) then
{
_PAM_timer = uiNameSpace getVariable "PAM_flashingTimer";
};
if (diag_tickTime > _PAM_timer + 0.5) then
{
_SituationalAwarenessCueVisibile = false;
};
if (diag_tickTime > _PAM_timer + 1) then
{
_PAM_timer = diag_tickTime;
};
uiNamespace setVariable ["PAM_flashingTimer", _PAM_timer];
};
};
};

if (missionnamespace getVariable "Fat_Lurch_ShowNorth") then {710 cutRsc ["North", "Plain", -1, false];}; //Enable/disable from CBA
if (missionnamespace getVariable "Fat_Lurch_ShowAz") then {709 cutRsc ["Az", "Plain", -1, false];}; //Enable/disable from CBA
if (missionnamespace getVariable "Fat_Lurch_ShowEl") then {708 cutRsc ["El", "Plain", -1, false];}; //Enable/disable from CBA

if ((missionnamespace getVariable "Fat_Lurch_ShowSituationalAwarenessCue") and _SituationalAwarenessCueVisibile) then {706 cutRsc ["SituationalAwarenessCue", "Plain", -1, false]};


uiNameSpace getVariable "myUI_LevelTitle" ctrlSetText(_target);
uiNameSpace getVariable "guiEl" ctrlSetText(format["%1",round(_turretEl)]);
Expand Down