public static void RegisterStackableMapIcon(StackableMapIcon icon)
        {
            if (StackableMapIconManager.s_instance == null)
            {
                Debug.LogError("ERROR: RegisterStackableMapIcon with null s_instance");
                return;
            }
            if (icon == null)
            {
                Debug.LogError("ERROR: RegisterStackableMapIcon with null icon");
                return;
            }
            bool flag = false;

            foreach (StackableMapIconContainer mContainer in StackableMapIconManager.s_instance.m_containers)
            {
                if (mContainer != null)
                {
                    if (mContainer.gameObject.activeSelf)
                    {
                        if (mContainer.m_startLocationMapID == icon.m_startLocationMapID)
                        {
                            Rect worldRect = mContainer.GetWorldRect();
                            if (!icon.GetWorldRect().Overlaps(worldRect))
                            {
                                continue;
                            }
                            mContainer.AddStackableMapIcon(icon);
                            icon.SetContainer(mContainer);
                            StackableMapIconManager.s_instance.m_containers.Add(mContainer);
                            flag = true;
                            break;
                        }
                    }
                }
            }
            if (!flag)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(StackableMapIconManager.s_instance.m_stackableMapContainerPrefab);
                gameObject.transform.SetParent(icon.transform.parent, false);
                RectTransform component     = gameObject.GetComponent <RectTransform>();
                RectTransform rectTransform = icon.GetComponent <RectTransform>();
                component.anchorMin        = rectTransform.anchorMin;
                component.anchorMax        = rectTransform.anchorMax;
                component.sizeDelta        = icon.m_iconBoundsRT.sizeDelta;
                component.anchoredPosition = Vector2.zero;
                StackableMapIconContainer mStartLocationMapID = gameObject.GetComponent <StackableMapIconContainer>();
                if (mStartLocationMapID == null)
                {
                    Debug.LogError("ERROR: containerObj has no StackableMapIconContainer!!");
                }
                else
                {
                    mStartLocationMapID.m_startLocationMapID = icon.m_startLocationMapID;
                    mStartLocationMapID.AddStackableMapIcon(icon);
                    icon.SetContainer(mStartLocationMapID);
                    StackableMapIconManager.s_instance.m_containers.Add(mStartLocationMapID);
                }
            }
        }
 public static void RemoveStackableMapIconContainer(StackableMapIconContainer container)
 {
     if (StackableMapIconManager.s_instance != null && StackableMapIconManager.s_instance.m_containers.Contains(container))
     {
         StackableMapIconManager.s_instance.m_containers.Remove(container);
     }
 }
        public void JustZoomToMission()
        {
            UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.transform, Vector3.zero, 3f, 0f);
            Main.instance.m_UISound.Play_SelectMission();
            if (StaticDB.garrMissionDB.GetRecord(this.m_garrMissionID) == null)
            {
                return;
            }
            AdventureMapPanel         instance  = AdventureMapPanel.instance;
            StackableMapIcon          component = base.GetComponent <StackableMapIcon>();
            StackableMapIconContainer stackableMapIconContainer = null;

            if (component != null)
            {
                stackableMapIconContainer = component.GetContainer();
                AdventureMapPanel.instance.SetSelectedIconContainer(stackableMapIconContainer);
            }
            Vector2 tapPos;

            if (stackableMapIconContainer != null)
            {
                tapPos..ctor(stackableMapIconContainer.transform.position.x, stackableMapIconContainer.transform.position.y);
            }
            else
            {
                tapPos..ctor(base.transform.position.x, base.transform.position.y);
            }
            instance.CenterAndZoom(tapPos, null, true);
        }
 public void SetSelectedIconContainer(StackableMapIconContainer container)
 {
     this.m_iconContainer = container;
     if (this.SelectedIconContainerChanged != null)
     {
         this.SelectedIconContainerChanged(container);
     }
 }
Exemplo n.º 5
0
 private void HandleSelectedIconContainerChanged(StackableMapIconContainer container)
 {
     if (container != this)
     {
         this.ShowIconArea(false);
     }
     else if (this.GetIconCount() > 1)
     {
         this.ShowIconArea(true);
     }
 }
Exemplo n.º 6
0
        public void OnClick()
        {
            Main.instance.m_UISound.Play_SelectWorldQuest();
            UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.transform, Vector3.zero, 2f, 0f);
            AllPopups.instance.ShowWorldQuestTooltip(this.m_questID);
            StackableMapIcon component = base.GetComponent <StackableMapIcon>();

            if (component != null)
            {
                StackableMapIconContainer container = component.GetContainer();
                AdventureMapPanel.instance.SetSelectedIconContainer(container);
            }
        }
        public void JustZoomToMission()
        {
            Vector2 vector2;

            UiAnimMgr.instance.PlayAnim("MinimapPulseAnim", base.transform, Vector3.zero, 3f, 0f);
            Main.instance.m_UISound.Play_SelectMission();
            if (StaticDB.garrMissionDB.GetRecord(this.m_garrMissionID) == null)
            {
                return;
            }
            AdventureMapPanel         adventureMapPanel = AdventureMapPanel.instance;
            StackableMapIcon          component         = base.GetComponent <StackableMapIcon>();
            StackableMapIconContainer container         = null;

            if (component != null)
            {
                container = component.GetContainer();
                AdventureMapPanel.instance.SetSelectedIconContainer(container);
            }
            vector2 = (container == null ? new Vector2(base.transform.position.x, base.transform.position.y) : new Vector2(container.transform.position.x, container.transform.position.y));
            adventureMapPanel.CenterAndZoom(vector2, null, true);
        }
Exemplo n.º 8
0
 public void SetContainer(StackableMapIconContainer iconContainer)
 {
     this.m_iconContainer = iconContainer;
 }