Exemple #1
0
        public void Refresh_Tab()
        {
            int dataCount = Singleton <CFriendContoller> .GetInstance().model.GetDataCount(CFriendModel.FriendType.RequestFriend);

            int index = !CSysDynamicBlock.bSocialBlocked ? 2 : 1;

            if (dataCount > 0)
            {
                CUICommonSystem.AddRedDot(this.tablistScript.GetElemenet(index).gameObject, enRedDotPos.enTopRight, dataCount);
            }
            else
            {
                CUICommonSystem.DelRedDot(this.tablistScript.GetElemenet(index).gameObject);
            }
        }
        public void OnPlayMishuAnimation(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CLobbySystem.LOBBY_FORM_PATH);

            if (form == null)
            {
                return;
            }
            Transform transform = form.transform.Find("LobbyBottom/Newbie/Image_DaJi");

            if (transform != null)
            {
                CUICommonSystem.PlayAnimator(transform.gameObject, "Blink_0" + Random.Range(1, 3));
            }
        }
Exemple #3
0
        public void ShowSendButton(bool bEnable)
        {
            if (this.SendCoin == null)
            {
                return;
            }
            Button component = this.SendCoin.GetComponent <Button>();

            if (component == null)
            {
                return;
            }
            component.gameObject.CustomSetActive(true);
            CUICommonSystem.SetButtonEnableWithShader(component, bEnable, true);
        }
        private void ShowCountDownTime(GameObject Btn, bool bMapOpened)
        {
            if (Btn != null)
            {
                Transform transform  = Btn.transform;
                uint      tagUInt    = Btn.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tagUInt;
                Transform transform2 = transform.FindChild("Desc");
                if (transform2 != null)
                {
                    GameObject gameObject = transform2.FindChild("Text").gameObject;
                    GameObject obj3       = transform2.FindChild("Timer").gameObject;
                    if (!bMapOpened)
                    {
                        obj3.CustomSetActive(false);
                        gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        int  utilOpenDay = 0;
                        uint utilOpenSec = 0;
                        CUICommonSystem.GetTimeUtilOpen(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_REWARDMATCH, tagUInt, out utilOpenSec, out utilOpenDay);
                        if ((utilOpenDay == 0) && (utilOpenSec == 0))
                        {
                            obj3.CustomSetActive(false);
                            gameObject.CustomSetActive(true);
                            gameObject.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips6");
                        }
                        else if (utilOpenSec < SECOND_ONE_DAY)
                        {
                            gameObject.CustomSetActive(false);
                            obj3.CustomSetActive(true);
                            CUITimerScript component = obj3.transform.FindChild("Text").GetComponent <CUITimerScript>();
                            component.SetTotalTime((float)utilOpenSec);
                            component.StartTimer();
                        }
                        else
                        {
                            int num4 = utilOpenDay;
                            gameObject.CustomSetActive(true);
                            obj3.CustomSetActive(false);
                            string text = Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips7");

                            gameObject.GetComponent <Text>().text = string.Format(text, num4);
                        }
                    }
                }
            }
        }
        public static void SetStarLevelPanel(uint starLevel, Transform panelTransform, CUIFormScript form)
        {
            if (panelTransform == null)
            {
                return;
            }
            int num        = (int)(starLevel / 216u);
            int num2       = (int)(starLevel % 216u / 36u);
            int num3       = (int)(starLevel % 216u % 36u / 6u);
            int num4       = (int)(starLevel % 216u % 36u % 6u);
            int childCount = panelTransform.childCount;

            for (int i = 0; i < childCount; i++)
            {
                Transform child = panelTransform.GetChild(i);
                if (child == null)
                {
                    return;
                }
                Image component = child.GetComponent <Image>();
                if (component == null)
                {
                    return;
                }
                child.gameObject.CustomSetActive(true);
                if (i < num)
                {
                    component.SetSprite(CGuildHelper.DynamicPrefabPathCrown, form, true, false, false, false);
                }
                else if (i < num + num2)
                {
                    component.SetSprite(CGuildHelper.DynamicPrefabPathSun, form, true, false, false, false);
                }
                else if (i < num + num2 + num3)
                {
                    component.SetSprite(CGuildHelper.DynamicPrefabPathMoon, form, true, false, false, false);
                }
                else if (i < num + num2 + num3 + num4)
                {
                    component.SetSprite(CGuildHelper.DynamicPrefabPathStar, form, true, false, false, false);
                }
                else
                {
                    child.gameObject.CustomSetActive(false);
                }
            }
            CUICommonSystem.SetCommonTipsEvent(form, panelTransform.gameObject, CGuildHelper.GetStarLevelTipString(starLevel), enUseableTipsPos.enTop);
        }
        private void RefreshAcntInfo()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CUnionBattleRankSystem.UNION_RANK_PATH);

            if (form == null)
            {
                return;
            }
            CSDT_RANKING_LIST_ITEM_INFO actRankInfo = this.GetActRankInfo(this.m_CurSelRankType);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            GameObject        widget    = form.GetWidget(1);
            RankingItemHelper component = widget.GetComponent <RankingItemHelper>();
            uint num = 0u;

            if (actRankInfo != null && masterRoleInfo != null)
            {
                widget.CustomSetActive(true);
                string name  = masterRoleInfo.Name;
                uint   level = masterRoleInfo.Level;
                num = actRankInfo.dwRankNo;
                uint num2;
                if (num == 0u)
                {
                    num2 = CUnionBattleEntrySystem.GetRewardMatchStateByMapId(this.m_CurSelMapId).dwPerfectCnt;
                }
                else
                {
                    num2 = actRankInfo.dwRankScore;
                }
                widget.transform.FindChild("Value").gameObject.CustomSetActive(true);
                widget.transform.FindChild("ValueType").gameObject.CustomSetActive(true);
                CUnionBattleRankSystem.SetGameObjChildText(widget, "Value", num2.ToString(CultureInfo.get_InvariantCulture()));
                CUnionBattleRankSystem.SetGameObjChildText(widget, "NameGroup/PlayerName", masterRoleInfo.Name);
                CUnionBattleRankSystem.SetGameObjChildText(widget, "PlayerLv", string.Format("Lv.{0}", level.ToString(CultureInfo.get_InvariantCulture())));
            }
            CUnionBattleRankSystem.RankNobSet(num, component);
            MonoSingleton <NobeSys> .GetInstance().SetMyQQVipHead(component.QqVip.GetComponent <Image>());

            GameObject gameObject = widget.transform.FindChild("HeadItemCell").gameObject;

            CUICommonSystem.SetHostHeadItemCell(gameObject);
            MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(component.WxIcon, Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo().m_privilegeType, 1, true, false);

            MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(component.QqIcon, Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo().m_privilegeType, 2, true, false);

            MonoSingleton <NobeSys> .GetInstance().SetGameCenterVisible(component.GuestIcon, Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo().m_privilegeType, 5, true, false);
        }
        public static void SetPveHeroItemData(CUIFormScript formScript, GameObject listItem, IHeroData data)
        {
            if ((listItem != null) && (data != null))
            {
                bool      bPlayerOwn = data.bPlayerOwn;
                Transform transform  = listItem.transform;
                Transform transform2 = transform.Find("heroProficiencyImg");
                Transform transform3 = transform.Find("heroProficiencyBgImg");
                CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform2.gameObject, data.proficiencyLV);
                CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform3.gameObject, data.proficiencyLV, false);
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    transform3.GetComponent <Image>().color = !masterRoleInfo.IsHaveHero(data.cfgID, true) ? CUIUtility.s_Color_GrayShader : Color.white;
                    transform2.GetComponent <Image>().color = !masterRoleInfo.IsHaveHero(data.cfgID, true) ? CUIUtility.s_Color_GrayShader : Color.white;
                }
                bool flag2   = false;
                bool bActive = false;
                bool flag4   = false;
                if (masterRoleInfo != null)
                {
                    flag2   = masterRoleInfo.IsFreeHero(data.cfgID);
                    bActive = masterRoleInfo.IsCreditFreeHero(data.cfgID);
                    flag4   = masterRoleInfo.IsValidExperienceHero(data.cfgID);
                    CUICommonSystem.SetHeroItemImage(formScript, listItem, masterRoleInfo.GetHeroSkinPic(data.cfgID), enHeroHeadType.enBust, (!bPlayerOwn && !flag2) && !flag4);
                }
                GameObject gameObject = transform.Find("profession").gameObject;
                CUICommonSystem.SetHeroJob(formScript, gameObject, (enHeroJobType)data.heroType);
                transform.Find("heroNameText").GetComponent <Text>().text = data.heroName;
                Transform transform4 = transform.Find("TxtFree");
                Transform transform5 = transform.Find("TxtCreditFree");
                if (transform4 != null)
                {
                    transform4.gameObject.CustomSetActive(flag2 && !bActive);
                }
                if (transform5 != null)
                {
                    transform5.gameObject.CustomSetActive(bActive);
                }
                transform.Find("imgExperienceMark").gameObject.CustomSetActive(data.IsValidExperienceHero());
                CUIEventScript  component   = listItem.GetComponent <CUIEventScript>();
                stUIEventParams eventParams = new stUIEventParams();
                eventParams.openHeroFormPar.heroId  = data.cfgID;
                eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.HeroListClick;
                component.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams);
            }
        }
