Map icons

This commit is contained in:
SilentSpike 2015-07-24 15:36:36 +01:00
parent fa306a0fb8
commit eaeda2667c
4 changed files with 35 additions and 4 deletions

View File

@ -172,6 +172,7 @@ class GVAR(interface) {
w = safeZoneW; w = safeZoneW;
h = safeZoneH; h = safeZoneH;
onMouseButtonDblClick = QUOTE([ARR_2('onMapDblClick',_this)] call FUNC(handleInterface)); onMouseButtonDblClick = QUOTE([ARR_2('onMapDblClick',_this)] call FUNC(handleInterface));
onDraw = QUOTE([ARR_2('onDraw',_this)] call FUNC(handleInterface));
}; };
class helpSplash: RscControlsGroupNoScrollbars { class helpSplash: RscControlsGroupNoScrollbars {
idc = IDC_HELP; idc = IDC_HELP;

View File

@ -234,8 +234,6 @@ switch (toLower _mode) do {
}; };
case 50: { // M case 50: { // M
[_display,nil,nil,nil,true] call FUNC(toggleInterface); [_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 case 57: { // Spacebar
// Freecam attachment here, if in external then set cam pos and attach // Freecam attachment here, if in external then set cam pos and attach
@ -372,12 +370,40 @@ switch (toLower _mode) do {
// Map events // Map events
case "onmapdblclick": { case "onmapdblclick": {
_args params ["_map","_button","_x","_y","_shift","_ctrl"]; _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]; _newPos = _map ctrlMapScreenToWorld [_x,_y];
_oldZ = (ASLtoATL GVAR(camPos)) select 2; _oldZ = (ASLtoATL GVAR(camPos)) select 2;
_newPos set [2, _oldZ]; _newPos set [2, _oldZ];
GVAR(camPos) = (ATLtoASL _newPos); 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);
};
}; };

View File

@ -42,6 +42,10 @@ if (GVAR(showMap)) then {
{ {
(_display displayCtrl _x) ctrlShow false; (_display displayCtrl _x) ctrlShow false;
} forEach [IDC_COMP,IDC_HELP,IDC_TOOL,IDC_UNIT]; } 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 { } else {
// Can only toggle interface with map minimised // Can only toggle interface with map minimised
GVAR(showInterface) = [GVAR(showInterface), !GVAR(showInterface)] select _toggleInterface; GVAR(showInterface) = [GVAR(showInterface), !GVAR(showInterface)] select _toggleInterface;

View File

@ -48,7 +48,7 @@ if (_newMode == 0) then { // Free
GVAR(camera) cameraEffect ["internal", "back"]; GVAR(camera) cameraEffect ["internal", "back"];
// Switch to player to stop AI group chat // Switch to player to stop AI group chat
ACE_Player switchCamera "internal"; GVAR(camera) switchCamera "internal";
clearRadio; clearRadio;
// HUD stuff // HUD stuff