From b8b8f1de224a27b66bb5dcd6c3832a0e134a9f35 Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Sat, 3 Feb 2024 13:53:28 -0800 Subject: [PATCH] use netId in dairy entry link for dedicated to work --- .../fbcb2/assets/fn_updateAssetDiary.sqf | 8 +++-- .../assets/markers/fn_showMarkersOnMap.sqf | 29 ++++--------------- 2 files changed, 12 insertions(+), 25 deletions(-) diff --git a/functions/fbcb2/assets/fn_updateAssetDiary.sqf b/functions/fbcb2/assets/fn_updateAssetDiary.sqf index 9709b9d..b17763e 100644 --- a/functions/fbcb2/assets/fn_updateAssetDiary.sqf +++ b/functions/fbcb2/assets/fn_updateAssetDiary.sqf @@ -112,14 +112,18 @@ private _distinctVehiclesClassNames = []; }; // Link to show markers - _recordText pushBack format[ + private _showMarkersText = format[ "SHOW MARKERS at vehicle positions (in %5)", _className, _markerType, _randomColor#0, - _vehiclesOfThisKind, + (_vehiclesOfThisKind apply { + format["%1", _x call BIS_fnc_netId] + }), format["%2", _randomColor#1, _randomColor#2] ]; + hint _showMarkersText; + _recordText pushBack _showMarkersText; // Link to hide markers _recordText pushBack "REMOVE ALL MARKERS showing asset positions"; diff --git a/functions/fbcb2/assets/markers/fn_showMarkersOnMap.sqf b/functions/fbcb2/assets/markers/fn_showMarkersOnMap.sqf index c28426b..c804d76 100644 --- a/functions/fbcb2/assets/markers/fn_showMarkersOnMap.sqf +++ b/functions/fbcb2/assets/markers/fn_showMarkersOnMap.sqf @@ -30,7 +30,7 @@ private _assetMarkerStore = localNamespace getVariable [ /////////////////////////////////////////////////////////////////////////////// // Create base markers if not already present if (not (count _baseMarkerStore > 0)) then { - { + { // milsim_baseObjects is accessed directly, so are valid objects private _base = _x; // 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 _createdAssetMarkers = []; -{ - private _asset = _x; +{ // _assetObjects is a serialized parameter, so we pass the netIds (strings) + private _assetNetIdStr = _x; + private _asset = _assetNetIdStr call BIS_fnc_objectFromNetId; // if asset was removed since last update if (isNull _asset) then {continue}; // check if a marker is already placed for this asset @@ -90,34 +90,17 @@ private _createdAssetMarkers = []; format["milsim_fbcb2_assets_marker_%1", _start], getPosASL _asset ]; - _newMarker setMarkerAlphaLocal 0; + _newMarker setMarkerAlphaLocal 1; _newMarker setMarkerTypeLocal _markerType; _newMarker setMarkerColorLocal _markerColor; // _newMarker setMarkerTextLocal ([configOf _asset] call BIS_fnc_displayName); - _createdAssetMarkers pushBack [ + _assetMarkerStore pushBack [ _asset, _newMarker ]; _start = _start + 1; } 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 localNamespace setVariable [_assetMarkerStoreVar, _assetMarkerStore];