mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Marker Fixes for 1.42 WIP
This commit is contained in:
parent
5f1201d75a
commit
63b7f0a755
@ -1,4 +1,3 @@
|
||||
|
||||
class RscPicture;
|
||||
class RscText;
|
||||
class RscStructuredText;
|
||||
@ -13,91 +12,34 @@ class RscXSliderH;
|
||||
class RscDisplayInsertMarker {
|
||||
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
|
||||
onUnload = QUOTE(_this call DFUNC(placeMarker););
|
||||
idd = 54;
|
||||
// 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 RscText_1000: RscText {idc = 1000;};
|
||||
};
|
||||
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 ButtonMenuOK: RscButtonMenuOK {idc = 1;};
|
||||
// class ButtonMenuCancel: RscButtonMenuCancel {idc = 2;};
|
||||
// class Title: RscText {idc = 1001;};
|
||||
// class Description: RscStructuredText {idc = 1100;};
|
||||
// class DescriptionChannel: RscStructuredText {idc = 1101;};
|
||||
// class MarkerPicture: RscPicture {idc = 102;};
|
||||
// class MarkerText: RscEdit {idc = 101;};
|
||||
// class MarkerChannel: RscCombo {idc = 103;};
|
||||
|
||||
class MarkerShape: RscCombo {
|
||||
idc = 1210;
|
||||
};
|
||||
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 MarkerColor: RscCombo {
|
||||
idc = 1211;
|
||||
};
|
||||
/*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)";
|
||||
class MarkerAngle: RscXSliderH {
|
||||
idc = 1220;
|
||||
};
|
||||
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 MarkerAngleText: RscText {
|
||||
idc = 1221;
|
||||
};
|
||||
|
||||
/*class SizeX: RscEdit {
|
||||
idc = 1200;
|
||||
text = "10";
|
||||
@ -114,34 +56,5 @@ class RscDisplayInsertMarker {
|
||||
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)";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -14,25 +14,15 @@ 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];
|
||||
|
||||
_name = getText (_marker >> "name");
|
||||
_icon = getText (_marker >> "icon");
|
||||
GVAR(MarkersCache) pushBack [_name, _a, _icon];
|
||||
|
||||
_index = _index + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -40,39 +30,27 @@ if (isNil QGVAR(MarkersCache)) then {
|
||||
// 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];
|
||||
|
||||
_name = getText (_marker >> "name");
|
||||
_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;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
//Server Sync JIP markers:
|
||||
[QGVAR(sendMarkersJIP), FUNC(sendMarkersJIP)] call EFUNC(common,addEventHandler);
|
||||
|
||||
ADDON = true;
|
||||
|
@ -15,14 +15,19 @@
|
||||
// prevent vanilla key input
|
||||
_display displayAddEventHandler ["KeyDown", {(_this select 1) in [200, 208]}];
|
||||
|
||||
//BIS Controlls:
|
||||
_text = _display displayctrl 101;
|
||||
_picture = _display displayctrl 102;
|
||||
_channel = _display displayctrl 103;
|
||||
_buttonOK = _display displayctrl 1;
|
||||
_buttonCancel = _display displayctrl 2;
|
||||
_description = _display displayctrl 1100;
|
||||
_title = _display displayctrl 1001;
|
||||
_sizeX = _display displayctrl 1200;
|
||||
_sizeY = _display displayctrl 1201;
|
||||
_descriptionChannel = _display displayctrl 1101;
|
||||
|
||||
//ACE Controlls:
|
||||
// _sizeX = _display displayctrl 1200;
|
||||
// _sizeY = _display displayctrl 1201;
|
||||
_shape = _display displayctrl 1210;
|
||||
_color = _display displayctrl 1211;
|
||||
_angle = _display displayctrl 1220;
|
||||
@ -30,51 +35,6 @@
|
||||
|
||||
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
|
||||
_pos = ctrlposition _text;
|
||||
_posX = (_pos select 0) + 0.01;
|
||||
@ -96,12 +56,11 @@
|
||||
//--- Description
|
||||
_pos set [1,_posY - 1*_posH];
|
||||
_pos set [3,6*_posH + 6 * BORDER];
|
||||
_description ctrlenable false;
|
||||
_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;
|
||||
|
||||
_activeColor = (["IGUI","WARNING_RGB"] call bis_fnc_displaycolorget) call bis_fnc_colorRGBtoHTML;
|
||||
|
||||
//--- Shape
|
||||
_pos set [1,_posY + 1 * _posH + 2 * BORDER];
|
||||
_pos set [2,_posW];
|
||||
@ -127,15 +86,37 @@
|
||||
_angleText ctrlsetposition _pos;
|
||||
_angleText 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
|
||||
_pos set [1,_posY + 5 * _posH + 7 * BORDER];
|
||||
_pos set [2,_posW * (8.9/10) - BORDER];
|
||||
_pos set [1,_posY + _offsetButtons];
|
||||
_pos set [2,_posW / 2 - BORDER];
|
||||
_pos set [3,_posH];
|
||||
_buttonOk ctrlsetposition _pos;
|
||||
_buttonOk ctrlcommit 0;
|
||||
|
||||
//--- ButtonCancel
|
||||
_pos set [0,_posX + _posW * (8.9 / 10)];
|
||||
_pos set [2,_posW * (1.1 / 10)];
|
||||
_pos set [0,_posX + _posW / 2];
|
||||
_pos set [1,_posY + _offsetButtons];
|
||||
_pos set [2,_posW / 2];
|
||||
_pos set [3,_posH];
|
||||
_buttonCancel ctrlsetposition _pos;
|
||||
_buttonCancel ctrlcommit 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user