2017-06-23 03:58:00 +00:00
|
|
|
// PabstMirror
|
|
|
|
// [] execVM "\z\ace\addons\repair\dev\draw_showRepairInfo.sqf";
|
|
|
|
|
2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2017-06-23 03:58:00 +00:00
|
|
|
|
|
|
|
addMissionEventHandler ["Draw3D", {
|
2024-06-17 17:31:35 +00:00
|
|
|
if (isGamePaused) exitWith {};
|
2017-06-23 03:58:00 +00:00
|
|
|
if !((cursorObject isKindOf "Car") || (cursorObject isKindOf "Tank") || (cursorObject isKindOf "Air")) exitWith {};
|
2021-02-18 18:58:08 +00:00
|
|
|
private _config = configOf cursorObject;
|
2017-06-23 03:58:00 +00:00
|
|
|
|
|
|
|
private _hitpointPositions = getArray (_config >> QGVAR(hitpointPositions));
|
|
|
|
private _hitpointGroups = getArray (_config >> QGVAR(hitpointGroups));
|
|
|
|
|
|
|
|
(getAllHitPointsDamage cursorObject) params [["_hitPoints", []], ["_hitSelections", []]];
|
2024-06-17 17:31:35 +00:00
|
|
|
([cursorObject] call EFUNC(common,getWheelHitPointsWithSelections)) params ["_wheelHitPoints", "_wheelHitSelections"];
|
2017-06-23 03:58:00 +00:00
|
|
|
|
|
|
|
private _output = [];
|
2021-10-30 21:42:03 +00:00
|
|
|
|
2017-06-23 03:58:00 +00:00
|
|
|
{
|
|
|
|
private _selection = _x;
|
|
|
|
private _hitpoint = _hitPoints select _forEachIndex;
|
|
|
|
|
|
|
|
if ((_selection != "") && {_hitPoint != ""}) then {
|
2024-03-07 21:08:13 +00:00
|
|
|
if ("glass" in (toLowerANSI _hitPoint)) exitWith {};
|
2017-06-23 03:58:00 +00:00
|
|
|
|
|
|
|
private _info = "";
|
|
|
|
private _color = [1,0,0,1];
|
|
|
|
if (_selection in _wheelHitSelections) then {
|
|
|
|
_info = _info + "[Wheel]";
|
|
|
|
_color = [0,1,0,1];
|
|
|
|
};
|
2024-06-18 14:08:03 +00:00
|
|
|
if !((getText (_config>> "HitPoints" >> _hitpoint >> "depends")) in ["", "0"]) then {
|
2017-06-23 03:58:00 +00:00
|
|
|
_info = _info + format ["[depends: %1]", getText (_config>> "HitPoints" >> _hitpoint >> "depends")];
|
|
|
|
_color = [0,0,1,1]
|
|
|
|
};
|
|
|
|
|
|
|
|
private _position = cursorObject selectionPosition [_selection, "HitPoints"];
|
|
|
|
{
|
|
|
|
_x params ["_hit", "_pos"];
|
|
|
|
if (_hitpoint == _hit) exitWith {
|
|
|
|
_info = _info + format ["[hitPos: %1]", _pos];
|
|
|
|
if (_pos isEqualType []) exitWith {
|
|
|
|
_position = _pos;
|
|
|
|
};
|
|
|
|
if (_pos isEqualType "") exitWith {
|
|
|
|
_position = cursorObject selectionPosition [_pos, "HitPoints"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} forEach _hitpointPositions;
|
|
|
|
|
|
|
|
private _parentHitpoint = "";
|
|
|
|
{
|
|
|
|
private _xParent = _x select 0;
|
|
|
|
{
|
|
|
|
if (_hitpoint == _x) exitWith {
|
|
|
|
_info = _info + format ["[Parent: %1]", _xParent];
|
|
|
|
_parentHitpoint = _xParent;
|
|
|
|
};
|
|
|
|
} forEach (_x select 1);
|
|
|
|
} forEach _hitpointGroups;
|
|
|
|
|
|
|
|
if (_parentHitpoint == "") then {
|
|
|
|
drawIcon3D ["", _color, (cursorObject modelToWorld _position), 0.5, 0.5, 0, format ["%1 [%2]", _hitpoint, _selection], 0.5, 0.025, "TahomaB"];
|
|
|
|
};
|
|
|
|
_output pushBack format ["%1: %2[%3] = %4", _forEachIndex, _hitPoint, _selection, cursorObject getHitIndex _forEachIndex];
|
|
|
|
_output pushBack format ["- %1 -",_info];
|
|
|
|
};
|
2018-04-12 14:15:57 +00:00
|
|
|
} forEach _hitSelections;
|
2017-06-23 03:58:00 +00:00
|
|
|
hintSilent (_output joinString "\n");
|
|
|
|
}];
|