mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Map icons
This commit is contained in:
parent
fa306a0fb8
commit
eaeda2667c
@ -172,6 +172,7 @@ class GVAR(interface) {
|
||||
w = safeZoneW;
|
||||
h = safeZoneH;
|
||||
onMouseButtonDblClick = QUOTE([ARR_2('onMapDblClick',_this)] call FUNC(handleInterface));
|
||||
onDraw = QUOTE([ARR_2('onDraw',_this)] call FUNC(handleInterface));
|
||||
};
|
||||
class helpSplash: RscControlsGroupNoScrollbars {
|
||||
idc = IDC_HELP;
|
||||
|
@ -234,8 +234,6 @@ switch (toLower _mode) do {
|
||||
};
|
||||
case 50: { // M
|
||||
[_display,nil,nil,nil,true] call FUNC(toggleInterface);
|
||||
(_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
|
||||
@ -372,12 +370,40 @@ switch (toLower _mode) do {
|
||||
// Map events
|
||||
case "onmapdblclick": {
|
||||
_args params ["_map","_button","_x","_y","_shift","_ctrl"];
|
||||
private ["_newPos","_oldZ"];
|
||||
|
||||
if (GVAR(camMode == 0) && (_button == 0) && _ctrl) then {
|
||||
if ((GVAR(camMode) == 0) && (_button == 0) && _ctrl) then {
|
||||
_newPos = _map ctrlMapScreenToWorld [_x,_y];
|
||||
_oldZ = (ASLtoATL GVAR(camPos)) select 2;
|
||||
_newPos set [2, _oldZ];
|
||||
GVAR(camPos) = (ATLtoASL _newPos);
|
||||
};
|
||||
};
|
||||
case "ondraw": {
|
||||
_args params ["_map"];
|
||||
|
||||
if (GVAR(camMode) == 0) then {
|
||||
_map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(camera),24,24,GVAR(camPan)];
|
||||
};
|
||||
|
||||
private ["_cachedVehicles","_unit","_color","_icon"];
|
||||
_cachedVehicles = [];
|
||||
{
|
||||
_unit = vehicle _x;
|
||||
|
||||
if !(_unit in _cachedVehicles) then {
|
||||
_cachedVehicles pushBack _unit;
|
||||
|
||||
_color = [side group _unit] call BIS_fnc_sideColor;
|
||||
_icon = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "Icon");
|
||||
|
||||
// Handle CfgVehicleIcons
|
||||
if isText (configFile >> "CfgVehicleIcons" >> _icon) then {
|
||||
_icon = getText (configFile >> "CfgVehicleIcons" >> _icon);
|
||||
};
|
||||
|
||||
_map drawIcon [_icon, _color, _unit, 24, 24, getDir _unit];
|
||||
};
|
||||
} forEach GVAR(unitList);
|
||||
};
|
||||
};
|
||||
|
@ -42,6 +42,10 @@ if (GVAR(showMap)) then {
|
||||
{
|
||||
(_display displayCtrl _x) ctrlShow false;
|
||||
} forEach [IDC_COMP,IDC_HELP,IDC_TOOL,IDC_UNIT];
|
||||
|
||||
// Centre map on camera/unit
|
||||
(_display displayCtrl IDC_MAP) ctrlMapAnimAdd [0, 0.5, [GVAR(camUnit),GVAR(camera)] select (GVAR(camMode) == 0)];
|
||||
ctrlMapAnimCommit (_display displayCtrl IDC_MAP);
|
||||
} else {
|
||||
// Can only toggle interface with map minimised
|
||||
GVAR(showInterface) = [GVAR(showInterface), !GVAR(showInterface)] select _toggleInterface;
|
||||
|
@ -48,7 +48,7 @@ if (_newMode == 0) then { // Free
|
||||
GVAR(camera) cameraEffect ["internal", "back"];
|
||||
|
||||
// Switch to player to stop AI group chat
|
||||
ACE_Player switchCamera "internal";
|
||||
GVAR(camera) switchCamera "internal";
|
||||
clearRadio;
|
||||
|
||||
// HUD stuff
|
||||
|
Loading…
Reference in New Issue
Block a user