void OnClickStage(uint id)
    {
        Info.SelectId = id;
        DungeonTable.ColosseumInfo coloInfo = _LowDataMgr.instance.GetLowDataColosseumInfo(id);
        if (coloInfo == null)
        {
            return;
        }

        if (Info.StageId < id)//IsStartUser &&
        {
            transform.FindChild("Btn_sweep").collider.enabled = false;
            transform.FindChild("Btn_sweep").GetComponent <UISprite>().color = Color.gray;
        }
        else
        {
            bool isClear = id < Info.StageId;//클리어
            if (isClear)
            {
                transform.FindChild("Btn_sweep").collider.enabled = true;
                transform.FindChild("Btn_sweep").GetComponent <UISprite>().color = Color.white;
            }
            else
            {
                transform.FindChild("Btn_sweep").collider.enabled = false;
                transform.FindChild("Btn_sweep").GetComponent <UISprite>().color = Color.gray;
            }
        }

        List <string> getItemList = coloInfo.rewardItemId.list;

        if (InvenSlotList.Count < getItemList.Count)
        {
            Debug.LogWarning("Over RewardItem Slot Count " + getItemList.Count);
        }

        for (int i = 0; i < InvenSlotList.Count; i++)
        {
            if (getItemList.Count <= i)
            {
                InvenSlotList[i].gameObject.SetActive(false);
                continue;
            }

            uint itemId = 0;
            if (!uint.TryParse(getItemList[i], out itemId))
            {
                continue;
            }

            InvenSlotList[i].gameObject.SetActive(true);
            int arr = i;
            InvenSlotList[i].SetLowDataItemSlot(itemId, 0, (ulong key) => {
                UIMgr.OpenDetailPopup(this, (uint)key, 4);
                //UIMgr.OpenClickPopup((uint)key, InvenSlotList[arr].transform.position );
            });
        }
    }