Exemple #8
0
        private void OnTips_ItemSourceInfoOpen(CUIEvent uiEvent)
        {
            CUIFormScript formScript = Singleton <CUIManager> .GetInstance().OpenForm(s_itemGetSourceFormPath, false, true);

            CUseable      iconUseable = uiEvent.m_eventParams.iconUseable;
            GameObject    gameObject  = formScript.gameObject.transform.Find("Panel/itemCell").gameObject;
            Text          component   = formScript.gameObject.transform.Find("Panel/lblName").GetComponent <Text>();
            Text          text2       = formScript.gameObject.transform.Find("Panel/lblDesc").GetComponent <Text>();
            CUIListScript list        = formScript.gameObject.transform.Find("Panel/List").GetComponent <CUIListScript>();

            CUICommonSystem.SetItemCell(formScript, gameObject, iconUseable, false, false);
            component.text = iconUseable.m_name;
            string[] values = new string[] { iconUseable.GetSalableCount().ToString() };
            text2.text = CUIUtility.StringReplace(iconUseable.m_description, values);
            CUICommonSystem.SetGetInfoToList(formScript, list, iconUseable);
        }
        private void OnClickMiShu(CUIEvent uiEvent)
        {
            CUICommonSystem.ResetLobbyFormFadeRecover();
            CUIEvent cUIEvent = new CUIEvent();

            cUIEvent.m_eventID         = enUIEventID.Task_OpenForm;
            cUIEvent.m_eventParams.tag = 1;
            if (Singleton <CTaskSys> .instance.model.IsShowMainTaskTab_RedDotCount())
            {
                cUIEvent.m_eventParams.tag = 0;
            }
            Singleton <CUIEventManager> .instance.DispatchUIEvent(cUIEvent);

            CMiShuSystem.SendUIClickToServer(enUIClickReprotID.rp_MishuBtn);
            MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.onEnterMishu, new uint[0]);
        }
