Пример #1
0
 private void SelectMapItem(HuntMapItem item)
 {
     if (this.mLastSelectMap != null)
     {
         this.mLastSelectMap.IsSelect = false;
     }
     this.mLastSelectMap          = item;
     this.mLastSelectMap.IsSelect = true;
 }
Пример #2
0
    public void OpenHuntCityById(int cityId)
    {
        Debug.LogFormat("进入地图[{0}]", new object[]
        {
            cityId
        });
        HuntMapItem huntMapItem = this.mMapList.Find((HuntMapItem e) => e.Id == cityId);

        if (huntMapItem != null)
        {
            this.OnClickCity(huntMapItem);
        }
    }
Пример #3
0
 protected override void OnEnable()
 {
     base.OnEnable();
     CurrenciesUIViewModel.Show(true);
     CurrenciesUIViewModel.Instance.SetSubUI(true, ResourceManager.GetCodeSprite(110046), string.Empty, delegate
     {
         UIStackManager.Instance.PopUIPrevious(base.uiType);
     }, false);
     if (this.mLastSelectMap != null)
     {
         this.mLastSelectMap.IsSelect = false;
     }
     this.mLastSelectMap = null;
     this.RefreshRightPanel();
     this.RefreshLeftPanel((GuaJiDiTuPeiZhi)this.mLastSelectMap.Data);
 }
Пример #4
0
 private HuntMapItem CreateMapItem(GuaJiDiTuPeiZhi data)
 {
     if (data != null)
     {
         GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("HuntMapItem");
         UGUITools.SetParent(this.mMapContent, instantiate2Prefab, false);
         instantiate2Prefab.set_name("map" + data.id);
         HuntMapItem component = instantiate2Prefab.GetComponent <HuntMapItem>();
         component.SetData(data.id, data.minLv, data.maxLv, data.name, data);
         component.EventHandler = new Predicate <HuntMapItem>(this.OnClickCity);
         instantiate2Prefab.SetActive(true);
         this.mMapList.Add(component);
         return(component);
     }
     return(null);
 }
Пример #5
0
 private bool OnClickCity(HuntMapItem item)
 {
     if (item.CurState == HuntMapItem.State.OPEN)
     {
         TramcarUI.LastSelectMapId = item.Id;
         this.SelectMapItem(item);
         return(true);
     }
     if (item.CurState == HuntMapItem.State.LOW)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(511618, false));
     }
     else if (item.CurState == HuntMapItem.State.HIGH)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(511617, false));
     }
     return(false);
 }
Пример #6
0
 private bool OnClickCity(HuntMapItem item)
 {
     if (item.CurState == HuntMapItem.State.OPEN)
     {
         HuntUI.LastSelectMapId = item.Id;
         this.SelectMapItem(item);
         this.RefreshRightPanel();
         this.RefreshLeftPanel((GuaJiDiTuPeiZhi)item.Data);
         return(true);
     }
     if (item.CurState == HuntMapItem.State.LOW)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(511618, false));
     }
     else if (item.CurState == HuntMapItem.State.HIGH)
     {
         UIManagerControl.Instance.ShowToastText(GameDataUtils.GetChineseContent(511617, false));
     }
     return(false);
 }
Пример #7
0
    public void OpenHuntAreaById(int areaId)
    {
        int cityId = areaId / 10;

        Debug.LogFormat("进入地图[{0}]区域[{1}]", new object[]
        {
            cityId,
            areaId
        });
        HuntMapItem huntMapItem = this.mMapList.Find((HuntMapItem e) => e.Id == cityId);

        if (huntMapItem != null && this.OnClickCity(huntMapItem))
        {
            GuaJiQuYuPeiZhi guaJiQuYuPeiZhi = DataReader <GuaJiQuYuPeiZhi> .Get(areaId);

            if (guaJiQuYuPeiZhi != null)
            {
                this.OnClickArea(guaJiQuYuPeiZhi);
            }
        }
    }
Пример #8
0
 private void RefreshRightPanel()
 {
     if (this.mMapList == null)
     {
         this.mMapList = new List <HuntMapItem>();
         List <GuaJiDiTuPeiZhi> dataList = DataReader <GuaJiDiTuPeiZhi> .DataList;
         for (int i = 0; i < dataList.get_Count(); i++)
         {
             HuntMapItem huntMapItem = this.CreateMapItem(dataList.get_Item(i));
             if (this.mLastSelectMap == null && huntMapItem.CurState == HuntMapItem.State.OPEN)
             {
                 this.SelectMapItem(huntMapItem);
             }
         }
     }
     else
     {
         for (int j = 0; j < this.mMapList.get_Count(); j++)
         {
             HuntMapItem huntMapItem = this.mMapList.get_Item(j);
             huntMapItem.Refresh();
             if (this.mLastSelectMap == null && huntMapItem.CurState == HuntMapItem.State.OPEN)
             {
                 this.SelectMapItem(huntMapItem);
             }
         }
     }
     if (HuntUI.LastSelectMapId > 0 && this.mLastSelectMap.Id != HuntUI.LastSelectMapId)
     {
         HuntMapItem huntMapItem2 = this.mMapList.Find((HuntMapItem e) => e.Id == HuntUI.LastSelectMapId);
         if (huntMapItem2 != null && huntMapItem2.MinLevel <= EntityWorld.Instance.EntSelf.Lv && huntMapItem2.MaxLevel >= EntityWorld.Instance.EntSelf.Lv)
         {
             this.SelectMapItem(huntMapItem2);
         }
     }
     HuntUI.LastSelectMapId = this.mLastSelectMap.Id;
     ResourceManager.SetSprite(this.mImgMapName, GameDataUtils.GetIcon((this.mLastSelectMap.Data as GuaJiDiTuPeiZhi).title));
     this.mImgMapName.SetNativeSize();
 }
Пример #9
0
 protected override void OnEnable()
 {
     base.OnEnable();
     CurrenciesUIViewModel.Show(true);
     CurrenciesUIViewModel.Instance.SetSubUI(true, ResourceManager.GetCodeSprite(110048), string.Empty, delegate
     {
         UIStackManager.Instance.PopUIPrevious(base.uiType);
     }, false);
     if (this.mLastSelectMap != null)
     {
         this.mLastSelectMap.IsSelect = false;
     }
     this.mLastSelectMap = null;
     this.mTxMultTips.set_text(GameDataUtils.GetChineseContent(513665, false));
     this.RefreshRightPanel();
     this.RefreshLeftPanel(false);
     this.RefreshInfoPanel();
     if (TramcarManager.Instance.CurMapId != TramcarUI.LastSelectMapId)
     {
         TramcarManager.Instance.SendOpenTramcarPanelReq(TramcarUI.LastSelectMapId);
     }
 }