Example #1
0
 public override void Refresh(object data)
 {
     if (this.mZoneData == data)
     {
         return;
     }
     this.mZoneData = (ZoneItemInfoData)data;
     this.Refresh();
 }
Example #2
0
 public void OnItemClick(GameObject go)
 {
     if (!GameSetting.Data.LastGMLogin && (this.mZoneData == null || this.mZoneData.mState == 5))
     {
         return;
     }
     Globals.Instance.EffectSoundMgr.Play("ui/ui_001");
     if (GUILoginZoneItem.selectedZone)
     {
         GUILoginZoneItem.selectedZone.mBG.enabled = false;
     }
     GUILoginZoneItem.selectedZone = this;
     GUILoginZoneItem.selectedZoneData = this.mZoneData;
     this.mBG.enabled = true;
     this.mBaseScene.selectedZoneData = this.mZoneData;
     this.mBaseScene.mNum.text = this.mNum.text;
     this.mBaseScene.mNum.color = this.mNum.color;
     this.mBaseScene.mName.text = this.mName.text;
     this.mBaseScene.mName.color = this.mName.color;
     this.mBaseScene.mNew.enabled = this.mNew.enabled;
     this.mBaseScene.mState.spriteName = this.mState.spriteName;
     this.mBaseScene.CloseZonesWindow();
 }
Example #3
0
 private void InitZonesWindow(List<GUIGameLoginScene.ServerList> datas)
 {
     if (datas != null && datas.Count > 0)
     {
         datas.Sort(new Comparison<GUIGameLoginScene.ServerList>(this.SortByShowID));
         this.mServerListData = datas;
         if (this.fullServerList || this.selectedZoneData == null)
         {
             int num = 0;
             ZoneItemInfoData zoneItemInfoData = null;
             int num2 = -1;
             int num3 = 0;
             int num4 = -1;
             this.mGroupsTable.SetDragAmount(0f, 0f);
             this.mGroupsTable.ClearData();
             int i = 0;
             while (i < datas.Count)
             {
                 GUIGameLoginScene.ServerList serverList = datas[i];
                 if (GameSetting.Data.LastGMLogin)
                 {
                     goto IL_112;
                 }
                 if (serverList.env != 0)
                 {
                     if (string.IsNullOrEmpty(serverList.platform))
                     {
                         goto IL_112;
                     }
                     string[] array = serverList.platform.Split(new char[]
                     {
                         '|'
                     });
                     string platform = SdkU3d.getPlatform();
                     bool flag = false;
                     for (int j = 0; j < array.Length; j++)
                     {
                         if (array[j] == platform)
                         {
                             flag = true;
                             break;
                         }
                     }
                     if (flag)
                     {
                         goto IL_112;
                     }
                 }
                 IL_234:
                 i++;
                 continue;
                 IL_112:
                 ZoneItemInfoData data = this.GetData(serverList, i);
                 if (data == null)
                 {
                     goto IL_234;
                 }
                 if (num2 < 0)
                 {
                     num2 = data.mShowNum;
                 }
                 num3++;
                 if (num3 >= 10)
                 {
                     this.mGroupsTable.AddData(new GroupItemInfoData(num2, data.mShowNum));
                     num2 = -1;
                     num3 = 0;
                 }
                 if (GameSetting.Data.ServerName == serverList.name)
                 {
                     this.mLastTimeZone.Refresh(data);
                     if (this.selectedZoneData == null)
                     {
                         this.selectedZoneData = data;
                     }
                     else if (this.selectedZoneData.mName == GameSetting.Data.ServerName)
                     {
                         this.selectedZoneData = data;
                     }
                 }
                 else if (this.selectedZoneData != null && this.selectedZoneData.mName == serverList.name)
                 {
                     this.selectedZoneData = data;
                 }
                 else if (this.selectedZoneData == null && serverList.show_id > num && (zoneItemInfoData == null || serverList.status != 5))
                 {
                     num = serverList.show_id;
                     zoneItemInfoData = data;
                 }
                 num4 = i;
                 goto IL_234;
             }
             if (num2 > 0 && num4 >= 0 && num4 < datas.Count)
             {
                 this.mGroupsTable.AddData(new GroupItemInfoData(num2, datas[num4].show_id));
             }
             if (this.selectedZoneData == null)
             {
                 this.selectedZoneData = zoneItemInfoData;
             }
         }
         if (this.selectedZoneData != null)
         {
             this.mNum.text = Singleton<StringManager>.Instance.GetString("loginZoneNum", new object[]
             {
                 this.selectedZoneData.mShowNum
             });
             this.mName.text = this.selectedZoneData.mName;
             this.mName.color = Color.white;
             this.mNum.color = Color.white;
             switch (this.selectedZoneData.mState)
             {
             case 1:
                 this.mState.spriteName = "green";
                 break;
             case 2:
                 this.mState.spriteName = "green";
                 break;
             case 3:
                 this.mState.spriteName = "yellow";
                 break;
             case 4:
                 this.mState.spriteName = "red";
                 break;
             case 5:
                 this.mState.spriteName = "gray";
                 this.mName.color = Color.gray;
                 this.mNum.color = Color.gray;
                 break;
             }
             int num5 = this.selectedZoneData.mNew;
             if (num5 != 0)
             {
                 if (num5 == 1)
                 {
                     this.mNew.enabled = true;
                 }
             }
             else
             {
                 this.mNew.enabled = false;
             }
             foreach (BaseData current in this.mGroupsTable.mDatas)
             {
                 GroupItemInfoData groupItemInfoData = (GroupItemInfoData)current;
                 if (groupItemInfoData.StartNum <= this.selectedZoneData.mShowNum && groupItemInfoData.EndNum >= this.selectedZoneData.mShowNum)
                 {
                     this.RefreshZones(groupItemInfoData.StartNum, groupItemInfoData.EndNum);
                     break;
                 }
             }
         }
     }
     this.mZonesTable.repositionNow = true;
 }