Exemplo n.º 2
0
    public void OnFriendList(List <NetData.FriendBaseInfo> friendList)
    {
        DungeonTable.ColosseumInfo coloInfo = _LowDataMgr.instance.GetLowDataColosseumInfo(NetData.instance.GameRoomData.DungeonId);
        //ulong myRoleId = NetData.instance.GetUserInfo().GetCharUUID();
        for (int i = 0; i < friendList.Count;) //예외처리
        {
            if (!friendList[i].IsLogin)        //접속 종료한 유저 제외시킨다.
            {
                friendList.RemoveAt(i);
            }
            else
            if (friendList[i].nLevel < coloInfo.LimitLevel)//레벨 제한 걸림
            {
                friendList.RemoveAt(i);
            }
            else if (friendList[i].BattlePower < coloInfo.FightingPower)//권장 전투력 미달
            {
                friendList.RemoveAt(i);
            }
            else
            {
                ++i;
            }
        }

        FriendList.Clear();
        FriendList = friendList;

        int count = SlotList.Count < friendList.Count ? friendList.Count : SlotList.Count;

        for (int i = 0; i < count; i++)
        {
            GameObject go = null;
            if (SlotList.Count <= i)
            {
                go = Instantiate(SlotList[0]) as GameObject;
                go.transform.parent        = Grid.transform;
                go.transform.localPosition = Vector3.zero;
                go.transform.localScale    = Vector3.one;
                SlotList.Add(go);
            }
            else
            {
                go = SlotList[i];
            }

            OnCallbackSlot(i, go);
        }

        ScrollView.enabled = friendList.Count < 4 ? false : true;
        ScrollView.ResetPosition();
        Grid.repositionNow = true;

        Empty.SetActive(friendList.Count == 0);
    }
    //private bool IsStartUser;

    public override void Init()
    {
        base.Init();

        Info = NetData.instance.GetUserInfo()._ColosseumData;

        uint amount = 0;
        int  itemData = NetData.instance.GetUserInfo().GetItemCountForItemId(SystemDefine.SweepItemLowDataID_2, (byte)eItemType.USE);
        int  now = 0, max = 0;

        NetData.instance.GetUserInfo().GetCompleteCount(EtcID.ColosseumCount, ref now, ref max);
        if (0 < itemData && now < itemData)//소탕권이 더 많다면 일일 클리어 횟수로 넣어준다.
        {
            amount = (uint)(max - now);
        }
        else//소탕권이 더 작다면 걍 넣어줌.
        {
            amount = (uint)itemData;
        }

        transform.FindChild("Btn_sweep/label").GetComponent <UILabel>().text = string.Format("{0}\n({1})", _LowDataMgr.instance.GetStringCommon(296), amount);//소탕\n(n)

        Transform parentTf = transform.FindChild("ClearItem");

        for (int i = 0; i < parentTf.childCount; i++)
        {
            Transform slotTf = parentTf.FindChild(string.Format("{0}", i));
            if (slotTf == null)//끝임
            {
                break;
            }

            GameObject          go   = UIHelper.CreateInvenSlot(slotTf);
            InvenItemSlotObject slot = go.GetComponent <InvenItemSlotObject>();
            //slot.SetBackGround("Bod_Inbod06");
            InvenSlotList.Add(slot);
        }

        EventDelegate.Set(transform.FindChild("Btn_sweep").GetComponent <UIEventTrigger>().onClick, delegate() {
            //uiMgr.AddPopup(18, null, null, null);
            if (Info.StageId < Info.SelectId)
            {
                return;
            }

            NetworkClient.instance.SendPMsgColosseumSweepC(Info.SelectId, 1);
        });

        EventDelegate.Set(transform.FindChild("Btn_go").GetComponent <UIEventTrigger>().onClick, delegate() {
            if (Info.IsPossible)
            {
                DungeonTable.ColosseumInfo coloInfo = _LowDataMgr.instance.GetLowDataColosseumInfo(Info.SelectId);
                if (NetData.instance.GetUserInfo()._TotalAttack < coloInfo.FightingPower)
                {
                    string msg = string.Format(_LowDataMgr.instance.GetStringCommon(729), coloInfo.FightingPower);
                    SceneManager.instance.SetNoticePanel(NoticeType.Message, 0, msg);
                }
                else
                {
                    NetworkClient.instance.SendPMsgColosseumCreateRoomC(Info.SelectId);
                }
            }
            else
            {
                uiMgr.AddErrorPopup((int)Sw.ErrorCode.ER_TowerBattleStartS_Pre_Stage_Error);//uiMgr.AddPopup(2003, null, null, null);
            }
        });

        List <DungeonTable.ColosseumInfo> list = _LowDataMgr.instance.GetLowDataColosseumList();
        uint startId = 0;

        if (list[list.Count - 1].StageId < Info.StageId) //모든 스테이지 클리어
        {
            startId = list[list.Count - 1].StageId;
        }
        else
        {
            startId = Info.StageId;
        }

        int count = list.Count;

        for (int i = 0; i < count; i++)
        {
            if (StageListTf.childCount <= i)//문제가 있다.
            {
                continue;
            }

            DungeonTable.ColosseumInfo colInfo = list[i];
            Transform tf = StageListTf.FindChild(string.Format("slot_0{0}", i + 1));
            if (tf == null)
            {
                Debug.LogError(string.Format("not found slot_0{0} error ", i + 1));
                continue;
            }

            UILabel stageName = tf.FindChild("stage_name").GetComponent <UILabel>();
            stageName.text = _LowDataMgr.instance.GetStringStageData(colInfo.String);
            tf.FindChild("sweep").gameObject.SetActive(false);                                  //소탕 표기 일딴 꺼놓는다

            if (colInfo.StageId <= startId && colInfo.LimitLevel <= NetData.instance.UserLevel) //입장 조건 만족
            {
                tf.GetComponent <UITexture>().color = Color.white;
                stageName.color = Color.white;
            }
            else
            {
                tf.GetComponent <UITexture>().color = Color.gray;
                stageName.color = Color.gray;
            }

            uint colId = colInfo.StageId;
            EventDelegate.Set(tf.GetComponent <UIEventTrigger>().onClick, delegate() {
                OnClickStage(colId);
            });
        }

        OnClickStage(startId);
    }
