Page MenuHomeFeedback Tracker

Add a command to determine what custom info panel sub-mode is used
Feedback, NormalPublic

Description

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.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

I can update infoPanel command, please provide me some sort of testing code

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

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
        ];
BIS_fnc_KK removed BIS_fnc_KK as the assignee of this task.Jan 28 2023, 5:46 PM
BIS_fnc_KK changed the task status from New to Feedback.
dedmen set Ref Ticket to AIII-55529.Jan 30 2023, 10:06 AM