Exemple #10
0
        public override void Clear()
        {
            base.view.activity.OnTimeStateChange -= new Activity.ActivityEvent(this.OnStateChange);
            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Activity_ClickGoto, new CUIEventManager.OnUIEventHandler(this.OnClickGoto));

            for (int i = 0; i < this._elementList.Count; i++)
            {
                this._elementList[i].Clear();
                if (i > 0)
                {
                    CUICommonSystem.DestoryObj(this._elementList[i].root, 0.1f);
                }
            }
            this._elementList = null;
            this._elementTmpl = null;
        }
 public static void DestoryAllChild(GameObject node)
 {
     if (node == null)
     {
         return;
     }
     while (node.transform.childCount > 0)
     {
         Transform child = node.transform.GetChild(0);
         if (child == null || child.gameObject == null)
         {
             return;
         }
         CUICommonSystem.DestoryObj(child.gameObject, 0f);
     }
 }
        public static void GetRollDiscount(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            byte bZheKou = msg.stPkgData.stAkaliShopZheKouRsp.bZheKou;

            Singleton <CMallMysteryShop> .GetInstance().Discount = (uint)(bZheKou * 10);

            CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(MYSTERY_ROLL_DISCOUNT_FORM_PATH, false, true);

            DebugHelper.Assert(script != null, "获得随机折扣form失败");
            if (script != null)
            {
                CUICommonSystem.PlayAnimator(Utility.FindChild(script.gameObject, "Panel_NewDiscount/Content/Discount"), string.Format("Discount_{0}", bZheKou));
            }
        }
Exemple #13
0
    private void OnOpenForm(CUIEvent cuiEvent)
    {
        CUICommonSystem.ResetLobbyFormFadeRecover();
        if (!this.IsOpenAddSkillSys())
        {
            return;
        }
        CUIFormScript cUIFormScript = Singleton <CUIManager> .instance.OpenForm("UGUI/Form/System/AddedSkill/Form_AddedSkill.prefab", false, true);

        if (cUIFormScript != null)
        {
            CAddSkillView.OpenForm(cUIFormScript.gameObject);
        }
        CMiShuSystem.SendUIClickToServer(enUIClickReprotID.rp_AddSkillBtn);
        Singleton <CUINewFlagSystem> .instance.SetNewFlagForLobbyAddedSkill(false);
    }
