Added cse_sys_cc source

This commit is contained in:
Thomas Kooi 2015-01-12 23:24:37 +01:00
parent ff88c74537
commit 2c276ecf50
135 changed files with 6841 additions and 0 deletions

View File

@ -0,0 +1,52 @@
/*
NAME: fnc_assignTrackersServer
USAGE: running serverside, assigning IDs to all newly found trackers
AUTHOR: Glowbal
ARGUMENTS: none
RETURN: void
*/
// SERVER SIDE ONLY
if !(isServer) exitwith{};
private ["_storedIDs","_newID","_availableClasses"];
_availableClasses = ["cse_m_tablet","cse_m_pda"];
waituntil {!isnil "CSE_CC_LOGIC_OBJECT_CC"};
_storedIDs = [];
{
_storedIDs set[count _storedIDs,[]];
}foreach _availableClasses;
_newID = "";
while {true} do {
{
private ["_unit","_IDCollection"];
_unit = _x;
if (alive _unit) then {
_IDCollection = 0;
{
_foundIt = (_x in ((backpackItems _unit) + (uniformItems _unit)+ (vestItems _unit) + (assignedItems _unit)));
if (_foundIt) exitwith {
_newID = format["%1_%2",_x,count(_storedIDs select _IDCollection)+1];
_check = CSE_CC_LOGIC_OBJECT_CC getvariable _newID;
if (isnil "_check") then {
(_storedIDs select _IDCollection) set [count((_storedIDs select _IDCollection)),_newID];
_trackerStatus = _unit getvariable ["cse_bft_info_cc",["Infantry"," ",true,false]];
CSE_CC_LOGIC_OBJECT_CC setvariable [_newID,_trackerStatus,true];
if (_x in (assignedItems _unit)) then {
_unit unassignItem _x;
};
[[_unit,_x,_newID], "cse_fnc_switchItem", owner _unit, false] spawn BIS_fnc_MP;
//waituntil {(!((_x in ((backpackItems _unit) + (uniformItems _unit)+ (vestItems _unit) + (assignedItems _unit)))) || (!alive _unit))};
};
};
_IDCollection = _IDCollection + 1;
}foreach _availableClasses;
//sleep 0.001;
sleep 1;
};
}foreach allUnits;
};

View File

@ -0,0 +1,25 @@
/*
fnc_assignTrackerInfo.sqf
Usage: Assigns tracker info for the BFT
Author: Glowbal
Arguments: array [logic (OBJECT)]
Returns: void
Affects: All localities
Executes: All Localities
*/
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (!isNull _logic) then {
_type = _logic getvariable ["type","Infantry"];
_callsign = _logic getvariable ["callSign",""];
_objects = synchronizedObjects _logic;
{
_x setvariable ["cse_bft_info_cc",[_type,_callsign,true,false]];
}foreach _objects;
};
true

View File

@ -0,0 +1,48 @@
/*
NAME: fnc_displayBFTSymbolOnPerson.sqf
USAGE: grabs BFT item and information from unit, then returns information
AUTHOR: Glowbal
ARGUMENTS: PERSON / UNIT.
RETURN: 2d ARRAY. Contains information about every tracker on unit.
*/
private ["_person","_trackers","_tracker","_newMarker","_filterLevel","_return"];
_person = _this select 0;
_return = [];
_trackers = [_person] call cse_fnc_getAllBFTItems_CC;
{
_trackerInfo = [_person] call cse_fnc_getTrackerInformation_CC;
if (_trackerInfo select 2) then {
_prefix = switch (([_x] call cse_fnc_getDeviceSide_CC)) do {
case WEST: {"b_"};
case EAST: {"o_"};
case independent: {"n_"};
default {"n_"};
};
_prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix;
_icon = switch (_trackerInfo select 0) do {
case "Infantry": {_prefix+"inf.paa"};
case "Motorized": {_prefix+"motor_inf.paa"};
case "Plane": {_prefix+"plane.paa"};
case "Helicopter": {_prefix+"air.paa"};
case "Armor": {_prefix+"armor.paa"};
case "Naval": {_prefix+"naval.paa"};
case "HQ": {_prefix+"hq.paa"};
case "Medical": {_prefix+"med.paa"};
case "Maintanance": {_prefix+"maint.paa"};
case "Artillery": {_prefix+"art.paa"};
case "Mortar": {_prefix+"mortar.paa"};
case "Service": {_prefix+"service.paa"};
case "Recon": {_prefix+"recon.paa"};
case "Mechanized": {_prefix+"mech_inf.paa"};
case "uav": {_prefix+"uav.paa"};
case "Installation": {_prefix+"installation.paa"};
default {_prefix+"unknown.paa"};
};
_return pushback [_icon,getPos _person, (_trackerInfo select 1),CSE_SIDE_WEST_COLOR,_x,_person,([_x] call cse_fnc_getDeviceSide_CC)];
};
}foreach _trackers;
_return

View File

