Exemple #1
0
        private void PlayItemUseAnimation(CUseable item, int itemCount)
        {
            if (item != null)
            {
                CItem item2 = (CItem)item;
                if (item2 != null)
                {
                    if ((item2.m_itemData.bType == 4) && (item2.m_itemData.EftParam[2] != 0f))
                    {
                        CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_openAwardpFormPath, false, true);

                        if (script != null)
                        {
                            CUITimerScript component = script.transform.Find("Timer").GetComponent <CUITimerScript>();
                            component.m_eventParams[1].iconUseable = item;
                            component.m_eventParams[1].tag         = itemCount;
                            component.EndTimer();
                            component.StartTimer();
                        }
                    }
                    else if (!this.CheckNameChangeCard(item2))
                    {
                        SendItemUseMsgToServer(item.m_objID, 0, itemCount);
                    }
                }
            }
        }
Exemple #2
0
        public void CheckMiShuTalk(bool isRestarTimer = true)
        {
            bool   flag = false;
            string text = null;

            if (Singleton <CTaskSys> .get_instance().model.IsShowMainTaskTab_RedDotCount())
            {
                flag = true;
                text = Singleton <CTextManager> .get_instance().GetText("Secretary_Reward_Tips");
            }
            else
            {
                CTask maxIndex_TaskID_InState = Singleton <CTaskSys> .get_instance().model.GetMaxIndex_TaskID_InState(enTaskTab.TAB_USUAL, CTask.State.Have_Done);

                if (maxIndex_TaskID_InState != null)
                {
                    flag = true;
                    text = Singleton <CTextManager> .get_instance().GetText("Secretary_Reward_Tips");
                }
                else
                {
                    maxIndex_TaskID_InState = Singleton <CTaskSys> .get_instance().model.GetMaxIndex_TaskID_InState(enTaskTab.TAB_USUAL, CTask.State.OnGoing);

                    if (maxIndex_TaskID_InState != null)
                    {
                        flag = true;
                        text = maxIndex_TaskID_InState.m_resTask.szMiShuDesc;
                    }
                }
            }
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form == null)
            {
                return;
            }
            Transform      transform  = form.transform.Find("LobbyBottom/Newbie/TalkFrame");
            Text           component  = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Text").GetComponent <Text>();
            CUITimerScript component2 = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Timer").GetComponent <CUITimerScript>();

            if (flag)
            {
                transform.gameObject.CustomSetActive(true);
                component.text = text;
                component2.ReStartTimer();
            }
            else
            {
                transform.gameObject.CustomSetActive(false);
                component2.EndTimer();
            }
            if (isRestarTimer)
            {
                CUITimerScript component3 = form.transform.Find("LobbyBottom/Newbie/Timer").GetComponent <CUITimerScript>();
                component3.ReStartTimer();
            }
        }
Exemple #3
0
        public void OnCloseTalk(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form != null)
            {
                Transform      transform = form.transform.Find("LobbyBottom/Newbie/TalkFrame");
                CUITimerScript component = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Timer").GetComponent <CUITimerScript>();
                transform.gameObject.CustomSetActive(false);
                component.EndTimer();
            }
        }
Exemple #4
0
        public void CheckMiShuTalk(bool isRestarTimer = true)
        {
            bool   flag        = false;
            string szMiShuDesc = null;

            if (Singleton <CTaskSys> .instance.model.IsShowMainTaskTab_RedDotCount())
            {
                flag        = true;
                szMiShuDesc = Singleton <CTextManager> .instance.GetText("Secretary_Reward_Tips");
            }
            else if (Singleton <CTaskSys> .instance.model.GetMaxIndex_TaskID_InState(RES_TASK_TYPE.RES_TASKTYPE_USUAL, CTask.State.Have_Done) != null)
            {
                flag        = true;
                szMiShuDesc = Singleton <CTextManager> .instance.GetText("Secretary_Reward_Tips");
            }
            else
            {
                CTask task = Singleton <CTaskSys> .instance.model.GetMaxIndex_TaskID_InState(RES_TASK_TYPE.RES_TASKTYPE_USUAL, CTask.State.OnGoing);

                if (task != null)
                {
                    flag        = true;
                    szMiShuDesc = task.m_resTask.szMiShuDesc;
                }
            }
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form != null)
            {
                Transform      transform = form.transform.Find("LobbyBottom/Newbie/TalkFrame");
                Text           component = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Text").GetComponent <Text>();
                CUITimerScript script2   = form.transform.Find("LobbyBottom/Newbie/TalkFrame/Timer").GetComponent <CUITimerScript>();
                if (flag)
                {
                    transform.gameObject.CustomSetActive(true);
                    component.text = szMiShuDesc;
                    script2.ReStartTimer();
                }
                else
                {
                    transform.gameObject.CustomSetActive(false);
                    script2.EndTimer();
                }
                if (isRestarTimer)
                {
                    form.transform.Find("LobbyBottom/Newbie/Timer").GetComponent <CUITimerScript>().ReStartTimer();
                }
            }
        }