Exemple #14
0
        public void OnTalent_ItemClick(CUIEvent uiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_TalentFormPath);

            if (form != null)
            {
                CUIListScript[]     scriptArray = new CUIListScript[] { form.gameObject.transform.Find("Panel/PanelLeft/List1").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List2").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List3").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List4").GetComponent <CUIListScript>(), form.gameObject.transform.Find("Panel/PanelLeft/List5").GetComponent <CUIListScript>() };
                CUIListScript       srcWidgetBelongedListScript = uiEvent.m_srcWidgetBelongedListScript;
                stTalentEventParams talentParams = uiEvent.m_eventParams.talentParams;
                if ((uiEvent.m_srcWidgetIndexInBelongedList != -1) && (talentParams.talentInfo != null))
                {
                    for (int i = 0; i < scriptArray.Length; i++)
                    {
                        if (scriptArray[i] != srcWidgetBelongedListScript)
                        {
                            CUIListElementScript lastSelectedElement = scriptArray[i].GetLastSelectedElement();
                            if (lastSelectedElement != null)
                            {
                                lastSelectedElement.ChangeDisplay(false);
                            }
                            scriptArray[i].SelectElement(-1, true);
                        }
                    }
                    GameObject gameObject = form.gameObject.transform.Find("Panel/PanelRight").gameObject;
                    Image      component  = form.gameObject.transform.Find("Panel/PanelRight/talentCell/imgIcon").GetComponent <Image>();
                    Text       text       = form.gameObject.transform.Find("Panel/PanelRight/lblDesc").GetComponent <Text>();
                    Button     btn        = form.gameObject.transform.Find("Panel/PanelRight/btnLearn").GetComponent <Button>();
                    component.SetSprite(CUIUtility.s_Sprite_Dynamic_Talent_Dir + talentParams.talentInfo.dwIcon, form, true, false, false);
                    text.text = StringHelper.UTF8BytesToString(ref talentParams.talentInfo.szDesc);
                    if (!talentParams.isCanLearn && !talentParams.isHaveTalent)
                    {
                        text.text = Singleton <CTextManager> .instance.GetText("Talent_Buy_1");
                    }
                    btn.gameObject.CustomSetActive(true);
                    if (talentParams.isCanLearn)
                    {
                        CUICommonSystem.SetButtonEnable(btn, true, true, true);
                        btn.gameObject.transform.GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Talent_BtnLearnClick, uiEvent.m_eventParams);
                    }
                    else
                    {
                        CUICommonSystem.SetButtonEnable(btn, false, false, true);
                    }
                    gameObject.CustomSetActive(true);
                }
            }
        }
Exemple #15
0
        public void OnEditTag(CUIEvent evt)
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CPlayerSocialInfoController.s_socialTagEditFormPath, false, true);

            if (!cUIFormScript)
            {
                return;
            }
            GameObject widget = cUIFormScript.GetWidget(0);

            if (widget != null)
            {
                CUIToggleListScript component = widget.transform.GetComponent <CUIToggleListScript>();
                int num = GameDataMgr.socialTagsDataBin.Count();
                component.SetElementAmount(num);
                for (int i = 0; i < num; i++)
                {
                    CUIToggleListElementScript cUIToggleListElementScript = (CUIToggleListElementScript)component.GetElemenet(i);
                    ResSocialTags dataByIndex = GameDataMgr.socialTagsDataBin.GetDataByIndex(i);
                    if (cUIToggleListElementScript != null)
                    {
                        Transform transform  = cUIToggleListElementScript.gameObject.transform;
                        Transform transform2 = transform.Find("Text");
                        CUICommonSystem.SetTextContent(transform2.gameObject, dataByIndex.szText);
                        Text component2 = transform2.transform.GetComponent <Text>();
                        byte bType      = dataByIndex.bType;
                        if (bType != 1)
                        {
                            if (bType == 2)
                            {
                                component2.set_color(this.m_colorTagKawaii);
                            }
                        }
                        else
                        {
                            component2.set_color(this.m_colorTagCool);
                        }
                    }
                }
                component.SetSelectLimitCount(4);
                for (int j = 0; j < this.m_tags.get_Count(); j++)
                {
                    component.SetMultiSelected(Convert.ToInt32(this.m_tags.get_Item(j)), true);
                }
            }
            this.OnTagSelectChanged(null);
        }
        private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum)
        {
            Button          component          = Mopup.GetComponent <Button>();
            CUIEventScript  component2         = component.gameObject.GetComponent <CUIEventScript>();
            stUIEventParams onClickEventParams = default(stUIEventParams);
            bool            isEnable;

            if (difficulty == 1)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text");
                componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[]
                {
                    "10"
                });

                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip());
                onClickEventParams.tag          = 10;
                component2.m_onClickEventParams = onClickEventParams;
            }
            else
            {
                if (difficulty != 2)
                {
                    DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[]
                    {
                        difficulty
                    });
                    return;
                }
                Text componetInChild2 = Utility.GetComponetInChild <Text>(Mopup, "Text");
                if (LeftPlayNum > 0)
                {
                    componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[]
                    {
                        LeftPlayNum.ToString()
                    });
                }
                else
                {
                    componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep");
                }
                isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip() && LeftPlayNum > 0);
                onClickEventParams.tag          = LeftPlayNum;
                component2.m_onClickEventParams = onClickEventParams;
            }
            CUICommonSystem.SetButtonEnable(component, isEnable, true, true);
        }
