< Summary

Class:DCL.MapRenderer
Assembly:MapRenderer
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/MapRenderer/MapRenderer.cs
Covered lines:1
Uncovered lines:230
Coverable lines:231
Total lines:524
Line coverage:0.4% (1 of 231)
Covered branches:0
Total branches:0
Covered methods:2
Total methods:48
Method coverage:4.1% (2 of 48)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
MapRenderer()0%2100%
Awake()0%2100%
Update()0%12300%
OnDestroy()0%2100%
Initialize()0%6200%
MoveHomePointIcon(...)0%2100%
InitializeHomePointIcon()0%2100%
EnsurePools()0%12300%
SetParcelHighlightActive(...)0%2100%
GetParcelHighlightTransform()0%2100%
SetOtherPlayersIconActive(...)0%6200%
SetPlayerIconActive(...)0%2100%
SetHighlighSize(...)0%2100%
SetHighlightStyle(...)0%2100%
Cleanup()0%30500%
CleanLandsHighlights()0%6200%
ClearLandHighlightsInfo()0%2100%
SelectLand(...)0%12300%
HighlightLands(...)0%42600%
CreateHighlightParcel(...)0%2100%
UpdateCursorMapCoords()0%6200%
IsCursorOverMapChunk()0%6200%
UpdateParcelHighlight()0%90900%
UpdateParcelHold()0%12300%
OnKernelConfigChanged(...)0%2100%
CoordinatesAreInsideTheWorld(...)0%12300%
MapRenderer_OnSceneInfoUpdated(...)0%1101000%
SetPointOfInterestActive(...)0%6200%
IsEmptyParcel(...)0%6200%
OnOtherPlayersAdded(...)0%2100%
OnOtherPlayerRemoved(...)0%6200%
ConfigureUserIcon(...)0%2100%
OnCharacterRotate(...)0%2100%
OnCharacterSetPosition(...)0%6200%
UpdateRendering(...)0%2100%
UpdateBackgroundLayer(...)0%2100%
UpdateSelectionLayer()0%2100%
UpdateOverlayLayer()0%2100%
ClickMousePositionParcel()0%6200%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/MapRenderer/MapRenderer.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using DCL.Helpers;
 4using KernelConfigurationTypes;
 5using TMPro;
 6using UnityEngine;
 7using UnityEngine.EventSystems;
 8using UnityEngine.UI;
 9
 10namespace DCL
 11{
 12    public class MapRenderer : MonoBehaviour
 13    {
 14        const int LEFT_BORDER_PARCELS = 25;
 15        const int RIGHT_BORDER_PARCELS = 31;
 16        const int TOP_BORDER_PARCELS = 31;
 17        const int BOTTOM_BORDER_PARCELS = 25;
 18        const int WORLDMAP_WIDTH_IN_PARCELS = 300;
 19        const string MINIMAP_USER_ICONS_POOL_NAME = "MinimapUserIconsPool";
 20        const int MINIMAP_USER_ICONS_MAX_PREWARM = 30;
 21        private const int MAX_CURSOR_PARCEL_DISTANCE = 40;
 22        private const int MAX_SCENE_CHARACTER_TITLE = 29;
 23        private const string EMPTY_PARCEL_NAME = "Empty parcel";
 24
 25        public static System.Action<int, int> OnParcelClicked;
 26        public static System.Action OnCursorFarFromParcel;
 27
 028        [SerializeField] private float parcelHightlightScale = 1.25f;
 29        [SerializeField] private Button ParcelHighlightButton;
 30        [SerializeField] private MapParcelHighlight highlight;
 31        [SerializeField] private Image parcelHighlightImage;
 32        [SerializeField] private Image parcelHighlighImagePrefab;
 33        [SerializeField] private Image parcelHighlighWithContentImagePrefab;
 34        [SerializeField] private Image selectParcelHighlighImagePrefab;
 35
 36        [HideInInspector] public Vector2Int cursorMapCoords;
 037        [HideInInspector] public bool showCursorCoords = true;
 38        public MapAtlas atlas;
 39        public TextMeshProUGUI highlightedParcelText;
 40        public Transform overlayContainer;
 41        public Transform overlayContainerPlayers;
 42        public Transform globalUserMarkerContainer;
 43        public RectTransform playerPositionIcon;
 44
 045        public float scaleFactor = 1f;
 46
 47        // Used as a reference of the coordinates origin in-map and as a parcel width/height reference
 48        public RectTransform centeredReferenceParcel;
 49
 50        public MapSceneIcon scenesOfInterestIconPrefab;
 51        public GameObject userIconPrefab;
 52        public GameObject homePointIconPrefab;
 53        public UserMarkerObject globalUserMarkerPrefab;
 054        private Dictionary<Vector2Int, Image> highlightedLands = new Dictionary<Vector2Int, Image>();
 055        private BaseVariable<Vector2Int> homePointCoordinates = DataStore.i.HUDs.homePoint;
 56        private RectTransform homePointIcon;
 57
 58        private bool isInitialized = false;
 59
 60        private Vector2Int lastClickedCursorMapCoords;
 061        private Vector3 lastPlayerPosition = new Vector3(float.NegativeInfinity, 0, float.NegativeInfinity);
 62        private Vector2Int lastSelectedLand;
 63        private int NAVMAP_CHUNK_LAYER;
 064        private bool otherPlayersIconsEnabled = true;
 065        private List<Vector2Int> ownedEmptyLands = new List<Vector2Int>();
 066        private List<Vector2Int> ownedLandsWithContent = new List<Vector2Int>();
 67
 68        private bool parcelHighlightEnabledValue = false;
 069        private BaseVariable<Vector3> playerWorldPosition = DataStore.i.player.playerWorldPosition;
 70
 071        private HashSet<MinimapMetadata.MinimapSceneInfo> scenesOfInterest = new HashSet<MinimapMetadata.MinimapSceneInf
 072        private Dictionary<MinimapMetadata.MinimapSceneInfo, GameObject> scenesOfInterestMarkers = new Dictionary<Minima
 073        private PointerEventData uiRaycastPointerEventData = new PointerEventData(EventSystem.current);
 074        private List<RaycastResult> uiRaycastResults = new List<RaycastResult>();
 075        private Dictionary<string, PoolableObject> usersInfoMarkers = new Dictionary<string, PoolableObject>();
 76        private Pool usersInfoPool;
 77
 078        List<WorldRange> validWorldRanges = new List<WorldRange>
 79        {
 80            new WorldRange(-150, -150, 150, 150) // default range
 81        };
 82
 83        [Obsolete]
 36384        public static MapRenderer i { get; private set; }
 85
 086        private Vector3Variable playerRotation => CommonScriptableObjects.cameraForward;
 087        public Vector3 playerGridPosition => Utils.WorldToGridPositionUnclamped(playerWorldPosition.Get());
 88
 089        public MapGlobalUsersPositionMarkerController usersPositionMarkerController { private set; get; }
 90
 91        public bool parcelHighlightEnabled
 92        {
 93            set
 94            {
 095                parcelHighlightEnabledValue = value;
 096                parcelHighlightImage.gameObject.SetActive(parcelHighlightEnabledValue);
 097                MapVisibilityChanged?.Invoke(value);
 098            }
 99
 100            get
 101            {
 0102                return parcelHighlightEnabledValue;
 103            }
 104        }
 105
 0106        private BaseDictionary<string, Player> otherPlayers => DataStore.i.player.otherPlayers;
 107
 108        private void Awake()
 109        {
 0110            i = this;
 0111            Initialize();
 0112        }
 113
 114        void Update()
 115        {
 0116            if ((playerWorldPosition.Get() - lastPlayerPosition).sqrMagnitude >= 0.1f * 0.1f)
 117            {
 0118                lastPlayerPosition = playerWorldPosition.Get();
 0119                UpdateRendering(Utils.WorldToGridPositionUnclamped(lastPlayerPosition));
 120            }
 121
 0122            if (!parcelHighlightEnabled)
 0123                return;
 124
 0125            UpdateCursorMapCoords();
 126
 0127            UpdateParcelHighlight();
 128
 0129            UpdateParcelHold();
 0130        }
 131
 132        public void OnDestroy()
 133        {
 0134            Cleanup();
 0135        }
 136
 137        [HideInInspector]
 138        public event System.Action<float, float> OnMovedParcelCursor;
 139        public event Action<bool> MapVisibilityChanged;
 140
 141        public void Initialize()
 142        {
 0143            if (isInitialized)
 0144                return;
 145
 0146            isInitialized = true;
 147
 0148            InitializeHomePointIcon();
 0149            EnsurePools();
 0150            atlas.InitializeChunks();
 0151            NAVMAP_CHUNK_LAYER = LayerMask.NameToLayer("NavmapChunk");
 152
 0153            MinimapMetadata.GetMetadata().OnSceneInfoUpdated += MapRenderer_OnSceneInfoUpdated;
 0154            otherPlayers.OnAdded += OnOtherPlayersAdded;
 0155            otherPlayers.OnRemoved += OnOtherPlayerRemoved;
 0156            homePointCoordinates.OnChange += MoveHomePointIcon;
 0157            MoveHomePointIcon(homePointCoordinates.Get(), new Vector2Int());
 158
 0159            ParcelHighlightButton.onClick.AddListener(ClickMousePositionParcel);
 160
 0161            playerRotation.OnChange += OnCharacterRotate;
 162
 0163            highlight.SetScale(parcelHightlightScale);
 164
 0165            usersPositionMarkerController = new MapGlobalUsersPositionMarkerController(globalUserMarkerPrefab,
 166                globalUserMarkerContainer,
 167                MapUtils.CoordsToPosition);
 168
 0169            usersPositionMarkerController.SetUpdateMode(MapGlobalUsersPositionMarkerController.UpdateMode.BACKGROUND);
 170
 0171            KernelConfig.i.OnChange += OnKernelConfigChanged;
 0172        }
 173
 174        private void MoveHomePointIcon(Vector2Int current, Vector2Int previous)
 175        {
 0176            homePointIcon.anchoredPosition = MapUtils.CoordsToPosition(new Vector3(current.x, current.y, 0));
 0177        }
 178
 179        private void InitializeHomePointIcon()
 180        {
 0181            homePointIcon = GameObject.Instantiate(homePointIconPrefab).GetComponent<RectTransform>();
 0182            homePointIcon.gameObject.transform.SetParent(overlayContainer.transform, false);
 0183            homePointIcon.anchoredPosition = new Vector2(0, 0);
 0184            homePointIcon.transform.localPosition = new Vector3(homePointIcon.transform.localPosition.x, homePointIcon.t
 0185            homePointIcon.localScale = new Vector3(2, 2, 2);
 0186            homePointIcon.transform.SetAsFirstSibling();
 0187        }
 188
 189        private void EnsurePools()
 190        {
 0191            usersInfoPool = PoolManager.i.GetPool(MINIMAP_USER_ICONS_POOL_NAME);
 192
 0193            if (usersInfoPool == null)
 194            {
 0195                usersInfoPool = PoolManager.i.AddPool(
 196                    MINIMAP_USER_ICONS_POOL_NAME,
 197                    Instantiate(userIconPrefab.gameObject, overlayContainerPlayers.transform),
 198                    maxPrewarmCount: MINIMAP_USER_ICONS_MAX_PREWARM,
 199                    isPersistent: true);
 200
 0201                if (!Configuration.EnvironmentSettings.RUNNING_TESTS)
 0202                    usersInfoPool.ForcePrewarm();
 203            }
 0204        }
 205
 206        public void SetParcelHighlightActive(bool isAtive) =>
 0207            parcelHighlightImage.enabled = isAtive;
 208
 209        public Vector3 GetParcelHighlightTransform() =>
 0210            parcelHighlightImage.transform.position;
 211
 212        public void SetOtherPlayersIconActive(bool isActive)
 213        {
 0214            otherPlayersIconsEnabled = isActive;
 215
 0216            foreach (PoolableObject poolableObject in usersInfoMarkers.Values) { poolableObject.gameObject.SetActive(isA
 0217        }
 218
 219        public void SetPlayerIconActive(bool isActive) =>
 0220            playerPositionIcon.gameObject.SetActive(isActive);
 221
 222        public void SetHighlighSize(Vector2Int size)
 223        {
 0224            highlight.ChangeHighlighSize(size);
 0225        }
 226
 227        public void SetHighlightStyle(MapParcelHighlight.HighlighStyle style)
 228        {
 0229            highlight.SetStyle(style);
 0230        }
 231
 232        public void Cleanup()
 233        {
 0234            if (atlas != null)
 0235                atlas.Cleanup();
 236
 0237            foreach (var kvp in scenesOfInterestMarkers)
 238            {
 0239                if (kvp.Value != null)
 0240                    Destroy(kvp.Value);
 241            }
 242
 0243            CleanLandsHighlights();
 0244            ClearLandHighlightsInfo();
 245
 0246            scenesOfInterestMarkers.Clear();
 247
 0248            playerRotation.OnChange -= OnCharacterRotate;
 0249            MinimapMetadata.GetMetadata().OnSceneInfoUpdated -= MapRenderer_OnSceneInfoUpdated;
 0250            otherPlayers.OnAdded -= OnOtherPlayersAdded;
 0251            otherPlayers.OnRemoved -= OnOtherPlayerRemoved;
 0252            homePointCoordinates.OnChange -= MoveHomePointIcon;
 253
 0254            ParcelHighlightButton.onClick.RemoveListener(ClickMousePositionParcel);
 255
 0256            usersPositionMarkerController?.Dispose();
 257
 0258            KernelConfig.i.OnChange -= OnKernelConfigChanged;
 259
 0260            isInitialized = false;
 0261        }
 262
 263        public void CleanLandsHighlights()
 264        {
 0265            foreach (KeyValuePair<Vector2Int, Image> kvp in highlightedLands) { Destroy(kvp.Value.gameObject); }
 266
 0267            highlightedLands.Clear(); //To Clear out the dictionary
 0268        }
 269
 270        public void ClearLandHighlightsInfo()
 271        {
 0272            ownedLandsWithContent.Clear(); //To Clear out the content lands
 0273            ownedEmptyLands.Clear(); //To Clear out the empty content
 0274        }
 275
 276        public void SelectLand(Vector2Int coordsToSelect, Vector2Int size)
 277        {
 0278            if (highlightedLands.ContainsKey(lastSelectedLand))
 279            {
 0280                Destroy(highlightedLands[lastSelectedLand].gameObject);
 0281                highlightedLands.Remove(lastSelectedLand);
 282            }
 283
 0284            HighlightLands(ownedEmptyLands, ownedLandsWithContent);
 285
 0286            if (highlightedLands.ContainsKey(coordsToSelect))
 287            {
 0288                Destroy(highlightedLands[coordsToSelect].gameObject);
 0289                highlightedLands.Remove(coordsToSelect);
 290            }
 291
 0292            CreateHighlightParcel(selectParcelHighlighImagePrefab, coordsToSelect, size);
 0293            lastSelectedLand = coordsToSelect;
 0294        }
 295
 296        public void HighlightLands(List<Vector2Int> landsToHighlight, List<Vector2Int> landsToHighlightWithContent)
 297        {
 0298            CleanLandsHighlights();
 299
 0300            foreach (Vector2Int coords in landsToHighlight)
 301            {
 0302                if (highlightedLands.ContainsKey(coords))
 303                    continue;
 304
 0305                CreateHighlightParcel(parcelHighlighImagePrefab, coords, Vector2Int.one);
 306            }
 307
 0308            foreach (Vector2Int coords in landsToHighlightWithContent)
 309            {
 0310                if (highlightedLands.ContainsKey(coords))
 311                    continue;
 312
 0313                if (!ownedLandsWithContent.Contains(coords))
 0314                    ownedLandsWithContent.Add(coords);
 315
 0316                CreateHighlightParcel(parcelHighlighWithContentImagePrefab, coords, Vector2Int.one);
 317            }
 318
 0319            ownedEmptyLands = landsToHighlight;
 0320            ownedLandsWithContent = landsToHighlightWithContent;
 0321        }
 322
 323        private void CreateHighlightParcel(Image prefab, Vector2Int coords, Vector2Int size)
 324        {
 0325            var highlightItem = Instantiate(prefab, overlayContainer, true).GetComponent<Image>();
 0326            highlightItem.rectTransform.localScale = new Vector3(parcelHightlightScale * size.x, parcelHightlightScale *
 0327            highlightItem.rectTransform.SetAsLastSibling();
 0328            highlightItem.rectTransform.anchoredPosition = MapUtils.CoordsToPosition(coords);
 0329            highlightedLands.Add(coords, highlightItem);
 0330        }
 331
 332        void UpdateCursorMapCoords()
 333        {
 0334            if (!IsCursorOverMapChunk())
 0335                return;
 336
 337            const int OFFSET = -60; //Map is a bit off centered, we need to adjust it a little.
 0338            RectTransformUtility.ScreenPointToLocalPointInRectangle(atlas.chunksParent, Input.mousePosition, DataStore.i
 0339            mapPoint -= Vector2.one * OFFSET;
 0340            mapPoint -= (atlas.chunksParent.sizeDelta / 2f);
 0341            cursorMapCoords = Vector2Int.RoundToInt(mapPoint / MapUtils.PARCEL_SIZE);
 0342        }
 343
 344        bool IsCursorOverMapChunk()
 345        {
 0346            uiRaycastPointerEventData.position = Input.mousePosition;
 0347            EventSystem.current.RaycastAll(uiRaycastPointerEventData, uiRaycastResults);
 348
 0349            return uiRaycastResults.Count > 0 && uiRaycastResults[0].gameObject.layer == NAVMAP_CHUNK_LAYER;
 350        }
 351
 352        void UpdateParcelHighlight()
 353        {
 0354            if (!CoordinatesAreInsideTheWorld((int)cursorMapCoords.x, (int)cursorMapCoords.y))
 355            {
 0356                if (parcelHighlightImage.gameObject.activeSelf)
 0357                    parcelHighlightImage.gameObject.SetActive(false);
 358
 0359                return;
 360            }
 361
 0362            if (!parcelHighlightImage.gameObject.activeSelf)
 0363                parcelHighlightImage.gameObject.SetActive(true);
 364
 0365            string previousText = highlightedParcelText.text;
 0366            parcelHighlightImage.rectTransform.SetAsLastSibling();
 0367            parcelHighlightImage.rectTransform.anchoredPosition = MapUtils.CoordsToPosition(cursorMapCoords);
 0368            highlightedParcelText.text = showCursorCoords ? $"{cursorMapCoords.x}, {cursorMapCoords.y}" : string.Empty;
 369
 0370            if (highlightedParcelText.text != previousText && !Input.GetMouseButton(0)) { OnMovedParcelCursor?.Invoke(cu
 371
 372            // ----------------------------------------------------
 373            // TODO: Use sceneInfo to highlight whole scene parcels and populate scenes hover info on navmap once we can
 374            // var sceneInfo = mapMetadata.GetSceneInfo(cursorMapCoords.x, cursorMapCoords.y);
 0375        }
 376
 377        void UpdateParcelHold()
 378        {
 0379            if (Vector2.Distance(lastClickedCursorMapCoords, cursorMapCoords) > MAX_CURSOR_PARCEL_DISTANCE / (scaleFacto
 0380        }
 381
 382        private void OnKernelConfigChanged(KernelConfigModel current, KernelConfigModel previous)
 383        {
 0384            validWorldRanges = current.validWorldRanges;
 0385        }
 386
 387        bool CoordinatesAreInsideTheWorld(int xCoord, int yCoord)
 388        {
 0389            foreach (WorldRange worldRange in validWorldRanges)
 390            {
 0391                if (worldRange.Contains(xCoord, yCoord)) { return true; }
 392            }
 393
 0394            return false;
 0395        }
 396
 397        private void MapRenderer_OnSceneInfoUpdated(MinimapMetadata.MinimapSceneInfo sceneInfo)
 398        {
 0399            if (!sceneInfo.isPOI)
 0400                return;
 401
 0402            if (scenesOfInterest.Contains(sceneInfo))
 0403                return;
 404
 0405            if (IsEmptyParcel(sceneInfo))
 0406                return;
 407
 0408            scenesOfInterest.Add(sceneInfo);
 409
 0410            GameObject go = Instantiate(scenesOfInterestIconPrefab.gameObject, overlayContainer.transform);
 411
 0412            Vector2 centerTile = Vector2.zero;
 413
 0414            foreach (var parcel in sceneInfo.parcels) { centerTile += parcel; }
 415
 0416            centerTile /= (float)sceneInfo.parcels.Count;
 0417            float distance = float.PositiveInfinity;
 0418            Vector2 centerParcel = Vector2.zero;
 419
 0420            foreach (var parcel in sceneInfo.parcels)
 421            {
 0422                if (Vector2.Distance(centerTile, parcel) < distance)
 423                {
 0424                    distance = Vector2.Distance(centerParcel, parcel);
 0425                    centerParcel = parcel;
 426                }
 427            }
 428
 0429            (go.transform as RectTransform).anchoredPosition = MapUtils.CoordsToPosition(centerParcel);
 430
 0431            MapSceneIcon icon = go.GetComponent<MapSceneIcon>();
 432
 0433            if (icon.title != null)
 0434                icon.title.text = sceneInfo.name.Length > MAX_SCENE_CHARACTER_TITLE ? sceneInfo.name.Substring(0, MAX_SC
 435
 0436            scenesOfInterestMarkers.Add(sceneInfo, go);
 0437        }
 438
 439        public void SetPointOfInterestActive(bool areActive)
 440        {
 0441            foreach (GameObject pointOfInterestGameObject in scenesOfInterestMarkers.Values) { pointOfInterestGameObject
 0442        }
 443
 444        private bool IsEmptyParcel(MinimapMetadata.MinimapSceneInfo sceneInfo)
 445        {
 0446            return (sceneInfo.name != null && sceneInfo.name.Equals(EMPTY_PARCEL_NAME));
 447        }
 448
 449        private void OnOtherPlayersAdded(string userId, Player player)
 450        {
 0451            var poolable = usersInfoPool.Get();
 0452            var marker = poolable.gameObject.GetComponent<MapUserIcon>();
 0453            marker.gameObject.name = $"UserIcon-{player.name}";
 0454            marker.gameObject.transform.SetParent(overlayContainerPlayers.transform, true);
 0455            marker.Populate(player);
 0456            marker.gameObject.SetActive(otherPlayersIconsEnabled);
 0457            marker.transform.localScale = Vector3.one;
 0458            usersInfoMarkers.Add(userId, poolable);
 0459        }
 460
 461        private void OnOtherPlayerRemoved(string userId, Player player)
 462        {
 0463            if (!usersInfoMarkers.TryGetValue(userId, out PoolableObject go)) { return; }
 464
 0465            usersInfoPool.Release(go);
 0466            usersInfoMarkers.Remove(userId);
 0467        }
 468
 469        private void ConfigureUserIcon(GameObject iconGO, Vector3 pos)
 470        {
 0471            var gridPosition = Utils.WorldToGridPositionUnclamped(pos);
 0472            iconGO.transform.localPosition = MapUtils.CoordsToPosition(Vector2Int.RoundToInt(gridPosition));
 0473        }
 474
 475        private void OnCharacterRotate(Vector3 current, Vector3 previous)
 476        {
 0477            UpdateRendering(Utils.WorldToGridPositionUnclamped(playerWorldPosition.Get()));
 0478        }
 479
 480        public void OnCharacterSetPosition(Vector2Int newCoords, Vector2Int oldCoords)
 481        {
 0482            if (oldCoords == newCoords)
 0483                return;
 484
 0485            UpdateRendering(new Vector2((float)newCoords.x, (float)newCoords.y));
 0486        }
 487
 488        public void UpdateRendering(Vector2 newCoords)
 489        {
 0490            UpdateBackgroundLayer(newCoords);
 0491            UpdateSelectionLayer();
 0492            UpdateOverlayLayer();
 0493        }
 494
 495        void UpdateBackgroundLayer(Vector2 newCoords)
 496        {
 0497            atlas.CenterToTile(newCoords);
 0498        }
 499
 500        void UpdateSelectionLayer()
 501        {
 502            //TODO(Brian): Build and place here the scene highlight if applicable.
 0503        }
 504
 505        void UpdateOverlayLayer()
 506        {
 507            //NOTE(Brian): Player icon
 0508            Vector3 f = CommonScriptableObjects.cameraForward.Get();
 0509            Quaternion playerAngle = Quaternion.Euler(0, 0, Mathf.Atan2(-f.x, f.z) * Mathf.Rad2Deg);
 510
 0511            var gridPosition = playerGridPosition;
 0512            playerPositionIcon.anchoredPosition = MapUtils.CoordsToPositionWithOffset(gridPosition);
 0513            playerPositionIcon.rotation = playerAngle;
 0514        }
 515
 516        // Called by the parcelhighlight image button
 517        public void ClickMousePositionParcel()
 518        {
 0519            highlightedParcelText.text = string.Empty;
 0520            lastClickedCursorMapCoords = cursorMapCoords;
 0521            OnParcelClicked?.Invoke(cursorMapCoords.x, cursorMapCoords.y);
 0522        }
 523    }
 524}

Methods/Properties

MapRenderer()
i()
i(DCL.MapRenderer)
playerRotation()
playerGridPosition()
usersPositionMarkerController(DCL.MapGlobalUsersPositionMarkerController)
usersPositionMarkerController()
parcelHighlightEnabled(System.Boolean)
parcelHighlightEnabled()
otherPlayers()
Awake()
Update()
OnDestroy()
Initialize()
MoveHomePointIcon(UnityEngine.Vector2Int, UnityEngine.Vector2Int)
InitializeHomePointIcon()
EnsurePools()
SetParcelHighlightActive(System.Boolean)
GetParcelHighlightTransform()
SetOtherPlayersIconActive(System.Boolean)
SetPlayerIconActive(System.Boolean)
SetHighlighSize(UnityEngine.Vector2Int)
SetHighlightStyle(MapParcelHighlight/HighlighStyle)
Cleanup()
CleanLandsHighlights()
ClearLandHighlightsInfo()
SelectLand(UnityEngine.Vector2Int, UnityEngine.Vector2Int)
HighlightLands(System.Collections.Generic.List[Vector2Int], System.Collections.Generic.List[Vector2Int])
CreateHighlightParcel(UnityEngine.UI.Image, UnityEngine.Vector2Int, UnityEngine.Vector2Int)
UpdateCursorMapCoords()
IsCursorOverMapChunk()
UpdateParcelHighlight()
UpdateParcelHold()
OnKernelConfigChanged(KernelConfigModel, KernelConfigModel)
CoordinatesAreInsideTheWorld(System.Int32, System.Int32)
MapRenderer_OnSceneInfoUpdated(MinimapMetadata/MinimapSceneInfo)
SetPointOfInterestActive(System.Boolean)
IsEmptyParcel(MinimapMetadata/MinimapSceneInfo)
OnOtherPlayersAdded(System.String, Player)
OnOtherPlayerRemoved(System.String, Player)
ConfigureUserIcon(UnityEngine.GameObject, UnityEngine.Vector3)
OnCharacterRotate(UnityEngine.Vector3, UnityEngine.Vector3)
OnCharacterSetPosition(UnityEngine.Vector2Int, UnityEngine.Vector2Int)
UpdateRendering(UnityEngine.Vector2)
UpdateBackgroundLayer(UnityEngine.Vector2)
UpdateSelectionLayer()
UpdateOverlayLayer()
ClickMousePositionParcel()