Exemple #5
0
        public static void InitConfirmBox(GameObject root, int PlayerNum, ref RoomInfo roomInfo, CUIFormScript form)
        {
            if (root.transform.Find("Panel/Timer") != null)
            {
                CUITimerScript component = root.transform.Find("Panel/Timer").GetComponent <CUITimerScript>();
                if (component != null)
                {
                    component.EndTimer();
                    component.StartTimer();
                }
            }
            if (root.transform.Find("Panel/Panel/Timer") != null)
            {
                CUITimerScript component2 = root.transform.Find("Panel/Panel/Timer").GetComponent <CUITimerScript>();
                if (component2 != null)
                {
                    component2.EndTimer();
                    component2.StartTimer();
                }
            }
            Transform       transform  = root.transform.Find("Panel/Panel/stateGroup");
            GridLayoutGroup component3 = transform.GetComponent <GridLayoutGroup>();

            if (component3)
            {
                component3.set_constraintCount((PlayerNum == 6) ? 3 : 5);
            }
            bool flag = roomInfo.roomAttrib.bPkAI == 2;
            int  num  = (!roomInfo.roomAttrib.bWarmBattle && flag) ? (PlayerNum / 2) : PlayerNum;

            for (int i = 1; i <= 10; i++)
            {
                GameObject gameObject = transform.Find(string.Format("icon{0}", i)).gameObject;
                gameObject.CustomSetActive(num >= i);
            }
            int num2 = 1;

            for (COM_PLAYERCAMP cOM_PLAYERCAMP = COM_PLAYERCAMP.COM_PLAYERCAMP_1; cOM_PLAYERCAMP < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; cOM_PLAYERCAMP++)
            {
                ListView <MemberInfo> listView = roomInfo[cOM_PLAYERCAMP];
                for (int j = 0; j < listView.Count; j++)
                {
                    MemberInfo memberInfo     = listView[j];
                    Transform  transform2     = transform.Find(string.Format("icon{0}", num2));
                    CRoleInfo  masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (!CSysDynamicBlock.bSocialBlocked)
                    {
                        if ((roomInfo.roomAttrib.bMapType == 3 && masterRoleInfo != null && (int)CLadderSystem.GetGradeDataByShowGrade((int)masterRoleInfo.m_rankGrade).bLogicGrade >= CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel) || roomInfo.roomAttrib.bMapType == 5)
                        {
                            Image component4 = transform2.Find("HttpImage").GetComponent <Image>();
                            if (component4)
                            {
                                component4.SetSprite(CUIUtility.s_Sprite_Dynamic_BustPlayer_Dir + "Common_PlayerImg", form, true, false, false, false);
                            }
                        }
                        else
                        {
                            CUIHttpImageScript component5 = transform2.Find("HttpImage").GetComponent <CUIHttpImageScript>();
                            if (component5)
                            {
                                component5.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(memberInfo.MemberHeadUrl));
                            }
                        }
                    }
                    Transform transform3 = transform.Find(string.Format("icon{0}/ready", num2));
                    if (transform3)
                    {
                        transform3.gameObject.CustomSetActive(false);
                    }
                    Transform transform4 = transform.Find(string.Format("icon{0}/unready", num2));
                    if (transform4)
                    {
                        transform4.gameObject.CustomSetActive(true);
                    }
                    num2++;
                }
            }
            Transform transform5 = root.transform.Find("Panel/Panel/TxtReadyNum");

            if (transform5)
            {
                Text component6 = transform5.GetComponent <Text>();
                if (component6)
                {
                    component6.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), 0, num));
                }
            }
            Transform transform6 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm");

            if (transform6)
            {
                Button component7 = transform6.GetComponent <Button>();
                component7.set_interactable(true);
            }
        }