Exemple #17
0
        public override void OnStateEnter()
        {
            this.m_originalBlendWeight = QualitySettings.blendWeights;
            if (GameSettings.RenderQuality == SGameRenderQuality.Low)
            {
                QualitySettings.blendWeights = BlendWeights.OneBone;
            }
            else
            {
                QualitySettings.blendWeights = BlendWeights.TwoBones;
            }
            ActionManager.Instance.frameMode = true;
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            string eventName = ((curLvelContext == null) || string.IsNullOrEmpty(curLvelContext.musicStartEvent)) ? "PVP01_Play" : curLvelContext.musicStartEvent;

            Singleton <CSoundManager> .GetInstance().PostEvent(eventName, null);

            string str2 = (curLvelContext == null) ? string.Empty : curLvelContext.ambientSoundEvent;

            if (!string.IsNullOrEmpty(str2))
            {
                Singleton <CSoundManager> .instance.PostEvent(str2, null);
            }
            CUICommonSystem.OpenFps();
            Singleton <CUIParticleSystem> .GetInstance().Open();

            CResourceManager.isBattleState = true;
            switch (Singleton <CNewbieAchieveSys> .GetInstance().trackFlag)
            {
            case CNewbieAchieveSys.TrackFlag.SINGLE_COMBAT_3V3_ENTER:
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(10, true);

                break;

            case CNewbieAchieveSys.TrackFlag.SINGLE_MATCH_3V3_ENTER:
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(11, true);

                break;

            case CNewbieAchieveSys.TrackFlag.PVE_1_1_1_Enter:
                MonoSingleton <NewbieGuideManager> .GetInstance().SetNewbieBit(13, true);

                break;
            }
        }
        private static void Show3DModel(CUIFormScript belongForm)
        {
            CUI3DImageScript cUI3DImageScript = null;
            Transform        transform        = belongForm.transform.Find("Root/Panel_Award/3DImage");

            if (transform != null)
            {
                cUI3DImageScript = transform.GetComponent <CUI3DImageScript>();
            }
            if (cUI3DImageScript == null)
            {
                return;
            }
            CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat;

            PlayerKDA hostKDA = playerKDAStat.GetHostKDA();

            if (hostKDA == null)
            {
                return;
            }
            ListView <HeroKDA> .Enumerator enumerator = hostKDA.GetEnumerator();
            uint num = 0u;

            while (enumerator.MoveNext())
            {
                HeroKDA current = enumerator.get_Current();
                if (current != null)
                {
                    num = (uint)current.HeroId;
                    break;
                }
            }
            int heroWearSkinId = (int)Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetHeroWearSkinId(num);

            GameObject       gameObject = cUI3DImageScript.AddGameObject(CUICommonSystem.GetHeroPrefabPath(num, heroWearSkinId, true).ObjectName, false, false);
            CHeroAnimaSystem instance   = Singleton <CHeroAnimaSystem> .GetInstance();

            instance.Set3DModel(gameObject);
            if (gameObject == null)
            {
                return;
            }
            instance.InitAnimatList();
            instance.InitAnimatSoundList(num, (uint)heroWearSkinId);
        }
        public static void DoCoinTweenEnd()
        {
            if (PVESettleView._coinLTD != null && PVESettleView._coinTweenText != null)
            {
                PVESettleView._coinTweenText.text = string.Format("+{0}", PVESettleView._coinTo.ToString("N0"));
                if (PVESettleView._coinMulti != null && Singleton <BattleStatistic> .GetInstance().acntInfo != null)
                {
                    COMDT_ACNT_INFO acntInfo = Singleton <BattleStatistic> .GetInstance().acntInfo;

                    CUICommonSystem.AppendMultipleText(PVESettleView._coinTweenText, CUseable.GetMultiple(acntInfo.dwPvpSettleBaseCoin, ref PVESettleView._coinMulti, 0, -1));
                }
                PVESettleView._coinLTD.cancel();
                PVESettleView._coinLTD       = null;
                PVESettleView._coinTweenText = null;
                PVESettleView._coinMulti     = null;
            }
        }
        public void InitUI()
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(CPlayerInfoSystem.sPlayerInfoFormPath);

            if (form == null)
            {
                return;
            }
            GameObject    widget           = form.GetWidget(2);
            CUIListScript componetInChild  = Utility.GetComponetInChild <CUIListScript>(widget, "panelTop/MenuList");
            CUIListScript componetInChild2 = Utility.GetComponetInChild <CUIListScript>(widget, "panelTop/DropList/List");

            CUICommonSystem.InitMenuPanel(componetInChild.gameObject, CPlayerPvpInfoController.sMainTitles, 0, true);
            CUICommonSystem.InitMenuPanel(componetInChild2.gameObject, CPlayerPvpInfoController.sSubTitles, CPlayerPvpInfoController.CacheSubTab, true);
            Utility.FindChild(widget, "btnGraph").CustomSetActive(false);
            Utility.FindChild(widget, "btnDetail").CustomSetActive(true);
        }
