Primative map interaction

This commit is contained in:
SilentSpike 2015-07-20 20:30:13 +01:00
parent 52244c1647
commit 0d94bfe8bd
2 changed files with 13 additions and 1 deletions

View File

@ -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;

View File

@ -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;
};
};
};