ToxaBes2 / ADR-Spec-Ops

Annex Done Right: Spec Ops (TEHGAM 1)
https://tehgam1.com
MIT License
10 stars 4 forks source link

Детектор мин #280

Closed ToxaBes2 closed 7 years ago

ToxaBes2 commented 7 years ago

Нам нужно вот такое: 107410_screenshots_20170407181709_1

ToxaBes2 commented 7 years ago

Нужно что-то типа:

  1. сбор информации о минах
    
    _allowedPlayers = ["B_engineer_F", "B_T_Engineer_F"];
    _mineIcon = getText (configfile >> "CfgInGameUI" >> "Cursor" >> "explosive");
    _mineColor = getArray (configfile >> "CfgInGameUI" >> "Cursor" >> "explosiveColor");
    minesArray = [];
    {
    if (_x isEqualType "") then
    {
        _mineColor set [_forEachIndex, call compile _x];
    };
    } forEach _mineColor;

if ("MineDetector" in items player && (typeOf player) in _allowedPlayers) then { { if (mineActive _x && _x distance player <= 200) then { minesArray pushBack [[_mineIcon, _mineColor, CENTER_POS(_x), 1, 1, 0, "", 2, 0, "PuristaMedium", "", true], _x, _posCode]; }; } forEach detectedMines playerSide; };

2. отрисовка (возможно тут нужно добавить отрисовку на компоненте)
```sqf
somehandler = addMissionEventHandler ["Draw3D",
{
    {
        _x params ["_drawArr", "_obj", "_posCode"];
        if (alive _obj) then { _drawArr set [2, _obj call _posCode] };
        drawIcon3D _drawArr;
    } forEach minesArray;
}];
ToxaBes2 commented 7 years ago

По каким-то причинам БИСы выпилили его:

_display = uiNamespace getVariable ["RscCustomInfoMiniMap", displayNull];
_display createDisplay "RscCustomInfoMineDetect";

Отображет детектор но он не работает. В configfile >> "RscCustomInfoMineDetect" есть:

onLoad = "[""onLoad"",_this,""RscCustomInfoMineDetect"",'IGUI'] call    (uinamespace getvariable 'BIS_fnc_initDisplay')";
onUnload = "[""onUnload"",_this,""RscCustomInfoMineDetect"",'IGUI'] call    (uinamespace getvariable 'BIS_fnc_initDisplay')";
scriptName = "RscCustomInfoMineDetect";
scriptPath = "IGUI";
ToxaBes2 commented 7 years ago

Добавить компонент пока можно только модом. Ждем пока БИСы вернут этот компонент в дефолтный список или добавят команды для управления компонентами.