Exemple #21
0
 private void RefreshSelectItem(CUIFormScript formScript, GameObject root, int selectIndex)
 {
     this.m_selectUseable = this.m_selectUseableContainer.GetUseableByIndex(selectIndex);
     if (this.m_selectUseable != null)
     {
         GameObject  gameObject = root.transform.Find("Panel_Left").gameObject;
         GameObject  itemCell   = root.transform.Find("Panel_Left/itemCell").gameObject;
         Text        component  = root.transform.Find("Panel_Left/lblName").GetComponent <Text>();
         CanvasGroup group      = root.transform.Find("Panel_Left/pnlCountTitle").GetComponent <CanvasGroup>();
         Text        text2      = group.transform.Find("lblCount").GetComponent <Text>();
         Text        text3      = root.transform.Find("Panel_Left/lblDesc").GetComponent <Text>();
         Text        text4      = root.transform.Find("Panel_Left/lblPrice").GetComponent <Text>();
         Text        text5      = root.transform.Find("Panel_Left/lblPriceTitle").GetComponent <Text>();
         Image       image      = root.transform.Find("Panel_Left/imgGold").GetComponent <Image>();
         Button      button     = root.transform.Find("Panel_Left/BtnGroup/Button_Sale").GetComponent <Button>();
         Button      button2    = root.transform.Find("Panel_Left/BtnGroup/Button_Use").GetComponent <Button>();
         Button      button3    = root.transform.Find("Panel_Left/BtnGroup/Button_Source").GetComponent <Button>();
         CUICommonSystem.SetItemCell(formScript, itemCell, this.m_selectUseable, false, false);
         component.text = this.m_selectUseable.m_name;
         text2.text     = this.m_selectUseable.GetSalableCount().ToString();
         text3.text     = this.m_selectUseable.m_description;
         text4.text     = this.m_selectUseable.m_coinSale.ToString();
         text4.gameObject.CustomSetActive(true);
         text5.gameObject.CustomSetActive(true);
         image.gameObject.CustomSetActive(true);
         button.gameObject.CustomSetActive(true);
         button2.gameObject.CustomSetActive(true);
         button3.gameObject.CustomSetActive(false);
         if (this.m_selectUseable.m_isSale <= 0)
         {
             text4.gameObject.CustomSetActive(false);
             text5.gameObject.CustomSetActive(false);
             image.gameObject.CustomSetActive(false);
             button.gameObject.CustomSetActive(false);
         }
         if ((this.m_selectUseable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL) && ((CSymbolItem)this.m_selectUseable).IsGuildSymbol())
         {
             group.alpha = 0f;
         }
         else
         {
             group.alpha = 1f;
         }
         gameObject.CustomSetActive(true);
     }
 }
 public static void DelRedDot(GameObject target)
 {
     if (target == null || target.transform == null)
     {
         return;
     }
     CUIMiniEventScript[] componentsInChildren = target.transform.GetComponentsInChildren <CUIMiniEventScript>(true);
     for (int i = 0; i < componentsInChildren.Length; i++)
     {
         if (componentsInChildren[i].m_onDownEventID == enUIEventID.Common_RedDotParsEvent && componentsInChildren[i].m_onDownEventParams.tag == 0)
         {
             componentsInChildren[i].m_onDownEventParams.tag = 1;
             componentsInChildren[i].gameObject.CustomSetActive(false);
             CUICommonSystem.DestoryObj(componentsInChildren[i].gameObject, 0.1f);
         }
     }
 }
Exemple #23
0
        public static void OpenHeroChooseForm()
        {
            enHeroJobType selectIndex   = enHeroJobType.All;
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(RankingView.s_ChooseHeroPath, false, true);

            GameObject widget  = cUIFormScript.GetWidget(2);
            GameObject widget2 = cUIFormScript.GetWidget(0);

            if (widget2 != null)
            {
                CUIListElementScript componetInChild = Utility.GetComponetInChild <CUIListElementScript>(widget, "ScrollRect/Content/ListElement_Template");
                componetInChild.m_onEnableEventID = enUIEventID.Ranking_HeroChg_Hero_Item_Enable;
            }
            if (widget2 != null)
            {
                GameObject widget3 = cUIFormScript.GetWidget(1);
                widget3.CustomSetActive(false);
                string text = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_All");

                string text2 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Tank");

                string text3 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Soldier");

                string text4 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Assassin");

                string text5 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Master");

                string text6 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Archer");

                string text7 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Aid");

                string[] titleList = new string[]
                {
                    text,
                    text2,
                    text3,
                    text4,
                    text5,
                    text6,
                    text7
                };
                CUICommonSystem.InitMenuPanel(widget2, titleList, (int)selectIndex, true);
                CUIListScript component = widget2.GetComponent <CUIListScript>();
                component.m_listSelectChangedEventID = enUIEventID.Ranking_HeroChg_Title_Click;
            }
        }
