Exemple #1
0
 public bool Decerialize(FlowNode_ReqMultiInvitation.Api_RoomInvitation.Json json)
 {
     if (json == null || json.rooms == null)
     {
         return(false);
     }
     this.rooms = new MultiInvitationReceiveWindow.ActiveData.RoomData[json.rooms.Length];
     for (int index = 0; index < json.rooms.Length; ++index)
     {
         MultiInvitationReceiveWindow.ActiveData.RoomData roomData = new MultiInvitationReceiveWindow.ActiveData.RoomData();
         roomData.roomid    = json.rooms[index].roomid;
         roomData.comment   = json.rooms[index].comment;
         roomData.num       = json.rooms[index].num;
         roomData.multiType = !(json.rooms[index].btype == "multi") ? MultiInvitationReceiveWindow.MultiType.TOWER : MultiInvitationReceiveWindow.MultiType.NORMAL;
         roomData.locked    = json.rooms[index].pwd_hash == "1";
         roomData.owner     = new MultiInvitationReceiveWindow.ActiveData.OwnerData(json.rooms[index].owner);
         roomData.quest     = new MultiInvitationReceiveWindow.ActiveData.QuestData(json.rooms[index].quest);
         if (string.IsNullOrEmpty(roomData.comment))
         {
             roomData.comment = LocalizedText.Get("sys.MULTI_INVTATION_COMMNET");
         }
         this.rooms[index] = roomData;
     }
     return(true);
 }
Exemple #2
0
 public void InitializeActiveList()
 {
     this.ReleaseActiveList();
     if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ActiveController, (UnityEngine.Object)null))
     {
         return;
     }
     this.m_ActiveSource = new MultiInvitationReceiveWindow.ActiveContent.ItemSource();
     if (this.m_ActiveData != null && this.m_ActiveData.rooms != null)
     {
         for (int index = 0; index < this.m_ActiveData.rooms.Length; ++index)
         {
             MultiInvitationReceiveWindow.ActiveData.RoomData room = this.m_ActiveData.rooms[index];
             if (room != null && room.isValid)
             {
                 MultiInvitationReceiveWindow.ActiveContent.ItemSource.ItemParam itemParam = new MultiInvitationReceiveWindow.ActiveContent.ItemSource.ItemParam(room);
                 if (itemParam != null && itemParam.IsValid())
                 {
                     this.m_ActiveSource.Add(itemParam);
                 }
             }
         }
     }
     this.m_ActiveController.Initialize((ContentSource)this.m_ActiveSource, Vector2.get_zero());
 }
Exemple #3
0
 private MultiInvitationReceiveWindow.ActiveData.RoomData GetActiveRoomData(int roomId)
 {
     if (this.m_ActiveData != null && this.m_ActiveData.rooms != null)
     {
         for (int index = 0; index < this.m_ActiveData.rooms.Length; ++index)
         {
             MultiInvitationReceiveWindow.ActiveData.RoomData room = this.m_ActiveData.rooms[index];
             if (room != null && room.roomid == roomId)
             {
                 return(room);
             }
         }
     }
     return((MultiInvitationReceiveWindow.ActiveData.RoomData)null);
 }
Exemple #4
0
 public ItemParam(MultiInvitationReceiveWindow.ActiveData.RoomData param)
 {
     this.m_Accessor.Setup(param);
 }
Exemple #5
0
 public void Setup(MultiInvitationReceiveWindow.ActiveData.RoomData param)
 {
     this.m_Param = param;
 }
Exemple #6
0
        public override int OnActivate(int pinId)
        {
            switch (pinId)
            {
            case 200:
                if (this.SetTab(MultiInvitationReceiveWindow.Tab.ACTIVE))
                {
                    this.InitializeActiveList();
                    this.InitializeLogList();
                }
                MultiInvitationBadge.isValid = false;
                this.Open();
                break;

            case 210:
                this.m_Destroy = true;
                this.Close(false);
                break;

            case 220:
                if (this.SetTab(MultiInvitationReceiveWindow.Tab.ACTIVE))
                {
                    this.InitializeActiveList();
                }
                return(300);

            case 230:
                if (this.SetTab(MultiInvitationReceiveWindow.Tab.LOG))
                {
                    this.InitializeLogList();
                }
                return(300);

            case 240:
                SerializeValueList currentValue = FlowNode_ButtonEvent.currentValue as SerializeValueList;
                if (currentValue != null)
                {
                    MultiInvitationReceiveWindow.ActiveData.RoomData dataSource = currentValue.GetDataSource <MultiInvitationReceiveWindow.ActiveData.RoomData>("item");
                    if (dataSource != null)
                    {
                        GlobalVars.SelectedMultiPlayRoomID   = dataSource.roomid;
                        GlobalVars.MultiInvitation           = (int)dataSource.multiType;
                        GlobalVars.MultiInvitationRoomOwner  = dataSource.owner.fuid;
                        GlobalVars.MultiInvitationRoomLocked = dataSource.locked;
                        string eventName = "MENU_MULTI";
                        if (dataSource.multiType == MultiInvitationReceiveWindow.MultiType.TOWER)
                        {
                            eventName = "MENU_MULTITOWER";
                            GameManager instance = MonoSingleton <GameManager> .Instance;
                            GlobalVars.SelectedMultiTowerID = dataSource.quest.param.iname;
                        }
                        GlobalEvent.Invoke(eventName, (object)null);
                        this.m_Destroy = true;
                        this.Close(false);
                        break;
                    }
                    break;
                }
                break;

            case 250:
                this.InitializeActiveList();
                break;

            case 260:
                this.InitializeLogList();
                break;
            }
            return(-1);
        }