There is currently no way to determine which custom info panel sub-mode is used.
For example, when using Nav custom info panel, we can't determine if map is locked to north or rotates, which causes custom icons to have wrong direction in the second mode.
Description
Description
Details
Details
- Severity
- Feature
- Resolution
- Open
- Reproducibility
- N/A
- Operating System
- Windows 10 x64
- Category
- Scripting
Event Timeline
Comment Actions
Insert this code into, for example, initPlayerLocal.sqf:
#include "\a3\ui_f\hpp\defineResincl.inc" #define ICON_SIZE 24 drawUnitIcons = { params ["_control"]; _unitSide = sideUnknown; _areFriendlySides = BIS_fnc_areFriendly; _getSideColor = BIS_fnc_sideColor; _vehiclesConfig = configFile >> "CfgVehicles"; { if ((_x == player) or { _unitSide = side (group _x); !([_unitSide, playerSide] call _areFriendlySides) }) then { continue; }; _vehicle = vehicle _x; if (!((_x == _vehicle) or { _x == (effectiveCommander _vehicle) })) then { continue; }; _icon = getText (_vehiclesConfig >> (typeOf _vehicle) >> "icon"); if (_icon == "") then { _icon = "#(argb,8,8,3)color(0,0,0,0)"; }; _control drawIcon [ _icon, [_unitSide] call _getSideColor, getPosASLVisual _vehicle, ICON_SIZE, ICON_SIZE, getDirVisual _vehicle, name _x, // text false, // shadow 0.04, // textSize "RobotoCondensed" // font ]; } forEach allUnits; }; [] spawn { _display = displayNull; waitUntil { _display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull]; !(isNull _display) }; (_display displayCtrl IDC_MINIMAP) ctrlAddEventHandler ["Draw", { call drawUnitIcons; }]; };
Comment Actions
Revision: 150278
ctrlMapDir
You can now just add it to icon dir
_control drawIcon [ _icon, [_unitSide] call _getSideColor, getPosASLVisual _vehicle, ICON_SIZE, ICON_SIZE, getDirVisual _vehicle + ctrlMapDir _control, name _x, // text false, // shadow 0.04, // textSize "RobotoCondensed" // font ];