Exemple #24
0
        private void ShowBuffSkillDesc(uint uiBuffId, Vector3 BtnPos)
        {
            ResSkillCombineCfgInfo dataByKey = GameDataMgr.skillCombineDatabin.GetDataByKey(uiBuffId);

            if (dataByKey == null)
            {
                return;
            }
            if (!string.IsNullOrEmpty(dataByKey.szSkillCombineDesc))
            {
                if (!this.m_BuffSkillPanel)
                {
                    return;
                }
                if (this.m_BuffDescTxtObj == null)
                {
                    this.m_BuffDescTxtObj = Utility.FindChild(this.m_BuffDescNodeObj, "Text");
                    if (this.m_BuffDescTxtObj == null)
                    {
                        return;
                    }
                }
                this.m_BuffDescNodeObj.CustomSetActive(true);
                Text component = this.m_BuffDescTxtObj.GetComponent <Text>();
                if (this.m_curActor && this.m_curActor.handle.ValueComponent != null)
                {
                    ValueDataInfo[] actorValue     = this.m_curActor.handle.ValueComponent.mActorValue.GetActorValue();
                    int             actorSoulLevel = this.m_curActor.handle.ValueComponent.actorSoulLevel;
                    uint            configId       = (uint)this.m_curActor.handle.TheActorMeta.ConfigId;
                    component.set_text(CUICommonSystem.GetSkillDesc(dataByKey.szSkillCombineDesc, actorValue, 1, actorSoulLevel, configId));
                }
                else
                {
                    component.set_text(dataByKey.szSkillCombineDesc);
                }
                float   num       = component.get_preferredHeight();
                Vector2 sizeDelta = this.m_textBgImage.get_rectTransform().sizeDelta;
                num += (this.m_textBgImage.gameObject.transform.localPosition.y - component.gameObject.transform.localPosition.y) * 2f + 10f;
                this.m_textBgImage.get_rectTransform().sizeDelta = new Vector2(sizeDelta.x, num);
                Vector3       localPosition = BtnPos;
                RectTransform component2    = this.m_BuffBtn0.GetComponent <RectTransform>();
                localPosition.y += this.m_BuffBtn0.transform.localScale.y * component2.rect.height / 2f + num / 2f + 15f;
                this.m_BuffDescNodeObj.transform.localPosition = localPosition;
            }
        }
Exemple #25
0
 public static void ShowUseableItem(CUseable item)
 {
     if (item == null)
     {
         return;
     }
     if (item.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP || item.MapRewardType == COM_REWARDS_TYPE.COM_REWARDS_TYPE_ITEM)
     {
         if (item.ExtraFromType == 1)
         {
             int extraFromData = item.ExtraFromData;
             CUICommonSystem.ShowNewHeroOrSkin((uint)extraFromData, 0u, enUIEventID.Activity_HeroShow_Back, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, (uint)item.m_stackCount, 0);
         }
         else if (item.ExtraFromType == 2)
         {
             int extraFromData2 = item.ExtraFromData;
             CUICommonSystem.ShowNewHeroOrSkin(0u, (uint)extraFromData2, enUIEventID.Activity_HeroShow_Back, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, true, null, enFormPriority.Priority1, (uint)item.m_stackCount, 0);
         }
         else
         {
             CUseable[] items = new CUseable[]
             {
                 item
             };
             Singleton <CUIManager> .GetInstance().OpenAwardTip(items, Singleton <CTextManager> .GetInstance().GetText("gotAward"), true, enUIEventID.None, false, true, "Form_Award");
         }
     }
     else if (item is CHeroSkin)
     {
         CHeroSkin cHeroSkin = item as CHeroSkin;
         CUICommonSystem.ShowNewHeroOrSkin(cHeroSkin.m_heroId, cHeroSkin.m_skinId, enUIEventID.Activity_HeroShow_Back, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN, true, null, enFormPriority.Priority1, 0u, 0);
     }
     else if (item is CHeroItem)
     {
         CUICommonSystem.ShowNewHeroOrSkin(item.m_baseID, 0u, enUIEventID.Activity_HeroShow_Back, true, COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO, true, null, enFormPriority.Priority1, 0u, 0);
     }
     else
     {
         CUseable[] items2 = new CUseable[]
         {
             item
         };
         Singleton <CUIManager> .GetInstance().OpenAwardTip(items2, Singleton <CTextManager> .GetInstance().GetText("gotAward"), true, enUIEventID.None, false, true, "Form_Award");
     }
 }