Exemple #6
0
        public static void InitConfirmBox(GameObject root, int PlayerNum, ref RoomInfo roomInfo, CUIFormScript form)
        {
            if (root.transform.Find("Panel/Timer") != null)
            {
                CUITimerScript script = root.transform.Find("Panel/Timer").GetComponent <CUITimerScript>();
                if (script != null)
                {
                    script.EndTimer();
                    script.StartTimer();
                }
            }
            if (root.transform.Find("Panel/Panel/Timer") != null)
            {
                CUITimerScript script2 = root.transform.Find("Panel/Panel/Timer").GetComponent <CUITimerScript>();
                if (script2 != null)
                {
                    script2.EndTimer();
                    script2.StartTimer();
                }
            }
            Transform       transform = root.transform.Find("Panel/Panel/stateGroup");
            GridLayoutGroup component = transform.GetComponent <GridLayoutGroup>();

            if (component != null)
            {
                component.constraintCount = (PlayerNum != 6) ? 5 : 3;
            }
            bool flag = roomInfo.roomAttrib.bPkAI == 2;
            int  num  = !(!roomInfo.roomAttrib.bWarmBattle ? flag : false) ? PlayerNum : (PlayerNum / 2);

            for (int i = 1; i <= 10; i++)
            {
                transform.Find(string.Format("icon{0}", i)).gameObject.CustomSetActive(num >= i);
            }
            int num3 = 1;

            for (COM_PLAYERCAMP com_playercamp = COM_PLAYERCAMP.COM_PLAYERCAMP_1; com_playercamp < COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT; com_playercamp += 1)
            {
                ListView <MemberInfo> view = roomInfo[com_playercamp];
                for (int j = 0; j < view.Count; j++)
                {
                    MemberInfo info           = view[j];
                    Transform  transform2     = transform.Find(string.Format("icon{0}", num3));
                    CRoleInfo  masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                    if (!CSysDynamicBlock.bSocialBlocked)
                    {
                        if ((((roomInfo.roomAttrib.bMapType == 3) && (masterRoleInfo != null)) && (masterRoleInfo.m_rankGrade >= 7)) || (roomInfo.roomAttrib.bMapType == 5))
                        {
                            Image image = transform2.Find("HttpImage").GetComponent <Image>();
                            if (image != null)
                            {
                                image.SetSprite(CUIUtility.s_Sprite_Dynamic_BustPlayer_Dir + "Common_PlayerImg", form, true, false, false);
                            }
                        }
                        else
                        {
                            CUIHttpImageScript script3 = transform2.Find("HttpImage").GetComponent <CUIHttpImageScript>();
                            if (script3 != null)
                            {
                                script3.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(info.MemberHeadUrl));
                            }
                        }
                    }
                    Transform transform3 = transform.Find(string.Format("icon{0}/ready", num3));
                    if (transform3 != null)
                    {
                        transform3.gameObject.CustomSetActive(false);
                    }
                    Transform transform4 = transform.Find(string.Format("icon{0}/unready", num3));
                    if (transform4 != null)
                    {
                        transform4.gameObject.CustomSetActive(true);
                    }
                    num3++;
                }
            }
            Transform transform5 = root.transform.Find("Panel/Panel/TxtReadyNum");

            if (transform5 != null)
            {
                Text text = transform5.GetComponent <Text>();
                if (text != null)
                {
                    text.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Matching_Confirm_PlayerNum"), 0, num);
                }
            }
            Transform transform6 = root.transform.Find("Panel/Panel/btnGroup/Button_Confirm");

            if (transform6 != null)
            {
                transform6.GetComponent <Button>().interactable = true;
            }
        }