Exemplo n.º 4
0
    /// <summary> 콜로세움, 멀티보스레이드 </summary>
    void InitNetworkDungeon(string startBtnLbl)
    {
        NetInfoTf.FindChild("BtnStart/need_food").GetComponent <UILabel>().text = startBtnLbl;

        uint stageId    = (uint)parameters[4];
        uint limitPower = 0;

        if (GameMode == GAME_MODE.COLOSSEUM)
        {
            DungeonTable.ColosseumInfo coloInfo = _LowDataMgr.instance.GetLowDataColosseumInfo(stageId);
            limitPower = coloInfo.FightingPower;
        }
        else
        {
            DungeonTable.MultyBossRaidInfo multyInfo = _LowDataMgr.instance.GetLowDataMultyBossInfo(stageId);
            limitPower = multyInfo.FightingPower;
        }

        NetInfoTf.FindChild("BattlePoint/my").GetComponent <UILabel>().text    = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(725), CharInven._TotalAttack);
        NetInfoTf.FindChild("BattlePoint/limit").GetComponent <UILabel>().text = string.Format("{0} : {1}", _LowDataMgr.instance.GetStringCommon(724), limitPower);

        Transform parBtnTf = transform.FindChild("Character/CharView");

        //if (NetData.instance.GameRoomData.OwnerId == CharInven.GetCharUUID() )//내가 방장
        NetData.RoomData roomData = NetData.instance.GameRoomData;
        if (roomData.IsLeader) //내가 방장
        {
            EventDelegate.Set(NetInfoTf.FindChild("BtnStart").GetComponent <UIButton>().onClick, OnClickStartGame);
            EventDelegate.Set(NetInfoTf.FindChild("BtnTown").GetComponent <UIButton>().onClick, OnInviteTown);
            EventDelegate.Set(NetInfoTf.FindChild("BtnInvite").GetComponent <UIButton>().onClick, () => {
                //IsTownInvite = false;
                UIMgr.OpenInvitePopup(GameMode);
                //Hide();
            });

            //캐릭터 닉네임, 레벨 셋팅
            string nickName = NetData.instance.Nickname;
            string lvStr    = string.Format(_LowDataMgr.instance.GetStringCommon(453), NetData.instance.UserLevel);
            transform.FindChild("Character/CharView/CharSlot/player_name").GetComponent <UILabel>().text =
                string.Format("{0} {1}", lvStr, nickName);

            //플레이어 생성
            NetData._CostumeData equipCostumeData = CharInven.GetEquipCostume();
            uint weaponId = 0, clothId = 0, headId = 0;
            if (CharInven.isHideCostum)
            {
                NetData._ItemData head   = CharInven.GetEquipParts(ePartType.HELMET);
                NetData._ItemData cloth  = CharInven.GetEquipParts(ePartType.CLOTH);
                NetData._ItemData weapon = CharInven.GetEquipParts(ePartType.WEAPON);

                if (head != null)
                {
                    headId = head._equipitemDataIndex;
                }

                if (cloth != null)
                {
                    clothId = cloth._equipitemDataIndex;
                }

                if (weapon != null)
                {
                    weaponId = weapon._equipitemDataIndex;
                }
            }

            UIHelper.CreatePcUIModel("ReadyPopup"
                                     , PlayCharRoot
                                     , CharInven.GetCharIdx()
                                     , headId
                                     , equipCostumeData._costmeDataIndex
                                     , clothId
                                     , weaponId
                                     , CharInven.GetEquipSKillSet().SkillSetId
                                     , 3
                                     , CharInven.isHideCostum
                                     , false);

            EventDelegate.Set(parBtnTf.FindChild("BtnPartnerSlot_0").GetComponent <UIEventTrigger>().onClick, delegate() {
                OnClickUserSlot(0);
            });
            EventDelegate.Set(parBtnTf.FindChild("BtnPartnerSlot_1").GetComponent <UIEventTrigger>().onClick, delegate() {
                OnClickUserSlot(1);
            });

            PnTouchObj[0].SetActive(true);
            PnTouchObj[1].SetActive(true);
        }
        else//파티 참가자
        {
            NetInfoTf.FindChild("BtnStart").collider.enabled  = false;
            NetInfoTf.FindChild("BtnTown").collider.enabled   = false;
            NetInfoTf.FindChild("BtnInvite").collider.enabled = false;

            parBtnTf.FindChild("BtnPartnerSlot_0").collider.enabled = false;
            parBtnTf.FindChild("BtnPartnerSlot_1").collider.enabled = false;

            PnTouchObj[0].SetActive(false);
            PnTouchObj[1].SetActive(false);

            //캐릭터 닉네임, 레벨 셋팅
            //방장 셋팅
            string lvStr = string.Format(_LowDataMgr.instance.GetStringCommon(453), roomData.Owner.Lv);
            transform.FindChild("Character/CharView/CharSlot/player_name").GetComponent <UILabel>().text =
                string.Format("{0} {1}", lvStr, roomData.Owner.Name);

            NetworkClient.instance.SendPMsgQueryRoleInfoC((long)roomData.Owner.Id);

            for (int i = 0; i < roomData.UserList.Count; i++)//파티원들 셋팅
            {
                int    arr = roomData.UserList[i].Slot;
                string lv  = string.Format(_LowDataMgr.instance.GetStringCommon(453), roomData.UserList[i].Lv);
                TakeParNames[arr].text = string.Format("{0} {1}", lv, roomData.UserList[i].Name);

                if (roomData.UserList[i].Id == CharInven.GetCharUUID())//나
                {
                    //플레이어 생성
                    NetData._CostumeData equipCostumeData = CharInven.GetEquipCostume();
                    uint weaponId = 0, clothId = 0, headId = 0;
                    if (CharInven.isHideCostum)
                    {
                        NetData._ItemData head   = CharInven.GetEquipParts(ePartType.HELMET);
                        NetData._ItemData cloth  = CharInven.GetEquipParts(ePartType.CLOTH);
                        NetData._ItemData weapon = CharInven.GetEquipParts(ePartType.WEAPON);

                        if (head != null)
                        {
                            headId = head._equipitemDataIndex;
                        }

                        if (cloth != null)
                        {
                            clothId = cloth._equipitemDataIndex;
                        }

                        if (weapon != null)
                        {
                            weaponId = weapon._equipitemDataIndex;
                        }
                    }

                    UIHelper.CreatePcUIModel("ReadyPopup"
                                             , PartnerModelRoot[arr]
                                             , CharInven.GetCharIdx()
                                             , headId
                                             , equipCostumeData._costmeDataIndex
                                             , clothId
                                             , weaponId
                                             , CharInven.GetEquipSKillSet().SkillSetId
                                             , 3
                                             , CharInven.isHideCostum
                                             , false);
                }
                else
                {
                    NetworkClient.instance.SendPMsgQueryRoleInfoC((long)roomData.UserList[i].Id);
                }
            }
        }
    }