Exemple #26
0
        private void OnOpenChangeHeroForm(CUIEvent uiEvent)
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CSymbolRecommendController.s_ChooseHeroPath, false, true);

            if (null == cUIFormScript)
            {
                return;
            }
            this.m_curHeroJob = enHeroJobType.All;
            GameObject widget = cUIFormScript.GetWidget(0);

            if (widget != null)
            {
                GameObject widget2 = cUIFormScript.GetWidget(1);
                if (widget2 != null)
                {
                    widget2.GetComponent <Toggle>().isOn = this.m_bOwnHeroFlag;
                }
                string text = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_All");

                string text2 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Tank");

                string text3 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Soldier");

                string text4 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Assassin");

                string text5 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Master");

                string text6 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Archer");

                string text7 = Singleton <CTextManager> .GetInstance().GetText("Hero_Job_Aid");

                string[] titleList = new string[]
                {
                    text,
                    text2,
                    text3,
                    text4,
                    text5,
                    text6,
                    text7
                };
                CUICommonSystem.InitMenuPanel(widget, titleList, (int)this.m_curHeroJob, true);
            }
        }
Exemple #27
0
 private void OnIDIPNoticeUpdate()
 {
     if (this._campaignForm != null)
     {
         GameObject iDIPRedObj = this._campaignForm.GetIDIPRedObj();
         if (iDIPRedObj != null)
         {
             if (MonoSingleton <IDIPSys> .GetInstance().HaveUpdateList)
             {
                 CUICommonSystem.AddRedDot(iDIPRedObj, enRedDotPos.enTopRight, 0);
             }
             else if (iDIPRedObj != null)
             {
                 CUICommonSystem.DelRedDot(iDIPRedObj);
             }
         }
     }
 }
Exemple #28
0
        public bool IsHaveEntertrainModeOpen()
        {
            uint[] array = new uint[3];
            uint.TryParse(Singleton <CTextManager> .get_instance().GetText("MapID_PVP_Fire"), ref array[0]);
            uint.TryParse(Singleton <CTextManager> .get_instance().GetText("MapID_PVP_5V5Clone"), ref array[1]);
            uint.TryParse(Singleton <CTextManager> .get_instance().GetText("MapID_PVP_5V5CD"), ref array[2]);
            bool result = false;

            for (int i = 0; i < 3; i++)
            {
                if (CUICommonSystem.GetMatchOpenState(4, array[i]).matchState == enMatchOpenState.enMatchOpen_InActiveTime)
                {
                    result = true;
                    break;
                }
            }
            return(result);
        }
Exemple #29
0
        private void InitSysBtn(Button btn, RES_GAME_ENTRANCE_TYPE entryType, GameObject txtObj, GameObject coinTextObj)
        {
            RES_SPECIALFUNCUNLOCK_TYPE type = CUICommonSystem.EntryTypeToUnlockType(entryType);

            if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(type))
            {
                txtObj.CustomSetActive(false);
                coinTextObj.CustomSetActive(true);
                CUICommonSystem.SetButtonEnableWithShader(btn, true, true);
                btn.GetComponent <CUIEventScript>().m_onClickEventParams.tag = entryType;
            }
            else
            {
                txtObj.CustomSetActive(true);
                coinTextObj.CustomSetActive(false);
                CUICommonSystem.SetButtonEnableWithShader(btn, false, true);
            }
        }
        public void RefreshSymbolMakeForm()
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CSymbolSystem.s_symbolFormPath);

            if (form != null)
            {
                CTextManager instance = Singleton <CTextManager> .GetInstance();

                string[] titleList = new string[] { instance.GetText("Symbol_Prop_Tab_All"), instance.GetText("Symbol_Prop_Tab_Atk"), instance.GetText("Symbol_Prop_Tab_Hp"), instance.GetText("Symbol_Prop_Tab_Defense"), instance.GetText("Symbol_Prop_Tab_Function"), instance.GetText("Symbol_Prop_Tab_HpSteal"), instance.GetText("Symbol_Prop_Tab_AtkSpeed"), instance.GetText("Symbol_Prop_Tab_Crit"), instance.GetText("Symbol_Prop_Tab_Penetrate") };
                CUICommonSystem.InitMenuPanel(form.GetWidget(4), titleList, (int)this.m_symbolFilterType);
                string[] strArray2 = new string[] { "1", "2", "3", "4", "5" };
                CUICommonSystem.InitMenuPanel(form.GetWidget(5), strArray2, this.m_symbolFilterLevel - 1);
                this.m_symbolSys.SetSymbolData();
                this.SetSymbolMakeListData();
                this.RefreshSymbolMakeList(form);
                form.GetWidget(7).GetComponent <Text>().text = this.GetBreakExcessSymbolCoinCnt(0xffff).ToString();
            }
        }