use netId in dairy entry link for dedicated to work

This commit is contained in:
2024-02-03 13:53:28 -08:00
parent 8d93bb5743
commit b8b8f1de22
2 changed files with 12 additions and 25 deletions

View File

@@ -112,14 +112,18 @@ private _distinctVehiclesClassNames = [];
}; };
// Link to show markers // Link to show markers
_recordText pushBack format[ private _showMarkersText = format[
"<execute expression='[""%1"",""%2"",""%3"",%4] call milsim_fbcb2_assets_fnc_showMarkersOnMap'>SHOW MARKERS at vehicle positions</execute> (in %5)", "<execute expression='[""%1"",""%2"",""%3"",%4] call milsim_fbcb2_assets_fnc_showMarkersOnMap'>SHOW MARKERS at vehicle positions</execute> (in %5)",
_className, _className,
_markerType, _markerType,
_randomColor#0, _randomColor#0,
_vehiclesOfThisKind, (_vehiclesOfThisKind apply {
format["%1", _x call BIS_fnc_netId]
}),
format["<font color='%1'>%2</font>", _randomColor#1, _randomColor#2] format["<font color='%1'>%2</font>", _randomColor#1, _randomColor#2]
]; ];
hint _showMarkersText;
_recordText pushBack _showMarkersText;
// Link to hide markers // Link to hide markers
_recordText pushBack "<execute expression=""call milsim_fbcb2_assets_fnc_removeMarkersOnMap"">REMOVE ALL MARKERS showing asset positions</execute>"; _recordText pushBack "<execute expression=""call milsim_fbcb2_assets_fnc_removeMarkersOnMap"">REMOVE ALL MARKERS showing asset positions</execute>";

View File

@@ -30,7 +30,7 @@ private _assetMarkerStore = localNamespace getVariable [
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Create base markers if not already present // Create base markers if not already present
if (not (count _baseMarkerStore > 0)) then { if (not (count _baseMarkerStore > 0)) then {
{ { // milsim_baseObjects is accessed directly, so are valid objects
private _base = _x; private _base = _x;
// create a circle marker with range as the detection range of assets // create a circle marker with range as the detection range of assets
@@ -74,9 +74,9 @@ if (not (count _baseMarkerStore > 0)) then {
private _start = (count _assetMarkerStore) + 1; private _start = (count _assetMarkerStore) + 1;
private _createdAssetMarkers = []; { // _assetObjects is a serialized parameter, so we pass the netIds (strings)
{ private _assetNetIdStr = _x;
private _asset = _x; private _asset = _assetNetIdStr call BIS_fnc_objectFromNetId;
// if asset was removed since last update // if asset was removed since last update
if (isNull _asset) then {continue}; if (isNull _asset) then {continue};
// check if a marker is already placed for this asset // check if a marker is already placed for this asset
@@ -90,34 +90,17 @@ private _createdAssetMarkers = [];
format["milsim_fbcb2_assets_marker_%1", _start], format["milsim_fbcb2_assets_marker_%1", _start],
getPosASL _asset getPosASL _asset
]; ];
_newMarker setMarkerAlphaLocal 0; _newMarker setMarkerAlphaLocal 1;
_newMarker setMarkerTypeLocal _markerType; _newMarker setMarkerTypeLocal _markerType;
_newMarker setMarkerColorLocal _markerColor; _newMarker setMarkerColorLocal _markerColor;
// _newMarker setMarkerTextLocal ([configOf _asset] call BIS_fnc_displayName); // _newMarker setMarkerTextLocal ([configOf _asset] call BIS_fnc_displayName);
_createdAssetMarkers pushBack [ _assetMarkerStore pushBack [
_asset, _asset,
_newMarker _newMarker
]; ];
_start = _start + 1; _start = _start + 1;
} forEach _assetObjects; } forEach _assetObjects;
// unhide added asset markers sequentially
[_createdAssetMarkers apply {_x#1}] spawn {
params ["_markers"];
for "_alpha" from 0.0 to 1.0 step 0.03 do
{
{
_x setMarkerAlphaLocal _alpha;
} forEach _markers;
Sleep 0.002;
};
};
// add to store
{
_assetMarkerStore pushBack _x;
} forEach _createdAssetMarkers;
// update store var // update store var
localNamespace setVariable [_assetMarkerStoreVar, _assetMarkerStore]; localNamespace setVariable [_assetMarkerStoreVar, _assetMarkerStore];