Exemplo n.º 5
0
    public void OnGuildMemberList(List <NetData.GuildMemberInfo> memberList)
    {
        DungeonTable.ColosseumInfo coloInfo = _LowDataMgr.instance.GetLowDataColosseumInfo(NetData.instance.GameRoomData.DungeonId);
        ulong myRoleId = NetData.instance.GetUserInfo().GetCharUUID();

        for (int i = 0; i < memberList.Count;) //예외처리
        {
            if (memberList[i].Id == myRoleId)  //나 자신은 목록에서 제외.
            {
                memberList.RemoveAt(i);
            }
            else if (memberList[i].LoginTime < memberList[i].LogountTime)//접속 종료한 유저 제외시킨다.
            {
                memberList.RemoveAt(i);
            }
            else if (memberList[i].Lv < coloInfo.LimitLevel)//레벨 제한 걸림
            {
                memberList.RemoveAt(i);
            }
            //else if(memberList[i].Power < coloInfo.FightingPower)//권장 전투력 미달
            //{
            //    memberList.RemoveAt(i);
            //}
            else
            {
                ++i;
            }
        }

        GuildMemberList.Clear();
        GuildMemberList = memberList;

        int count = SlotList.Count < memberList.Count ? memberList.Count : SlotList.Count;

        for (int i = 0; i < count; i++)
        {
            GameObject go = null;
            if (SlotList.Count <= i)
            {
                go = Instantiate(SlotList[0]) as GameObject;
                go.transform.parent        = Grid.transform;
                go.transform.localPosition = Vector3.zero;
                go.transform.localScale    = Vector3.one;
                SlotList.Add(go);
            }
            else
            {
                go = SlotList[i];
            }

            OnCallbackSlot(i, go);
        }

        ScrollView.enabled = memberList.Count < 4 ? false : true;
        ScrollView.ResetPosition();
        Grid.repositionNow = true;

        Empty.SetActive(memberList.Count == 0);


        //Paging.RefreshSlot(GuildMemberList.Count );
    }