@ -0,0 +1,118 @@
private ["_enableTracking","_toggleRoute","_toggleIntel","_return", "_iconType", "_callsign", "_person", "_trackerInfo"];
_return = [];
if (!isDedicated) then {
{
_person = _x;
_trackerInfo = [_person] call cse_fnc_getTrackerInformation_CC;
if (_trackerInfo select 2) then {
_positionOf = getPosASL _person;
_trackers = [_person] call cse_fnc_getAllBFTItems_CC;
{
_sideOfDevice = ([_x] call cse_fnc_getDeviceSide_CC);
_prefix = switch (_sideOfDevice) do {
case WEST: {"b_"};
case EAST: {"o_"};
case independent: {"n_"};
default {"n_"};
};
_prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix;
_icon = switch (_trackerInfo select 0) do {
case "Infantry": {_prefix+"inf.paa"};
case "Motorized": {_prefix+"motor_inf.paa"};
case "Plane": {_prefix+"plane.paa"};
case "Helicopter": {_prefix+"air.paa"};
case "Armor": {_prefix+"armor.paa"};
case "Naval": {_prefix+"naval.paa"};
case "HQ": {_prefix+"hq.paa"};
case "Medical": {_prefix+"med.paa"};
case "Maintanance": {_prefix+"maint.paa"};
case "Artillery": {_prefix+"art.paa"};
case "Mortar": {_prefix+"mortar.paa"};
case "Service": {_prefix+"service.paa"};
case "Recon": {_prefix+"recon.paa"};
case "Mechanized": {_prefix+"mech_inf.paa"};
case "uav": {_prefix+"uav.paa"};
case "Installation": {_prefix+"installation.paa"};
default {_prefix+"unknown.paa"};
};
_return pushback [_icon, _positionOf, (_trackerInfo select 1), CSE_SIDE_WEST_COLOR, _x, _person, _sideOfDevice];
}foreach _trackers;
};
}foreach allUnits;
{
_info = _x getvariable "cse_bft_info_cc";
if (!isnil "_info") then {
if (isEngineOn _x) then {
_prefix = switch (side _x) do {
case WEST: {"b_"};
case EAST: {"o_"};
case independent: {"n_"};
default {"n_"};
};
_prefix = "\A3\ui_f\data\map\markers\nato\" + _prefix;
_icon = switch (_info select 0) do {
case "Infantry": {_prefix+"inf.paa"};
case "Motorized": {_prefix+"motor_inf.paa"};
case "Plane": {_prefix+"plane.paa"};
case "Helicopter": {_prefix+"air.paa"};
case "Armor": {_prefix+"armor.paa"};
case "Naval": {_prefix+"naval.paa"};
case "HQ": {_prefix+"hq.paa"};
case "Medical": {_prefix+"med.paa"};
case "Maintanance": {_prefix+"maint.paa"};
case "Artillery": {_prefix+"art.paa"};
case "Mortar": {_prefix+"mortar.paa"};
case "Service": {_prefix+"service.paa"};
case "Recon": {_prefix+"recon.paa"};
case "Mechanized": {_prefix+"mech_inf.paa"};
case "uav": {_prefix+"uav.paa"};
case "Installation": {_prefix+"installation.paa"};
default {_prefix+"unknown.paa"};
};
_return pushback [_icon,getPosASL _x, _info select 1,CSE_SIDE_WEST_COLOR,"vehicle",_x, side _x];
};
} else {
if !(_x in allUnitsUav) then {
if (local _x) then {
if (CSE_AUTO_ASSIGN_CALLSIGNS_CC == 0 || CSE_AUTO_ASSIGN_CALLSIGNS_CC == 1) then {
_iconType = switch (true) do {
case (_x isKindOf "Car"): {"Motorized"};
case (_x isKindOf "Helicopter"): {"Helicopter"};
case (_x isKindOf "Air"): {"Plane"};
case (_x isKindOf "Armor"): {"Armor"};
case (_x isKindOf "Boat"): {"Naval"};
case (_x isKindOf "Artillery"): {"Artillery"};
default {"Unknown"};
};
_callsign = [_x] call cse_fnc_findTargetName_gui;
_x setvariable ["cse_bft_info_cc", [_iconType, _callsign, false, true], true];
};
};
};
};
}foreach vehicles;
if (CSE_AUTO_SHOW_UAV_TRACKERS_ON_BFT) then {
{
_info = _x getvariable "cse_bft_info_cc";
if (isnil "_info") then {
if (isEngineOn _x) then {
_prefix = switch (side _x) do {
case WEST: {"b_"};
case EAST: {"o_"};
case independent: {"n_"};
default {"n_"};
};
_return pushback [ "\A3\ui_f\data\map\markers\nato\" + _prefix + "uav.paa",getPosASL _x, [_x] call cse_fnc_findTargetName_gui,CSE_SIDE_WEST_COLOR,"uav",_x, side _x];
};
};
}foreach allUnitsUav;
};
};
_return

View File

@ -0,0 +1,54 @@
/**
* fn_displayBFT_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName", "_display"];
_deviceName = _this select 0;
if (isnil "CSE_CURRENT_SELECTED_FILTER_CC_APP_CC") then {
CSE_CURRENT_SELECTED_FILTER_CC_APP_CC = -1;
CSE_TOGGLE_ROUTE_LAYER_CC = true;
CSE_TOGGLE_INTEL_LAYER_CC = true;
CSE_TOGGLE_CALLSIGNS_CC = true;
CSE_SELECTED_ICON_CC = "";
};
if (isnil "CSE_INTEL_MARKER_COLLECTION_CC") then {
CSE_INTEL_MARKER_COLLECTION_CC = [];
};
if (isnil "CSE_ROUTE_MARKER_COLLECTION_CC") then {
CSE_ROUTE_MARKER_COLLECTION_CC = [];
};
if (isnil "CSE_TRACKER_ICONS") then {
CSE_TRACKER_ICONS = [];
};
/*
{
if (call (_X select 0)) then {
{
[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;
}foreach (_x select 1);
};
}foreach CSE_MARKER_COLLECTIONS_CC;
*/
disableSerialization;
_display = uiNamespace getvariable _deviceName;
(_display displayCtrl 10) ctrlAddEventHandler ["draw","
{[_x,(_this select 0)] call cse_fnc_drawBFTIcons_CC;}foreach CSE_TRACKER_ICONS;
if (CSE_TOGGLE_INTEL_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_INTEL_MARKER_COLLECTION_CC;};
if (CSE_TOGGLE_ROUTE_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_ROUTE_MARKER_COLLECTION_CC;};
"];
(_display displayCtrl 10) ctrlAddEventHandler ["MouseButtonUp",'if ((_this select 1) == 0) then {[[_this select 2, _this select 3]] call cse_fnc_clickedOnMap_CC;};'];
(_display displayCtrl 10) ctrlAddEventHandler ["MouseMoving",'CSE_MOUSE_RELATIVE_POSITION = [_this select 1, _this select 2];'];
(_display displayCtrl 10) ctrlMapAnimAdd [0, 0.05, player];
ctrlMapAnimCommit (_display displayCtrl 10);

View File

@ -0,0 +1,30 @@
/**
* fn_drawBFTIcons_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_trackerInfo", "_icon", "_pos", "_text", "_unit", "_side", "_color", "_map"];
_trackerInfo = _this select 0;
_map = _this select 1;
_icon = _trackerInfo select 0;
_pos = _trackerInfo select 1;
_text = _trackerInfo select 2;
_unit = _trackerInfo select 5;
_side = _trackerInfo select 6;
if (([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC) == _side || ([] call cse_fnc_getCurrentDeviceName_CC) == "") then {
if (!CSE_TOGGLE_CALLSIGNS_CC) then {
_text = "";
};
_color = _trackerInfo select 3;
if (_unit == player) then {
_color = [0.78,0.8,0.1,1];
};
_map drawIcon [_icon,_color, _pos, 30, 30, 0, _text, 0, 0.05, 'PuristaMedium', 'right'];
};

View File

@ -0,0 +1,26 @@
/**
* fn_drawBFTMarkers_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
_marker = _this select 0;
_map = _this select 1;
if !(_marker isEqualTo []) then {
_pos = _marker select 0;
_args = _marker select 1;
_icon = _args select 0;
_text = _args select 1;
_color = _args select 2;
_timeOfPlacement = _marker select 2;
_side = _marker select 3;
if (([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC) == _side) then {
_map drawIcon [_icon,_color, _pos, 30, 30, 0, _text, 0, 0.05, 'PuristaMedium', 'right'];
};
};

View File

@ -0,0 +1,17 @@
private["_unit","_return","_toCheck"];
_unit = _this select 0;
_item = _this select 1;
_return = [];
_itemArray = toArray _item;
{
_compArray = toArray _x;
if (_compArray select 0 == _itemArray select 0) then {
if ([_item,_x] call BIS_fnc_inString) then {
_return pushback _x;
};
};
}foreach ([_unit] call cse_fnc_getAllBFTItems_CC);
_return

View File

@ -0,0 +1,20 @@
private["_unit","_return","_toCheck","_item"];
_unit = _this select 0;
_return = [];
_toCheck = [];
if (!isNull _unit) then {
if (_unit iskindof "CaManBase") then {
_toCheck = items _unit;
};
{
if (_x != "") then {
if (((toArray _x) select 0) == ((toArray 'c') select 0)) then {
if ([_x] call cse_fnc_isBFTItem_CC) then {
_return pushback _x;
};
};
};
}foreach _toCheck;
};
_return

View File

@ -0,0 +1,13 @@
private ["_device","_side","_deviceName"];
_deviceName = _this select 0;
_side = playerSide;
if (isnil "CSE_REGISTERED_DEVICES_CC") then {
CSE_REGISTERED_DEVICES_CC = [];
};
{
if ((_x select 0) == _deviceName) exitwith {
_side = _x select 3;
};
}foreach CSE_REGISTERED_DEVICES_CC;
_side

View File

@ -0,0 +1,11 @@
/**
* fn_getTrackerInformation_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
((_this select 0) getvariable ["cse_bft_info_cc",["Infantry","",true,false]])

View File

@ -0,0 +1,16 @@
/**
* fn_hasItem_CC.sqf
* @Descr: Check if unit has an item of type.
* @Author: Glowbal
*
* @Arguments: [unit OBJECT, item STRING (Classname of CfgWeapons item)]
* @Return: BOOL
* @PublicAPI: true
*/
private ["_unit","_item"];
_unit = _this select 0;
_item = _this select 1;
if !(_unit isKindOf "CAManBase") exitwith {false};
(_item in ((items _unit) + (assignedItems _unit)));

View File

@ -0,0 +1,16 @@
/**
* fn_hasTrackerItem_CC.sqf
* @Descr: Check if unit has a BFT enabled item
* @Author: Glowbal
*
* @Arguments: [unit OBJECT]
* @Return: BOOL
* @PublicAPI: true
*/
private["_unit"];
_unit = _this select 0;
if (!isNull _unit && {(_unit iskindof "CaManBase")}) exitwith {
(({([_x] call cse_fnc_isBFTItem_CC)}count ((items _unit) + (assignedItems _unit))) > 0);
};
false

View File

@ -0,0 +1,6 @@
if (isnil "CSE_EXISTING_BFTRACKERS_CC") then {
CSE_EXISTING_BFTRACKERS_CC = [];
};
{
_x setMarkerAlphaLocal 0.0;
}foreach CSE_EXISTING_BFTRACKERS_CC;

View File

@ -0,0 +1,11 @@
/**
* fn_isBFTItem_CC.sqf
* @Descr: Check if item has blue force tracking enabled.
* @Author: Glowbal
*
* @Arguments: [item STRING (Classname of item)]
* @Return: BOOL
* @PublicAPI: true
*/
(getNumber(configFile >> "CfgWeapons" >> (_this select 0) >> "cse_blueForceTracker") == 1);

View File

@ -0,0 +1,45 @@
/*
fnc_removeIntelMarker.sqf
Usage: Removes intel marker nearest to given position
Author: Glowbal
Arguments: array [position (Position 3D)]
0: Position. Format: 3D [ x, y, z]
Returns: Void
Affects: Global
Executes: Local
Example:
[[50,20,0] call cse_fnc_removeIntelMarker_CC;
*/
private ["_mpSync","_args","_nearest","_lastestCount","_pos","_count","_position"];
if (count _this < 2) exitwith {
_mpSync = [_this, count _this, "", [""]] call BIS_fnc_param;
if (isnil "_mpSync") then {
_mpSync = "";
};
if (_mpSync != "MP_SYNC") then {
_args = _this + ["MP_SYNC"];
[_args, "cse_fnc_removeIntelMarker_CC", true, true] spawn BIS_fnc_MP;
};
};
if (isnil "CSE_INTEL_MARKER_COLLECTION_CC") then {
waituntil{!isnil "CSE_INTEL_MARKER_COLLECTION_CC"};
};
_position = [_this, 0, [0,0,0], [[]],3] call BIS_fnc_param;
_count = 0;
_nearest = 25;
_lastestCount = -1;
{
_pos = (_x select 0);
if ((_pos distance _position) < _nearest) then {
_nearest = _pos distance _position;
_lastestCount = _count;
};
_count = _count + 1;
}count CSE_INTEL_MARKER_COLLECTION_CC;
if (_lastestCount < 0) exitwith {};
CSE_INTEL_MARKER_COLLECTION_CC set [ _lastestCount, "REMOVE"];
CSE_INTEL_MARKER_COLLECTION_CC = CSE_INTEL_MARKER_COLLECTION_CC - ["REMOVE"];

View File

@ -0,0 +1,48 @@
/*
fnc_removeRouteMarker.sqf
Usage: Removes route marker nearest to given position
Author: Glowbal
Arguments: array [position (Position 3D)]
0: Position. Format: 3D [ x, y, z]
Returns: Void
Affects: Global
Executes: Local
Example:
[[50,20,0] call cse_fnc_removeRouteMarker_CC;
*/
private ["_mpSync","_args","_nearest","_lastestCount","_pos","_count","_position"];
if (count _this < 2) exitwith {
_mpSync = [_this, 1, "", [""]] call BIS_fnc_param;
if (isnil "_mpSync") then {
_mpSync = "";
};
if (_mpSync != "MP_SYNC") then {
_args = _this + ["MP_SYNC"];
[_args, "cse_fnc_removeRouteMarker_CC", true, true] spawn BIS_fnc_MP;
};
};
if (isnil "CSE_ROUTE_MARKER_COLLECTION_CC") then {
// This is a fix for waiting MP JIP synchronization.
waituntil{!isnil "CSE_ROUTE_MARKER_COLLECTION_CC"};
};
_position = [_this, 0, [0,0,0], [[]],3] call BIS_fnc_param;
_count = 0;
_nearest = 25;
_lastestCount = -1;
{
_pos = (_x select 0);
if ((_pos distance _position) < _nearest) then {
_nearest = _pos distance _position;
_lastestCount = _count;
};
_count = _count + 1;
}count CSE_ROUTE_MARKER_COLLECTION_CC;
if (_lastestCount < 0) exitwith {};
CSE_ROUTE_MARKER_COLLECTION_CC set [ _lastestCount, "REMOVE"];
CSE_ROUTE_MARKER_COLLECTION_CC = CSE_ROUTE_MARKER_COLLECTION_CC - ["REMOVE"];

View File

@ -0,0 +1,7 @@
private ["_id","_info"];
_id = _this select 0;
_info = _this select 1;
CSE_CC_LOGIC_OBJECT_CC setvariable [_id,_info,true];
true

View File

@ -0,0 +1,7 @@
class CfgFactionClasses
{
class NO_CATEGORY;
class cseCCModule: NO_CATEGORY {
displayName = "CSE Command & Control";
};
};

View File

@ -0,0 +1,126 @@
class CfgFunctions {
class CSE {
class CC {
file = "cse\cse_sys_cc\Modules\functions";
class assignTrackerInfo_CC { recompile = 1; };
class modulePlaceIntelMarker_CC { recompile = 1; };
};
class Tablets
{
file = "cse\cse_sys_cc\tablets\functions";
class registerDevice_CC { recompile = 1; };
class registerApp_CC{ recompile = 1; };
class getDeviceSettings_CC { recompile = 1; };
class openDevice_CC { recompile = 1; };
class openDeviceSmall_CC { recompile = 1; };
class openLastScreen_CC { recompile = 1; };
class getLastScreen_CC { recompile = 1; };
class openScreen_CC { recompile = 1; };
class getCurrentApplication_CC { recompile = 1; };
class openIntelMarkersMenu_CC { recompile = 1; };
class openRouteMarkersMenu_CC { recompile = 1; };
class openIconSelectMenu_CC { recompile = 1; };
class isSideBarOpen_CC { recompile = 1; };
class getCurrentDeviceName_CC { recompile = 1; };
class clickedOnMap_CC { recompile = 1; };
class clearDeviceScreen_CC { recompile = 1; };
class isLoggedIn_CC { recompile = 1; };
class setLoggedIn_CC { recompile = 1; };
class placeMarker_CC { recompile = 1; };
class placeMarkerGlobal_CC { recompile = 1; };
class manageLayers_CC { recompile = 1; };
};
class TabletResources
{
file = "cse\cse_sys_cc\TabletResources\functions";
class setBackground_CC { recompile = 1; };
class setMap_CC { recompile = 1; };
class setNavBar_CC { recompile = 1; };
class setPiP_CC { recompile = 1; };
class setTitle_CC { recompile = 1; };
class setSideBar_CC { recompile = 1; };
class setOptionField_CC { recompile = 1; };
class getFirstAvailableOptionField_CC { recompile = 1; };
class removeOptionField_CC { recompile = 1; };
class getOptionFieldOnPos_CC { recompile = 1; };
class sideBarHasMap_CC { recompile = 1; };
class setPopUpMenu_CC { recompile = 1; };
class setPopUpOptions_CC { recompile = 1; };
class popUpAccept_CC { recompile = 1; };
class isPopUpOpen_CC { recompile = 1; };
class getPopUpRatio_CC { recompile = 1; };
class setProgramIcons_CC { recompile = 1; };
class getSideBarOptionFields_CC { recompile = 1; };
class isMapOpen_CC { recompile = 1; };
class isPiPOpen_CC { recompile = 1; };
class getSideBarRatio_CC { recompile = 1; };
class getNavBarRatio_CC { recompile = 1; };
class removeSelectMenu_CC { recompile = 1; };
class isSelectMenuOpen_CC { recompile = 1; };
class setBottomBar_CC { recompile = 1; };
class isOpenBottomBar_CC { recompile = 1; };
class showLoadingScreen_CC { recompile = 1; };
class editIntelMarker_CC { recompile = 1; };
};
class tabletScreens
{
file = "cse\cse_sys_cc\tabletScreens\functions";
class openScreen_cc_app_CC { recompile = 1; };
class openScreen_home_CC { recompile = 1; };
class openScreen_login_CC { recompile = 1; };
class openScreen_notepad_CC { recompile = 1; };
class openScreen_settings_CC { recompile = 1; };
class openScreen_startUp_CC { recompile = 1; };
class openScreen_liveFeed_app_CC { recompile = 1; };
};
class BlueForceTracking
{
file = "cse\cse_sys_cc\BlueForceTracking\functions";
class displayBFT_CC { recompile = 1; };
class displayBFTSymbols_CC { recompile = 1; };
class displayBFTSymbolOnPerson_CC { recompile = 1; };
class getAllBFTItems_CC { recompile = 1; };
class hasTrackerItem_CC { recompile = 1; };
class hasItem_CC { recompile = 1; };
class getAllBFTItemsOfType_CC { recompile = 1; };
class getDeviceSide_CC { recompile = 1; };
class isBFTItem_CC { recompile = 1; };
class hideAllBFTSymbols_CC { recompile = 1; };
class assignTrackerIDs_Server_CC { recompile = 1; };
class getTrackerInformation_CC { recompile = 1; };
class setTrackerInformation_CC { recompile = 1; };
class removeIntelMarker_CC { recompile = 1; };
class removeRouteMarker_CC { recompile = 1; };
class drawBFTIcons_CC { recompile = 1; };
class drawBFTMarker_CC { recompile = 1; };
};
class LiveFeed {
file = "cse\cse_sys_cc\LiveFeed\functions";
class openScreen_LiveFeed_CC { recompile = 1; };
class viewLiveFeed_CC { recompile = 1; };
class setLiveFeedTargetObj_CC { recompile = 1; };
class canViewFeed_CC { recompile = 1; };
class getAllViewableFeeds_CC { recompile = 1; };
class takeControlUAV_CC { recompile = 1; };
};
class VehicleDisplaysBFT {
file = "cse\cse_sys_cc\vehicles\functions";
class openFlight_Display_CC;
class hasFlightDisplay_CC;
class drawBFTMarker_Vehicles_CC;
class drawBFTIcons_Vehicles_CC;
class canUseOnBoard_BFT_Device_CC;
};
class FutureSoldier {
file = "cse\cse_sys_cc\FutureSoldier\functions";
class startFutureSoldierDisplay_CC { recompile = 1; };
};
};
};

View File

@ -0,0 +1,59 @@
class CfgMagazines {
class Default;
class CA_magazine: Default{};
class cse_m_tablet: CA_magazine {
scope = 2;
value = 1;
count = 1;
type = 16;
displayName = "Military Tablet (NATO)";
descriptionUse = "Military Tablet (NATO)";
picture = "\cse\cse_sys_cc\data\m_tablet.paa";
descriptionShort = "Military Tablet";
mass = 5;
};
class cse_m_pda: CA_magazine {
scope = 2;
value = 1;
count = 1;
type = 16;
descriptionUse = "A PDA, for use in the field. NATO Software compatible.";
descriptionShort = "A PDA for use in the field (NATO)";
displayName = "PDA (NATO)";
picture = "\cse\cse_sys_cc\data\m_pda.paa";
mass = 2;
};
class cse_m_tablet_uk: CA_magazine {
scope = 2;
value = 1;
count = 1;
type = 16;
descriptionUse = "UK Tablet. NATO Software compatible.";
descriptionShort = "A Tablet for use in the field (UK)";
displayName = "Military Tablet (UK)";
picture = "\cse\cse_sys_cc\data\uk_tablet.paa";
mass = 5;
};
class cse_m_tablet_o: CA_magazine {
scope = 2;
value = 1;
count = 1;
type = 16;
descriptionUse = "OPFOR Tablet. OPFOR Software compatible.";
descriptionShort = "A Tablet for use in the field (OPFOR)";
displayName = "Military Tablet (OPFOR)";
picture = "\cse\cse_sys_cc\data\m_tablet.paa";
mass = 5;
};
class cse_m_pda_o: CA_magazine {
scope = 2;
value = 1;
count = 1;
type = 16;
descriptionUse = "OPFOR PDA. OPFOR Software compatible.";
descriptionShort = "A PDA for use in the field (OPFOR)";
displayName = "Military PDA (OPFOR)";
picture = "\cse\cse_sys_cc\data\m_pda.paa";
mass = 2;
};
};

View File

@ -0,0 +1,370 @@
class CfgVehicles
{
class Logic;
class Module_F: Logic
{
class ArgumentsBaseUnits
{
};
};
class cse_sys_cc: Module_F
{
scope = 2;
displayName = "Command and Control [CSE]";
icon = "\cse\cse_main\data\cse_cc_module.paa";
category = "cseCCModule";
function = "cse_fnc_initalizeModule_F";
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "Combat Space Enhancement";
class Arguments {
class allowFeeds {
displayName = "Enable Live Feeds";
description = "Enable Live Feeds & UAV control";
typeName = "BOOL";
defaultValue = true;
};
class showUAV {
displayName = "UAVs on BFT";
description = "Automatically show UAVs on the BFT Map";
typeName = "BOOL";
defaultValue = true;
};
class uavRestriction {
displayName = "Restrict UAV Feeds";
description = "Should UAV Feeds be restricted";
typeName = "BOOL";
defaultValue = false;
};
class allowVehicleDisplays {
displayName = "Vehicle Display";
description = "Allow Vehicle Displays";
typeName = "BOOL";
defaultValue = false;
};
class autoAssignCallSigns {
displayName = "Auto Assign Callsigns";
description = "Automatically assign callsigns for units";
typeName = "NUMBER";
defaultValue = -1;
class values {
class disabled {name="Disabled"; value=-1; default=1; };
class all {name="All"; value = 0; };
class vehicles {name="Vehicles only"; value = 1; };
class groups {name="Groups Only"; value = 2; };
};
};
class allowDisplayOnMainMap {
displayName = "Allow Main Map";
description = "Allow CC to be used on the main map";
typeName = "BOOL";
defaultValue = false;
};
};
};
class cse_assignTrackerInfo_CC: Module_F
{
scope = 2;
displayName = "Assign BFT Information [CSE]";
icon = "\cse\cse_main\data\cse_cc_module.paa";
category = "cseCCModule";
function = "cse_fnc_assignTrackerInfo_CC";
functionPriority = 1;
isGlobal = 2;
isTriggerActivated = 0;
isDisposable = 0;
author = "Combat Space Enhancement";
class Arguments
{
class EnableList {
displayName = "List";
description = "List of unit names that will be used for assigning the BFT information, separated by commas.";
defaultValue = "";
};
class type
{
displayName = "Type of Icon";
description = "What icon is being displayed on BFT";
typeName = "STRING";
class values {
class Infantry {name="Infantry"; value="Infantry"; default=1; };
class Motorized {name="Motorized"; value="Motorized";};
class Plane {name="Plane"; value="Plane";};
class Helicopter {name="Helicopter"; value="Helicopter";};
class Armor {name="Armor"; value="Armor";};
class Naval {name="Naval"; value="Naval";};
class HQ {name="HQ"; value="HQ";};
class Medical {name="Medical"; value="Medical";};
class Maintanance {name="Maintanance"; value="Maintanance";};
class Artillery {name="Artillery"; value="Artillery";};
class Mortar {name="Mortar"; value="Mortar";};
class Service {name="Service"; value="Service";};
class Recon {name="Recon"; value="Recon";};
class Mechanized {name="Mechanized"; value="Mechanized";};
class uav {name="uav"; value="uav";};
};
};
class callSign
{
displayName = "Call Sign";
description = "The Call Sign being displayed on BFT";
typeName = "STRING";
defaultValue = "";
};
};
class ModuleDescription {
description = "Sync this module to objects to assign tracker information. <br /> Please be aware that synchronizing this to JIP players does not work currently. <br />Visit our wiki (wiki.csemod.com) for more information.";
sync[] = {"Car","Air", "Amoured"};
};
};
class cse_placeIntelMarker_CC: Module_F
{
scope = 2;
displayName = "Place SALUTE Report[CSE]";
icon = "\cse\cse_main\data\cse_cc_module.paa";
category = "cseCCModule";
function = "cse_fnc_modulePlaceIntelMarker_CC";
functionPriority = 1;
isGlobal = 0;
isTriggerActivated = 0;
author = "Combat Space Enhancement";
class Arguments
{
class Type
{
displayName = "Type of Icon";
description = "What icon is being displayed on BFT";
typeName = "STRING";
class values {
class Infantry {name="Infantry"; value="Infantry"; default=1; };
class Motorized {name="Motorized"; value="Motorized";};
class Plane {name="Plane"; value="Plane";};
class Helicopter {name="Helicopter"; value="Helicopter";};
class Armor {name="Armor"; value="Armor";};
class Naval {name="Naval"; value="Naval";};
class HQ {name="HQ"; value="HQ";};
class Medical {name="Medical"; value="Medical";};
class Maintanance {name="Maintanance"; value="Maintanance";};
class Artillery {name="Artillery"; value="Artillery";};
class Mortar {name="Mortar"; value="Mortar";};
class Service {name="Service"; value="Service";};
class Recon {name="Recon"; value="Recon";};
class Mechanized {name="Mechanized"; value="Mechanized";};
class uav {name="uav"; value="uav";};
};
};
class Side
{
displayName = "Side";
description = "Side of the marker icon (Visual)";
typeName = "STRING";
class values {
class BLUFOR {name="BLUFOR"; value="BLUFOR"; default=1;};
class OPFOR {name="OPFOR"; value="OPFOR";};
class GREENFOR {name="GREENFOR"; value="GREENFOR";};
class UNKNOWN {name="UNKNOWN"; value="UNKNOWN";};
};
};
class Direction
{
displayName = "Direction";
description = "Which direction is the moment";
typeName = "STRING";
class values {
class Static {name="Static"; value="Static"; default=1;};
class North {name="North"; value="North";};
class NorthEast {name="North East"; value="North East";};
class East {name="East"; value="East";};
class SouthEast {name="South East"; value="South East";};
class South {name="South"; value="South";};
class SouthWest {name="South West"; value="South West";};
class West {name="West"; value="West";};
class NorthWest {name="North West"; value="North West";};
};
};
class Size
{
displayName = "Size";
description = "What is the amount of Units spotted";
typeName = "STRING";
class values {
class Building {name="Building"; value="Building"; default=1;};
class Fortication {name="Fortication"; value="Fortication";};
class Pax {name="Pax"; value="Pax";};
class FireTeam {name="Fire Team"; value="Fire Team";};
class Section {name="Section"; value="Section";};
class Platoon {name="Platoon"; value="Platoon";};
class Company {name="Company"; value="Company";};
class Battalion {name="Battalion"; value="Battalion";};
class Regiment {name="Regiment"; value="Regiment";};
class Brigade {name="Brigade"; value="Brigade";};
};
};
class Number
{
displayName = "Number";
description = "What is the amount of Units spotted";
typeName = "STRING";
class values {
class One {name="1x"; value="1x"; default=1;};
class Two {name="2x"; value="2x";};
class Three {name="3x"; value="3x";};
class Four {name="4x"; value="4x";};
class Five {name="5x"; value="5x";};
class Six {name="6x"; value="6x";};
class Seven {name="7x"; value="7x";};
};
};
class Note
{
displayName = "Note";
description = "Note for Salute Report";
typeName = "STRING";
defaultValue = "";
};
class PlacementSide
{
displayName = "Placement Side";
description = "Side for which the marker will be placed.";
typeName = "STRING";
class values {
class BLUFOR {name="BLUFOR"; value="west"; default=1;};
class OPFOR {name="OPFOR"; value="east";};
class GREENFOR {name="Independent"; value="independent";};
};
};
};
};
class Item_Base_F;
class cse_m_tabletItem: Item_Base_F
{
scope = 2;
scopeCurator = 2;
displayName = "Military Tablet (NATO)";
author = "Combat Space Enhancement";
vehicleClass = "Items";
class TransportItems
{
class cse_m_tablet
{
name = "cse_m_tablet";
count = 1;
};
};
};
class cse_m_pdaItem: Item_Base_F
{
scope = 2;
scopeCurator = 2;
displayName = "Military PDA (NATO)";
author = "Combat Space Enhancement";
vehicleClass = "Items";
class TransportItems
{
class cse_m_pda
{
name = "cse_m_pda";
count = 1;
};
};
};
class cse_m_tablet_uk_Item: Item_Base_F
{
scope = 2;
scopeCurator = 2;
displayName = "Military Tablet (UK)";
author = "Combat Space Enhancement";
vehicleClass = "Items";
class TransportItems
{
class cse_m_tablet_uk
{
name = "cse_m_tablet_uk";
count = 1;
};
};
};
class cse_m_tablet_o_Item: Item_Base_F
{
scope = 2;
scopeCurator = 2;
displayName = "Military Tablet (OPFOR)";
author = "Combat Space Enhancement";
vehicleClass = "Items";
class TransportItems
{
class cse_m_tablet_o
{
name = "cse_m_tablet_o";
count = 1;
};
};
};
class cse_m_pda_o_Item: Item_Base_F
{
scope = 2;
scopeCurator = 2;
displayName = "Military PDA (OPFOR)";
author = "Combat Space Enhancement";
vehicleClass = "Items";
class TransportItems
{
class cse_m_pda_o
{
name = "cse_m_pda_o";
count = 1;
};
};
};
class NATO_Box_Base;
class cse_ccItems_W : NATO_Box_Base {
scope = 2;
accuracy = 1000;
displayName = "CC Devices [NATO] (CSE)";
model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F";
author = "Combat Space Enhancement";
class TransportItems {
class cse_m_tablet {
name = "cse_m_tablet";
count = 5;
};
class cse_m_pda {
name = "cse_m_pda";
count = 5;
};
};
};
class cse_ccItems_O: cse_ccItems_W {
displayName = "CC Devices [OPFOR] (CSE)";
class TransportItems {
class cse_m_tablet_o {
name = "cse_m_tablet_o";
count = 5;
};
class cse_m_pda_o {
name = "cse_m_pda_o";
count = 5;
};
};
};
class cse_ccItems_G: cse_ccItems_W {
displayName = "CC Devices [IND] (CSE)";
class TransportItems {
class cse_m_tablet_g {
name = "cse_m_tablet_g";
count = 5;
};
class cse_m_pda_g {
name = "cse_m_pda_g";
count = 5;
};
};
};
};

View File

@ -0,0 +1,166 @@
class CfgWeapons {
class ItemCore;
class InventoryItem_Base_F;
class cse_m_tablet: ItemCore {
author = "Combat Space Enhancement";
scope = 2;
displayName = $STR_ITEM_CSE_M_TABLET_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_tablet.paa";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
descriptionShort = $STR_ITEM_CSE_M_TABLET_DESC;
descriptionUse = $STR_ITEM_CSE_M_TABLET_DESC_USE;
cse_blueForceTracker = 1; // enable Blue Force Tracking for item
class ItemInfo: InventoryItem_Base_F
{
mass=6;
type=201;
};
};
class cse_m_pda: cse_m_tablet
{
descriptionUse = $STR_ITEM_CSE_M_PDA_DESC_USE;
descriptionShort = $STR_ITEM_CSE_M_PDA_DESC;
displayName = $STR_ITEM_CSE_M_PDA_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_pda.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_m_tablet_uk: cse_m_tablet
{
descriptionUse = $STR_ITEM_CSE_M_TABLET_UK_DESC_USE;
descriptionShort = $STR_ITEM_CSE_M_TABLET_UK_DESC;
displayName = $STR_ITEM_CSE_M_TABLET_UK_DISPLAY;
picture = "\cse\cse_sys_cc\data\uk_tablet.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=6;
type=201;
};
};
class cse_m_tablet_o: cse_m_tablet
{
descriptionUse = $STR_ITEM_CSE_M_TABLET_O_DESC_USE;
descriptionShort = $STR_ITEM_CSE_M_TABLET_O_DESC;
displayName = $STR_ITEM_CSE_M_TABLET_O_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_tablet.paa";
};
class cse_m_pda_o: cse_m_pda
{
descriptionUse = $STR_ITEM_CSE_M_PDA_O_DESC_USE;
descriptionShort = $STR_ITEM_CSE_M_PDA_O_DESC;
displayName = $STR_ITEM_CSE_M_PDA_O_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_pda.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_m_tablet_g: cse_m_tablet
{
descriptionUse = $STR_ITEM_CSE_M_TABLET_G_DESC_USE;
descriptionShort = $STR_ITEM_CSE_M_TABLET_G_DESC;
displayName = $STR_ITEM_CSE_M_TABLET_O_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_tablet.paa";
};
class cse_m_pda_g: cse_m_pda
{
descriptionUse = $STR_ITEM_CSE_M_PDA_G_DESC_USE;
descriptionShort = $STR_ITEM_CSE_M_PDA_G_DESC;
displayName = $STR_ITEM_CSE_M_PDA_G_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_pda.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_itemHelmetCamera_W: ItemCore {
author = "Combat Space Enhancement";
scope = 2;
descriptionUse = $STR_ITEM_CSE_HELMET_CAMERA_DESC_SHORT;
descriptionShort = $STR_ITEM_CSE_HELMET_CAMERA_DESC;
displayName = $STR_ITEM_CSE_HELMET_CAMERA_DISPLAY;
picture = "\cse\cse_sys_cc\data\helmet_camera.paa";
model = "\A3\weapons_F\ammo\mag_univ.p3d";
simulation = "Weapon";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_itemHelmetCamera_O: cse_itemHelmetCamera_W {
descriptionUse = $STR_ITEM_CSE_HELMET_CAMERA_O_DESC_SHORT;
descriptionShort = $STR_ITEM_CSE_HELMET_CAMERA_O_DESC;
displayName = $STR_ITEM_CSE_HELMET_CAMERA_O_DISPLAY;
picture = "\cse\cse_sys_cc\data\helmet_camera.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_itemHelmetCamera_G: cse_itemHelmetCamera_W {
descriptionUse = $STR_ITEM_CSE_HELMET_CAMERA_G_DESC_SHORT;
descriptionShort = $STR_ITEM_CSE_HELMET_CAMERA_G_DESC;
displayName = $STR_ITEM_CSE_HELMET_CAMERA_G_DISPLAY;
picture = "\cse\cse_sys_cc\data\helmet_camera.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_trackerItem_w: cse_m_tablet {
displayName = $STR_ITEM_CSE_TRACKERITEM_W_DISPLAY;
picture = "\cse\cse_sys_cc\data\m_pda.paa";
descriptionShort = $STR_ITEM_CSE_TRACKERITEM_W_DESC;
descriptionUse = $STR_ITEM_CSE_TRACKERITEM_W_DESC_SHORT;
class ItemInfo: InventoryItem_Base_F
{
mass=1;
type=201;
};
};
class cse_trackerItem_o: cse_trackerItem_w {
displayName = $STR_ITEM_CSE_TRACKERITEM_O_DISPLAY;
descriptionShort = $STR_ITEM_CSE_TRACKERITEM_O_DESC;
descriptionUse = $STR_ITEM_CSE_TRACKERITEM_O_DESC_SHORT;
picture = "\cse\cse_sys_cc\data\m_pda.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
class cse_trackerItem_g: cse_trackerItem_w {
displayName = $STR_ITEM_CSE_TRACKERITEM_G_DISPLAY;
descriptionShort = $STR_ITEM_CSE_TRACKERITEM_G_DESC;
descriptionUse = $STR_ITEM_CSE_TRACKERITEM_G_DESC_SHORT;
picture = "\cse\cse_sys_cc\data\m_pda.paa";
class ItemInfo: InventoryItem_Base_F
{
mass=2;
type=201;
};
};
};

View File

@ -0,0 +1,30 @@
#define MENU_KEYBINDING 1
#define ACTION_KEYBINDING 2
#define CLIENT_SETTING 3
class Combat_Space_Enhancement {
class cfgModules {
class cse_sys_cc {
init = "call compile preprocessFile 'cse\cse_sys_cc\init_sys_cc.sqf';";
name = "Command and Control";
class Configurations {
class Command_and_Control {
type = MENU_KEYBINDING;
title = $STR_OPEN_CC_DEVICE_CONFIGURATION_TITLE;
description = $STR_OPEN_CC_DEVICE_CONFIGURATION_DESC;
value[] = {35,0,1,0};
onPressed = "switch (true) do {case ([player,'cse_m_tablet'] call cse_fnc_hasItem_CC): {['cse_m_tablet'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_tablet_uk'] call cse_fnc_hasItem_CC): {['cse_m_tablet_uk'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_tablet_o'] call cse_fnc_hasItem_CC): {['cse_m_tablet_o'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_pda'] call cse_fnc_hasItem_CC): {['cse_m_pda'] call cse_fnc_openDevice_CC;};case ([player,'cse_m_pda_o'] call cse_fnc_hasItem_CC): {['cse_m_pda_o'] call cse_fnc_openDevice_CC;};default {};};";
idd = 590823;
};
class OpenOnBoard_BFT_Device {
type = MENU_KEYBINDING;
title = $STR_OPEN_CC_ONBOARD_CONFIGURATION_TITLE;
description = $STR_OPEN_CC_ONBOARD_CONFIGURATION_DESC;
value[] = {0,0,0,0};
onPressed = "[vehicle player] call cse_fnc_openFlight_Display_CC;";
idd = 590823;
};
};
};
};
};

View File

@ -0,0 +1,32 @@
_code = {
if (isnil "CSE_INTEL_MARKER_COLLECTION_CC" || !(([player] call cse_fnc_hasTrackerItem_CC))) exitwith {};
_playerPos = (getPos player);
{
_pos = _x select 0;
_args = _x select 1;
_icon = _args select 0;
_text = _args select 1;
_color = _args select 2;
_side = _x select 3;
if (playerSide == _side && {_playerPos distance _pos < 200}) then {
drawIcon3D [_icon,_color, _pos, 1, 1, 0, _text, 0, 0.03, 'PuristaMedium'];
};
false;
}count CSE_INTEL_MARKER_COLLECTION_CC;
{
_pos = _x select 1;
_unit = _x select 5;
if (playerSide == (_x select 6) && {_playerPos distance _pos < 200} && {_unit != player}) then {
drawIcon3D [(_x select 0), (_X select 3), _pos, 1, 1, 0, (_x select 2), 0, 0.03, 'PuristaMedium'];
};
false;
}count CSE_TRACKER_ICONS;
};
["cse_futureSoldierDraw", [], _code] call cse_fnc_addTaskToPool_f;

View File

@ -0,0 +1,40 @@
/**
* fn_canViewFeed_CC.sqf
* @Descr: Check if the provided device can view the feed of target if available.
* @Author: Glowbal
*
* @Arguments: [target OBJECT, device STRING (Device classname)]
* @Return: BOOL True if targets feed can be viewed with devices of given classname.
* @PublicAPI: true
*/
private ["_target", "_return", "_deviceName", "_item"];
_target = [_this, 0, objNull, [objNull]] call BIS_fnc_Param;
_deviceName = [_this, 1, "", [""]] call BIS_fnc_Param;
_return = false;
if (_target isKindOf "CAManBase") then {
//if ([_target] call cse_fnc_hasTrackerItem_CC) then {
if (_target getvariable ["cse_hasCameraFeed_enabled_CC", false]) then {
_item = switch (([_deviceName] call cse_fnc_getDeviceSide_CC)) do {
case WEST: {"cse_itemHelmetCamera_W"};
case EAST: {"cse_itemHelmetCamera_O"};
case independent: {"cse_itemHelmetCamera_I"};
default {""};
};
if (_item == "") exitwith{};
if ([_target, _item] call cse_fnc_hasItem_CC) then {
_return = true;
};
};
//};
} else {
if (_deviceName != "") then {
if (_target in allUnitsUAV) then {
if (side _target == ([_deviceName] call cse_fnc_getDeviceSide_CC)) then {
_return = true;
};
};
};
};
_return;

View File

@ -0,0 +1 @@
[_deviceName,"main","hide"] call cse_fnc_setPiP_CC;

View File

@ -0,0 +1,40 @@
/**
* fn_getAllviewableFeeds_CC.sqf
* @Descr: Get all feeds that are viewable for provided device classname.
* @Author: Glowbal
*
* @Arguments: [deviceName STRING (Device classname)]
* @Return: ARRAY An array with objects that have a viewable feed.
* @PublicAPI: true
*/
private ["_deviceName", "_return", "_displayText"];
_deviceName = _this select 0;
_return = [];
{
if (_x isKindOf "CAManBase") then {
if ([_x, _deviceName] call cse_fnc_canViewFeed_CC) then {
_trackerInfo = [_x] call cse_fnc_getTrackerInformation_CC;
_displayText = _trackerInfo select 1;
if (_displayText == "") then {
_displayText = format["Unknown: ", _trackerInfo select 0];
};
_return pushback [_displayText, [_x]];
};
};
}foreach allUnits;
{
if ([_x, _deviceName] call cse_fnc_canViewFeed_CC) then {
_trackerInfo = [_x] call cse_fnc_getTrackerInformation_CC;
_displayText = _trackerInfo select 1;
if (_displayText == "") then {
_displayText = format["UAV: %1", [_x] call cse_fnc_findTargetName_gui];
};
_return pushback [_displayText, [_x]];
};
}foreach allUnitsUAV;
_return;

View File

@ -0,0 +1,58 @@
/**
* fn_openScreen_liveFeed_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName", "_appOpening", "_display", "_background"];
_deviceName = _this select 0;
if (isnil "CSE_LIVEFEED_TARGET_CC") exitwith {}; // error
[_deviceName,"main","full"] call cse_fnc_setPiP_CC;
[true] call cse_fnc_viewLiveFeed_CC;
CSE_PREVIOUS_APPLICATION_CC = [_deviceName] call cse_fnc_getCurrentApplication_CC;
_appOpening = "LiveFeed_Viewing";
if (CSE_LIVEFEED_TARGET_CC in allUnitsUAV) then {
_sideBarFullScreen = {
private["_deviceName","_cfg","_allowSidebar"];
_deviceName = _this select 0;
_allowSidebar = 0;
if (isnil 'CSE_REGISTERED_DEVICES_CC') then {
CSE_REGISTERED_DEVICES_CC = [];
};
{
if (_x select 0 == _deviceName) exitwith {
_allowSidebar = _x select 2;
};
}foreach CSE_REGISTERED_DEVICES_CC;
_allowSidebar
};
_sideBarN = ([_deviceName] call _sideBarFullScreen);
if (_sideBarN == 1) then {
_appOpening = _appOpening + "_UAV";
};
};
call compile format["CSE_CURRENT_APPLICATION_%1_CC = '%2';",_deviceName, _appOpening];
if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then {
[_deviceName,"right"] call cse_fnc_setSideBar_CC;
};
_display = uiNamespace getvariable _deviceName;
_background = _display displayCtrl 602;
_background ctrlSetPosition [0,0,0,0];
_background ctrlSetBackgroundColor [0.9,0.9,0.9,1];
_background ctrlCommit 0;
(_display displayCtrl 603) ctrlSetText "";
(_display displayCtrl 604) ctrlSetText "";

View File

@ -0,0 +1,115 @@
/**
* fn_setLiveFeedTarget_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define QUAD_COPTER_POS [0,0,-0.5]
#define LARGE_UAV_POS [0,0.5,-1.0]
#define GAV_POS [0,0,1]
private ["_target", "_camera", "_cameraAttachToPos"];
_target = _this select 0;
CSE_LIVEFEED_TARGET_CC = _target;
[format["Setting live feed target: %1",_this]] call cse_fnc_debug;
if (isNull _target) then {
[false] call cse_fnc_viewLiveFeed_CC;
} else {
_camera = objNull;
if (isnil "CSE_PIP_CAMERA_CC") then {
_camera = "camera" camCreate (position _target);
CSE_PIP_CAMERA_CC = _camera;
_camera cameraEffect ["INTERNAL", "BACK", "rendertarget11"];
} else {
if (isNull CSE_PIP_CAMERA_CC) then {
["LiveFeed Camera was null. Creating a new one."] call cse_fnc_debug;
_camera = "camera" camCreate (position _target);
CSE_PIP_CAMERA_CC = _camera;
_camera cameraEffect ["INTERNAL", "BACK", "rendertarget11"];
};
_camera = CSE_PIP_CAMERA_CC;
};
detach _camera;
if (_target isKindOf "CaManBase") then {
_camera attachto [_target,[-0.18,0.1,0.1], "head"];
[_target, _camera] spawn {
_target = _this select 0;
_camera = _this select 1;
while {((alive _target) && (CSE_LIVEFEED_TARGET_CC == _target) && alive _camera && dialog)} do {
if (vehicle _target != _target) then {
_positionInWorld = _target modelToWorld (_target selectionPosition "head");
_vehPos = (vehicle _target) worldToModel _positionInWorld;
_camera attachTo [(vehicle _target),_vehPos];
} else {
_camera attachto [_target,[-0.18,0.1,0.1], "head"];
};
};
};
} else {
if ((_target in allUnitsUAV)) then {
// TODO Make this dynamic through an array.
_cameraAttachToPos = switch (typeOf _target) do {
case "B_UAV_01_F": {
QUAD_COPTER_POS;
};
case "B_UAV_02_CAS_F": {
LARGE_UAV_POS;
};
case "B_UAV_02_F": {
LARGE_UAV_POS;
};
case "B_UGV_01_F": {
GAV_POS;
};
case "B_UGV_01_rcws_F": {
GAV_POS;
};
case "O_UAV_01_F": {
QUAD_COPTER_POS;
};
case "O_UAV_02_CAS_F": {
LARGE_UAV_POS;
};
case "O_UAV_02_F": {
LARGE_UAV_POS;
};
case "O_UGV_01_F": {
GAV_POS;
};
case "O_UGV_01_rcws_F": {
GAV_POS;
};
case "I_UAV_01_F": {
QUAD_COPTER_POS;
};
case "I_UAV_02_CAS_F": {
LARGE_UAV_POS;
};
case "I_UAV_02_F": {
LARGE_UAV_POS;
};
case "I_UGV_01_F": {
GAV_POS;
};
case "I_UGV_01_rcws_F": {
GAV_POS;
};
default {
QUAD_COPTER_POS;
};
};
_camera attachto [_target,_cameraAttachToPos];
};
};
};

View File

@ -0,0 +1,39 @@
/**
* fn_takeControlUAV_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: [uav OBJECT (Of type UAV)]
* @Return:
* @PublicAPI: false
*/
private ["_uav", "_continue"];
_uav = _this select 0;
if (_uav in allUnitsUAV) then {
if (isnil "CSE_CONTROL_UAV_RESTRICTED_CC") then {
CSE_CONTROL_UAV_RESTRICTED_CC = false;
};
_continue = true;
if (CSE_CONTROL_UAV_RESTRICTED_CC) then {
_continue = player getvariable ["cse_canControlUAVs_CC", false];
};
if (!_continue) exitwith {}; // has no access to control the UAV.
if (!("GUNNER" in uavControl _uav)) then {
if (count (crew _uav) >= 2) then {
player remoteControl ((crew _uav) select 1);
_uav switchCamera "Gunner";
closeDialog 0;
} else {
if (!("DRIVER" in uavControl _uav)) then {
if (count (crew _uav) >= 1) then {
player remoteControl ((crew _uav) select 0);
_uav switchCamera "INTERNAL";
closeDialog 0;
};
};
};
};
};

View File

@ -0,0 +1,42 @@
/**
* fn_viewLiveFeed_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_display","_view","_ctrl", "_camera"];
_view = _this select 0;
disableSerialization;
_deviceName = [] call cse_fnc_getCurrentDeviceName_CC;
[format["fn_viewLiveFeed_CC %1 %2",_this, _deviceName]] call cse_fnc_debug;
_display = uiNamespace getvariable _deviceName;
_ctrl = (_display displayCtrl 20);
if (_view) then {
_camera = objNull;
if (isnil "CSE_PIP_CAMERA_CC") then {
_camera = "camera" camCreate (position player);
CSE_PIP_CAMERA_CC = _camera;
_camera cameraEffect ["INTERNAL", "BACK","rendertarget11"];
} else {
if (isNull CSE_PIP_CAMERA_CC) then {
["LiveFeed Camera was null. Creating a new one."] call cse_fnc_debug;
_camera = "camera" camCreate (position player);
CSE_PIP_CAMERA_CC = _camera;
_camera cameraEffect ["INTERNAL", "BACK","rendertarget11"];
};
_camera = CSE_PIP_CAMERA_CC;
};
"rendertarget11" setPiPEffect [0];
_ctrl ctrlsettext "#(argb,256,256,1)r2t(rendertarget11,1.0)";
_ctrl ctrlcommit 0;
} else {
_ctrl ctrlsettext "";
_ctrl ctrlcommit 0;
};

View File

@ -0,0 +1,69 @@
/**
* fn_assignTrackerInfo_CC.sqf
* @Descr: assigns tracker info for the BFT. Does not work well with JIP players.
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_logic", "_type", "_objects", "_callsign"];
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
[format["AssigningTrackerInfo called. Arguments are: %1", _this]] call cse_fnc_debug;
if (!isNull _logic) then {
_type = _logic getvariable ["type","Infantry"];
_callsign = _logic getvariable ["callSign",""];
_list = _logic getvariable ["EnableList",""];
_splittedList = [_list, ","] call BIS_fnc_splitString;
_nilCheckPassedList = "";
{
_x = [_x] call cse_fnc_string_removeWhiteSpace;
if !(isnil _x) then {
if (_nilCheckPassedList == "") then {
_nilCheckPassedList = _x;
} else {
_nilCheckPassedList = _nilCheckPassedList + ","+ _x;
};
};
}foreach _splittedList;
_list = "[" + _nilCheckPassedList + "]";
_parsedList = [] call compile _list;
_objects = synchronizedObjects _logic;
if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then {
/*
This has been enabled again to allow backwards compatability for older CSE missions.
*/
[["synchronizedObjects for the 'assign BFT Information' Module is deprecated. Please use the enable for list instead!"], 1] call cse_fnc_debug;
{
if (!isnil "_x") then {
if (typeName _x == typeName objNull) then {
if (local _x) then {
(vehicle _x) setvariable ["cse_bft_info_cc",[_type,_callsign,true,false],true];
};
};
};
}foreach _objects;
};
{
if (!isnil "_x") then {
if (typeName _x == typeName objNull) then {
if (local _x) then {
(vehicle _x) setvariable ["cse_bft_info_cc",[_type,_callsign,true,false],true];
};
};
};
}foreach _parsedList;
} else {
[format["AssigningTrackerInfo called but logic is NULL"]] call cse_fnc_debug;
deleteVehicle _logic;
};
true

View File

@ -0,0 +1,39 @@
/**
* fn_modulePlaceIntelMarker_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private["_logic", "_placeMentSide"];
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (!isServer) exitwith{};
if (!isNull _logic) then {
if (!isnil "cse_fnc_placeMarker_CC") then {
_placeMentSide = _logic getvariable ["PlacementSide", "west"],
_placeMentSide = switch (_placeMentSide) do {
case "west": {west};
case "east": {east};
case "independent": {independent};
default {west};
};
[
[
_logic getvariable "Type",
_logic getvariable "Side",
_logic getvariable "Direction",
_logic getvariable "Size",
_logic getvariable "Number",
_logic getVariable "Note",
[0,0,0,0,0]
],
ASLToATL getPosASL _logic,
"intel", _placeMentSide
] call cse_fnc_placeMarker_CC;
};
};

View File

@ -0,0 +1,9 @@
/*
Support Requests:
- different amount of lines
- different priorities
- action on
*/

5
TO_MERGE/cse/sys_cc/UI.h Normal file
View File

@ -0,0 +1,5 @@
#include "ui\define.hpp"
#include "ui\cse_m_tablet.hpp"
#include "ui\cse_m_pda.hpp"
#include "ui\cse_m_tablet_uk.hpp"
#include "ui\m_flight_display.h"

View File

@ -0,0 +1,28 @@
#define _ARMA_
class CfgPatches
{
class cse_sys_cc
{
units[] = {"cse_m_tabletItem", "cse_m_pdaItem", "cse_m_tablet_uk_Item", "cse_m_tablet_o_Item", "cse_m_pda_o_Item"};
weapons[] = {"cse_m_tablet","cse_m_pda","cse_m_tablet_uk","cse_m_tablet_o", "cse_m_pda_o"};
requiredVersion = 0.1;
requiredAddons[] = {"cse_gui","cse_main", "A3_Weapons_F", "A3_Weapons_F_Items"};
version = "0.10.0_rc";
author[] = {"Combat Space Enhancement"};
authorUrl = "http://csemod.com";
};
};
class CfgAddons {
class PreloadAddons {
class cse_sys_cc {
list[] = {"cse_sys_cc"};
};
};
};
#include "CfgFactionClasses.h"
#include "CfgVehicles.h"
#include "CfgWeapons.h"
#include "CfgFunctions.h"
#include "ui.h"
#include "Combat_Space_Enhancement.h"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,20 @@
/*
server_init.sqf
Usage: Initalizes the Command and Control Server functionality
Author: Glowbal
Arguments: array []
Returns: void
Affects: Server
Executes: All Localities
*/
//if (isServer) exitwith{};
if (isnil "CSE_CC_LOGIC_OBJECT_CC") then {
_group = createGroup sideLogic;
CSE_CC_LOGIC_OBJECT_CC = _group createUnit ["logic", [1,1,1], [], 0, "FORM"];
publicVariable "CSE_CC_LOGIC_OBJECT_CC";
// [] call cse_fnc_assignTrackerIDs_Server_CC; // temp disabled, switching to non id based???
};

View File

@ -0,0 +1,147 @@
/**
* init_sys_cc.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_args"];
_args = _this;
CSE_CONTROL_UAV_RESTRICTED_CC = false;
CSE_AUTO_SHOW_UAV_TRACKERS_ON_BFT = false;
CSE_ALLOW_LIVE_FEEDS_CC = true;
CSE_ALLOW_VEHICLE_DISPLAYS_CC = true;
CSE_AUTO_ASSIGN_CALLSIGNS_CC = -1;
CSE_VIEW_ON_MAIN_MAP_SETTING_CC = false;
CSE_VIEW_ON_MAIN_MAP_ALLOWED_CC = false;
{
if (_x select 0 == "uavRestriction") then {
CSE_CONTROL_UAV_RESTRICTED_CC = (_x select 1);
};
if (_x select 0 == "showUAV") then {
CSE_AUTO_SHOW_UAV_TRACKERS_ON_BFT = _x select 1;
};
if (_x select 0 == "allowFeeds") then {
CSE_ALLOW_LIVE_FEEDS_CC = _x select 1;
};
if (_x select 0 == "allowVehicleDisplays") then {
CSE_ALLOW_VEHICLE_DISPLAYS_CC = _x select 1;
};
if (_x select 0 == "autoAssignCallSigns") then {
CSE_AUTO_ASSIGN_CALLSIGNS_CC = _x select 1;
};
if (_x select 0 == "allowDisplayOnMainMap") then {
CSE_VIEW_ON_MAIN_MAP_ALLOWED_CC = _x select 1;
};
}foreach _args;
[format["AIM - Command and Control initialisation started"],3] call cse_fnc_debug;
waituntil{!isnil "cse_gui"};
[format["CC - Command and Control Module initialised"],2] call cse_fnc_debug;
["cse_sys_cc_allowUseOfMainMap", ["Enable", "Disable"], (["cse_sys_cc_allowUseOfMainMap", 0] call cse_fnc_getClientSideOptionFromProfile_F), {
CSE_VIEW_ON_MAIN_MAP_SETTING_CC = (_this select 1) == 0;
}] call cse_fnc_addClientSideOptions_f;
["cse_sys_cc_allowUseOfMainMap","option","Use main map (CC)","Use Command and Control on the main map when you have a CC device. Read only."] call cse_fnc_settingsDefineDetails_F;
["cse_m_tablet",[-0.03,0.06,1.014,0.827],1,WEST] call cse_fnc_registerDevice_CC;
["cse_m_pda",[0.2761,0.38,0.33,0.47],2,WEST] call cse_fnc_registerDevice_CC;
["cse_m_tablet_o",[-0.03,0.06,1.014,0.827],1,EAST] call cse_fnc_registerDevice_CC;
["cse_m_pda_o",[0.2761,0.38,0.33,0.47],2,EAST] call cse_fnc_registerDevice_CC;
["cse_m_tablet_g",[-0.03,0.06,1.014,0.827],1,independent] call cse_fnc_registerDevice_CC;
["cse_m_pda_g",[0.2761,0.38,0.33,0.47],2,independent] call cse_fnc_registerDevice_CC;
["cse_m_tablet_uk",[-0.03,0.06,1.014,0.827],1,WEST] call cse_fnc_registerDevice_CC;
cse_fnc_switchItem = {
private ["_unit","_orig","_newI"];
_unit = _this select 0;
_orig = _this select 1;
_newI = _this select 2;
_unit removeItem _orig;
_unit addItem _newI;
};
CSE_DISPLAY_CC_VIEW_FULL_SCREEN_CC = false;
[] call compile preprocessFile "cse\cse_sys_cc\register_applications.sqf";
[] call compile preprocessFile "cse\cse_sys_cc\init_server.sqf";
CSE_ICON_PATH = "cse\cse_gui\radialmenu\data\icons\";
CSE_LIVEFEED_TARGET_CC = ObjNull;
_entries = [
["PDA (NATO)", {([player,"cse_m_pda"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; ["cse_m_pda"] call cse_fnc_openDevice_CC;}, "Open PDA (NATO)"],
["Tablet (NATO)", {([player,"cse_m_tablet"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; ["cse_m_tablet"] call cse_fnc_openDevice_CC;}, "Open Tablet (NATO)"],
["Tablet (UK)", {([player,"cse_m_tablet_uk"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet_uk.paa", {closeDialog 0; ["cse_m_tablet_uk"] call cse_fnc_openDevice_CC;}, "Open Tablet (UK)"],
["PDA (OPFOR)", {([player,"cse_m_pda_o"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; ["cse_m_pda_o"] call cse_fnc_openDevice_CC;}, "Open PDA (OPFOR)"],
["Tablet (OPFOR)", {([player,"cse_m_tablet_o"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; ["cse_m_tablet_o"] call cse_fnc_openDevice_CC;}, "Open Tablet (OPFOR)"],
["PDA (IND)", {([player,"cse_m_pda_g"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; ["cse_m_pda_g"] call cse_fnc_openDevice_CC;}, "Open PDA (IND)"],
["Tablet (IND)", {([player,"cse_m_tablet_g"] call cse_fnc_hasItem_CC)}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; ["cse_m_tablet_g"] call cse_fnc_openDevice_CC;}, "Open Tablet (IND)"]
];
["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F;
cse_fnc_hasHelmetCameraItem_CC = {
(([player,"cse_itemHelmetCamera_W"] call cse_fnc_hasItem_CC) || ([player,"cse_itemHelmetCamera_O"] call cse_fnc_hasItem_CC) || ([player,"cse_itemHelmetCamera_G"] call cse_fnc_hasItem_CC))
};
_entries = [
["Enable Camera", {(([] call cse_fnc_hasHelmetCameraItem_CC) && !(player getvariable ["cse_hasCameraFeed_enabled_CC", false]))}, CSE_ICON_PATH + "icon_helmetCam_small.paa", {closeDialog 0; player setvariable ["cse_hasCameraFeed_enabled_CC", true, true];}, "Turn on your helmet camera"],
["Disable Camera", {(([] call cse_fnc_hasHelmetCameraItem_CC) && (player getvariable ["cse_hasCameraFeed_enabled_CC", false]))}, CSE_ICON_PATH + "icon_helmetCam_small.paa", {closeDialog 0; player setvariable ["cse_hasCameraFeed_enabled_CC", false, true];}, "Turn off your helmet camera"]
];
["ActionMenu","equipment", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F;
// Request players to access their BFT device(s)
_entries = [
["PDA (NATO)", {([_this select 1,"cse_m_pda"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_pda'] call cse_fnc_hasItem_CC) then { ['cse_m_pda'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access PDA (NATO)"],
["Tablet (NATO)", {([_this select 1,"cse_m_tablet"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (NATO)"],
["Tablet (UK)", {([_this select 1,"cse_m_tablet_uk"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet_uk.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet_uk'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet_uk'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (UK)"],
["PDA (OPFOR)", {([_this select 1,"cse_m_pda_o"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_pda_o'] call cse_fnc_hasItem_CC) then { ['cse_m_pda_o'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access PDA (OPFOR)"],
["Tablet (OPFOR)", {([_this select 1,"cse_m_tablet_o"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet_o'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet_o'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (OPFOR)"],
["PDA (IND)", {([_this select 1,"cse_m_pda_g"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_pda.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_pda_g'] call cse_fnc_hasItem_CC) then { ['cse_m_pda_g'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access PDA (IND)"],
["Tablet (IND)", {([_this select 1,"cse_m_tablet_g"] call cse_fnc_hasItem_CC) && (player != (_this select 1))}, CSE_ICON_PATH + "icon_tablet.paa", {closeDialog 0; [player, _this select 1, "access_device", "%1 wants to access your BFT", "if !(_this select 2) exitwith {}; if ([_this select 1, 'cse_m_tablet_g'] call cse_fnc_hasItem_CC) then { ['cse_m_tablet_g'] call cse_fnc_openDevice_CC; };"] call cse_fnc_sendRequest_f;}, "Access Tablet (IND)"]
];
["ActionMenu","interaction", _entries] call cse_fnc_addMultipleEntriesToRadialCategory_F;
_entries = [
["BFT Display", {[player, vehicle player] call cse_fnc_canUseOnBoard_BFT_Device_CC}, CSE_ICON_PATH + "icon_m_flight_display.paa", {closeDialog 0; [vehicle player] call cse_fnc_openFlight_Display_CC;}, "Use onboard BFT Display"]
];
["ActionMenu","interaction", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F;
if (hasInterface) then {
// set the event handlers for the map
{
_x spawn {
disableserialization;
waituntil {!isnull (finddisplay _this displayctrl 51)};
private "_control";
_control = finddisplay _this displayctrl 51;
_control ctrlAddEventHandler ["draw","
if ([player] call cse_fnc_hasTrackerItem_CC && CSE_VIEW_ON_MAIN_MAP_SETTING_CC && CSE_VIEW_ON_MAIN_MAP_ALLOWED_CC) then {
{[_x,(_this select 0)] call cse_fnc_drawBFTIcons_CC;}foreach CSE_TRACKER_ICONS;
if (CSE_TOGGLE_INTEL_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_INTEL_MARKER_COLLECTION_CC;};
if (CSE_TOGGLE_ROUTE_LAYER_CC) then {{[_x,(_this select 0)] call cse_fnc_drawBFTMarker_CC;}foreach CSE_ROUTE_MARKER_COLLECTION_CC;};
};
"];
};
} foreach [getnumber (configfile >> "RscDisplayMainMap" >> "idd"), getnumber (configfile >> "RscDisplayGetReady" >> "idd"), getnumber (configfile >> "RscDisplayClientGetReady" >> "idd"), getnumber (configfile >> "RscDisplayServerGetReady" >> "idd")
];
};

View File

@ -0,0 +1,73 @@
/*
registerApplications.sqf
Usage: Registers applications for the Command and Control Module
Author: Glowbal
Arguments: array []
Returns: Void
Affects: Clients
Executes: All Localities
*/
_r = profilenamespace getvariable ['Map_BLUFOR_R',0];
_g = profilenamespace getvariable ['Map_BLUFOR_G',0.8];
_b = profilenamespace getvariable ['Map_BLUFOR_B',1];
_a = profilenamespace getvariable ['Map_BLUFOR_A',0.8];
CSE_SIDE_WEST_COLOR = [_r,_g,_b,_a];
CSE_SIDE_EAST_COLOR =
[
profilenamespace getvariable ['Map_OPFOR_R',0.5],
profilenamespace getvariable ['Map_OPFOR_G',0],
profilenamespace getvariable ['Map_OPFOR_B',0],
profilenamespace getvariable ['Map_OPFOR_A',0.8]
];
_r = profilenamespace getvariable ['Map_Independent_R',0];
_g = profilenamespace getvariable ['Map_Independent_G',1];
_b = profilenamespace getvariable ['Map_Independent_B',1];
_a = profilenamespace getvariable ['Map_OPFOR_A',0.8];
CSE_SIDE_IND_COLOR = [_r,_g,_b,_a];
if (isDedicated) exitwith {};
["home","","",1,[["Show BFT Icon","button","private '_var'; _var = [player] call cse_fnc_getTrackerInformation_CC; _var set [2, true]; player setvariable ['cse_bft_info_cc', _var, true]; ",0], ["Hide BFT Icon","button","private '_var'; _var = [player] call cse_fnc_getTrackerInformation_CC; _var set [2, false]; player setvariable ['cse_bft_info_cc', _var, true]; ",0]],[WEST,EAST,INDEPENDENT],"[_this select 0] call cse_fnc_openScreen_home_CC;", ["All"]]call cse_fnc_registerApp_CC;
_sideBarCC_APP = [["Blue Force Tracking","label","",0],
["Toggle Intel Layer","button","if (isnil 'CSE_TOGGLE_INTEL_LAYER_CC') then { CSE_TOGGLE_INTEL_LAYER_CC = true; } else { CSE_TOGGLE_INTEL_LAYER_CC = !CSE_TOGGLE_INTEL_LAYER_CC; };",0],
["Toggle Route Layer","button","if (isnil 'CSE_TOGGLE_ROUTE_LAYER_CC') then { CSE_TOGGLE_ROUTE_LAYER_CC = true; } else { CSE_TOGGLE_ROUTE_LAYER_CC = !CSE_TOGGLE_ROUTE_LAYER_CC; };",0],
["Toggle Callsigns","button","if (isnil 'CSE_TOGGLE_CALLSIGNS_CC') then { CSE_TOGGLE_CALLSIGNS_CC = true; } else { CSE_TOGGLE_CALLSIGNS_CC = !CSE_TOGGLE_CALLSIGNS_CC; };",0]
];
["cc_app","C2","cse\cse_sys_cc\data\icons\map-icon.paa",0,_sideBarCC_APP,[WEST,EAST,INDEPENDENT],"[_this select 0,WEST] call cse_fnc_openScreen_cc_app_CC;", ["All"]] call cse_fnc_registerApp_CC;
CSE_TOGGLE_CALLSIGNS_CC = true;
CSE_TOGGLE_ROUTE_LAYER_CC = true;
CSE_TOGGLE_INTEL_LAYER_CC = true;
[] spawn {
waituntil {
CSE_TRACKER_ICONS = [] call cse_fnc_displayBFTSymbols_CC;
uisleep 5;
false;
};
};
if (CSE_ALLOW_LIVE_FEEDS_CC) then {
_sideBarCC_APP = [["Live Feed","label","",0],
["Disconnect","button","[call cse_fnc_getCurrentDeviceName_CC, CSE_PREVIOUS_APPLICATION_CC] call cse_fnc_openScreen_CC; [call cse_fnc_getCurrentDeviceName_CC,'main', 'hidden'] call cse_fnc_setPiP_CC; ",0]
];
["LiveFeed_Viewing","","", 1,_sideBarCC_APP,[WEST,EAST,INDEPENDENT],"if (!isNull CSE_LIVEFEED_TARGET_CC) then { if (CSE_LIVEFEED_TARGET_CC in allUnitsUAV) exitwith {}; if ([CSE_LIVEFEED_TARGET_CC, call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_canViewFeed_CC) then {[_this select 0] call cse_fnc_openScreen_liveFeed_CC;} else {[_this select 0, 'LiveFeed_app'] call cse_fnc_openScreen_CC;}; };", ["All"]] call cse_fnc_registerApp_CC;
_sideBarCC_APP = [["Live Feed","label","",0],
["Disconnect","button","[call cse_fnc_getCurrentDeviceName_CC, CSE_PREVIOUS_APPLICATION_CC] call cse_fnc_openScreen_CC; [call cse_fnc_getCurrentDeviceName_CC,'main', 'hidden'] call cse_fnc_setPiP_CC; ",0],
["Take Control","button","if (!isNull CSE_LIVEFEED_TARGET_CC) then { if !(CSE_LIVEFEED_TARGET_CC in allUnitsUAV) exitwith {}; if ([CSE_LIVEFEED_TARGET_CC, call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_canViewFeed_CC) then {[CSE_LIVEFEED_TARGET_CC] call cse_fnc_takeControlUAV_CC; }; };",0]
];
["LiveFeed_Viewing_UAV","","", 1, _sideBarCC_APP,[WEST,EAST,INDEPENDENT],"if (!isNull CSE_LIVEFEED_TARGET_CC) then { if !(CSE_LIVEFEED_TARGET_CC in allUnitsUAV) exitwith {}; if ([CSE_LIVEFEED_TARGET_CC, call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_canViewFeed_CC) then {[_this select 0] call cse_fnc_openScreen_liveFeed_CC;} else {[_this select 0, 'LiveFeed_app'] call cse_fnc_openScreen_CC;};};", ["All"]] call cse_fnc_registerApp_CC;
["LiveFeed_app","TACNET","cse\cse_sys_cc\data\icons\icon_livefeed_app.paa", 0,[],[WEST,EAST,INDEPENDENT],"[_this select 0] call cse_fnc_openScreen_liveFeed_app_CC;", ["All"]] call cse_fnc_registerApp_CC;
};

View File

@ -0,0 +1,238 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project name="Combat Space Enhancement">
<Package name="cse_sys_cc">
<Container ID="Configuration">
<Key ID="STR_OPEN_CC_DEVICE_CONFIGURATION_TITLE">
<Original>open BFT Tablet/PDA</Original>
<Polish>Otwórz Tablet/PDA BFT</Polish>
<Spanish>Abrir Tableta BFT/PDA</Spanish>
</Key>
<Key ID="STR_OPEN_CC_DEVICE_CONFIGURATION_DESC">
<Original>Opens the tablet or PDA from CC if you have one in your inventory. Tablet takes priority above PDA.</Original>
<Polish>Otwiera tablet lub PDA z poziomu Konsoli Dowodzenia jeżeli posiadasz takowy na wyposażeniu. Tablet ma priorytet nad PDA.</Polish>
<Spanish>Abre la Tableta o PDA desde CC si tienes una en el inventario. La Tableta tiene priorida sobre la PDA</Spanish>
</Key>
<Key ID="STR_OPEN_CC_ONBOARD_CONFIGURATION_TITLE">
<Original>open On board BFT Device</Original>
<Polish>Otwórz pokładowe urządzenie BFT</Polish>
<Spanish>Abre el dispositivo BFT de a bordo</Spanish>
</Key>
<Key ID="STR_OPEN_CC_ONBOARD_CONFIGURATION_DESC">
<Original>Opens the onboard BFT device of the vehicle the player is currently in, if available.</Original>
<Polish>Otwiera pokładowe urządzenie BFT w pojeździe, w którym znajduje się gracz, jeżeli pojazd ten posiada takowe urzadzenie.</Polish>
<Spanish>Abre el dispositivo BFT del vehículo del jugador, si estuviera disponible.</Spanish>
</Key>
</Container>
<Container ID="CfgWeapons">
<Key ID="STR_ITEM_CSE_M_TABLET_DISPLAY">
<Original>Military Tablet (NATO)</Original>
<Polish>Wojskowy Tablet (NATO)</Polish>
<Spanish>Tableta Militar (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_DESC">
<Original>Military Tablet (NATO)</Original>
<Polish>Wojskowy Tablet (NATO)</Polish>
<Spanish>Tableta Militar (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_DESC_USE"></Key>
<Original>Military Tablet (NATO)</Original>
<Polish>Wojskowy Tablet (NATO)</Polish>
<Spanish>Tableta Militar (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_DISPLAY">
<Original>PDA (NATO)</Original>
<Polish>PDA (NATO)</Polish>
<Spanish>PDA (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_DESC">
<Original>A PDA for use in the field (NATO)</Original>
<Polish>Palmtop przystosowany do użytku w polu (NATO)</Polish>
<Spanish>PDA para uso en el campo de batalla (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_DESC_USE">
<Original>A PDA, for use in the field (NATO)</Original>
<Polish>Palmtop przystosowany do użytku w polu (NATO)</Polish>
<Spanish>PDA para uso en el campo de batalla (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_UK_DISPLAY">
<Original>Military Tablet (UK/NATO)</Original>
<Polish>Wojskowy Tablet (UK/NATO)</Polish>
<Spanish>Tableta Militar (UK/OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_UK_DESC">
<Original>A Tablet for use in the field (UK/NATO)</Original>
<Polish>Tablet przystosowany do użytku w polu (UK/NATO)</Polish>
<Spanish>Una Tableta para uso en el campo de batalla (UK/OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_UK_DESC_USE">
<Original>UK Tablet. Functions with NATO side.</Original>
<Polish>Brytyjski Tablet. Współdziała dla strony NATO.</Polish>
<Spanish>Tableta UK. Funciones del bando OTAN.</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_O_DISPLAY">
<Original>Military Tablet (OPFOR)</Original>
<Polish>Wojskowy Tablet (OPFOR)</Polish>
<Spanish>Tableta Militar (OPFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_O_DESC">
<Original>Military Tablet for OPFOR</Original>
<Polish>Wojskowy Tablet dla strony OPFOR</Polish>
<Spanish>Tableta Militar para OPFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_O_DESC_USE">
<Original>OPFOR Tablet</Original>
<Polish>Tablet OPFOR</Polish>
<Spanish>Tableta Militar OPFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_O_DISPLAY">
<Original>PDA (OPFOR)</Original>
<Polish>PDA (OPFOR)</Polish>
<Spanish>PDA (OPFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_O_DESC">
<Original>A PDA for use in the field (OPFOR)</Original>
<Polish>Palmtop przystosowany do użytku w polu (OPFOR)</Polish>
<Spanish>PDA para uso en el campo de batalla (OPFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_O_DESC_USE">
<Original>OPFOR PDA</Original>
<Polish>PDA (OPFOR)</Polish>
<Spanish>PDA OPFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_G_DISPLAY">
<Original>Military Tablet (IND)</Original>
<Polish>Wojskowy Tablet (IND)</Polish>
<Spanish>Tableta Militar (IND)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_G_DESC">
<Original>Military Tablet for IND</Original>
<Polish>Wojskowy Tablet dla strony INDFOR</Polish>
<Spanish>Tableta Militar para IND</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_TABLET_G_DESC_USE">
<Original>Independent Tablet</Original>
<Polish>Wojskowy Tablet (IND)</Polish>
<Spanish>Tableta del bando Independiente</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_G_DISPLAY">
<Original>PDA (IND)</Original>
<Polish>PDA (IND)</Polish>
<Spanish>PDA (IND)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_G_DESC">
<Original>A PDA for use in the field (IND)</Original>
<Polish>Palmtop przystosowany do użytku w polu (IND)</Polish>
<Spanish>PDA para uso en el campo de batalla (IND)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_M_PDA_G_DESC_USE">
<Original>Independent PDA</Original>
<Polish>PDA (INDFOR)</Polish>
<Spanish>PDA del bando Independiente</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_DISPLAY">
<Original>Helmet Camera (NATO)</Original>
<Polish>Kamera nahełmowa (NATO)</Polish>
<Spanish>Cámara del Casco (OTAN)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_DESC">
<Original>Helmet Camera for NATO forces</Original>
<Polish>Kamera nahełmowa dla sił NATO</Polish>
<Spanish>Cámara del Casco para fuerzas de la OTAN</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_DESC_SHORT">
<Original>NATO Helmet Camera</Original>
<Polish>Kamera nahełmowa NATO</Polish>
<Spanish>Cámara del Casco OTAN</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_O_DISPLAY">
<Original>Helmet Camera (OPFOR)</Original>
<Polish>Kamera nahełmowa (OPFOR)</Polish>
<Spanish>Cámara del Casco (OPFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_O_DESC">
<Original>Helmet Camera for OPFOR forces</Original>
<Polish>Kamera nahełmowa dla sił OPFOR</Polish>
<Spanish>Cámara del Casco para fuerzas OPFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_O_DESC_SHORT">
<Original>OPFOR Helmet Camera</Original>
<Polish>Kamera nahełmowa OPFOR</Polish>
<Spanish>Cámara del Casco OPFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_G_DISPLAY">
<Original>Helmet Camera (IND)</Original>
<Polish>Kamera nahełmowa (IND)</Polish>
<Spanish>Cámara del Casco (IND)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_G_DESC">
<Original>Helmet Camera for Independent</Original>
<Polish>Kamera nahełmowa dla sił INDFOR</Polish>
<Spanish>Cámara del Casco de los Independientes</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_HELMET_CAMERA_G_DESC_SHORT">
<Original>IND Helmet Camera</Original>
<Polish>Kamera nahełmowa INDFOR</Polish>
<Spanish>Cámara del Casco IND</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_G_DISPLAY">
<Original>Blue Force Tracker (IND)</Original>
<Polish>Blue Force Tracker (IND)</Polish>
<Spanish>Blue Force Tracker (IND)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_G_DESC">
<Original>Blue Force Tracker for Independent</Original>
<Polish>Blue Force Tracker dla strony INDFOR</Polish>
<Spanish>Blue Force Tracker para Independentes</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_G_DESC_SHORT">
<Original>Blue Force Tracker (IND)</Original>
<Polish>Blue Force Tracker (IND)</Polish>
<Spanish>Blue Force Tracker (IND)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_O_DISPLAY">
<Original>Blue Force Tracker (OPFOR)</Original>
<Polish>Blue Force Tracker (OPFOR)</Polish>
<Spanish>Blue Force Tracker (OPFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_O_DESC">
<Original>Blue Force Tracker for OPFOR</Original>
<Polish>Blue Force Tracker dla strony OPFOR</Polish>
<Spanish>Blue Force Tracker para OPFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_O_DESC_SHORT">
<Original>Blue Force Tracker (OPFOR)</Original>
<Polish>Blue Force Tracker (OPFOR)</Polish>
<Spanish>Blue Force Tracker (OPFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_W_DISPLAY">
<Original>Blue Force Tracker (BLUFOR)</Original>
<Polish>Blue Force Tracker (BLUFOR)</Polish>
<Spanish>Blue Force Tracker (BLUFOR)</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_W_DESC">
<Original>Blue Force Tracker for BLUFOR</Original>
<Polish>Blue Force Tracker dla strony BLUFOR</Polish>
<Spanish>Blue Force Tracker para BLUFOR</Spanish>
</Key>
<Key ID="STR_ITEM_CSE_TRACKERITEM_W_DESC_SHORT">
<Original>Blue Force Tracker (BLUFOR)</Original>
<Polish>Blue Force Tracker (BLUFOR)</Polish>
<Spanish>Blue Force Tracker (BLUFOR)</Spanish>
</Key>
</Container>
</Package>
</Project>

View File

@ -0,0 +1,39 @@
private ["_mpSync","_args","_nearest","_lastestCount","_pos","_count","_position"];
_position = [_this, 0, [0,0,0], [[]],3] call BIS_fnc_param;
_nearest = 25;
_lastestCount = -1;
_marker = [];
{
_pos = (_x select 0);
if ((_pos distance _position) < _nearest) then {
_nearest = _pos distance _position;
_lastestCount = _foreachIndex;
_marker = _x;
};
}foreach CSE_INTEL_MARKER_COLLECTION_CC;
if (_lastestCount < 0) exitwith {};
_selection = _marker select 4;
_usedDesc = _marker select 5;
_inputDesc = if (_usedDesc) then { _marker select 1 select 1;} else { "" };
_device = call cse_fnc_getCurrentDeviceName_CC;
[_device,"open","SALUTE Report",format["[_this,%1,'intel', ([([] call cse_fnc_getCurrentDeviceName_CC)] call cse_fnc_getDeviceSide_CC)] call cse_fnc_updateMarker_CC",_position]] call cse_fnc_setPopUpMenu_CC;
_opt = [
["Type:","combo","",
["Infantry","Motorized","Plane","Helicopter","Armor","Naval","HQ","Medical","Maintanance","Artillery","Mortar","Service","Recon","Mechanized","uav","Installation","Unknown"], _selection select 0
],
["Side:","combo","",["BLUFOR","OPFOR","GREENFOR","UNKNOWN"], _selection select 1],
["direction:","combo","",["Static","North","North East","East","South East","South","South West","West","North West"], _selection select 2],
["Size:","combo","",["Pax","Fire Team","Section","Platoon","Company","Battalion","Regiment", "Brigade"], _selection select 3],
["","combo","",["1x","2x","3x","4x","5x","6x", "7x"], _selection select 4],
["Description:","input",_inputDesc]
];
[_device,_opt] call cse_fnc_setPopUpOptions_CC;
cse_fnc_updateMarker_CC = {
[CSE_CLICKED_ON_MAP_FOUND_INTELMARKER_CC] call cse_fnc_removeIntelMarker_CC;
_this call cse_fnc_placeMarker_CC;
};

View File

@ -0,0 +1,50 @@
/**
* fn_getFirstAvailableOptionFieldMain_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_LABEL_IDC 140
#define START_COMBO_IDC 150
#define START_BUTTON_IDC 160
#define START_EDIT_IDC 171
#define START_LB_IDC 180
private ["_deviceName","_display","_type","_idcStart","_return"];
_deviceName = _this select 0;
_type = _this select 1;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_idcStart = switch (_type) do {
case "label": {
START_LABEL_IDC
};
case "drop": {
START_COMBO_IDC
};
case "button": {
START_BUTTON_IDC
};
case "edit": {
START_EDIT_IDC
};
case "lb": {
START_LB_IDC
};
default {-1};
};
_return = controlNull;
for [{_i=_idcStart},{_i < _idcStart + 10},{_i=_i+1}] do {
_ctrl = (_display displayCtrl _i);
_foundPos = ctrlPosition _ctrl;
if (_foundPos select 2 <= 0) exitwith {
_return = _ctrl;
};
};
_return

View File

@ -0,0 +1,46 @@
/**
* fn_getFirstAvailableOptionField_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_LABEL_IDC 40;
#define START_LB_IDC 50;
#define START_BUTTON_IDC 60;
#define START_EDIT_IDC 71;
private ["_deviceName","_display","_type","_idcStart","_return"];
_deviceName = _this select 0;
_type = _this select 1;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_idcStart = switch (_type) do {
case "label": {
START_LABEL_IDC
};
case "drop": {
START_LB_IDC
};
case "button": {
START_BUTTON_IDC
};
case "edit": {
START_EDIT_IDC
};
default {-1};
};
_return = controlNull;
for [{_i=_idcStart},{_i < _idcStart + 10},{_i=_i+1}] do {
_ctrl = (_display displayCtrl _i);
_foundPos = ctrlPosition _ctrl;
if (_foundPos select 2 <= 0) exitwith {
_return = _ctrl;
};
};
_return

View File

@ -0,0 +1,16 @@
/**
* fn_getNavBarRatio_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings"];
_deviceName = _this select 0;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_settings set[3,(_settings select 3) / 13];
_settings

View File

@ -0,0 +1,60 @@
/**
* fn_getOptionFieldOnPos_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_LABEL_IDC 40;
#define START_LB_IDC 50;
#define START_BUTTON_IDC 60;
#define START_EDIT_IDC 71;
private ["_deviceName","_settings","_display","_pos","_ctrl","_options","_idcStart","_ctrlPosition","_return","_possibleTypes","_sideBarHeight","_buttonHeightwithSpacing","_buttonSpacing","_buttonHeight","_maxPositions"];
_deviceName = _this select 0;
_pos = _this select 1;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_maxPositions = (_settings select 3) / 0.05;
_maxPositions = 12;
_sideBarHeight = _sideBarRatio select 3;
_buttonHeightwithSpacing = _sideBarHeight / _maxPositions;
_buttonSpacing = _buttonHeightwithSpacing / 20;
_buttonHeight = _buttonHeightwithSpacing - _buttonSpacing;
_ctrlPosition = [(_sideBarRatio select 0) + 0.001, (_sideBarRatio select 1) + (_navBarRatio select 3)/1.5, (_sideBarRatio select 2) - 0.002, _buttonHeight];
_ctrlPosition set[1, (_ctrlPosition select 1) + (_pos * (_buttonHeight + _buttonSpacing))+ 0.002];
_display = uiNamespace getvariable _deviceName;
_return = controlNull;
_possibleTypes = ["label","drop","button","edit"];
{
_idcStart = switch (_x) do {
case "label": {
START_LABEL_IDC
};
case "drop": {
START_LB_IDC
};
case "button": {
START_BUTTON_IDC
};
case "edit": {START_EDIT_IDC};
default {-1};
};
private ["_i","_foundPos"];
for [{_i=_idcStart},{_i < _idcStart + 10},{_i=_i+1}] do {
_ctrl = (_display displayCtrl _i);
_foundPos = ctrlPosition _ctrl;
if (((_foundPos select 0 == _ctrlPosition select 0) && (_foundPos select 1 == _ctrlPosition select 1) && (_foundPos select 2 == _ctrlPosition select 2) && (_foundPos select 3 == _ctrlPosition select 3))) then {
_return = _ctrl;
};
};
}foreach _possibleTypes;
_return

View File

@ -0,0 +1,20 @@
/**
* fn_getPopUpRatio_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_spacingSide","_spacingTop","_widthOfPopUp","_heightOfPopUp"];
disableSerialization;
_deviceName = (call cse_fnc_getCurrentDeviceName_CC);
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_spacingSide = (_settings select 2) / 10;
_spacingTop = (_settings select 3) / 10;
_widthOfPopUp = ((_settings select 2)) - (_spacingSide * 2);
_heightOfPopUp = ((_settings select 3)) - (_spacingTop * 2);
([(_settings select 0) + _spacingSide, (_settings select 1) + _spacingTop,_widthOfPopUp, _heightOfPopUp])

View File

@ -0,0 +1,50 @@
/**
* fn_getSideBarOptionFields_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_currentApp","_cfg","_return","_posCounter","_pos"];
_deviceName = _this select 0;
_return = [];
_currentApp = call cse_fnc_getCurrentApplication_CC;
_posCounter = 0;
if (isnil 'CSE_REGISTERED_DEVICES_CC') then {
CSE_REGISTERED_DEVICES_CC = [];
};
{
if (_x select 0 == _currentApp) exitwith {
{
private ["_text","_type","_action","_newOptionField"];
_text = _x select 0;
_type = _x select 1;
_action = _x select 2;
_pos = _x select 3;
_option = [_text,_type,_action];
if (_pos < _posCounter) then {
_pos = _posCounter;
};
if (_posCounter < _pos) then {
_posCounter = _pos;
};
if (_type == "drop") then {
private ["_values","_valueCfg"];
_values = (_x select 4);
_option set[3,_values];
};
_newOptionField = [_pos,_option];
_return pushback _newOptionField;
_posCounter = _posCounter + 1;
}foreach (_x select 4);
};
}foreach CSE_REGISTERED_APPLICATIONS_CC;
_return

View File

@ -0,0 +1,42 @@
/**
* fn_getSideBarRatio_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl"];
_deviceName = _this select 0;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_navBarSettings = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_sideBarFullScreen = {
private["_deviceName","_cfg","_allowSideBar"];
_deviceName = _this select 0;
_allowSidebar = 0;
if (isnil 'CSE_REGISTERED_DEVICES_CC') then {
CSE_REGISTERED_DEVICES_CC = [];
};
{
if (_x select 0 == _deviceName) exitwith {
_allowSidebar = _x select 2;
};
}foreach CSE_REGISTERED_DEVICES_CC;
_allowSidebar
};
_sideBarN = ([_deviceName] call _sideBarFullScreen);
_return = switch (_sideBarN) do {
case 1: {[(_settings select 0) + ((_settings select 2)-((_settings select 2) / 4.5)), (_settings select 1) + (_navBarSettings select 3)/2, (_settings select 2)/4.5, (_settings select 3) - (_navBarSettings select 3)/2]};
case 2: {[(_settings select 0) + ((_settings select 2)-((_settings select 2) / 1.5)), (_settings select 1)+ (_navBarSettings select 3)/2, (_settings select 2)/1.5, (_settings select 3) - (_navBarSettings select 3)/2]};
case 3: {[_settings select 0, (_settings select 1)+ (_navBarSettings select 3)/2, _settings select 2, (_settings select 3) - (_navBarSettings select 3)/2]};
default {[0,0,0,0]};
};
_return

View File

@ -0,0 +1,20 @@
/**
* fn_isMapOpen_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_return","_idc"];
_deviceName = _this select 0;
_selected = _this select 1;
_display = uiNamespace getvariable _deviceName;
_idc = switch (_selected) do {
case "main": {10};
case "sidebar": {11};
default {10};
};
!((ctrlPosition ((_display displayCtrl _idc)) select 0 == 0) && ((ctrlPosition (_display displayCtrl _idc)) select 1 == 0))

View File

@ -0,0 +1,15 @@
/**
* fn_isOpenBottomBar_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_return","_idc"];
_deviceName = _this select 0;
_display = uiNamespace getvariable _deviceName;
_idc = 155;
!((ctrlPosition ((_display displayCtrl _idc)) select 0 == 0) && ((ctrlPosition (_display displayCtrl _idc)) select 2 == 0))

View File

@ -0,0 +1,20 @@
/**
* fn_isPiPOpen_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_return","_idc"];
_deviceName = _this select 0;
_selected = _this select 1;
_display = uiNamespace getvariable _deviceName;
_idc = switch (_selected) do {
case "main": {20};
case "sidebar": {21};
default {20};
};
!((ctrlPosition ((_display displayCtrl _idc)) select 0 == 0) && ((ctrlPosition (_display displayCtrl _idc)) select 2 == 0))

View File

@ -0,0 +1,24 @@
/**
* fn_isPopUpOpen_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName"];
_deviceName = _this select 0;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_backGroundCtrl = (_display displayCtrl 150);
_return = false;
{
if (_x != 0) then {
_return = true;
};
}foreach (ctrlPosition _backGroundCtrl);
_return

View File

@ -0,0 +1,19 @@
/**
* fn_isSelectMenuOpen_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_IDC 260
#define NUMBER_OF_IC 9
private ["_deviceName","_display"];
_deviceName = _this select 0;
_display = uiNamespace getvariable _deviceName;
(((ctrlPosition (_display displayCtrl START_IDC)) select 2) != 0)

View File

@ -0,0 +1,78 @@
/**
* fn_popUpAccept_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_IDC_LABEL 240
#define START_IDC_COMBO 250
#define START_IDC_BTN 260
#define START_IDC_LIST 280
#define START_IDC_INPUT 270
private ["_deviceName","_display","_ctrlBtn","_ctrlLbl","_ctrlCmbo","_return","_name","_type","_action","_ctrlRight","_ctrlLeft","_content","_ctrlInput"];
_deviceName = _this select 0;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrlBtn = START_IDC_BTN;
_ctrlLbl = START_IDC_LABEL;
_ctrlCmbo = START_IDC_COMBO;
_ctrlInput = START_IDC_INPUT;
_return = [];
_selectables = [];
{
_name = _x select 0;
_type = _x select 1;
_action = _x select 2;
switch (_type) do {
case "btn": {
_ctrlRight = (_display displayCtrl _ctrlBtn);
_ctrlBtn = _ctrlBtn + 1;
_selectables pushback -1;
};
case "label": {
_ctrlRight = (_display displayCtrl _ctrlLbl);
_ctrlLbl = _ctrlLbl + 1;
_selectables pushback -1;
};
case "combo": {
_ctrlRight = (_display displayCtrl _ctrlCmbo);
_ctrlLeft = (_display displayCtrl _ctrlLbl);
_ctrlCmbo = _ctrlCmbo + 1;
_ctrlLbl = _ctrlLbl + 1;
_content = (_x select 3);
if (isnil "_content") then {
_content = [];
};
if (typeName _content != typeName []) then {
_content = [];
};
_selected = lbCurSel _ctrlRight;
if (_selected <0) then {
_selected = 0;
};
_value = (_content select _selected);
_return pushback _value;
_selectables pushback _selected;
};
case "input": {
_ctrlRight = (_display displayCtrl _ctrlInput);
_ctrlInput = _ctrlInput + 1;
_return pushback (ctrlText _ctrlRight);
_selectables pushback -1;
};
default {};
};
}foreach CSE_POP_UP_OPTIONS_CC;
_return pushback _selectables;
_return

View File

@ -0,0 +1,23 @@
/**
* fn_removeOptionField_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_LABEL_IDC 40;
#define START_LB_IDC 50;
#define START_BUTTON_IDC 60;
private ["_deviceName","_pos","_return","_ctrl"];
_deviceName = _this select 0;
_pos = _this select 1;
_ctrl = [_deviceName,_pos] call cse_fnc_getOptionFieldOnPos_CC;
_ctrl ctrlSetPosition [0,0,0,0];
_ctrl ctrlCommit 0;
_ctrl

View File

@ -0,0 +1,22 @@
/**
* fn_removeSelectMenu_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_IDC 260
#define NUMBER_OF_IC 9
private ["_deviceName","_display"];
_deviceName = _this select 0;
_display = uiNamespace getvariable _deviceName;
for [{_i=START_IDC},{_i < START_IDC + NUMBER_OF_IC},{_i=_i+1}] do {
(_display displayCtrl _i) ctrlSetPosition [0,0,0,0];
(_display displayCtrl _i) ctrlCommit 0;
};

View File

@ -0,0 +1,36 @@
/**
* fn_setBackground_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl","_newBackGround"];
_deviceName = _this select 0;
_pos = _this select 1;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrl = (_display displayCtrl 1);
_newPos = switch (_pos) do {
case "full": {_settings};
case "hidden": {[0,0,0,0]};
};
_newBackGround = "cse\cse_sys_cc\data\empty_background2.paa";
if (count _this > 2) then {
_newBackGround = switch (_this select 2) do {
case "black": {"cse\cse_sys_cc\data\black_background.paa"};
default {"cse\cse_sys_cc\data\empty_background2.paa"};
};
};
_ctrl ctrlSetText _newBackGround;
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlCommit 0;

View File

@ -0,0 +1,65 @@
/**
* fn_setBottomBar_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl","_newBackGround"];
_deviceName = _this select 0;
_pos = _this select 1;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_settings set[1,(_settings select 1) + (_settings select 3) - ((_settings select 3) / 13)];
_settings set[3,(_settings select 3) / 13];
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrl = (_display displayCtrl 155);
_newPos = switch (_pos) do {
case "show": {_settings};
case "hidden": {[0,0,0,0]};
};
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlCommit 0;
_ctrl = (_display displayCtrl 156);
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlSetText "";
_ctrl ctrlCommit 0;
if (_pos == "Show") then {
[_deviceName] spawn {
_deviceName = _this select 0;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrl = (_display displayCtrl 156);
_mapCtrl = (_display displayCtrl 10);
if (isnil "CSE_MOUSE_RELATIVE_POSITION") then {
CSE_MOUSE_RELATIVE_POSITION = [0,0];
};
while {([_deviceName] call cse_fnc_isOpenBottomBar_CC)} do {
if !([_deviceName, "main"] call cse_fnc_isPiPOpen_CC) then {
_WorldCoord = _mapCtrl posScreenToWorld CSE_MOUSE_RELATIVE_POSITION;
_WorldCoord set [2, 0];
_mousePosition = mapGridPosition _WorldCoord;
_positionPlayer = mapGridPosition player;
_playerPos = getPos player;
_playerPos set [2, 0];
_ctrl ctrlSetText format["CUR: %1 TAG: %2 DIS: %3",_positionPlayer,_mousePosition, _playerPos distance _WorldCoord];
} else {
_targetPos = getPos CSE_LIVEFEED_TARGET_CC;
_targetPos set [2, 0];
_mousePosition = mapGridPosition _targetPos;
_positionPlayer = mapGridPosition player;
_playerPos = getPos player;
_playerPos set [2, 0];
_ctrl ctrlSetText format["CUR: %1 TAG: %2 DIS: %3",_positionPlayer,_mousePosition, _playerPos distance _targetPos];
};
};
};
};

View File

@ -0,0 +1,19 @@
/**
* fn_setMainOptionField_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl","_options","_buttonHeightwithSpacing","_sideBarHeight","_buttonHeight","_buttonSpacing"];
_deviceName = _this select 0;
_pos = round(_this select 1);
_options = _this select 2;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_maxPositions = (_settings select 3) / 0.05;
_maxPositions = 12;

View File

@ -0,0 +1,80 @@
/**
* fn_setMap_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl","_newPos"];
_deviceName = _this select 0;
_selected = _this select 1;
_pos = _this select 2;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_idc = switch (_selected) do {
case "main": {10};
case "sidebar": {11};
default {10};
};
_ctrl = (_display displayCtrl _idc);
_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_navBarHeight = _navBarRatio select 3;
_sideBarWidth = _sideBarRatio select 2;
_fullScreenSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2) - _sideBarWidth, (_settings select 3) - (_navBarHeight*2)];
_fullScreenNoSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), (_settings select 3) - (_navBarHeight*2)];
_newPos = switch (_pos) do {
case "full": {
[_deviceName,"show"] call cse_fnc_setBottomBar_CC;
if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then {
_fullScreenSideBar
} else {
_fullScreenNoSideBar
};
};
default { /* includes hidden */
[_deviceName,"hidden"] call cse_fnc_setBottomBar_CC;
[0,0,0,0]
};
};
if (_selected == "sidebar") then {
_sideBarMapWidth = _sideBarWidth - 0.02;
_sideBarMapHeight = ((_sideBarRatio select 3) / 12) * 2;
_newPos = switch (_pos) do {
case "top": {[(_sideBarRatio select 0) + 0.01 , (_settings select 1) + _navBarHeight + _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]};
case "center": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth*2,_sideBarMapWidth, _sideBarMapHeight]};
case "bottom": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]};
case "hidden": {[0,0,0,0]};
default {[0,0,0,0]};
};
if (_pos == "invisable" || _pos == "visable") then {
_newPos = ctrlPosition _ctrl;
if (_pos == "invisable") then {
_ctrl ctrlShow false;
} else {
_ctrl ctrlShow true;
};
};
};
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlCommit 0;
_ctrl ctrlEnable true;
if (_selected == "sidebar" && !(_pos == "visable" || _pos == "invisable" || _pos == "hidden")) then {
if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then {
[_deviceName,"sidebar","visable"] call cse_fnc_setMap_CC;
} else {
[_deviceName,"sidebar","invisable"] call cse_fnc_setMap_CC;
};
};
_ctrl

View File

@ -0,0 +1,73 @@
private ["_deviceName","_settings","_display","_pos","_ctrl", "_moment", "_lastNumber"];
_deviceName = _this select 0;
_pos = _this select 1;
_settings = [_deviceName] call cse_fnc_getNavBarRatio_CC;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrl = (_display displayCtrl 3);
_newPos = switch (_pos) do {
case "top": {_settings};
case "hidden": {[0,0,0,0]};
};
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlCommit 0;
_allowsideBar = {
private["_deviceName","_cfg","_allowSideBar"];
_deviceName = _this select 0;
_allowSidebar = 0;
if (isnil 'CSE_REGISTERED_DEVICES_CC') then {
CSE_REGISTERED_DEVICES_CC = [];
};
{
if (_x select 0 == _deviceName) exitwith {
_allowSidebar = _x select 2;
};
}foreach CSE_REGISTERED_DEVICES_CC;
(_allowSidebar > 0)
};
if ([_deviceName] call _allowsideBar) then {
_openSideBarCtrl = (_display displayCtrl 4);
_openSideBarCtrl ctrlSetPosition [
(_settings select 0) + (( _settings select 2) - (_settings select 3)),
(_settings select 1),
(_settings select 3),
(_settings select 3)
];
_openSideBarCtrl ctrlCommit 0;
_openSideBarCtrl ctrlSetEventHandler ["ButtonClick", format["['%1','toggle'] call cse_fnc_setSideBar_CC;",_deviceName]];
};
_navBarIconHomeCtrl = (_display displayCtrl 199);
_navBarIconHomeCtrl ctrlSetPosition [(_settings select 0),(_settings select 1),(_settings select 3),(_settings select 3)];
_navBarIconHomeCtrl ctrlSetText "cse\cse_sys_cc\data\home_icon.paa";
_navBarIconHomeCtrl ctrlCommit 0;
(_display displayCtrl 198) ctrlSetPosition [(_settings select 0),(_settings select 1),(_settings select 3),(_settings select 3)];
(_display displayCtrl 198) ctrlCommit 0;
(_display displayCtrl 198) ctrlSetEventHandler ["ButtonClick", format["['%1','home'] call cse_fnc_openScreen_CC;",_deviceName]];
_infoLabelCtrl = (_display displayCtrl 5);
_infoLabelCtrl ctrlSetPosition [
(_settings select 0),
(_settings select 1),(_settings select 2) - (_settings select 3),(_settings select 3)
];
_infoLabelCtrl ctrlCommit 0;
[_infoLabelCtrl] spawn {
disableSerialization;
_infoLabelCtrl = _this select 0;
while {dialog} do {
_lastNumber = date select 4;
_moment = format["%1:%2",date select 3, _lastNumber];
if (_lastNumber < 10) then {
_moment = format["%1:0%2",date select 3, _lastNumber];
};
_infoLabelCtrl ctrlSetText _moment;
};
};

View File

@ -0,0 +1,79 @@
/**
* fn_setOptionField_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl","_options","_buttonHeightwithSpacing","_sideBarHeight","_buttonHeight","_buttonSpacing"];
_deviceName = _this select 0;
_pos = round(_this select 1);
_options = _this select 2;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_maxPositions = (_settings select 3) / 0.05;
_maxPositions = 12;
_sideBarHeight = _sideBarRatio select 3;
_buttonHeightwithSpacing = _sideBarHeight / _maxPositions;
_buttonSpacing = _buttonHeightwithSpacing / 20;
_buttonHeight = _buttonHeightwithSpacing - _buttonSpacing;
_type = _options select 1;
if (((_pos < 0) || _pos >= _maxPositions) && !(_type == "map")) exitwith {};
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrlPosition = [(_sideBarRatio select 0) + 0.001, (_sideBarRatio select 1) + (_navBarRatio select 3)/ 1.5, (_sideBarRatio select 2) - 0.002, _buttonHeight];
_ctrlPosition set[1, (_ctrlPosition select 1) + (_pos * (_buttonHeight + _buttonSpacing))+ 0.002];
//_ctrlPosition set[2, 0.2];
//_ctrlPosition set[3,0.04];
_labelText = _options select 0;
[_deviceName,_pos] call cse_fnc_removeOptionField_CC;
_ctrl = [_deviceName,_type] call cse_fnc_getFirstAvailableOptionField_CC;
_ctrl ctrlSetPosition _ctrlPosition;
//_ctrl ctrlSetFontHeight _buttonHeight;
switch (_type) do {
case "label": {
_ctrl ctrlSetText _labelText;
};
case "edit": {
_ctrl ctrlSetText "";
};
case "drop": {
private ["_index","_availableSelection"];
_availableSelection = _options select 3;
lbClear _ctrl;
if (count _availableSelection > 0) then {
_index = 0;
{
_ctrl lbadd (_x select 0);
_ctrl lbSetData [_index, (_x select 1)];
_index = _index + 1;
}foreach _availableSelection;
} else {
//private ["_refill"];
//_refill = getText ((_cfg select _i) >> "refill");
//[_deviceName, _ctrl] call compile _refill;
};
_ctrl ctrlSetEventHandler ["LBSelChanged", format["['%1',_this] call %2;",_deviceName,compile (_options select 2)]];
};
case "button": {
_ctrl ctrlSetText _labelText;
_ctrl ctrlSetEventHandler ["ButtonClick", format["['%1',_this] call %2;",_deviceName,compile (_options select 2)]];
};
case "map": {
[_deviceName,"sidebar","bottom"] call cse_fnc_setMap_CC;
};
default {};
};
_ctrl ctrlCommit 0;
_ctrl

View File

@ -0,0 +1,81 @@
/**
* fn_setPiP_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl","_newPos"];
_deviceName = _this select 0;
_selected = _this select 1;
_pos = _this select 2;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_idc = switch (_selected) do {
case "main": {20};
case "sidebar": {21};
default {20};
};
_ctrl = (_display displayCtrl _idc);
_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_navBarHeight = _navBarRatio select 3;
_sideBarWidth = _sideBarRatio select 2;
_fullScreenSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2) - _sideBarWidth, (_settings select 3) - (_navBarHeight*2)];
_fullScreenNoSideBar = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), (_settings select 3) - (_navBarHeight*2)];
_newPos = switch (_pos) do {
case "full": {
[_deviceName,"show"] call cse_fnc_setBottomBar_CC;
if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then {
_fullScreenSideBar
} else {
_fullScreenNoSideBar
};
};
default { /* includes hidden */
[_deviceName,"hidden"] call cse_fnc_setBottomBar_CC;
[0,0,0,0]
};
};
if (_selected == "sidebar") then {
_sideBarMapWidth = _sideBarWidth - 0.02;
_sideBarMapHeight = ((_sideBarRatio select 3) / 12) * 2;
_newPos = switch (_pos) do {
case "top": {[(_sideBarRatio select 0) + 0.01 , (_settings select 1) + _navBarHeight + _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]};
case "center": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth*2,_sideBarMapWidth, _sideBarMapHeight]};
case "bottom": {[(_sideBarRatio select 0) + 0.01, (_settings select 1) + (_sideBarRatio select 3) - _sideBarMapWidth,_sideBarMapWidth, _sideBarMapHeight]};
case "hidden": {[0,0,0,0]};
default {[0,0,0,0]};
};
if (_pos == "invisable" || _pos == "visable") then {
_newPos = ctrlPosition _ctrl;
if (_pos == "invisable") then {
_ctrl ctrlShow false;
} else {
_ctrl ctrlShow true;
};
};
};
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlCommit 0;
_ctrl ctrlEnable true;
if (_selected == "sidebar" && !(_pos == "visable" || _pos == "invisable" || _pos == "hidden")) then {
if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then {
[_deviceName,"sidebar","visable"] call cse_fnc_setPiP_CC;
} else {
[_deviceName,"sidebar","invisable"] call cse_fnc_setPiP_CC;
};
};
_ctrl

View File

@ -0,0 +1,102 @@
/**
* fn_setPopUpMenu_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_toggle","_deviceName","_position","_display","_backGroundCtrl"];
_deviceName = _this select 0;
_toggle = _this select 1;
//if (([_deviceName] call cse_fnc_isPopUpOpen_CC) && _toggle == "open") exitwith { };
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_backGroundCtrl = (_display displayCtrl 150);
_headerCtrl = (_display displayCtrl 151);
_headerTitle = (_display displayCtrl 152);
_buttonClose = (_display displayCtrl 154);
_buttonAccept = (_display displayCtrl 153);
if (_toggle == "open") then {
disableSerialization;
//_navBarSettings = [_deviceName] call cse_fnc_getNavBarRatio_CC;
if ([_deviceName] call cse_fnc_isSideBarOpen_CC) then {
[_deviceName,"hidden"] call cse_fnc_setSideBar_CC;
};
(_display displayCtrl 10) ctrlEnable false;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_spacingSide = (_settings select 2) / 10;
_spacingTop = (_settings select 3) / 10;
_widthOfPopUp = ((_settings select 2)) - (_spacingSide * 2);
_heightOfPopUp = ((_settings select 3)) - (_spacingTop * 2);
_newPos = [(_settings select 0) + _spacingSide, (_settings select 1) + _spacingTop,_widthOfPopUp, _heightOfPopUp];
_backGroundCtrl ctrlSetPosition _newPos;
_backGroundCtrl ctrlCommit 0;
_newPos set [3,_heightOfPopUp / 10];
_headerCtrl ctrlSetPosition _newPos;
_headerCtrl ctrlCommit 0;
_headerTitle ctrlSetPosition _newPos;
_headerTitle ctrlCommit 0;
_newPos set [1, (_newPos select 1) + (_heightOfPopUp - (_heightOfPopUp / 10))];
_newPos set [2, (_newPos select 2) / 2];
_buttonClose ctrlSetPosition _newPos;
_buttonClose ctrlCommit 0;
_newPos set [0, (_newPos select 0) + (_newPos select 2)];
_buttonAccept ctrlSetPosition _newPos;
_buttonAccept ctrlCommit 0;
_title = _this select 2;
if (isnil "_title") then {
_title = "";
};
if (typeName _title != typeName "") then {
_title = "";
};
ctrlSetText[152,_title];
_buttonClose ctrlSetEventHandler ["ButtonClick", format["['%1','close'] call cse_fnc_setPopUpMenu_CC",_deviceName]];
_onAccept = (_this select 3);
if (isnil "_onAccept") then {
_onAccept = "";
};
if (typeName _onAccept != typeName "") then {
_onAccept = "";
};
_buttonAccept ctrlSetEventHandler ["ButtonClick", format["(['%1'] call cse_fnc_popUpAccept_CC) call %2; ['%1','close'] call cse_fnc_setPopUpMenu_CC;",_deviceName,compile _onAccept]];
[_deviceName, (_display displayCtrl 10)] spawn {
waituntil {!([_this select 0] call cse_fnc_isPopUpOpen_CC)};
(_this select 1) ctrlEnable true;
};
} else {
_newPos = [0,0,0,0];
_backGroundCtrl ctrlSetPosition _newPos;
_backGroundCtrl ctrlCommit 0;
_headerCtrl ctrlSetPosition _newPos;
_headerCtrl ctrlCommit 0;
_headerTitle ctrlSetPosition _newPos;
_headerTitle ctrlCommit 0;
_buttonClose ctrlSetPosition _newPos;
_buttonClose ctrlCommit 0;
_buttonAccept ctrlSetPosition _newPos;
_buttonAccept ctrlCommit 0;
ctrlSetText[152,""];
[_deviceName,[]] call cse_fnc_setPopUpOptions_CC;
};

View File

@ -0,0 +1,132 @@
/**
* fn_setPopUpOptions_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#define START_IDC_LABEL 242
#define START_IDC_COMBO 250
#define START_IDC_BTN 260
#define START_IDC_LIST 280
#define START_IDC_INPUT 270
private["_deviceName","_options","_display","_settings","_spacingSide", "_spacingTop","_positionLeft","_positionRight","_widthOfPopUp","_heightOfPopUp","_ctrl","_ctrlInput", "_select"];
_deviceName = _this select 0;
_options = _this select 1;
_settings = ([_deviceName] call cse_fnc_getDeviceSettings_CC);
_spacingSide = (_settings select 2) / 10;
_spacingTop = (_settings select 3) / 10;
_widthOfPopUp = ((_settings select 2)) - (_spacingSide * 2);
_heightOfPopUp = ((_settings select 3)) - (_spacingTop * 2);
_positionLeft = [(_settings select 0) + _spacingSide + 0.01, (_settings select 1) + _spacingTop + (_heightOfPopUp / 10),(_widthOfPopUp / 2) - 0.02, _heightOfPopUp / 10];
_positionRight = [(_settings select 0) + _spacingSide + 0.01 + (_widthOfPopUp / 2), (_settings select 1) + _spacingTop + (_heightOfPopUp / 10),(_widthOfPopUp / 2) - 0.02, _heightOfPopUp / 10];
_increasePerTime = (_heightOfPopUp / 10) + 0.01;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
_ctrlBtn = START_IDC_BTN;
_ctrlLbl = START_IDC_LABEL;
_ctrlCmbo = START_IDC_COMBO;
_ctrlInput = START_IDC_INPUT;
{
_idc = _x;
for [{_x=_idc},{_x< (_idc + 10)},{_x=_x+1}] do {
_ctrl = (_display displayCtrl _x);
_ctrl ctrlSetPosition [100,100,0.1,0.1]; /* Cannot use 0 for editfields */
_ctrl ctrlCommit 0;
};
}foreach [START_IDC_BTN,START_IDC_LABEL,START_IDC_COMBO,START_IDC_INPUT];
CSE_POP_UP_OPTIONS_CC = +_options;
{
_name = _x select 0;
_type = _x select 1;
_action = _x select 2;
switch (_type) do {
case "btn": {
_ctrlRight = (_display displayCtrl _ctrlBtn);
_ctrlRight ctrlSetPosition _positionRight;
_ctrlRight ctrlSetText _name;
_ctrlRight ctrlCommit 0;
_positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime];
_positionRight set [ 1, (_positionRight select 1)+_increasePerTime];
_ctrlBtn = _ctrlBtn + 1;
};
case "label": {
_ctrlRight = (_display displayCtrl _ctrlLbl);
_ctrlRight ctrlSetPosition _positionRight;
_ctrlRight ctrlSetText (toUpper _name);
_ctrlRight ctrlCommit 0;
_positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime];
_positionRight set [ 1, (_positionRight select 1)+_increasePerTime];
_ctrlLbl = _ctrlLbl + 1;
};
case "combo": {
private ["_content"];
_ctrlRight = (_display displayCtrl _ctrlCmbo);
_ctrlRight ctrlSetPosition _positionRight;
_ctrlRight ctrlCommit 0;
_content = (_x select 3);
_select = -1;
if (count _x > 3) then {
_select = _x select 4;
[format["_select %1",_select]] call cse_fnc_debug;
};
if (isnil "_content") then {
_content = [];
};
if (typeName _content != typeName []) then {
_content = [];
};
lbClear _ctrlCmbo;
{
_ctrlRight lbadd format["%1",_x];
}foreach _content;
if (_select >= 0) then {
_ctrlRight lbSetCurSel _select;
};
_ctrlLeft = (_display displayCtrl _ctrlLbl);
_ctrlLeft ctrlSetPosition _positionLeft;
_ctrlLeft ctrlSetText (toUpper _name);
_ctrlLeft ctrlCommit 0;
_positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime];
_positionRight set [ 1, (_positionRight select 1)+_increasePerTime];
_ctrlCmbo = _ctrlCmbo + 1;
_ctrlLbl = _ctrlLbl + 1;
};
case "input": {
_ctrlRight = (_display displayCtrl _ctrlInput);
_ctrlRight ctrlSetPosition _positionRight;
if (count _x > 3) then {
_ctrlRight ctrlSetText (_x select 3);
} else {
_ctrlRight ctrlSetText "";
};
_ctrlRight ctrlCommit 0;
_ctrlLeft = (_display displayCtrl _ctrlLbl);
_ctrlLeft ctrlSetPosition _positionLeft;
_ctrlLeft ctrlSetText (toUpper _name);
_ctrlLeft ctrlCommit 0;
_positionLeft set [ 1, (_positionLeft select 1)+_increasePerTime];
_positionRight set [ 1, (_positionRight select 1)+_increasePerTime];
_ctrlInput = _ctrlInput + 1;
_ctrlLbl = _ctrlLbl + 1;
};
default {};
};
}foreach _options;

View File

@ -0,0 +1,98 @@
/**
* fn_setProgramIcons_CC.sqf
* @Descr: Set the program or Application icons on the desktop of a cC device.
* @Author: Glowbal
*
* @Arguments: [deviceName STRING (the classname of the device)]
* @Return: nil
* @PublicAPI: false
*/
#define AVAILABLE_ICONS [100,101,102,103,104,105,106,107,108,109,110,111,112]
#define ICON_WIDTH 0.05
#define ICON_HEIGHT ICON_WIDTH
private ["_deviceName","_settings","_display","_pos","_ctrl","_newPos","_cfg","_availablePrograms","_displayName","_iconWidth","_startingPos","_maxIconsOnWidth","_currentIconN","_ctrlButton","_ctrlLabel", "_devices"];
_deviceName = _this select 0;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_availablePrograms = [];
if (isnil 'CSE_REGISTERED_APPLICATIONS_CC') then {
CSE_REGISTERED_APPLICATIONS_CC = [];
};
// Collect all applications that will be displayed on the Desktop and are available for the device.
{
// Check if application is hidden (such as main). 0 = show, 1 = hidden.
if ((_x select 3) == 0) then {
_devices = _x select 7;
// Check if the device Classname matches any entry in the devices list, to ensure the application is registered for this device.
if (_deviceName in _devices || "All" in _devices) then {
// store the: Name, Icon, displayName.
_option = [_x select 0,_x select 2,_x select 1];
_availablePrograms pushback _option;
} else {
[format["Application %1 is not registered on device %2 | %3", (_x select 0), _deviceName, _devices],3] call cse_fnc_debug;
};
};
}foreach CSE_REGISTERED_APPLICATIONS_CC;
disableSerialization;
_display = uiNamespace getvariable _deviceName;
if (isnil "_display") exitwith {}; // error
if (isNull _display) exitwith {}; // error
// Set all desktop icons in normal state
{
(_display displayCtrl _x) ctrlSetPosition [0,0,0,0];
(_display displayCtrl _x) ctrlCommit 0;
(_display displayCtrl (_x + 20)) ctrlSetPosition [0,0,0,0];
(_display displayCtrl (_x + 20)) ctrlCommit 0;
}foreach AVAILABLE_ICONS;
// Calculate height width and placement for icons.
_iconWidth = (_settings select 3) / 10;
_iconHeight = _iconWidth;
_startingPos = [(_settings select 0) + (_iconWidth / 4),(_settings select 1) + ((_settings select 3) / 13) + (_iconHeight / 2),_iconHeight,_iconWidth];
_maxIconsOnWidth = round(((_settings select 2) / _iconWidth) - 1);
_currentIconN = 1;
{
// To ensure that we won't accidently try to place down more icons as available.
if (_foreachIndex < count AVAILABLE_ICONS) then {
_name = _x select 0;
_icon = _x select 1;
_displayName = _x select 2;
// Set icon on correct position.
_ctrl = (_display displayCtrl (AVAILABLE_ICONS select _foreachIndex));
_ctrl ctrlSetPosition _startingPos;
_ctrl ctrlSetText _icon;
_ctrl ctrlCommit 0;
// Set the button on the correct position with ButtonClick eventhandler.
_ctrlButton = (_display displayCtrl ((AVAILABLE_ICONS select _foreachIndex) + 20));
_ctrlButton ctrlSetPosition _startingPos;
_ctrlButton ctrlCommit 0;
_ctrlButton ctrlSetEventHandler ["ButtonClick", format["['%1','%2'] call cse_fnc_openScreen_CC",_deviceName,_name]];
// Setting the label underneat the button/icon.
_ctrlLabel = (_display displayCtrl ((AVAILABLE_ICONS select _foreachIndex) + 40));
_ctrlLabel ctrlSetPosition [_startingPos select 0, (_startingPos select 1) + (_iconHeight / 1.31), _iconHeight, 0.03];
_ctrlLabel ctrlSetText format["%1",_displayName];
_ctrlLabel ctrlSetFontHeight (_iconHeight * 0.35);
_ctrlLabel ctrlCommit 0;
// calculate position for next icon.
_startingPos set[0,(_startingPos select 0) + _iconWidth + 0.005];
// Start next row of icons.
if ((_foreachIndex+1) % _maxIconsOnWidth == 0) then {
_startingPos set[0,(_startingPos select 0) - (_iconWidth + 0.005) * _maxIconsOnWidth];
_startingPos set[1,(_startingPos select 1) + (_iconWidth * 1.1)];
};
};
}foreach _availablePrograms;
nil;

View File

@ -0,0 +1,75 @@
/**
* fn_setSideBar_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display","_pos","_ctrl"];
_deviceName = _this select 0;
_pos = _this select 1;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_display = uiNamespace getvariable _deviceName;
if (count (call cse_fnc_getSideBarOptionFields_CC) < 1) then {
_pos = "hidden";
};
if (_pos == 'toggle') then {
if ((ctrlPosition ((_display displayCtrl 2)) select 0 == 0) &&
((ctrlPosition (_display displayCtrl 2)) select 1 == 0) && (ctrlPosition ((_display displayCtrl 2)) select 2 == 0) && (ctrlPosition ((_display displayCtrl 2)) select 3 == 0)) then {
_pos = "right";
} else {
_pos = "hidden";
};
};
disableSerialization;
_ctrl = (_display displayCtrl 2);
_newPos = switch (_pos) do {
//case "left": {[_settings select 0, _settings select 1, (_settings select 2) / 4.5, _settings select 3]};
case "right": {[_deviceName] call cse_fnc_getSideBarRatio_CC};
case "hidden": {[0,0,0,0]};
default {[0,0,0,0]};
};
_ctrl ctrlsetPosition _newPos;
_ctrl ctrlCommit 0;
for [{_i=0},{_i < 20},{_i=_i+1}] do {
[_deviceName,_i] call cse_fnc_removeOptionField_CC;
};
if (_pos != "hidden") then {
{
_args = [_deviceName] + _x;
_args call cse_fnc_setOptionField_CC;
}foreach (call cse_fnc_getSideBarOptionFields_CC);
[_deviceName,"hidden"] spawn cse_fnc_setPopUpMenu_CC;
if ([_deviceName,"sidebar"] call cse_fnc_isMapOpen_CC) then {
if (call cse_fnc_sideBarHasMap_CC) then {
[_deviceName,"sidebar","visable"] call cse_fnc_setMap_CC;
} else {
[_deviceName,"sidebar","hidden"] call cse_fnc_setMap_CC;
};
};
} else {
if ([_deviceName,"sidebar"] call cse_fnc_isMapOpen_CC) then {
[_deviceName,"sidebar","invisable"] call cse_fnc_setMap_CC;
};
};
if ([_deviceName,"main"] call cse_fnc_isMapOpen_CC) then {
[_deviceName,"main","full"] call cse_fnc_setMap_CC;
};
if ([_deviceName,"main"] call cse_fnc_isPiPOpen_CC) then {
[_deviceName,"main","full"] call cse_fnc_setPiP_CC;
};
if ([_deviceName] call cse_fnc_isSelectMenuOpen_CC) exitwith {
[_deviceName] call cse_fnc_removeSelectMenu_CC;
};

View File

@ -0,0 +1,67 @@
_deviceName = _this select 0;
_showTime = _this select 1;
disableSerialization;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_display = uiNamespace getvariable _deviceName;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_navBarHeight = _navBarRatio select 3;
_heightOfLB = (_settings select 3) - (_navBarHeight*2)/2;
_barPosition = [(_settings select 0) + ((_settings select 2) / 4),(_settings select 1) + ((_settings select 3) / 2) - (_navBarHeight/2) , (_settings select 2) / 2, _navBarHeight];
_labelPosition = [(_settings select 0) + ((_settings select 2) / 4),(_settings select 1) + ((_settings select 3) / 2) - (_navBarHeight * 1.5) , (_settings select 2) / 2, _navBarHeight];
_background = _display displayCtrl 607;
_bar = _display displayCtrl 606;
_label = _display displayCtrl 608;
_background ctrlSetPosition _settings;
_background ctrlSetBackgroundColor [0.8,0.8,0.8,1];
_background ctrlCommit 0;
_loadingText = "LOADING";
_label ctrlSetText _loadingText;
_label ctrlSetPosition _labelPosition;
_label ctrlCommit 0;
_bar ctrlSetPosition _barPosition;
_bar ctrlCommit 0;
_newStatus = 0;
_toSleep = (1 / _showTime) / 20;
_start = time;
_numOfDots = 0;
_runs = 0;
while {(_newStatus <= 1.00 && !(isNull _display))} do {
uisleep 0.01;
_bar progressSetPosition _newStatus;
_newStatus = _newStatus + _toSleep;
if (_runs >= 30) then {
_runs = 0;
if (_loadingText == "LOADING") then {
_loadingText = "PLEASE WAIT";
} else {
_loadingText = "LOADING";
};
_label ctrlSetText _loadingText;
} else {
_runs = _runs + 1;
};
};
uisleep 0.5;
if !(isNull _display) then {
_background ctrlSetPosition [0,0,0,0];
_background ctrlCommit 0;
_bar ctrlSetPosition [0,0,0,0];
_bar ctrlCommit 0;
_label ctrlSetText "";
_label ctrlSetPosition [0,0,0,0];
_label ctrlCommit 0;
};

View File

@ -0,0 +1,31 @@
/**
* fn_sideBarHasMap_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_currentApp","_cfg","_hasMap","_return"];
//_currentApp = call cse_fnc_getCurrentApplication_CC;
_return = false;
/*_cfg = (missionConfigFile >> "Combat_Space_Enhancement" >> "command_and_control" >> "applications" >> _currentApp >> "sideBar");
_hasMap = 0;
if (isClass _cfg) then {
for [{_i=0},{_i < (count _cfg)},{_i=_i+1}] do {
if (isClass (_cfg select _i)) then {
private ["_type"];
_type = getText ((_cfg select _i) >> "type");
if (_type == "map") then {
_hasMap = _hasMap + 1;
};
};
};
};
if (_hasMap > 0) then {
_return = true;
};*/
_return

View File

@ -0,0 +1,24 @@
/**
* fn_openScreen_cc_app_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
//_this spawn {
//[_deviceName] call cse_fnc_clearDeviceScreen_CC;
private ["_deviceName"];
_deviceName = _this select 0;
[_deviceName,"main","full"] call cse_fnc_setMap_CC;
if (isnil "CSE_CURRENT_SELECTED_FILTER_CC_APP_CC") then {
CSE_CURRENT_SELECTED_FILTER_CC_APP_CC = -1;
CSE_TOGGLE_ROUTE_LAYER_CC = false;
CSE_TOGGLE_INTEL_LAYER_CC = false;
CSE_TOGGLE_CALLSIGNS_CC = false;
CSE_SELECTED_ICON_CC = "";
};

View File

@ -0,0 +1,19 @@
/**
* fn_openScreen_home_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName","_settings","_display"];
_deviceName = _this select 0;
[_deviceName] call cse_fnc_clearDeviceScreen_CC;
[_deviceName,"full"] call cse_fnc_setBackground_CC;
[_deviceName,"top"] call cse_fnc_setNavBar_CC;
[_deviceName,"hidden"] call cse_fnc_setSideBar_CC;
[_deviceName,"hidden"] call cse_fnc_setBottomBar_CC;
[_deviceName] call cse_fnc_setProgramIcons_CC;

View File

@ -0,0 +1,73 @@
/**
* fn_openScreen_liveFeed_app_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName", "_allAvailableFeeds"];
_deviceName = _this select 0;
disableSerialization;
_settings = [_deviceName] call cse_fnc_getDeviceSettings_CC;
_display = uiNamespace getvariable _deviceName;
_background = _display displayCtrl 602;
_listBox = _display displayCtrl 601;
_sideBarRatio = [_deviceName] call cse_fnc_getSideBarRatio_CC;
_navBarRatio = [_deviceName] call cse_fnc_getNavBarRatio_CC;
_navBarHeight = _navBarRatio select 3;
_sideBarWidth = _sideBarRatio select 2;
_heightOfLB = (_settings select 3) - (_navBarHeight*2)/2;
_fullBackground = [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), (_heightOfLB/4)*1.01];
_background ctrlSetPosition _fullBackground;
_background ctrlSetBackgroundColor [0.9,0.9,0.9,1];
_background ctrlCommit 0;
_listBoxPosition = [_settings select 0,(_settings select 1) + _navBarHeight + (_heightOfLB/4), (_settings select 2), ((_heightOfLB)/4)*3];
_listBox ctrlSetPosition _listBoxPosition;
_listBox ctrlEnable false;
_listBox ctrlEnable true;
_listBox ctrlCommit 0;
_listBox ctrlSetEventHandler ["MouseButtonDblClick", "
[_this] call cse_fnc_debug;
_lb = _this select 0;
_currentSelection = lbCurSel _lb;
if (_currentSelection >= 0) then {
_targetArray = CSE_ALL_AVAILABLE_LIVE_FEEDS_AT_MOMENT_CC select _currentSelection;
_target = _targetArray select 1 select 0;
[_target] call cse_fnc_setLiveFeedTargetObj_CC;
_lb ctrlSetPosition [0,0,0,0];
_lb ctrlCommit 0;
_lb ctrlEnable false;
[[] call cse_fnc_getCurrentDeviceName_CC] call cse_fnc_openScreen_liveFeed_CC;
};
"];
lbclear 601;
_allAvailableFeeds = [_deviceName] call cse_fnc_getAllViewableFeeds_CC;
CSE_ALL_AVAILABLE_LIVE_FEEDS_AT_MOMENT_CC = _allAvailableFeeds;
{
lbadd [601, (_x select 0)];
//lbSetData [601, _foreachIndex, str ((_x select 1) select 0)];
}foreach _allAvailableFeeds;
ctrlSetFocus _listBox;
_listBox lbSetCurSel 0;
(_display displayCtrl 603) ctrlSetPosition [_settings select 0,(_settings select 1) + _navBarHeight, (_settings select 2), _navBarHeight];
(_display displayCtrl 604) ctrlSetPosition [_settings select 0,(_settings select 1) + _navBarHeight + _navBarHeight, (_settings select 2), (_heightOfLB/4)*1.01 - _navBarHeight];
(_display displayCtrl 603) ctrlSetText "TACNET";
(_display displayCtrl 604) ctrlSetText "Select an feed in the list below. To view the feed, double click on the item.";
(_display displayCtrl 603) ctrlCommit 0;
(_display displayCtrl 604) ctrlCommit 0;
(_display displayCtrl 604) ctrlEnable false;

View File

@ -0,0 +1,6 @@
private ["_deviceName"];
_deviceName = _this select 0;
hint 'you are required to log in';
[_deviceName,"open","login"] spawn cse_fnc_setPopUpMenu_CC;

View File

@ -0,0 +1,15 @@
/**
* fn_openScreen_settings_CC.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
private ["_deviceName"];
_deviceName = _this select 0;
[_deviceName] call cse_fnc_clearDeviceScreen_CC;
[_deviceName,"full","black"] call cse_fnc_setBackground_CC;
[_deviceName,"top"] call cse_fnc_setNavBar_CC;

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