diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp index 4996212ce2..fc8081b5d5 100644 --- a/addons/spectator/UI/interface.hpp +++ b/addons/spectator/UI/interface.hpp @@ -6,7 +6,7 @@ class RscStructuredText; class RscText; class RscTree; -class GVAR(overlay) { +class GVAR(interface) { idd = 12249; enableSimulation = 1; movingEnable = 0; @@ -141,33 +141,42 @@ class GVAR(overlay) { idc = -1; style = 64; }; - class unitTree: RscTree { - idc = IDC_TREE; + class unitTools: RscControlsGroup { + idc = IDC_UNIT; x = safeZoneX; - y = safezoneY + TOOL_H * 2; + y = safeZoneY + TOOL_H * 2; w = TOOL_W * 2; - h = safeZoneH - TOOL_H * 5; - borderSize = 1; - colorBorder[] = {1,1,1,1}; - colorBackground[] = {0.1,0.1,0.1,0.8}; - colorSelect[] = { - "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", - "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", - "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", - 1 + h = safeZoneH - TOOL_H * 4; + class controls { + class unitTree: RscTree { + idc = IDC_UNIT_TREE; + x = 0; + y = 0; + w = TOOL_W * 2; + h = safeZoneH - TOOL_H * 5; + borderSize = 1; + colorBorder[] = {1,1,1,1}; + colorBackground[] = {0.1,0.1,0.1,0.8}; + colorSelect[] = { + "(profilenamespace getvariable ['GUI_BCG_RGB_R',0.3843])", + "(profilenamespace getvariable ['GUI_BCG_RGB_G',0.7019])", + "(profilenamespace getvariable ['GUI_BCG_RGB_B',0.8862])", + 1 + }; + multiselectEnabled = 0; + maxHistoryDelay = -1; + onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface)); + }; + class unitRefresh: RscButtonMenu { + x = 0; + y = safeZoneY + safeZoneH - TOOL_H * 3; + w = TOOL_W * 2; + h = TOOL_H; + sizeEx = TOOL_H; + text = CSTRING(RefreshList); + action = QUOTE([] call FUNC(handleTree)); + }; }; - multiselectEnabled = 0; - maxHistoryDelay = -1; - onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface)); - }; - class unitRefresh: RscButtonMenu { - x = safeZoneX; - y = safeZoneY + safeZoneH - TOOL_H * 3; - w = TOOL_W * 2; - h = TOOL_H; - sizeEx = TOOL_H; - text = CSTRING(RefreshList); - action = QUOTE([] call FUNC(handleTree)); }; class spectatorMap: RscMapControl { idc = IDC_MAP; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index 6c1e29286c..50776eef53 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -70,7 +70,7 @@ switch (toLower _mode) do { [allUnits] call FUNC(updateUnits); // Create the dialog - createDialog QGVAR(overlay); + createDialog QGVAR(interface); // Cache and disable nametag settings if (["ace_nametags"] call EFUNC(common,isModLoaded)) then { @@ -202,7 +202,7 @@ switch (toLower _mode) do { }; case 14: { // Backspace private ["_tree","_show"]; - _tree = _display displayCtrl IDC_TREE; + _tree = _display displayCtrl IDC_UNIT; _show = !ctrlShown _tree; _tree ctrlShow _show; diff --git a/addons/spectator/functions/fnc_handleTree.sqf b/addons/spectator/functions/fnc_handleTree.sqf index 730dfde312..fc647f5a9a 100644 --- a/addons/spectator/functions/fnc_handleTree.sqf +++ b/addons/spectator/functions/fnc_handleTree.sqf @@ -25,7 +25,7 @@ if !(isNil QGVAR(treePFH)) then { // Fetch tree disableSerialization; _display = GETUVAR(GVAR(display),displayNull); -_ctrl = _display displayCtrl IDC_TREE; +_ctrl = (_display displayCtrl IDC_UNIT) controlsGroupCtrl IDC_UNIT_TREE; // Cache current selection _curSelData = _ctrl tvData (tvCurSel _ctrl); @@ -77,7 +77,7 @@ GVAR(treePFH) = [{ disableSerialization; _display = GETUVAR(GVAR(display),displayNull); - _ctrl = _display displayCtrl IDC_TREE; + _ctrl = (_display displayCtrl IDC_UNIT) controlsGroupCtrl IDC_UNIT_TREE; _nodes = (_ctrl tvCount []) - 1; for "_n" from 0 to _nodes do { @@ -88,7 +88,7 @@ GVAR(treePFH) = [{ if (isNull _unit || !alive _unit) then { _ctrl tvDelete [_n,_i]; - GVAR(unitList) = GVAR(unitList) - [_unit]; + [[_unit],false] call FUNC(updateUnits); }; }; }; diff --git a/addons/spectator/script_component.hpp b/addons/spectator/script_component.hpp index d6163b1afd..6567951024 100644 --- a/addons/spectator/script_component.hpp +++ b/addons/spectator/script_component.hpp @@ -29,12 +29,16 @@ #define COMPASS_X (safeZoneW * 0.5 - (COMPASS_W * 0.5)) // IDCs -#define IDC_TOOL 3000 #define IDC_COMP 4490 -#define IDC_TREE 6187 -#define IDC_MAP 6791 -#define IDC_HELP 7631 +#define IDC_COMP_0 5000 +#define IDC_COMP_90 5090 +#define IDC_COMP_180 5180 +#define IDC_COMP_270 5270 +#define IDC_HELP 7631 +#define IDC_MAP 6791 + +#define IDC_TOOL 3000 #define IDC_TOOL_CLOCK 3003 #define IDC_TOOL_FOCUS 3004 #define IDC_TOOL_FOV 3005 @@ -42,7 +46,5 @@ #define IDC_TOOL_SPEED 3006 #define IDC_TOOL_VIEW 3002 -#define IDC_COMP_0 5000 -#define IDC_COMP_90 5090 -#define IDC_COMP_180 5180 -#define IDC_COMP_270 5270 +#define IDC_UNIT 6002 +#define IDC_UNIT_TREE 6187