mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
commit
fc3c73a174
@ -1,136 +0,0 @@
|
||||
|
||||
class RscDisplayInsertMarker {
|
||||
onLoad = "_this call compile preprocessFileLineNumbers 'AGM_Markers\scripts\initInsertMarker.sqf'";
|
||||
onUnload = "_this call compile preprocessFileLineNumbers 'AGM_Markers\scripts\placeMarker.sqf'";
|
||||
idd = 54;
|
||||
movingEnable = 1;
|
||||
class controlsBackground {
|
||||
class RscText_1000: RscText {
|
||||
idc = 1000;
|
||||
/*x = "0 * GUI_GRID_INSERTMARKER_W + GUI_GRID_INSERTMARKER_X";
|
||||
y = "0 * GUI_GRID_INSERTMARKER_H + GUI_GRID_INSERTMARKER_Y";
|
||||
w = "8 * GUI_GRID_INSERTMARKER_W";
|
||||
h = "2.5 * GUI_GRID_INSERTMARKER_H";
|
||||
colorBackground[] = {0,0,0,0.5};*/
|
||||
};
|
||||
class Description: RscStructuredText {
|
||||
colorBackground[] = {0,0,0,0.7};
|
||||
idc = 1100;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "9.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
};
|
||||
class controls {
|
||||
//delete ButtonOK;
|
||||
class ButtonMenuOK: RscButtonMenuOK {
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "8.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
// size = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
// sizeEx = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
text = "";
|
||||
};
|
||||
class ButtonMenuCancel: RscButtonMenuCancel {
|
||||
x = "23 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "1.1 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
|
||||
text = "X";
|
||||
colorBackground[] = {0.75,0,0,0.5};
|
||||
colorBackgroundFocused[] = {0.75,0,0,0.5};
|
||||
colorBackground2[] = {1,0,0,0.5};
|
||||
};
|
||||
/*class ButtonMenuInfo: RscButtonMenu {
|
||||
idc = 2400;
|
||||
text = "$STR_A3_RscDisplayInsertMarker_ButtonMenuInfo";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
delete ButtonMenuInfo;
|
||||
class Title: RscText {
|
||||
moving = 1;
|
||||
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"};
|
||||
idc = 1001;
|
||||
text = "$STR_A3_RscDisplayInsertMarker_Title";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "8.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
delete Description;
|
||||
/*class Info: RscStructuredText {
|
||||
colorBackground[] = {0,0,0,0.7};
|
||||
idc = 1101;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
delete Info;
|
||||
class Picture: RscPicture {
|
||||
idc = 102;
|
||||
x = 0.259984;
|
||||
y = 0.4;
|
||||
w = 0.05;
|
||||
h = 0.0666667;
|
||||
};
|
||||
class Text: RscEdit {
|
||||
idc = 101;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "10.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
/*class SizeX: RscEdit {
|
||||
idc = 1200;
|
||||
text = "10";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class SizeY: RscEdit {
|
||||
idc = 1201;
|
||||
text = "10";
|
||||
x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
class MarkerShape: RscCombo {
|
||||
idc = 1210;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerColor: RscCombo {
|
||||
idc = 1211;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerAngle: RscXSliderH {
|
||||
idc = 1220;
|
||||
text = "10";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerAngleText: RscText {
|
||||
idc = 1221;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "14.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
};
|
||||
};
|
@ -1,7 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
// request marker data for JIP
|
||||
if (isMultiplayer && {!isServer}) then {
|
||||
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
||||
[_logic, "AGM_Markers_fnc_sendMarkersJIP", 1] call AGM_Core_fnc_execRemoteFnc;
|
||||
};
|
@ -1,47 +0,0 @@
|
||||
class CfgPatches {
|
||||
class AGM_Markers {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = 0.60;
|
||||
requiredAddons[] = {AGM_Core};
|
||||
version = "0.95";
|
||||
versionStr = "0.95";
|
||||
versionAr[] = {0,95,0};
|
||||
author[] = {"commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
};
|
||||
};
|
||||
|
||||
class CfgFunctions {
|
||||
class AGM_Markers {
|
||||
class AGM_Markers {
|
||||
file = "AGM_Markers\functions";
|
||||
class onLBSelChangedColor;
|
||||
class onLBSelChangedShape;
|
||||
class onSliderPosChangedAngle;
|
||||
class sendMarkersJIP;
|
||||
class setMarker;
|
||||
class setMarkerJIP;
|
||||
class setMarkerNetwork;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class AGM_Markers {
|
||||
clientInit = "call compile preprocessFileLineNumbers 'AGM_Markers\clientInit.sqf'";
|
||||
};
|
||||
};
|
||||
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class RscStructuredText;
|
||||
class RscButtonMenuOK;
|
||||
class RscButtonMenuCancel;
|
||||
class RscButtonMenu;
|
||||
class RscEdit;
|
||||
class RscCombo;
|
||||
class RscSlider;
|
||||
class RscXSliderH;
|
||||
|
||||
#include <InsertMarker.hpp>
|
@ -1,15 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private "_logic";
|
||||
|
||||
_logic = _this;
|
||||
|
||||
[
|
||||
[
|
||||
missionNamespace getVariable ["AGM_allMapMarkers", []],
|
||||
missionNamespace getVariable ["AGM_allMapMarkersProperties", []],
|
||||
_logic
|
||||
],
|
||||
"AGM_Markers_fnc_setMarkerJIP",
|
||||
_logic
|
||||
] call AGM_Core_fnc_execRemoteFnc;
|
@ -1,15 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_marker", "_data", "_config"];
|
||||
|
||||
_marker = _this select 0;
|
||||
_data = _this select 1;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select (_data select 0);
|
||||
[[_marker, configName _config], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerTypeLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
|
||||
[[_marker, configName _config], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerColorLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
|
||||
|
||||
[[_marker, _data select 2], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerPosLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
|
||||
[[_marker, _data select 3], "{if ((_this select 0) in allMapMarkers) then {(_this select 0) setMarkerDirLocal (_this select 1)};}", 2] call AGM_Core_fnc_execRemoteFnc;
|
@ -1,26 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"];
|
||||
|
||||
_allMapMarkers = _this select 0;
|
||||
_allMapMarkersProperties = _this select 1;
|
||||
_logic = _this select 2;
|
||||
|
||||
{
|
||||
_index = _allMapMarkers find _x;
|
||||
|
||||
if (_index != -1) then {
|
||||
_data = _allMapMarkersProperties select _index;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select (_data select 0);
|
||||
_x setMarkerTypeLocal configName _config;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
|
||||
_x setMarkerColorLocal configName _config;
|
||||
|
||||
_x setMarkerPosLocal (_data select 2);
|
||||
_x setMarkerDirLocal (_data select 3);
|
||||
};
|
||||
} forEach allMapMarkers;
|
||||
|
||||
deleteVehicle _logic;
|
@ -1,36 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
private ["_marker", "_data", "_config"];
|
||||
|
||||
_marker = _this select 0;
|
||||
_data = _this select 1;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select (_data select 0);
|
||||
_marker setMarkerTypeLocal configName _config;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
|
||||
_marker setMarkerColorLocal configName _config;
|
||||
|
||||
_marker setMarkerPosLocal (_data select 2);
|
||||
_marker setMarkerDirLocal (_data select 3);
|
||||
|
||||
// save properties on server machine for JIP, marker editing ready
|
||||
if (isMultiplayer && {isServer}) then {
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
|
||||
|
||||
_allMapMarkers = missionNamespace getVariable ["AGM_allMapMarkers", []];
|
||||
_allMapMarkersProperties = missionNamespace getVariable ["AGM_allMapMarkersProperties", []];
|
||||
|
||||
_index = _allMapMarkers find _marker;
|
||||
|
||||
if (_index == -1) then {
|
||||
_allMapMarkers pushBack _marker;
|
||||
_allMapMarkersProperties pushBack _data;
|
||||
} else {
|
||||
_allMapMarkers set [_index, _marker];
|
||||
_allMapMarkersProperties set [_index, _data];
|
||||
};
|
||||
|
||||
AGM_allMapMarkers = _allMapMarkers;
|
||||
AGM_allMapMarkersProperties = _allMapMarkersProperties;
|
||||
};
|
@ -1,51 +0,0 @@
|
||||
// by commy2
|
||||
|
||||
if (_this select 1 == 1) then {
|
||||
disableserialization;
|
||||
_display = _this select 0;
|
||||
|
||||
_pos = ctrlPosition (_display displayCtrl 102);
|
||||
_pos = [
|
||||
(_pos select 0) + (_pos select 2) / 2,
|
||||
(_pos select 1) + (_pos select 3) / 2
|
||||
];
|
||||
|
||||
switch (true) do {
|
||||
case (!isNull findDisplay 12) : {
|
||||
_pos = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 37) : {
|
||||
_pos = (findDisplay 37 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 52) : {
|
||||
_pos = (findDisplay 52 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 53) : {
|
||||
_pos = (findDisplay 53 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
};
|
||||
|
||||
_pos spawn {
|
||||
/*[
|
||||
allMapMarkers select (count allMapMarkers - 1),
|
||||
[
|
||||
uiNamespace getVariable ['AGM_Markers_currentMarkerShape', 0],
|
||||
uiNamespace getVariable ['AGM_Markers_currentMarkerColor', 0],
|
||||
_this,
|
||||
uiNamespace getVariable ['AGM_Markers_currentMarkerAngle', 0]
|
||||
]
|
||||
] call AGM_Markers_fnc_setMarker;*/
|
||||
|
||||
[
|
||||
[
|
||||
allMapMarkers select (count allMapMarkers - 1),
|
||||
[
|
||||
uiNamespace getVariable ['AGM_Markers_currentMarkerShape', 0],
|
||||
uiNamespace getVariable ['AGM_Markers_currentMarkerColor', 0],
|
||||
_this,
|
||||
uiNamespace getVariable ['AGM_Markers_currentMarkerAngle', 0]
|
||||
]
|
||||
], "AGM_Markers_fnc_setMarkerNetwork", 2
|
||||
] call AGM_Core_fnc_execRemoteFnc;
|
||||
};
|
||||
};
|
1
addons/markers/$PBOPREFIX$
Normal file
1
addons/markers/$PBOPREFIX$
Normal file
@ -0,0 +1 @@
|
||||
z\ace\addons\markers
|
12
addons/markers/CfgEventHandlers.hpp
Normal file
12
addons/markers/CfgEventHandlers.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
class Extended_PreInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||
};
|
||||
};
|
||||
|
||||
class Extended_PostInit_EventHandlers {
|
||||
class ADDON {
|
||||
init = QUOTE(call COMPILE_FILE(XEH_postInit));
|
||||
};
|
||||
};
|
147
addons/markers/InsertMarker.hpp
Normal file
147
addons/markers/InsertMarker.hpp
Normal file
@ -0,0 +1,147 @@
|
||||
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class RscStructuredText;
|
||||
class RscButtonMenuOK;
|
||||
class RscButtonMenuCancel;
|
||||
class RscButtonMenu;
|
||||
class RscEdit;
|
||||
class RscCombo;
|
||||
class RscSlider;
|
||||
class RscXSliderH;
|
||||
|
||||
class RscDisplayInsertMarker {
|
||||
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
|
||||
onUnload = QUOTE(_this call DFUNC(placeMarker););
|
||||
idd = 54;
|
||||
movingEnable = 1;
|
||||
class controlsBackground {
|
||||
class RscText_1000: RscText {
|
||||
idc = 1000;
|
||||
/*x = "0 * GUI_GRID_INSERTMARKER_W + GUI_GRID_INSERTMARKER_X";
|
||||
y = "0 * GUI_GRID_INSERTMARKER_H + GUI_GRID_INSERTMARKER_Y";
|
||||
w = "8 * GUI_GRID_INSERTMARKER_W";
|
||||
h = "2.5 * GUI_GRID_INSERTMARKER_H";
|
||||
colorBackground[] = {0,0,0,0.5};*/
|
||||
};
|
||||
class Description: RscStructuredText {
|
||||
colorBackground[] = {0,0,0,0.7};
|
||||
idc = 1100;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "9.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
};
|
||||
class controls {
|
||||
//delete ButtonOK;
|
||||
class ButtonMenuOK: RscButtonMenuOK {
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "8.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
// size = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
// sizeEx = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
||||
text = "";
|
||||
};
|
||||
class ButtonMenuCancel: RscButtonMenuCancel {
|
||||
x = "23 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "1.1 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
|
||||
text = "X";
|
||||
colorBackground[] = {0.75,0,0,0.5};
|
||||
colorBackgroundFocused[] = {0.75,0,0,0.5};
|
||||
colorBackground2[] = {1,0,0,0.5};
|
||||
};
|
||||
/*class ButtonMenuInfo: RscButtonMenu {
|
||||
idc = 2400;
|
||||
text = "$STR_A3_RscDisplayInsertMarker_ButtonMenuInfo";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
delete ButtonMenuInfo;
|
||||
class Title: RscText {
|
||||
moving = 1;
|
||||
colorBackground[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.69])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.75])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.5])","(profilenamespace getvariable ['GUI_BCG_RGB_A',0.8])"};
|
||||
idc = 1001;
|
||||
text = "$STR_A3_RscDisplayInsertMarker_Title";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "8.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
delete Description;
|
||||
/*class Info: RscStructuredText {
|
||||
colorBackground[] = {0,0,0,0.7};
|
||||
idc = 1101;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
delete Info;
|
||||
class Picture: RscPicture {
|
||||
idc = 102;
|
||||
x = 0.259984;
|
||||
y = 0.4;
|
||||
w = 0.05;
|
||||
h = 0.0666667;
|
||||
};
|
||||
class Text: RscEdit {
|
||||
idc = 101;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "10.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
/*class SizeX: RscEdit {
|
||||
idc = 1200;
|
||||
text = "10";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class SizeY: RscEdit {
|
||||
idc = 1201;
|
||||
text = "10";
|
||||
x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};*/
|
||||
class MarkerShape: RscCombo {
|
||||
idc = 1210;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerColor: RscCombo {
|
||||
idc = 1211;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerAngle: RscXSliderH {
|
||||
idc = 1220;
|
||||
text = "10";
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
class MarkerAngleText: RscText {
|
||||
idc = 1221;
|
||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
||||
y = "14.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||
};
|
||||
};
|
||||
};
|
16
addons/markers/XEH_postInit.sqf
Normal file
16
addons/markers/XEH_postInit.sqf
Normal file
@ -0,0 +1,16 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
// recieve remote marker data
|
||||
[QGVAR(setMarkerNetwork), {_this call DFUNC(setMarkerNetwork)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// recieve marker data for JIP
|
||||
[QGVAR(setMarkerJIP), {_this call DFUNC(setMarkerJIP)}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// request marker data for JIP
|
||||
if (isMultiplayer && {!isServer} && {hasInterface}) then {
|
||||
private "_logic";
|
||||
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
||||
|
||||
[QGVAR(sendMarkersJIP), _logic] call EFUNC(common,serverEvent);
|
||||
};
|
74
addons/markers/XEH_preInit.sqf
Normal file
74
addons/markers/XEH_preInit.sqf
Normal file
@ -0,0 +1,74 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
PREP(initInsertMarker);
|
||||
PREP(onLBSelChangedColor);
|
||||
PREP(onLBSelChangedShape);
|
||||
PREP(onSliderPosChangedAngle);
|
||||
PREP(placeMarker);
|
||||
PREP(sendMarkersJIP);
|
||||
PREP(setMarkerJIP);
|
||||
PREP(setMarkerNetwork);
|
||||
|
||||
// init marker types
|
||||
if (isNil QGVAR(MarkersCache)) then {
|
||||
_config = configfile >> "CfgMarkers";
|
||||
_index = 0;
|
||||
|
||||
GVAR(MarkersCache) = [];
|
||||
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
_marker = _config select _a;
|
||||
|
||||
_scope = getNumber (_marker >> "scope");
|
||||
_name = getText (_marker >> "name");
|
||||
_icon = getText (_marker >> "icon");
|
||||
|
||||
if (_scope == 2) then {
|
||||
_shape lbAdd _name;
|
||||
_shape lbSetValue [_index, _a];
|
||||
_shape lbSetPicture [_index, _icon];
|
||||
|
||||
GVAR(MarkersCache) pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// init marker colors
|
||||
if (isNil QGVAR(MarkerColorsCache)) then {
|
||||
_config = configfile >> "CfgMarkerColors";
|
||||
_index = 0;
|
||||
|
||||
GVAR(MarkerColorsCache) = [];
|
||||
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
_marker = _config select _a;
|
||||
|
||||
_scope = getNumber (_marker >> "scope");
|
||||
_name = getText (_marker >> "name");
|
||||
|
||||
if (_scope == 2) then {
|
||||
_color lbAdd _name;
|
||||
_color lbSetValue [_index, _a];
|
||||
|
||||
_rgba = getArray (_marker >> "color");
|
||||
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_rgba set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _rgba;
|
||||
|
||||
_icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _rgba select 0, _rgba select 1, _rgba select 2, _rgba select 3];
|
||||
|
||||
_color lbSetPicture [_index, _icon];
|
||||
|
||||
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler);
|
16
addons/markers/config.cpp
Normal file
16
addons/markers/config.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
author[] = {"commy2"};
|
||||
authorUrl = "https://github.com/commy2/";
|
||||
VERSION_CONFIG;
|
||||
};
|
||||
};
|
||||
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "InsertMarker.hpp"
|
@ -1,18 +1,18 @@
|
||||
// stuff taken from bohemia, edited by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
#define BORDER 0.005
|
||||
|
||||
with uinamespace do {
|
||||
_this spawn {
|
||||
[{
|
||||
disableserialization;
|
||||
_display = _this select 0;
|
||||
|
||||
//Prevent Captive Players from placing markers
|
||||
if (AGM_player getVariable ["AGM_isCaptive", false]) exitWith {
|
||||
_display closeDisplay 2; //emulate "Cancel" button
|
||||
};
|
||||
/*if (ACE_player getVariable ["ACE_isCaptive", false]) exitWith {
|
||||
_display closeDisplay 2; //emulate "Cancel" button
|
||||
};*/
|
||||
|
||||
// display vanilla key input
|
||||
// prevent vanilla key input
|
||||
_display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}];
|
||||
|
||||
_text = _display displayctrl 101;
|
||||
@ -31,47 +31,41 @@ with uinamespace do {
|
||||
ctrlSetFocus _text;
|
||||
|
||||
//Change ok button's text based on current channel
|
||||
[_buttonOK] spawn {
|
||||
disableserialization;
|
||||
private ["_buttonOK", "_channel", "_textColor"];
|
||||
_buttonOK = _this select 0;
|
||||
//if (isNull _buttonOK) exitWith {true};
|
||||
|
||||
waitUntil {
|
||||
if (isNull _buttonOK) exitWith {true};
|
||||
_textColor = [1,1,1,1];
|
||||
switch (call AGM_Core_fnc_currentChannel) do {
|
||||
case ("global"): {
|
||||
_channel = "";
|
||||
_textColor = [1,1,1,1];
|
||||
switch (call EFUNC(common,currentChannel)) do {
|
||||
case ("global"): {
|
||||
_channel = localize "str_channel_global";
|
||||
_textColor = [(216/255),(216/255),(216/255),1];
|
||||
};
|
||||
case ("side"): {
|
||||
};
|
||||
case ("side"): {
|
||||
_channel = localize "str_channel_side";
|
||||
_textColor = [(70/255),(211/255),(252/255),1];
|
||||
};
|
||||
case ("group"): {
|
||||
};
|
||||
case ("group"): {
|
||||
_channel = localize "str_channel_group";
|
||||
_textColor = [(181/255),(248/255),(98/255),1];
|
||||
};
|
||||
case ("vehicle"): {
|
||||
};
|
||||
case ("vehicle"): {
|
||||
_channel = localize "str_channel_vehicle";
|
||||
_textColor = [(255/255),(208/255),(0/255),1];
|
||||
};
|
||||
case ("direct"): {
|
||||
};
|
||||
case ("direct"): {
|
||||
_channel = localize "str_channel_direct";
|
||||
_textColor = [(255/255),(255/255),(255/255),1];
|
||||
};
|
||||
case ("command"): {
|
||||
};
|
||||
case ("command"): {
|
||||
_channel = localize "str_channel_command";
|
||||
_textColor = [(255/255),(255/255),(70/255),1];
|
||||
};
|
||||
};
|
||||
//If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text)
|
||||
if (_channel != "") then {
|
||||
_buttonOK ctrlSetTextColor _textColor;
|
||||
_buttonOK ctrlSetText format [localize "STR_AGM_Markers_PlaceIn", _channel];
|
||||
};
|
||||
false
|
||||
};
|
||||
};
|
||||
|
||||
//If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text)
|
||||
if (_channel != "") then {
|
||||
_buttonOK ctrlSetTextColor _textColor;
|
||||
_buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel];
|
||||
};
|
||||
|
||||
//--- Background
|
||||
@ -150,40 +144,15 @@ with uinamespace do {
|
||||
|
||||
|
||||
// init marker shape lb
|
||||
_config = configfile >> "CfgMarkers";
|
||||
_index = 0;
|
||||
|
||||
if (isNil "AGM_Markers_MarkersCache") then {
|
||||
AGM_Markers_MarkersCache = [];
|
||||
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
_marker = _config select _a;
|
||||
|
||||
_scope = getNumber (_marker >> "scope");
|
||||
_name = getText (_marker >> "name");
|
||||
_icon = getText (_marker >> "icon");
|
||||
|
||||
if (_scope == 2) then {
|
||||
_shape lbAdd _name;
|
||||
_shape lbSetValue [_index, _a];
|
||||
_shape lbSetPicture [_index, _icon];
|
||||
|
||||
AGM_Markers_MarkersCache pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
{
|
||||
{
|
||||
_shape lbAdd (_x select 0);
|
||||
_shape lbSetValue [_forEachIndex, _x select 1];
|
||||
_shape lbSetPicture [_forEachIndex, _x select 2];
|
||||
} forEach AGM_Markers_MarkersCache;
|
||||
};
|
||||
} forEach GVAR(MarkersCache);
|
||||
|
||||
_shape ctrlAddEventHandler ["LBSelChanged", {_this call AGM_Markers_fnc_onLBSelChangedShape}];
|
||||
_shape ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}];
|
||||
|
||||
_curSelShape = uiNamespace getVariable ["AGM_Markers_curSelMarkerShape", 0];
|
||||
_curSelShape = GETGVAR(curSelMarkerShape,0);
|
||||
_shape lbSetCurSel _curSelShape;
|
||||
_data = _shape lbValue _curSelShape;
|
||||
_config = (configfile >> "CfgMarkers") select _data;
|
||||
@ -192,74 +161,39 @@ with uinamespace do {
|
||||
|
||||
|
||||
// init marker color lb
|
||||
_config = configfile >> "CfgMarkerColors";
|
||||
_index = 0;
|
||||
|
||||
if (isNil "AGM_Markers_MarkerColorsCache") then {
|
||||
AGM_Markers_MarkerColorsCache = [];
|
||||
|
||||
for "_a" from 0 to (count _config - 1) do {
|
||||
_marker = _config select _a;
|
||||
|
||||
_scope = getNumber (_marker >> "scope");
|
||||
_name = getText (_marker >> "name");
|
||||
|
||||
if (_scope == 2) then {
|
||||
_color lbAdd _name;
|
||||
_color lbSetValue [_index, _a];
|
||||
|
||||
_rgba = getArray (_marker >> "color");
|
||||
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_rgba set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _rgba;
|
||||
|
||||
_icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _rgba select 0, _rgba select 1, _rgba select 2, _rgba select 3];
|
||||
|
||||
_color lbSetPicture [_index, _icon];
|
||||
|
||||
AGM_Markers_MarkerColorsCache pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
} else {
|
||||
{
|
||||
{
|
||||
_color lbAdd (_x select 0);
|
||||
_color lbSetValue [_forEachIndex, _x select 1];
|
||||
_color lbSetPicture [_forEachIndex, _x select 2];
|
||||
} forEach AGM_Markers_MarkerColorsCache;
|
||||
};
|
||||
} forEach GVAR(MarkerColorsCache);
|
||||
|
||||
_color ctrlAddEventHandler ["LBSelChanged", {_this call AGM_Markers_fnc_onLBSelChangedColor}];
|
||||
_color ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}];
|
||||
|
||||
_curSelColor = uiNamespace getVariable ["AGM_Markers_curSelMarkerColor", 0];
|
||||
_curSelColor = GETGVAR(curSelMarkerColor,0);
|
||||
_color lbSetCurSel _curSelColor;
|
||||
_data = _color lbValue _curSelColor;
|
||||
_config = (configfile >> "CfgMarkerColors") select _data;
|
||||
_rgba = getArray (_config >> "color");
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_rgba set [_forEachIndex, call compile _x];
|
||||
};
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_rgba set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _rgba;
|
||||
_picture ctrlSetTextColor _rgba;
|
||||
|
||||
|
||||
// init marker angle slider
|
||||
_angle sliderSetRange [-180, 180];
|
||||
_angle ctrlAddEventHandler ["SliderPosChanged", {_this call AGM_Markers_fnc_onSliderPosChangedAngle}];
|
||||
_angle ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
||||
|
||||
_curSelAngle = uiNamespace getVariable ["AGM_Markers_curSelMarkerAngle", 0];
|
||||
_curSelAngle = GETGVAR(curSelMarkerAngle,0);
|
||||
_angle sliderSetPosition _curSelAngle;
|
||||
|
||||
_curSelAngle = round _curSelAngle;
|
||||
if (_curSelAngle < 0) then {
|
||||
_curSelAngle = _curSelAngle + 360;
|
||||
_curSelAngle = _curSelAngle + 360;
|
||||
};
|
||||
|
||||
_angleText ctrlSetText format [localize "STR_AGM_Markers_MarkerDirection", _curSelAngle];
|
||||
};
|
||||
};
|
||||
_angleText ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _curSelAngle];
|
||||
|
||||
}, _this] call EFUNC(common,execNextFrame);
|
@ -1,22 +1,23 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ctrl", "_data", "_config", "_color"];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_data = _ctrl lbValue (_this select 1);
|
||||
|
||||
uiNamespace setVariable ["AGM_Markers_curSelMarkerColor", _this select 1];
|
||||
GVAR(curSelMarkerColor) = _this select 1;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select _data;
|
||||
|
||||
_color = getArray (_config >> "color");
|
||||
|
||||
{
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_color set [_forEachIndex, call compile _x];
|
||||
};
|
||||
if (typeName _x != "SCALAR") then {
|
||||
_color set [_forEachIndex, call compile _x];
|
||||
};
|
||||
} forEach _color;
|
||||
|
||||
((ctrlParent _ctrl) displayCtrl 102) ctrlSetTextColor _color;
|
||||
|
||||
uiNamespace setVariable ["AGM_Markers_currentMarkerColor", _data];
|
||||
GVAR(currentMarkerColor) = _data;
|
@ -1,11 +1,12 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ctrl", "_data", "_config", "_icon"];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_data = _ctrl lbValue (_this select 1);
|
||||
|
||||
uiNamespace setVariable ["AGM_Markers_curSelMarkerShape", _this select 1];
|
||||
GVAR(curSelMarkerShape) = _this select 1;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select _data;
|
||||
|
||||
@ -13,4 +14,4 @@ _icon = getText (_config >> "icon");
|
||||
|
||||
((ctrlParent _ctrl) displayCtrl 102) ctrlSetText _icon;
|
||||
|
||||
uiNamespace setVariable ["AGM_Markers_currentMarkerShape", _data];
|
||||
GVAR(currentMarkerShape) = _data;
|
@ -1,17 +1,18 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_ctrl", "_data", "_direction"];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_data = _this select 1;
|
||||
|
||||
uiNamespace setVariable ["AGM_Markers_curSelMarkerAngle", _data];
|
||||
GVAR(curSelMarkerAngle) = _data;
|
||||
|
||||
_direction = round _data;
|
||||
if (_direction < 0) then {
|
||||
_direction = _direction + 360;
|
||||
_direction = _direction + 360;
|
||||
};
|
||||
|
||||
((ctrlParent _ctrl) displayCtrl 1221) ctrlSetText format [localize "STR_AGM_Markers_MarkerDirection", _direction];
|
||||
((ctrlParent _ctrl) displayCtrl 1221) ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _direction];
|
||||
|
||||
uiNamespace setVariable ["AGM_Markers_currentMarkerAngle", _data];
|
||||
GVAR(currentMarkerAngle) = _data;
|
46
addons/markers/functions/fnc_placeMarker.sqf
Normal file
46
addons/markers/functions/fnc_placeMarker.sqf
Normal file
@ -0,0 +1,46 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (_this select 1 == 1) then {
|
||||
disableserialization;
|
||||
_display = _this select 0;
|
||||
|
||||
_pos = ctrlPosition (_display displayCtrl 102);
|
||||
_pos = [
|
||||
(_pos select 0) + (_pos select 2) / 2,
|
||||
(_pos select 1) + (_pos select 3) / 2
|
||||
];
|
||||
|
||||
switch (true) do {
|
||||
case (!isNull findDisplay 12): {
|
||||
_pos = (findDisplay 12 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 37): {
|
||||
_pos = (findDisplay 37 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 52): {
|
||||
_pos = (findDisplay 52 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
case (!isNull findDisplay 53): {
|
||||
_pos = (findDisplay 53 displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||
};
|
||||
};
|
||||
|
||||
// set and send marker data the next frame. the actual marker isn't created yet
|
||||
[
|
||||
{
|
||||
|
||||
[QGVAR(setMarkerNetwork), [
|
||||
allMapMarkers select (count allMapMarkers - 1), [
|
||||
GETGVAR(currentMarkerShape,0),
|
||||
GETGVAR(currentMarkerColor,0),
|
||||
_this,
|
||||
GETGVAR(currentMarkerAngle,0)
|
||||
]
|
||||
]] call EFUNC(common,globalEvent);
|
||||
|
||||
},
|
||||
_pos
|
||||
] call EFUNC(common,execNextFrame);
|
||||
|
||||
};
|
13
addons/markers/functions/fnc_sendMarkersJIP.sqf
Normal file
13
addons/markers/functions/fnc_sendMarkersJIP.sqf
Normal file
@ -0,0 +1,13 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private "_logic";
|
||||
|
||||
_logic = _this;
|
||||
|
||||
[QGVAR(setMarkerJIP), _logic, [
|
||||
GETGVAR(allMapMarkers,[]),
|
||||
GETGVAR(allMapMarkersProperties,[]),
|
||||
_logic
|
||||
]
|
||||
] call EFUNC(common,targetEvent);
|
27
addons/markers/functions/fnc_setMarkerJIP.sqf
Normal file
27
addons/markers/functions/fnc_setMarkerJIP.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"];
|
||||
|
||||
_allMapMarkers = _this select 0;
|
||||
_allMapMarkersProperties = _this select 1;
|
||||
_logic = _this select 2;
|
||||
|
||||
{
|
||||
_index = _allMapMarkers find _x;
|
||||
|
||||
if (_index != -1) then {
|
||||
_data = _allMapMarkersProperties select _index;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select (_data select 0);
|
||||
_x setMarkerTypeLocal configName _config;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
|
||||
_x setMarkerColorLocal configName _config;
|
||||
|
||||
_x setMarkerPosLocal (_data select 2);
|
||||
_x setMarkerDirLocal (_data select 3);
|
||||
};
|
||||
} forEach allMapMarkers;
|
||||
|
||||
deleteVehicle _logic;
|
37
addons/markers/functions/fnc_setMarkerNetwork.sqf
Normal file
37
addons/markers/functions/fnc_setMarkerNetwork.sqf
Normal file
@ -0,0 +1,37 @@
|
||||
// by commy2
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_marker", "_data", "_config"];
|
||||
|
||||
_marker = _this select 0;
|
||||
_data = _this select 1;
|
||||
|
||||
_config = (configfile >> "CfgMarkers") select (_data select 0);
|
||||
_marker setMarkerTypeLocal configName _config;
|
||||
|
||||
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
|
||||
_marker setMarkerColorLocal configName _config;
|
||||
|
||||
_marker setMarkerPosLocal (_data select 2);
|
||||
_marker setMarkerDirLocal (_data select 3);
|
||||
|
||||
// save properties on server machine for JIP, marker editing ready
|
||||
if (isMultiplayer && {isServer}) then {
|
||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
|
||||
|
||||
_allMapMarkers = GETMVAR(allMapMarkers,[]);
|
||||
_allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]);
|
||||
|
||||
_index = _allMapMarkers find _marker;
|
||||
|
||||
if (_index == -1) then {
|
||||
_allMapMarkers pushBack _marker;
|
||||
_allMapMarkersProperties pushBack _data;
|
||||
} else {
|
||||
_allMapMarkers set [_index, _marker];
|
||||
_allMapMarkersProperties set [_index, _data];
|
||||
};
|
||||
|
||||
GVAR(allMapMarkers) = _allMapMarkers;
|
||||
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
|
||||
};
|
1
addons/markers/functions/script_component.hpp
Normal file
1
addons/markers/functions/script_component.hpp
Normal file
@ -0,0 +1 @@
|
||||
#include "\z\ace\addons\markers\script_component.hpp"
|
12
addons/markers/script_component.hpp
Normal file
12
addons/markers/script_component.hpp
Normal file
@ -0,0 +1,12 @@
|
||||
#define COMPONENT markers
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_MARKERS
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLED_MARKERS
|
||||
#define DEBUG_SETTINGS DEBUG_ENABLED_MARKERS
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Edited with tabler - 2014-12-22 -->
|
||||
<Project name="AGM">
|
||||
<Project name="ACE">
|
||||
<Package name="Markers">
|
||||
<Key ID="STR_AGM_Markers_MarkerDirection">
|
||||
<Key ID="STR_ACE_Markers_MarkerDirection">
|
||||
<English>Direction: %1°</English>
|
||||
<German>Drehung: %1°</German>
|
||||
<French>Direction: %1°</French>
|
||||
@ -11,7 +11,7 @@
|
||||
<Spanish>Dirección: %1°</Spanish>
|
||||
<Russian>Направление: %1</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_AGM_Markers_PlaceIn">
|
||||
<Key ID="STR_ACE_Markers_PlaceIn">
|
||||
<English>Place in: %1</English>
|
||||
<German>Platz in: %1</German>
|
||||
<Spanish>Colocar en: %1</Spanish>
|
Loading…
Reference in New Issue
Block a user