From 0d94bfe8bd98e573420e05292a38ea391044459a Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 20 Jul 2015 20:30:13 +0100 Subject: [PATCH] Primative map interaction --- addons/spectator/UI/interface.hpp | 1 + addons/spectator/functions/fnc_handleInterface.sqf | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/addons/spectator/UI/interface.hpp b/addons/spectator/UI/interface.hpp index 029bef45d0..fa5df2ec03 100644 --- a/addons/spectator/UI/interface.hpp +++ b/addons/spectator/UI/interface.hpp @@ -170,6 +170,7 @@ class GVAR(interface) { y = safeZoneY; w = safeZoneW; h = safeZoneH; + onMouseButtonDblClick = QUOTE([ARR_2('onMapDblClick',_this)] call FUNC(handleInterface)); }; class helpSplash: RscControlsGroupNoScrollbars { idc = IDC_HELP; diff --git a/addons/spectator/functions/fnc_handleInterface.sqf b/addons/spectator/functions/fnc_handleInterface.sqf index c3dc8d32f5..5738ae21c2 100644 --- a/addons/spectator/functions/fnc_handleInterface.sqf +++ b/addons/spectator/functions/fnc_handleInterface.sqf @@ -196,7 +196,8 @@ switch (toLower _mode) do { }; case 50: { // M [_display,nil,nil,nil,true] call FUNC(updateInterface); - //[_show] call FUNC(handleMap); + (_display displayCtrl IDC_MAP) ctrlMapAnimAdd [0, 0.5, [GVAR(camUnit),GVAR(camera)] select (GVAR(camMode) == 0)]; + ctrlMapAnimCommit (_display displayCtrl IDC_MAP); }; case 57: { // Spacebar // Freecam attachment here, if in external then set cam pos and attach @@ -316,4 +317,14 @@ switch (toLower _mode) do { { _tree tvSort [[_x], false]; } forEach [0,1,2,3,4]; }; + // Map events + case "onmapdblclick": { + _args params ["_map","_button","_x","_y","_shift","_ctrl"]; + + if (GVAR(camMode == 0) && (_button == 0) && _ctrl) then { + _newPos = _map ctrlMapScreenToWorld [_x,_y]; + _newPos set [2, 20]; + GVAR(camera) setPosATL _newPos; + }; + }; };