mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #267 from KoffeinFlummi/142Markers
1.42 Marker Placement
This commit is contained in:
commit
023a2d2202
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
class Extended_PreInit_EventHandlers {
|
class Extended_PreInit_EventHandlers {
|
||||||
class ADDON {
|
class ADDON {
|
||||||
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
init = QUOTE(call COMPILE_FILE(XEH_preInit));
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
class RscPicture;
|
class RscPicture;
|
||||||
class RscText;
|
class RscText;
|
||||||
class RscStructuredText;
|
class RscStructuredText;
|
||||||
@ -13,91 +12,34 @@ class RscXSliderH;
|
|||||||
class RscDisplayInsertMarker {
|
class RscDisplayInsertMarker {
|
||||||
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
|
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
|
||||||
onUnload = QUOTE(_this call DFUNC(placeMarker););
|
onUnload = QUOTE(_this call DFUNC(placeMarker););
|
||||||
idd = 54;
|
// idd = 54;
|
||||||
movingEnable = 1;
|
movingEnable = 1;
|
||||||
class controlsBackground {
|
class controlsBackground {
|
||||||
class RscText_1000: RscText {
|
// class RscText_1000: RscText {idc = 1000;};
|
||||||
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 {
|
class controls {
|
||||||
//delete ButtonOK;
|
// class ButtonMenuOK: RscButtonMenuOK {idc = 1;};
|
||||||
class ButtonMenuOK: RscButtonMenuOK {
|
// class ButtonMenuCancel: RscButtonMenuCancel {idc = 2;};
|
||||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
// class Title: RscText {idc = 1001;};
|
||||||
y = "15.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
// class Description: RscStructuredText {idc = 1100;};
|
||||||
w = "8.9 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
// class DescriptionChannel: RscStructuredText {idc = 1101;};
|
||||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
// class MarkerPicture: RscPicture {idc = 102;};
|
||||||
// size = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
// class MarkerText: RscEdit {idc = 101;};
|
||||||
// sizeEx = "0.85 * ( ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
|
// class MarkerChannel: RscCombo {idc = 103;};
|
||||||
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";
|
class MarkerShape: RscCombo {
|
||||||
colorBackground[] = {0.75,0,0,0.5};
|
idc = 1210;
|
||||||
colorBackgroundFocused[] = {0.75,0,0,0.5};
|
|
||||||
colorBackground2[] = {1,0,0,0.5};
|
|
||||||
};
|
};
|
||||||
/*class ButtonMenuInfo: RscButtonMenu {
|
class MarkerColor: RscCombo {
|
||||||
idc = 2400;
|
idc = 1211;
|
||||||
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 MarkerAngle: RscXSliderH {
|
||||||
/*class Info: RscStructuredText {
|
idc = 1220;
|
||||||
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 {
|
class MarkerAngleText: RscText {
|
||||||
idc = 101;
|
idc = 1221;
|
||||||
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 {
|
/*class SizeX: RscEdit {
|
||||||
idc = 1200;
|
idc = 1200;
|
||||||
text = "10";
|
text = "10";
|
||||||
@ -114,34 +56,5 @@ class RscDisplayInsertMarker {
|
|||||||
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
||||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
||||||
};*/
|
};*/
|
||||||
class MarkerShape: RscCombo {
|
|
||||||
idc = 1210;
|
|
||||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
|
||||||
y = "11.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
|
||||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
|
||||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
|
||||||
};
|
|
||||||
class MarkerColor: RscCombo {
|
|
||||||
idc = 1211;
|
|
||||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
|
||||||
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
|
||||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
|
||||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
|
||||||
};
|
|
||||||
class MarkerAngle: RscXSliderH {
|
|
||||||
idc = 1220;
|
|
||||||
text = "10";
|
|
||||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
|
||||||
y = "13.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
|
||||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
|
||||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
|
||||||
};
|
|
||||||
class MarkerAngleText: RscText {
|
|
||||||
idc = 1221;
|
|
||||||
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
|
|
||||||
y = "14.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
|
|
||||||
w = "10 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
|
|
||||||
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -11,6 +11,12 @@
|
|||||||
if (isMultiplayer && {!isServer} && {hasInterface}) then {
|
if (isMultiplayer && {!isServer} && {hasInterface}) then {
|
||||||
private "_logic";
|
private "_logic";
|
||||||
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
|
||||||
|
[QGVAR(sendMarkersJIP), [_logic]] call EFUNC(common,serverEvent);
|
||||||
[QGVAR(sendMarkersJIP), _logic] call EFUNC(common,serverEvent);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
GVAR(mapDisplaysWithDrawEHs) = [];
|
||||||
|
GVAR(currentMarkerPosition) = [];
|
||||||
|
GVAR(currentMarkerAngle) = 0;
|
||||||
|
GVAR(currentMarkerColorConfigName) = "";
|
||||||
|
GVAR(currentMarkerConfigName) = "";
|
@ -3,6 +3,7 @@
|
|||||||
ADDON = false;
|
ADDON = false;
|
||||||
|
|
||||||
PREP(initInsertMarker);
|
PREP(initInsertMarker);
|
||||||
|
PREP(mapDrawEH);
|
||||||
PREP(onLBSelChangedColor);
|
PREP(onLBSelChangedColor);
|
||||||
PREP(onLBSelChangedShape);
|
PREP(onLBSelChangedShape);
|
||||||
PREP(onSliderPosChangedAngle);
|
PREP(onSliderPosChangedAngle);
|
||||||
@ -14,25 +15,15 @@ PREP(setMarkerNetwork);
|
|||||||
// init marker types
|
// init marker types
|
||||||
if (isNil QGVAR(MarkersCache)) then {
|
if (isNil QGVAR(MarkersCache)) then {
|
||||||
_config = configfile >> "CfgMarkers";
|
_config = configfile >> "CfgMarkers";
|
||||||
_index = 0;
|
|
||||||
|
|
||||||
GVAR(MarkersCache) = [];
|
GVAR(MarkersCache) = [];
|
||||||
|
|
||||||
for "_a" from 0 to (count _config - 1) do {
|
for "_a" from 0 to (count _config - 1) do {
|
||||||
_marker = _config select _a;
|
_marker = _config select _a;
|
||||||
|
|
||||||
_scope = getNumber (_marker >> "scope");
|
_scope = getNumber (_marker >> "scope");
|
||||||
_name = getText (_marker >> "name");
|
|
||||||
_icon = getText (_marker >> "icon");
|
|
||||||
|
|
||||||
if (_scope == 2) then {
|
if (_scope == 2) then {
|
||||||
_shape lbAdd _name;
|
_name = getText (_marker >> "name");
|
||||||
_shape lbSetValue [_index, _a];
|
_icon = getText (_marker >> "icon");
|
||||||
_shape lbSetPicture [_index, _icon];
|
|
||||||
|
|
||||||
GVAR(MarkersCache) pushBack [_name, _a, _icon];
|
GVAR(MarkersCache) pushBack [_name, _a, _icon];
|
||||||
|
|
||||||
_index = _index + 1;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -40,39 +31,27 @@ if (isNil QGVAR(MarkersCache)) then {
|
|||||||
// init marker colors
|
// init marker colors
|
||||||
if (isNil QGVAR(MarkerColorsCache)) then {
|
if (isNil QGVAR(MarkerColorsCache)) then {
|
||||||
_config = configfile >> "CfgMarkerColors";
|
_config = configfile >> "CfgMarkerColors";
|
||||||
_index = 0;
|
|
||||||
|
|
||||||
GVAR(MarkerColorsCache) = [];
|
GVAR(MarkerColorsCache) = [];
|
||||||
|
|
||||||
for "_a" from 0 to (count _config - 1) do {
|
for "_a" from 0 to (count _config - 1) do {
|
||||||
_marker = _config select _a;
|
_marker = _config select _a;
|
||||||
|
|
||||||
_scope = getNumber (_marker >> "scope");
|
_scope = getNumber (_marker >> "scope");
|
||||||
_name = getText (_marker >> "name");
|
|
||||||
|
|
||||||
if (_scope == 2) then {
|
if (_scope == 2) then {
|
||||||
_color lbAdd _name;
|
_name = getText (_marker >> "name");
|
||||||
_color lbSetValue [_index, _a];
|
|
||||||
|
|
||||||
_rgba = getArray (_marker >> "color");
|
_rgba = getArray (_marker >> "color");
|
||||||
|
|
||||||
{
|
{
|
||||||
if (typeName _x != "SCALAR") then {
|
if (typeName _x != "SCALAR") then {
|
||||||
_rgba set [_forEachIndex, call compile _x];
|
_rgba set [_forEachIndex, call compile _x];
|
||||||
};
|
};
|
||||||
} forEach _rgba;
|
} 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];
|
_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];
|
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon];
|
||||||
|
|
||||||
_index = _index + 1;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//Server Sync JIP markers:
|
||||||
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler);
|
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
ADDON = true;
|
ADDON = true;
|
||||||
|
@ -1,87 +1,84 @@
|
|||||||
// stuff taken from bohemia, edited by commy2
|
/*
|
||||||
|
* Author: BIS, commy2
|
||||||
|
* Sets up the marker placement
|
||||||
|
* Run instead of \a3\ui_f\scripts\GUI\RscDisplayInsertMarker.sqf
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: RscDisplayInsertMarker <DISPLAY>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [onLoad] call ace_markers_fnc_initInsertMarker;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
#define BORDER 0.005
|
#define BORDER 0.005
|
||||||
|
|
||||||
[{
|
[{
|
||||||
disableserialization;
|
disableserialization;
|
||||||
_display = _this select 0;
|
PARAMS_1(_display);
|
||||||
|
|
||||||
//Prevent Captive Players from placing markers
|
//Can't place markers when can't interact
|
||||||
/*if (ACE_player getVariable ["ACE_isCaptive", false]) exitWith {
|
if (!([ACE_player, objNull, ["notOnMap", "isNotInside"]] call EFUNC(common,canInteractWith))) exitWith {
|
||||||
_display closeDisplay 2; //emulate "Cancel" button
|
_display closeDisplay 2; //emulate "Cancel" button
|
||||||
};*/
|
};
|
||||||
|
|
||||||
// prevent vanilla key input
|
|
||||||
_display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}];
|
|
||||||
|
|
||||||
|
//BIS Controls:
|
||||||
_text = _display displayctrl 101;
|
_text = _display displayctrl 101;
|
||||||
_picture = _display displayctrl 102;
|
_picture = _display displayctrl 102;
|
||||||
|
_channel = _display displayctrl 103;
|
||||||
_buttonOK = _display displayctrl 1;
|
_buttonOK = _display displayctrl 1;
|
||||||
_buttonCancel = _display displayctrl 2;
|
_buttonCancel = _display displayctrl 2;
|
||||||
_description = _display displayctrl 1100;
|
_description = _display displayctrl 1100;
|
||||||
_title = _display displayctrl 1001;
|
_title = _display displayctrl 1001;
|
||||||
_sizeX = _display displayctrl 1200;
|
_descriptionChannel = _display displayctrl 1101;
|
||||||
_sizeY = _display displayctrl 1201;
|
|
||||||
_shape = _display displayctrl 1210;
|
|
||||||
_color = _display displayctrl 1211;
|
|
||||||
_angle = _display displayctrl 1220;
|
|
||||||
_angleText = _display displayctrl 1221;
|
|
||||||
|
|
||||||
|
//ACE Controls:
|
||||||
|
// _sizeX = _display displayctrl 1200;
|
||||||
|
// _sizeY = _display displayctrl 1201;
|
||||||
|
_aceShapeLB = _display displayctrl 1210;
|
||||||
|
_aceColorLB = _display displayctrl 1211;
|
||||||
|
_aceAngleSlider = _display displayctrl 1220;
|
||||||
|
_aceAngleSliderText = _display displayctrl 1221;
|
||||||
|
|
||||||
|
|
||||||
|
//Install MapDrawEH on current map
|
||||||
|
_mapIDD = -1;
|
||||||
|
{
|
||||||
|
if (!isNull (findDisplay _x)) exitWith {_mapIDD = _x};
|
||||||
|
} forEach [12, 37, 52, 53];
|
||||||
|
if (_mapIDD == -1) exitWith {ERROR("No Map?");};
|
||||||
|
if (!(_mapIDD in GVAR(mapDisplaysWithDrawEHs))) then {
|
||||||
|
GVAR(mapDisplaysWithDrawEHs) pushBack _mapIDD;
|
||||||
|
((finddisplay _mapIDD) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(mapDrawEH)}];
|
||||||
|
};
|
||||||
|
|
||||||
|
//Calculate center position of the marker placement ctrl
|
||||||
|
_pos = ctrlPosition _picture;
|
||||||
|
_pos = [(_pos select 0) + (_pos select 2) / 2, (_pos select 1) + (_pos select 3) / 2];
|
||||||
|
GVAR(currentMarkerPosition) = ((findDisplay _mapIDD) displayCtrl 51) ctrlMapScreenToWorld _pos;
|
||||||
|
|
||||||
|
//Hide the bis picture:
|
||||||
|
_picture ctrlShow false;
|
||||||
|
|
||||||
|
// prevent vanilla key input
|
||||||
|
_display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}];
|
||||||
|
|
||||||
|
|
||||||
|
//Focus on the text input
|
||||||
ctrlSetFocus _text;
|
ctrlSetFocus _text;
|
||||||
|
|
||||||
//Change ok button's text based on current channel
|
|
||||||
[{
|
|
||||||
EXPLODE_2_PVT(_this,_params,_pfhId);
|
|
||||||
EXPLODE_1_PVT(_params,_buttonOK);
|
|
||||||
|
|
||||||
if (isNull _buttonOK) exitWith {
|
|
||||||
[_pfhId] call CBA_fnc_removePerFrameHandler;
|
|
||||||
};
|
|
||||||
|
|
||||||
_channel = "";
|
|
||||||
_textColor = [1,1,1,1];
|
|
||||||
switch (call EFUNC(common,currentChannel)) do {
|
|
||||||
case ("global"): {
|
|
||||||
_channel = localize "str_channel_global";
|
|
||||||
_textColor = [(216/255),(216/255),(216/255),1];
|
|
||||||
};
|
|
||||||
case ("side"): {
|
|
||||||
_channel = localize "str_channel_side";
|
|
||||||
_textColor = [(70/255),(211/255),(252/255),1];
|
|
||||||
};
|
|
||||||
case ("group"): {
|
|
||||||
_channel = localize "str_channel_group";
|
|
||||||
_textColor = [(181/255),(248/255),(98/255),1];
|
|
||||||
};
|
|
||||||
case ("vehicle"): {
|
|
||||||
_channel = localize "str_channel_vehicle";
|
|
||||||
_textColor = [(255/255),(208/255),(0/255),1];
|
|
||||||
};
|
|
||||||
case ("direct"): {
|
|
||||||
_channel = localize "str_channel_direct";
|
|
||||||
_textColor = [(255/255),(255/255),(255/255),1];
|
|
||||||
};
|
|
||||||
case ("command"): {
|
|
||||||
_channel = localize "str_channel_command";
|
|
||||||
_textColor = [(255/255),(255/255),(70/255),1];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
//If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text)
|
|
||||||
if (_channel != "") then {
|
|
||||||
_buttonOK ctrlSetTextColor _textColor;
|
|
||||||
_buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel];
|
|
||||||
};
|
|
||||||
}, 0, [_buttonOK]] call CBA_fnc_addPerFrameHandler;
|
|
||||||
|
|
||||||
//--- Background
|
//--- Background
|
||||||
_pos = ctrlposition _text;
|
_pos = ctrlposition _text;
|
||||||
_posX = (_pos select 0) + 0.01;
|
_posX = (_pos select 0) + 0.01;
|
||||||
_posY = _pos select 1;
|
_posY = _pos select 1;
|
||||||
_posW = _pos select 2;
|
_posW = _pos select 2;
|
||||||
_posH = _pos select 3;
|
_posH = _pos select 3;
|
||||||
_posY = _posY min ((safeZoneH + safeZoneY) - (6 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen
|
_posY = _posY min ((safeZoneH + safeZoneY) - (8 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen
|
||||||
_pos set [0,_posX];
|
_pos set [0,_posX];
|
||||||
_pos set [1,_posY];
|
_pos set [1,_posY];
|
||||||
_text ctrlsetposition _pos;
|
_text ctrlsetposition _pos;
|
||||||
@ -96,46 +93,67 @@
|
|||||||
//--- Description
|
//--- Description
|
||||||
_pos set [1,_posY - 1*_posH];
|
_pos set [1,_posY - 1*_posH];
|
||||||
_pos set [3,6*_posH + 6 * BORDER];
|
_pos set [3,6*_posH + 6 * BORDER];
|
||||||
|
_description ctrlenable false;
|
||||||
_description ctrlsetposition _pos;
|
_description ctrlsetposition _pos;
|
||||||
_description ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>","Description:"]; //--- ToDo: Localze
|
_description ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>", (localize "str_lib_label_description")];
|
||||||
_description ctrlcommit 0;
|
_description ctrlcommit 0;
|
||||||
|
|
||||||
_activeColor = (["IGUI","WARNING_RGB"] call bis_fnc_displaycolorget) call bis_fnc_colorRGBtoHTML;
|
|
||||||
|
|
||||||
//--- Shape
|
//--- Shape
|
||||||
_pos set [1,_posY + 1 * _posH + 2 * BORDER];
|
_pos set [1,_posY + 1 * _posH + 2 * BORDER];
|
||||||
_pos set [2,_posW];
|
_pos set [2,_posW];
|
||||||
_pos set [3,_posH];
|
_pos set [3,_posH];
|
||||||
_shape ctrlsetposition _pos;
|
_aceShapeLB ctrlsetposition _pos;
|
||||||
_shape ctrlcommit 0;
|
_aceShapeLB ctrlcommit 0;
|
||||||
|
|
||||||
//--- Color
|
//--- Color
|
||||||
_pos set [1,_posY + 2 * _posH + 3 * BORDER];
|
_pos set [1,_posY + 2 * _posH + 3 * BORDER];
|
||||||
_pos set [2,_posW];
|
_pos set [2,_posW];
|
||||||
_color ctrlsetposition _pos;
|
_aceColorLB ctrlsetposition _pos;
|
||||||
_color ctrlcommit 0;
|
_aceColorLB ctrlcommit 0;
|
||||||
|
|
||||||
//--- Angle
|
//--- Angle
|
||||||
_pos set [1,_posY + 3 * _posH + 4 * BORDER];
|
_pos set [1,_posY + 3 * _posH + 4 * BORDER];
|
||||||
_pos set [2,_posW];
|
_pos set [2,_posW];
|
||||||
_angle ctrlsetposition _pos;
|
_aceAngleSlider ctrlsetposition _pos;
|
||||||
_angle ctrlcommit 0;
|
_aceAngleSlider ctrlcommit 0;
|
||||||
|
|
||||||
//--- Angle Text
|
//--- Angle Text
|
||||||
_pos set [1,_posY + 4 * _posH + 5 * BORDER];
|
_pos set [1,_posY + 4 * _posH + 5 * BORDER];
|
||||||
_pos set [2,_posW];
|
_pos set [2,_posW];
|
||||||
_angleText ctrlsetposition _pos;
|
_aceAngleSliderText ctrlsetposition _pos;
|
||||||
_angleText ctrlcommit 0;
|
_aceAngleSliderText ctrlcommit 0;
|
||||||
|
|
||||||
|
_offsetButtons = 0;
|
||||||
|
if (isMultiplayer) then {
|
||||||
|
_pos set [1,_posY + 5 * _posH + 7 * BORDER];
|
||||||
|
_pos set [3,_posH];
|
||||||
|
_descriptionChannel ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>", (localize "str_a3_cfgvehicles_modulerespawnposition_f_arguments_marker_0") + ":"];
|
||||||
|
_descriptionChannel ctrlsetposition _pos;
|
||||||
|
_descriptionChannel ctrlcommit 0;
|
||||||
|
|
||||||
|
_pos set [1,_posY + 6 * _posH + 7 * BORDER];
|
||||||
|
_pos set [3,_posH];
|
||||||
|
_channel ctrlsetposition _pos;
|
||||||
|
_channel ctrlcommit 0;
|
||||||
|
_offsetButtons = 7 * _posH + 8 * BORDER;
|
||||||
|
} else {
|
||||||
|
_descriptionChannel ctrlshow false;
|
||||||
|
_channel ctrlshow false;
|
||||||
|
_offsetButtons = 5 * _posH + 7 * BORDER;
|
||||||
|
};
|
||||||
|
|
||||||
//--- ButtonOK
|
//--- ButtonOK
|
||||||
_pos set [1,_posY + 5 * _posH + 7 * BORDER];
|
_pos set [1,_posY + _offsetButtons];
|
||||||
_pos set [2,_posW * (8.9/10) - BORDER];
|
_pos set [2,_posW / 2 - BORDER];
|
||||||
|
_pos set [3,_posH];
|
||||||
_buttonOk ctrlsetposition _pos;
|
_buttonOk ctrlsetposition _pos;
|
||||||
_buttonOk ctrlcommit 0;
|
_buttonOk ctrlcommit 0;
|
||||||
|
|
||||||
//--- ButtonCancel
|
//--- ButtonCancel
|
||||||
_pos set [0,_posX + _posW * (8.9 / 10)];
|
_pos set [0,_posX + _posW / 2];
|
||||||
_pos set [2,_posW * (1.1 / 10)];
|
_pos set [1,_posY + _offsetButtons];
|
||||||
|
_pos set [2,_posW / 2];
|
||||||
|
_pos set [3,_posH];
|
||||||
_buttonCancel ctrlsetposition _pos;
|
_buttonCancel ctrlsetposition _pos;
|
||||||
_buttonCancel ctrlcommit 0;
|
_buttonCancel ctrlcommit 0;
|
||||||
|
|
||||||
@ -151,56 +169,41 @@
|
|||||||
|
|
||||||
|
|
||||||
// init marker shape lb
|
// init marker shape lb
|
||||||
|
lbClear _aceShapeLB;
|
||||||
{
|
{
|
||||||
_shape lbAdd (_x select 0);
|
_aceShapeLB lbAdd (_x select 0);
|
||||||
_shape lbSetValue [_forEachIndex, _x select 1];
|
_aceShapeLB lbSetValue [_forEachIndex, _x select 1];
|
||||||
_shape lbSetPicture [_forEachIndex, _x select 2];
|
_aceShapeLB lbSetPicture [_forEachIndex, _x select 2];
|
||||||
} forEach GVAR(MarkersCache);
|
} forEach GVAR(MarkersCache);
|
||||||
|
|
||||||
_shape ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}];
|
|
||||||
|
|
||||||
_curSelShape = GETGVAR(curSelMarkerShape,0);
|
_curSelShape = GETGVAR(curSelMarkerShape,0);
|
||||||
_shape lbSetCurSel _curSelShape;
|
_aceShapeLB lbSetCurSel _curSelShape;
|
||||||
_data = _shape lbValue _curSelShape;
|
|
||||||
_config = (configfile >> "CfgMarkers") select _data;
|
//Update now and add eventHandler:
|
||||||
_icon = getText (_config >> "icon");
|
[_aceShapeLB, _curSelShape] call FUNC(onLBSelChangedShape);
|
||||||
_picture ctrlSetText _icon;
|
_aceShapeLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}];
|
||||||
|
|
||||||
|
|
||||||
// init marker color lb
|
// init marker color lb
|
||||||
|
lbClear _aceColorLB;
|
||||||
{
|
{
|
||||||
_color lbAdd (_x select 0);
|
_aceColorLB lbAdd (_x select 0);
|
||||||
_color lbSetValue [_forEachIndex, _x select 1];
|
_aceColorLB lbSetValue [_forEachIndex, _x select 1];
|
||||||
_color lbSetPicture [_forEachIndex, _x select 2];
|
_aceColorLB lbSetPicture [_forEachIndex, _x select 2];
|
||||||
} forEach GVAR(MarkerColorsCache);
|
} forEach GVAR(MarkerColorsCache);
|
||||||
|
|
||||||
_color ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}];
|
|
||||||
|
|
||||||
_curSelColor = GETGVAR(curSelMarkerColor,0);
|
_curSelColor = GETGVAR(curSelMarkerColor,0);
|
||||||
_color lbSetCurSel _curSelColor;
|
_aceColorLB lbSetCurSel _curSelColor;
|
||||||
_data = _color lbValue _curSelColor;
|
|
||||||
_config = (configfile >> "CfgMarkerColors") select _data;
|
//Update now and add eventHandler:
|
||||||
_rgba = getArray (_config >> "color");
|
[_aceColorLB, _curSelColor] call FUNC(onLBSelChangedColor);
|
||||||
{
|
_aceColorLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}];
|
||||||
if (typeName _x != "SCALAR") then {
|
|
||||||
_rgba set [_forEachIndex, call compile _x];
|
|
||||||
};
|
|
||||||
} forEach _rgba;
|
|
||||||
_picture ctrlSetTextColor _rgba;
|
|
||||||
|
|
||||||
|
|
||||||
// init marker angle slider
|
// init marker angle slider
|
||||||
_angle sliderSetRange [-180, 180];
|
_aceAngleSlider sliderSetRange [-180, 180];
|
||||||
_angle ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
_curSelAngle = GETGVAR(currentMarkerAngle,0);
|
||||||
|
_aceAngleSlider sliderSetPosition _curSelAngle;
|
||||||
_curSelAngle = GETGVAR(curSelMarkerAngle,0);
|
//Update now and add eventHandler:
|
||||||
_angle sliderSetPosition _curSelAngle;
|
[_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle);
|
||||||
|
_aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
|
||||||
_curSelAngle = round _curSelAngle;
|
|
||||||
if (_curSelAngle < 0) then {
|
|
||||||
_curSelAngle = _curSelAngle + 360;
|
|
||||||
};
|
|
||||||
|
|
||||||
_angleText ctrlSetText format [localize "STR_ACE_Markers_MarkerDirection", _curSelAngle];
|
|
||||||
|
|
||||||
}, _this] call EFUNC(common,execNextFrame);
|
}, _this] call EFUNC(common,execNextFrame);
|
||||||
|
45
addons/markers/functions/fnc_mapDrawEH.sqf
Normal file
45
addons/markers/functions/fnc_mapDrawEH.sqf
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Draws the current temp marker. Allows rotation.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: TheMap <Control>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [theMapControl] call ace_markers_fnc_mapDrawEH;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
private ["_theMap", "_sizeX", "_sizeY", "_textureConfig", "_texture", "_markerSize", "_markerShadow", "_colorConfig", "_drawColor"];
|
||||||
|
|
||||||
|
PARAMS_1(_theMap);
|
||||||
|
|
||||||
|
//Only show if marker place is open:
|
||||||
|
if (isNull (findDisplay 54)) exitWith {};
|
||||||
|
//Error checking:
|
||||||
|
if ((GVAR(currentMarkerConfigName) == "") || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith {ERROR("Bad Data");};
|
||||||
|
|
||||||
|
_sizeX = 1;
|
||||||
|
_sizeY = 1;
|
||||||
|
|
||||||
|
_textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName);
|
||||||
|
_texture = getText (_textureConfig >> "icon");
|
||||||
|
_markerSize = getNumber (_textureConfig >> "size");
|
||||||
|
_markerShadow = getNumber (_textureConfig >> "shadow");
|
||||||
|
_colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName));
|
||||||
|
_drawColor = getArray (_colorConfig >> "color");
|
||||||
|
|
||||||
|
//Convert possible code into numbers
|
||||||
|
{
|
||||||
|
if (typeName _x == "STRING") then {
|
||||||
|
_drawColor set [_forEachIndex, (call compile _x)];
|
||||||
|
};
|
||||||
|
} forEach _drawColor;
|
||||||
|
_drawColor set [3, ((_drawColor select 3) * 0.875)]; //Arma adds a slight transparency
|
||||||
|
|
||||||
|
_theMap drawIcon [_texture, _drawColor, GVAR(currentMarkerPosition), (_sizeX * _markerSize), (_sizeY * _markerSize), GVAR(currentMarkerAngle), "", _markerShadow];
|
@ -1,23 +1,28 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* When the color list box is changed.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Color ListBox (idc 1211) <CONTROL>
|
||||||
|
* 1: Selected Index <NUMBER>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [ColorLB, 5] call ace_markers_fnc_onLBSelChangedColor;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_ctrl", "_data", "_config", "_color"];
|
private ["_data", "_config"];
|
||||||
|
|
||||||
_ctrl = _this select 0;
|
PARAMS_2(_ctrl,_index);
|
||||||
_data = _ctrl lbValue (_this select 1);
|
_data = _ctrl lbValue _index;
|
||||||
|
|
||||||
GVAR(curSelMarkerColor) = _this select 1;
|
GVAR(curSelMarkerColor) = _index;
|
||||||
|
|
||||||
_config = (configfile >> "CfgMarkerColors") select _data;
|
_config = (configfile >> "CfgMarkerColors") select _data;
|
||||||
|
|
||||||
_color = getArray (_config >> "color");
|
|
||||||
|
|
||||||
{
|
|
||||||
if (typeName _x != "SCALAR") then {
|
|
||||||
_color set [_forEachIndex, call compile _x];
|
|
||||||
};
|
|
||||||
} forEach _color;
|
|
||||||
|
|
||||||
((ctrlParent _ctrl) displayCtrl 102) ctrlSetTextColor _color;
|
|
||||||
|
|
||||||
GVAR(currentMarkerColorConfigName) = (configName _config);
|
GVAR(currentMarkerColorConfigName) = (configName _config);
|
||||||
|
@ -1,17 +1,28 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* When the shape list box is changed.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Shape ListBox (idc 1210) <CONTROL>
|
||||||
|
* 1: Selected Index <NUMBER>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [ColorLB, 5] call ace_markers_fnc_onLBSelChangedShape;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_ctrl", "_data", "_config", "_icon"];
|
private ["_data", "_config"];
|
||||||
|
|
||||||
_ctrl = _this select 0;
|
PARAMS_2(_ctrl,_index);
|
||||||
_data = _ctrl lbValue (_this select 1);
|
_data = _ctrl lbValue _index;
|
||||||
|
|
||||||
GVAR(curSelMarkerShape) = _this select 1;
|
GVAR(curSelMarkerShape) = _index;
|
||||||
|
|
||||||
_config = (configfile >> "CfgMarkers") select _data;
|
_config = (configfile >> "CfgMarkers") select _data;
|
||||||
|
|
||||||
_icon = getText (_config >> "icon");
|
|
||||||
|
|
||||||
((ctrlParent _ctrl) displayCtrl 102) ctrlSetText _icon;
|
|
||||||
|
|
||||||
GVAR(currentMarkerConfigName) = (configName _config);
|
GVAR(currentMarkerConfigName) = (configName _config);
|
||||||
|
@ -1,12 +1,24 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Angle Slider Pos changed
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Slider (idc 1210) <CONTROL>
|
||||||
|
* 1: Slider Data (angle: -180..180) <NUMBER>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [Slider, 2] call ace_markers_fnc_onSliderPosChangedAngle;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_ctrl", "_data", "_direction"];
|
private ["_direction"];
|
||||||
|
|
||||||
_ctrl = _this select 0;
|
PARAMS_2(_ctrl,_data);
|
||||||
_data = _this select 1;
|
|
||||||
|
|
||||||
GVAR(curSelMarkerAngle) = _data;
|
|
||||||
|
|
||||||
_direction = round _data;
|
_direction = round _data;
|
||||||
if (_direction < 0) then {
|
if (_direction < 0) then {
|
||||||
|
@ -1,46 +1,36 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* MarkerPlacement closed
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: RscDisplayInsertMarker <DISPLAY>
|
||||||
|
* 1: CloseNumber (1 = ButtonOk) <NUMBER>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [onUnloadEvent] call ace_markers_fnc_placeMarker;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
if (_this select 1 == 1) then {
|
disableserialization;
|
||||||
disableserialization;
|
PARAMS_2(_display,_closeNum);
|
||||||
_display = _this select 0;
|
|
||||||
|
|
||||||
_pos = ctrlPosition (_display displayCtrl 102);
|
if (_closeNum == 1) then {
|
||||||
_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
|
// set and send marker data the next frame. the actual marker isn't created yet
|
||||||
[
|
[{
|
||||||
{
|
[QGVAR(setMarkerNetwork), [
|
||||||
|
allMapMarkers select (count allMapMarkers - 1), [
|
||||||
[QGVAR(setMarkerNetwork), [
|
GETGVAR(currentMarkerConfigName,""),
|
||||||
allMapMarkers select (count allMapMarkers - 1), [
|
GETGVAR(currentMarkerColorConfigName,""),
|
||||||
GETGVAR(currentMarkerConfigName,""),
|
GETGVAR(currentMarkerPosition,[]),
|
||||||
GETGVAR(currentMarkerColorConfigName,""),
|
GETGVAR(currentMarkerAngle,0)
|
||||||
_this,
|
]
|
||||||
GETGVAR(currentMarkerAngle,0)
|
]] call EFUNC(common,globalEvent);
|
||||||
]
|
|
||||||
]] call EFUNC(common,globalEvent);
|
|
||||||
|
|
||||||
},
|
|
||||||
_pos
|
|
||||||
] call EFUNC(common,execNextFrame);
|
|
||||||
|
|
||||||
|
}, []] call EFUNC(common,execNextFrame);
|
||||||
};
|
};
|
||||||
|
@ -1,13 +1,25 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Server: Recives a dummy logic, sends marker data back to the owner.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Logic <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [onUnloadEvent] call ace_markers_fnc_sendMarkerJIP;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private "_logic";
|
PARAMS_1(_logic);
|
||||||
|
|
||||||
_logic = _this;
|
[QGVAR(setMarkerJIP), [_logic], [
|
||||||
|
GETGVAR(allMapMarkers,[]),
|
||||||
[QGVAR(setMarkerJIP), _logic, [
|
GETGVAR(allMapMarkersProperties,[]),
|
||||||
GETGVAR(allMapMarkers,[]),
|
_logic
|
||||||
GETGVAR(allMapMarkersProperties,[]),
|
]
|
||||||
_logic
|
|
||||||
]
|
|
||||||
] call EFUNC(common,targetEvent);
|
] call EFUNC(common,targetEvent);
|
||||||
|
@ -1,35 +1,49 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Client: Recives a marker data from server.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Array of map marker names <ARRAY>
|
||||||
|
* 1: Array of map marker data <ARRAY>
|
||||||
|
* 2: Logic <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [[],[],dummyLogic] call ace_markers_fnc_setMarkerJIP;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index", "_data", "_config"];
|
private ["_index", "_data", "_config"];
|
||||||
|
|
||||||
_allMapMarkers = _this select 0;
|
PARAMS_3(_allMapMarkers,_allMapMarkersProperties,_logic);
|
||||||
_allMapMarkersProperties = _this select 1;
|
|
||||||
_logic = _this select 2;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
_index = _allMapMarkers find _x;
|
_index = _allMapMarkers find _x;
|
||||||
|
|
||||||
if (_index != -1) then {
|
if (_index != -1) then {
|
||||||
_data = _allMapMarkersProperties select _index;
|
_data = _allMapMarkersProperties select _index;
|
||||||
|
|
||||||
_config = (configfile >> "CfgMarkers") >> (_data select 0);
|
_config = (configfile >> "CfgMarkers") >> (_data select 0);
|
||||||
if (!isClass _config) then {
|
if (!isClass _config) then {
|
||||||
WARNING("CfgMarker not found, changed to milDot");
|
WARNING("CfgMarker not found, changed to milDot");
|
||||||
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
||||||
|
};
|
||||||
|
_x setMarkerTypeLocal (configName _config);
|
||||||
|
|
||||||
|
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
|
||||||
|
if (!isClass _config) then {
|
||||||
|
WARNING("CfgMarkerColors not found, changed to Default");
|
||||||
|
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
||||||
|
};
|
||||||
|
_x setMarkerColorLocal (configName _config);
|
||||||
|
|
||||||
|
_x setMarkerPosLocal (_data select 2);
|
||||||
|
_x setMarkerDirLocal (_data select 3);
|
||||||
};
|
};
|
||||||
_x setMarkerTypeLocal (configName _config);
|
|
||||||
|
|
||||||
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
|
|
||||||
if (!isClass _config) then {
|
|
||||||
WARNING("CfgMarkerColors not found, changed to Default");
|
|
||||||
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
|
||||||
};
|
|
||||||
_x setMarkerColorLocal (configName _config);
|
|
||||||
|
|
||||||
_x setMarkerPosLocal (_data select 2);
|
|
||||||
_x setMarkerDirLocal (_data select 3);
|
|
||||||
};
|
|
||||||
} forEach allMapMarkers;
|
} forEach allMapMarkers;
|
||||||
|
|
||||||
deleteVehicle _logic;
|
deleteVehicle _logic;
|
||||||
|
@ -1,45 +1,61 @@
|
|||||||
// by commy2
|
/*
|
||||||
|
* Author: commy2
|
||||||
|
* Sets newly placed marker
|
||||||
|
* Handles the QGVAR(setMarkerNetwork) event.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Markername <STRING>
|
||||||
|
* 1: Marker Data <ARRAY>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [[],[],dummyLogic] call ace_markers_fnc_setMarkerJIP;
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_marker", "_data", "_config"];
|
private ["_config"];
|
||||||
|
|
||||||
_marker = _this select 0;
|
PARAMS_2(_marker,_data);
|
||||||
_data = _this select 1;
|
EXPLODE_4_PVT(_data,_markerClassname,_colorClassname,_markerPos,_markerDir);
|
||||||
|
|
||||||
_config = (configfile >> "CfgMarkers") >> (_data select 0);
|
_config = (configfile >> "CfgMarkers") >> _markerClassname;
|
||||||
if (!isClass _config) then {
|
if (!isClass _config) then {
|
||||||
WARNING("CfgMarker not found, changed to milDot");
|
WARNING("CfgMarker not found, changed to milDot");
|
||||||
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
_config == (configFile >> "CfgMarkers" >> "MilDot");
|
||||||
};
|
};
|
||||||
_marker setMarkerTypeLocal (configName _config);
|
_marker setMarkerTypeLocal (configName _config);
|
||||||
|
|
||||||
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
|
_config = (configfile >> "CfgMarkerColors") >> _colorClassname;
|
||||||
if (!isClass _config) then {
|
if (!isClass _config) then {
|
||||||
WARNING("CfgMarkerColors not found, changed to Default");
|
WARNING("CfgMarkerColors not found, changed to Default");
|
||||||
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
_config == (configFile >> "CfgMarkerColors" >> "Default");
|
||||||
};
|
};
|
||||||
_marker setMarkerColorLocal configName _config;
|
_marker setMarkerColorLocal configName _config;
|
||||||
|
|
||||||
_marker setMarkerPosLocal (_data select 2);
|
_marker setMarkerPosLocal _markerPos;
|
||||||
_marker setMarkerDirLocal (_data select 3);
|
_marker setMarkerDirLocal _markerDir;
|
||||||
|
|
||||||
// save properties on server machine for JIP, marker editing ready
|
// save properties on server machine for JIP, marker editing ready
|
||||||
if (isMultiplayer && {isServer}) then {
|
if (isMultiplayer && {isServer}) then {
|
||||||
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
|
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
|
||||||
|
|
||||||
_allMapMarkers = GETMVAR(allMapMarkers,[]);
|
_allMapMarkers = GETGVAR(allMapMarkers,[]);
|
||||||
_allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]);
|
_allMapMarkersProperties = GETGVAR(allMapMarkersProperties,[]);
|
||||||
|
|
||||||
_index = _allMapMarkers find _marker;
|
_index = _allMapMarkers find _marker;
|
||||||
|
|
||||||
if (_index == -1) then {
|
if (_index == -1) then {
|
||||||
_allMapMarkers pushBack _marker;
|
_allMapMarkers pushBack _marker;
|
||||||
_allMapMarkersProperties pushBack _data;
|
_allMapMarkersProperties pushBack _data;
|
||||||
} else {
|
} else {
|
||||||
_allMapMarkers set [_index, _marker];
|
_allMapMarkers set [_index, _marker];
|
||||||
_allMapMarkersProperties set [_index, _data];
|
_allMapMarkersProperties set [_index, _data];
|
||||||
};
|
};
|
||||||
|
|
||||||
GVAR(allMapMarkers) = _allMapMarkers;
|
GVAR(allMapMarkers) = _allMapMarkers;
|
||||||
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
|
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
|
||||||
};
|
};
|
||||||
|
@ -11,13 +11,5 @@
|
|||||||
<Spanish>Dirección: %1°</Spanish>
|
<Spanish>Dirección: %1°</Spanish>
|
||||||
<Russian>Направление: %1</Russian>
|
<Russian>Направление: %1</Russian>
|
||||||
</Key>
|
</Key>
|
||||||
<Key ID="STR_ACE_Markers_PlaceIn">
|
|
||||||
<English>Place in: %1</English>
|
|
||||||
<German>Platz in: %1</German>
|
|
||||||
<Spanish>Colocar en: %1</Spanish>
|
|
||||||
<Polish>Umieść na: %1</Polish>
|
|
||||||
<Czech>Umístit do: %1</Czech>
|
|
||||||
<Russian>Место в: %1</Russian>
|
|
||||||
</Key>
|
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user