Esempio n. 1
0
        private void RefreshAwardPanel(CUIFormScript shareForm, uint achievementId)
        {
            ResAchievement dataByKey = GameDataMgr.achieveDatabin.GetDataByKey(achievementId);

            if (dataByKey != null)
            {
                ListView <CUseable> view = new ListView <CUseable>();
                CUseable            item = CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, (int)dataByKey.dwPoint);
                view.Add(item);
                for (int i = 0; i < dataByKey.astReward.Length; i++)
                {
                    if ((dataByKey.astReward[i].bRewardType != 0) && (dataByKey.astReward[i].dwRewardNum > 0))
                    {
                        CUseable useable2 = CUseableManager.CreateUsableByServerType((RES_REWARDS_TYPE)dataByKey.astReward[i].bRewardType, (int)dataByKey.astReward[i].dwRewardNum, dataByKey.astReward[i].dwRewardID);
                        if (useable2 != null)
                        {
                            view.Add(useable2);
                        }
                    }
                }
                CUIListScript component = shareForm.GetWidget(11).GetComponent <CUIListScript>();
                component.SetElementAmount(view.Count);
                for (int j = 0; j < view.Count; j++)
                {
                    CUIListElementScript elemenet = component.GetElemenet(j);
                    if (elemenet != null)
                    {
                        GameObject gameObject = elemenet.gameObject;
                        CUICommonSystem.SetItemCell(shareForm, gameObject, view[j], true, false);
                    }
                }
            }
        }
Esempio n. 2
0
        private void OnAchievementOpenAwardForm(CUIEvent uiEvent)
        {
            uint           tagUInt   = uiEvent.m_eventParams.tagUInt;
            ResAchievement dataByKey = GameDataMgr.achieveDatabin.GetDataByKey(tagUInt);

            if (dataByKey != null)
            {
                ListView <CUseable> inList = new ListView <CUseable>();
                CUseable            item   = CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, (int)dataByKey.dwPoint);
                inList.Add(item);
                for (int i = 0; i < dataByKey.astReward.Length; i++)
                {
                    if ((dataByKey.astReward[i].bRewardType != 0) && (dataByKey.astReward[i].dwRewardNum > 0))
                    {
                        CUseable useable2 = CUseableManager.CreateUsableByServerType((RES_REWARDS_TYPE)dataByKey.astReward[i].bRewardType, (int)dataByKey.astReward[i].dwRewardNum, dataByKey.astReward[i].dwRewardID);
                        if (useable2 != null)
                        {
                            inList.Add(useable2);
                        }
                    }
                }
                if (inList.Count > 0)
                {
                    Singleton <CUIManager> .GetInstance().OpenAwardTip(LinqS.ToArray <CUseable>(inList), Singleton <CTextManager> .GetInstance().GetText("Achievement_Get_Award_Success"), false, enUIEventID.None, false, false, "Form_Award");
                }
            }
        }
Esempio n. 3
0
            public void Validate()
            {
                if ((this.phase != null) && (this.uiItem != null))
                {
                    this.uiItem.CustomSetActive(true);
                    ResDT_PointExchange    config = this.phase.Config;
                    PointsExchangeActivity owner  = this.phase.Owner as PointsExchangeActivity;
                    if ((owner != null) && (owner.PointsConfig != null))
                    {
                        ResWealPointExchange pointsConfig = owner.PointsConfig;
                        GameObject           gameObject   = this.uiItem.transform.FindChild("DuihuanBtn").gameObject;
                        gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt32Param1 = (uint)this.index;
                        uint maxExchangeCount = owner.GetMaxExchangeCount(this.index);
                        uint exchangeCount    = owner.GetExchangeCount(this.index);
                        uint dwPointCnt       = config.dwPointCnt;
                        uint jiFen            = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().JiFen;

                        bool isEnable = (jiFen >= dwPointCnt) && ((maxExchangeCount == 0) || (exchangeCount < maxExchangeCount));
                        if (this.owner.view.activity.timeState != Activity.TimeState.Going)
                        {
                            CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true);
                        }
                        else
                        {
                            CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), isEnable, isEnable, true);
                        }
                        CUseable   itemUseable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianJuanJiFen, 1);
                        GameObject itemCell    = this.uiItem.transform.FindChild("Panel/PointsCell").gameObject;
                        CUICommonSystem.SetItemCell(this.owner.view.form.formScript, itemCell, itemUseable, true, false);
                        CUseable   useable2 = CUseableManager.CreateUseable((COM_ITEM_TYPE)config.wResItemType, config.dwResItemID, config.wResItemCnt);
                        GameObject obj4     = this.uiItem.transform.FindChild("Panel/GetItemCell").gameObject;
                        CUICommonSystem.SetItemCell(this.owner.view.form.formScript, obj4, useable2, true, false);
                        Text component = this.uiItem.transform.FindChild("Panel/PointsCell/ItemCount").gameObject.GetComponent <Text>();
                        if (jiFen < config.dwPointCnt)
                        {
                            component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), jiFen, dwPointCnt);
                            CUICommonSystem.SetButtonEnable(gameObject.GetComponent <Button>(), false, false, true);
                        }
                        else
                        {
                            component.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), jiFen, dwPointCnt);
                        }
                        GameObject obj5 = this.uiItem.transform.FindChild("ExchangeCount").gameObject;
                        if (maxExchangeCount > 0)
                        {
                            obj5.CustomSetActive(true);
                            obj5.GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount);
                        }
                        else
                        {
                            obj5.CustomSetActive(false);
                        }
                    }
                }
            }
Esempio n. 4
0
 private void OnItemBreakAnimatorEnd(CUIEvent uiEvent)
 {
     if (s_breakSymbolCoinCnt > 0)
     {
         CUseable useable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSymbolCoin, s_breakSymbolCoinCnt);
         if (useable != null)
         {
             CUseable[] items = new CUseable[] { useable };
             Singleton <CUIManager> .GetInstance().OpenAwardTip(items, null, false, enUIEventID.None, false, false, "Form_Award");
         }
         s_breakSymbolCoinCnt = 0;
     }
 }
Esempio n. 5
0
        public void SwitchToSymbolMakePanel(CUIEvent uiEvent)
        {
            this.ClearSymbolMakeData();
            this.RefreshSymbolMakeForm();
            CSymbolSystem.RefreshSymbolCntText();
            CUseable        useable     = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSymbolCoin, 0);
            stUIEventParams eventParams = new stUIEventParams {
                iconUseable = useable,
                tag         = 3
            };
            CUIEventScript component = uiEvent.m_srcFormScript.GetWidget(8).GetComponent <CUIEventScript>();

            if (component != null)
            {
                component.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams);
                component.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
                component.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams);
                component.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
            }
        }
Esempio n. 6
0
        public static CUseable CreateUsableByServerType(COM_REWARDS_TYPE type, int cnt, uint baseId)
        {
            CUseable result = null;

            switch (type)
            {
            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_COIN:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enGoldCoin, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_ITEM:
                result = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, 0uL, baseId, cnt, 0);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_EXP:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enExp, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_COUPONS:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianQuan, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_EQUIP:
                result = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMEQUIP, 0uL, baseId, cnt, 0);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_HERO:
                result = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HERO, baseId, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_SYMBOL:
                result = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, 0uL, baseId, cnt, 0);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_BURNING_COIN:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enBurningCoin, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_ARENA_COIN:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enArenaCoin, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_AP:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enHeart, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKIN:
                result = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN, 0uL, baseId, cnt, 0);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_HONOUR:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enGoldCoin, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_HEROPOOLEXP:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enExpPool, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_SKINCOIN:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSkinCoin, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_SYMBOLCOIN:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSymbolCoin, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_DIAMOND:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDiamond, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_HUOYUEDU:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enHuoyueDu, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_MATCH_POINT_PERSON:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enMatchPersonalPoint, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_MATCH_POINT_GUILD:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enMatchTeamPoint, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_HEADIMAGE:
                result = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HEADIMG, 0uL, baseId, cnt, 0);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_ACHIEVE:
                CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, cnt);
                break;

            case COM_REWARDS_TYPE.COM_REWARDS_TYPE_MASTERPOINT:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enMentorPoint, cnt);
                break;
            }
            return(result);
        }
Esempio n. 7
0
        private void SetAchievementListItemAward(CUIListElementScript listElement, CAchieveItem achieveItem)
        {
            Transform  transform           = listElement.transform;
            GameObject gameObject          = transform.Find("pnlAward/pnlPoint").gameObject;
            GameObject obj3                = transform.Find("pnlAward/pnlCoin").gameObject;
            GameObject obj4                = transform.Find("pnlAward/pnlDiamond").gameObject;
            GameObject obj5                = transform.Find("pnlAward/pnlItem").gameObject;
            GameObject obj6                = transform.Find("pnlAward/pnlSkin").gameObject;
            uint       dwPoint             = achieveItem.m_cfgInfo.dwPoint;
            uint       achievementAwardCnt = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_HONOUR);
            uint       num3                = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_DIAMOND);
            uint       num4                = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_ITEM);
            uint       num5                = achieveItem.GetAchievementAwardCnt(RES_REWARDS_TYPE.RES_REWARDS_TYPE_SKIN);

            gameObject.transform.Find("txtNum").GetComponent <Text>().text = dwPoint.ToString();
            CUIEventScript component = gameObject.GetComponent <CUIEventScript>();
            CUseable       useable   = CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, (int)dwPoint);

            this.SetAchievementAwardTipsEvent(component, useable);
            if (achievementAwardCnt > 0)
            {
                obj3.CustomSetActive(true);
                obj3.GetComponent <LayoutElement>().ignoreLayout         = false;
                obj3.transform.Find("txtNum").GetComponent <Text>().text = achievementAwardCnt.ToString();
                CUIEventScript eventScript = obj3.GetComponent <CUIEventScript>();
                CUseable       useable2    = CUseableManager.CreateVirtualUseable(enVirtualItemType.enGoldCoin, (int)achievementAwardCnt);
                this.SetAchievementAwardTipsEvent(eventScript, useable2);
            }
            else
            {
                obj3.CustomSetActive(false);
                obj3.GetComponent <LayoutElement>().ignoreLayout = true;
            }
            if (num3 > 0)
            {
                obj4.CustomSetActive(true);
                obj4.GetComponent <LayoutElement>().ignoreLayout         = false;
                obj4.transform.Find("txtNum").GetComponent <Text>().text = num3.ToString();
                CUIEventScript script3  = obj4.GetComponent <CUIEventScript>();
                CUseable       useable3 = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDiamond, (int)num3);
                this.SetAchievementAwardTipsEvent(script3, useable3);
            }
            else
            {
                obj4.CustomSetActive(false);
                obj4.GetComponent <LayoutElement>().ignoreLayout = true;
            }
            if (num4 > 0)
            {
                obj5.CustomSetActive(true);
                obj5.GetComponent <LayoutElement>().ignoreLayout         = false;
                obj5.transform.Find("txtNum").GetComponent <Text>().text = num4.ToString();
                string prefabPath = CUIUtility.s_Sprite_Dynamic_Icon_Dir + achieveItem.GetAchievementAwardId(RES_REWARDS_TYPE.RES_REWARDS_TYPE_ITEM);
                obj5.transform.Find("imgIcon").GetComponent <Image>().SetSprite(prefabPath, listElement.m_belongedFormScript, true, false, false);
            }
            else
            {
                obj5.CustomSetActive(false);
                obj5.GetComponent <LayoutElement>().ignoreLayout = true;
            }
            if (num5 > 0)
            {
                obj6.CustomSetActive(true);
                obj6.GetComponent <LayoutElement>().ignoreLayout         = false;
                obj6.transform.Find("txtNum").GetComponent <Text>().text = num5.ToString();
                string str2 = CUIUtility.s_Sprite_Dynamic_Icon_Dir + achieveItem.GetAchievementAwardId(RES_REWARDS_TYPE.RES_REWARDS_TYPE_SKIN);
                obj6.transform.Find("imgIcon").GetComponent <Image>().SetSprite(str2, listElement.m_belongedFormScript, true, false, false);
            }
            else
            {
                obj6.CustomSetActive(false);
                obj6.GetComponent <LayoutElement>().ignoreLayout = true;
            }
        }
Esempio n. 8
0
        public static CUseable CreateUsableByServerType(COM_REWARDS_TYPE type, int cnt, uint baseId)
        {
            CUseable result = null;

            switch (type)
            {
            case 0:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enGoldCoin, cnt);
                break;

            case 1:
                result = CUseableManager.CreateUseable(2, 0uL, baseId, cnt, 0);
                break;

            case 2:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enExp, cnt);
                break;

            case 3:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianQuan, cnt);
                break;

            case 4:
                result = CUseableManager.CreateUseable(3, 0uL, baseId, cnt, 0);
                break;

            case 5:
                result = CUseableManager.CreateUseable(4, baseId, cnt);
                break;

            case 6:
                result = CUseableManager.CreateUseable(5, 0uL, baseId, cnt, 0);
                break;

            case 7:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enBurningCoin, cnt);
                break;

            case 8:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enArenaCoin, cnt);
                break;

            case 9:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enHeart, cnt);
                break;

            case 10:
                result = CUseableManager.CreateUseable(7, 0uL, baseId, cnt, 0);
                break;

            case 11:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enGoldCoin, cnt);
                break;

            case 12:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enExpPool, cnt);
                break;

            case 13:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSkinCoin, cnt);
                break;

            case 14:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSymbolCoin, cnt);
                break;

            case 16:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDiamond, cnt);
                break;

            case 17:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enHuoyueDu, cnt);
                break;

            case 18:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enMatchPersonalPoint, cnt);
                break;

            case 19:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enMatchTeamPoint, cnt);
                break;

            case 20:
                result = CUseableManager.CreateUseable(8, 0uL, baseId, cnt, 0);
                break;

            case 21:
                CUseableManager.CreateVirtualUseable(enVirtualItemType.enAchievementPoint, cnt);
                break;

            case 22:
                result = CUseableManager.CreateVirtualUseable(enVirtualItemType.enMentorPoint, cnt);
                break;
            }
            return(result);
        }
            public void Validate()
            {
                if (this.phase == null || this.uiItem == null)
                {
                    return;
                }
                this.uiItem.CustomSetActive(true);
                ResDT_PointExchange    config = this.phase.Config;
                PointsExchangeActivity pointsExchangeActivity = this.phase.Owner as PointsExchangeActivity;

                if (pointsExchangeActivity == null || pointsExchangeActivity.PointsConfig == null)
                {
                    return;
                }
                ResWealPointExchange pointsConfig = pointsExchangeActivity.PointsConfig;
                GameObject           gameObject   = this.uiItem.transform.FindChild("DuihuanBtn").gameObject;

                gameObject.GetComponent <CUIEventScript>().m_onClickEventParams.commonUInt32Param1 = (uint)this.index;
                uint      maxExchangeCount = pointsExchangeActivity.GetMaxExchangeCount(this.index);
                uint      exchangeCount    = pointsExchangeActivity.GetExchangeCount(this.index);
                uint      dwPointCnt       = config.dwPointCnt;
                CRoleInfo masterRoleInfo   = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                uint jiFen    = masterRoleInfo.JiFen;
                bool isEnable = jiFen >= dwPointCnt && (maxExchangeCount == 0u || exchangeCount < maxExchangeCount);

                if (this.owner.view.activity.timeState != Activity.TimeState.Going)
                {
                    CUICommonSystem.SetButtonEnableWithShader(gameObject.GetComponent <Button>(), false, true);
                }
                else
                {
                    CUICommonSystem.SetButtonEnableWithShader(gameObject.GetComponent <Button>(), isEnable, true);
                }
                CUseable   itemUseable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianJuanJiFen, 1);
                GameObject gameObject2 = this.uiItem.transform.FindChild("Panel/PointsCell").gameObject;

                CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject2, itemUseable, true, false, false, false);
                CUseable   cUseable    = CUseableManager.CreateUseable((COM_ITEM_TYPE)config.wResItemType, config.dwResItemID, (int)config.wResItemCnt);
                GameObject gameObject3 = this.uiItem.transform.FindChild("Panel/GetItemCell").gameObject;

                if (cUseable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP)
                {
                    CItem cItem = cUseable as CItem;
                    if (cItem != null && cItem.m_itemData.bIsView > 0)
                    {
                        CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, cUseable, true, false, false, true);
                    }
                    else
                    {
                        CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, cUseable, true, false, false, false);
                        if (gameObject3 != null)
                        {
                            CUIEventScript component = gameObject3.GetComponent <CUIEventScript>();
                            if (component != null)
                            {
                                component.SetUIEvent(enUIEventType.Click, enUIEventID.None);
                            }
                        }
                    }
                }
                else
                {
                    CUICommonSystem.SetItemCell(this.owner.view.form.formScript, gameObject3, cUseable, true, false, false, false);
                    if (gameObject3 != null)
                    {
                        CUIEventScript component2 = gameObject3.GetComponent <CUIEventScript>();
                        if (component2 != null)
                        {
                            component2.SetUIEvent(enUIEventType.Click, enUIEventID.None);
                        }
                    }
                }
                bool bActive = false;

                if (cUseable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HERO)
                {
                    CHeroItem cHeroItem = (CHeroItem)cUseable;
                    if (cHeroItem != null)
                    {
                        CRoleInfo masterRoleInfo2 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                        if (masterRoleInfo2 != null)
                        {
                            bActive = masterRoleInfo2.IsHaveHero(cHeroItem.m_baseID, true);
                        }
                    }
                }
                else if (cUseable.m_type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)
                {
                    CHeroSkin cHeroSkin = (CHeroSkin)cUseable;
                    if (cHeroSkin != null)
                    {
                        CRoleInfo masterRoleInfo3 = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                        if (masterRoleInfo3 != null)
                        {
                            bActive = masterRoleInfo3.IsHaveHeroSkin(cHeroSkin.m_heroId, cHeroSkin.m_skinId, false);
                        }
                    }
                }
                Transform transform = this.uiItem.transform.FindChild("Panel/GetItemCell/HaveItemFlag");

                if (transform != null && transform.gameObject != null)
                {
                    transform.gameObject.CustomSetActive(bActive);
                }
                Text component3 = this.uiItem.transform.FindChild("Panel/PointsCell/ItemCount").gameObject.GetComponent <Text>();

                if (jiFen < config.dwPointCnt)
                {
                    component3.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemNotEnoughCount"), jiFen, dwPointCnt));
                    CUICommonSystem.SetButtonEnableWithShader(gameObject.GetComponent <Button>(), false, true);
                }
                else
                {
                    component3.set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_ItemCount"), jiFen, dwPointCnt));
                }
                GameObject gameObject4 = this.uiItem.transform.FindChild("ExchangeCount").gameObject;

                if (maxExchangeCount > 0u)
                {
                    gameObject4.CustomSetActive(true);
                    gameObject4.GetComponent <Text>().set_text(string.Format(Singleton <CTextManager> .GetInstance().GetText("Exchange_TimeLimit"), exchangeCount, maxExchangeCount));
                }
                else
                {
                    gameObject4.CustomSetActive(false);
                }
            }
Esempio n. 10
0
        private void InitForm(CUIFormScript form)
        {
            this.m_FormObj        = form.gameObject;
            this.m_PlayerName     = this.m_FormObj.transform.Find("PlayerHead/NameGroup/PlayerName").GetComponent <Text>();
            this.m_PvpLevel       = this.m_FormObj.transform.Find("PlayerHead/pvpLevel").GetComponent <Text>();
            this.m_PlayerExp      = this.m_FormObj.transform.Find("PlayerHead/PlayerExp").GetComponent <Text>();
            this.m_PlayerVipLevel = this.m_FormObj.transform.Find("PlayerHead/imgVipBg/txtVipLevel").GetComponent <Text>();
            this.m_PvpExpImg      = this.m_FormObj.transform.Find("PlayerHead/pvpExp/expBg/imgExp").GetComponent <Image>();
            this.m_PvpExpTxt      = this.m_FormObj.transform.Find("PlayerHead/pvpExp/expBg/txtExp").GetComponent <Text>();
            this.animatorScript   = this.m_FormObj.GetComponent <CUIAnimatorScript>();
            this.hero_btn         = this.m_FormObj.transform.Find("LobbyBottom/SysEntry/HeroBtn").gameObject;
            this.symbol_btn       = this.m_FormObj.transform.Find("LobbyBottom/SysEntry/SymbolBtn").gameObject;
            this.bag_btn          = this.m_FormObj.transform.Find("LobbyBottom/SysEntry/BagBtn").gameObject;
            this.task_btn         = this.m_FormObj.transform.Find("LobbyBottom/Newbie").gameObject;
            this.social_btn       = this.m_FormObj.transform.Find("LobbyBottom/SysEntry/SocialBtn").gameObject;
            this.addSkill_btn     = this.m_FormObj.transform.Find("LobbyBottom/SysEntry/AddedSkillBtn").gameObject;
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_HERO);
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_SYMBOL);
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_BAG);
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_TASK);
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_UNION);
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_FRIEND);
            this.Check_Enable(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL);
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform = this.m_FormObj.transform.Find("Popup");
                if (transform != null)
                {
                    transform.gameObject.CustomSetActive(false);
                }
                Transform transform2 = this.m_FormObj.transform.Find("BtnCon/CompetitionBtn");
                if (transform2 != null)
                {
                    transform2.gameObject.CustomSetActive(false);
                }
                if (this.task_btn != null)
                {
                    this.task_btn.CustomSetActive(false);
                }
                Transform transform3 = this.m_FormObj.transform.Find("DiamondPayBtn");
                if (transform3 != null)
                {
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            if (CSysDynamicBlock.bUnfinishBlock)
            {
                Transform transform4 = this.m_FormObj.transform.Find("BtnCon/WebBtn");
                if (transform4 != null)
                {
                    transform4.gameObject.CustomSetActive(false);
                }
            }
            Button component = this.m_FormObj.transform.Find("BtnCon/LadderBtn").GetComponent <Button>();

            if (component != null)
            {
                component.interactable = Singleton <CLadderSystem> .GetInstance().IsLevelQualified();

                Transform transform5 = component.transform.Find("Lock");
                if (transform5 != null)
                {
                    transform5.gameObject.CustomSetActive(!component.interactable);
                }
            }
            Button button2 = this.m_FormObj.transform.FindChild("BtnCon/UnionBtn").GetComponent <Button>();

            if (button2 != null)
            {
                bool bActive = Singleton <CUnionBattleEntrySystem> .GetInstance().IsUnionFuncLocked();

                button2.interactable = !bActive;
                button2.transform.FindChild("Lock").gameObject.CustomSetActive(bActive);
            }
            GameObject gameObject = this.m_FormObj.transform.Find("PlayerHead/pvpExp").gameObject;

            if (gameObject != null)
            {
                CUIEventScript script = gameObject.GetComponent <CUIEventScript>();
                if (script == null)
                {
                    script = gameObject.AddComponent <CUIEventScript>();
                    script.Initialize(form);
                }
                CUseable        useable     = CUseableManager.CreateVirtualUseable(enVirtualItemType.enExp, 0);
                stUIEventParams eventParams = new stUIEventParams {
                    iconUseable = useable,
                    tag         = 3
                };
                script.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams);
                script.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
                script.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams);
                script.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams);
            }
            RefreshDianQuanPayButton(false);
            Transform transform6 = this.m_FormObj.transform.Find("BtnCon/PvpBtn");
            Transform transform7 = this.m_FormObj.transform.Find("BtnCon/PveBtn");

            if (transform6 != null)
            {
                Singleton <CMallSystem> .instance.LoadUIPrefab(Pvp_BtnRes_PATH, "PvpBtnDynamic", transform6.gameObject, form);
            }
            if (transform7 != null)
            {
                Singleton <CMallSystem> .instance.LoadUIPrefab(Pve_BtnRes_PATH, "PveBtnDynamic", transform7.gameObject, form);
            }
        }
Esempio n. 11
0
        public static void SetItemEtcCell(CUIFormScript form, GameObject item, Text name, COMDT_REWARD_INFO rewardInfo, COMDT_SETTLE_RESULT_DETAIL settleData)
        {
            byte bType = rewardInfo.bType;

            switch (bType)
            {
            case 1:
            {
                CUseable cUseable = CUseableManager.CreateUseable(2, 0uL, rewardInfo.stRewardInfo.get_stItem().dwItemID, (int)rewardInfo.stRewardInfo.get_stItem().dwCnt, 0);
                cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                ResPropInfo dataByKey = GameDataMgr.itemDatabin.GetDataByKey(rewardInfo.stRewardInfo.get_stItem().dwItemID);
                if (dataByKey != null)
                {
                    name.text = StringHelper.UTF8BytesToString(ref dataByKey.szName);
                }
                break;
            }

            case 2:
                break;

            case 3:
            {
                CUseable cUseable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianQuan, (int)rewardInfo.stRewardInfo.dwCoupons);
                cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                name.text = cUseable.m_name;
                break;
            }

            case 4:
            {
                CUseable cUseable = CUseableManager.CreateUseable(3, 0uL, rewardInfo.stRewardInfo.get_stEquip().dwEquipID, (int)rewardInfo.stRewardInfo.get_stEquip().dwCnt, 0);
                cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                ResEquipInfo dataByKey2 = GameDataMgr.equipInfoDatabin.GetDataByKey(rewardInfo.stRewardInfo.get_stEquip().dwEquipID);
                if (dataByKey2 != null)
                {
                    name.text = StringHelper.UTF8BytesToString(ref dataByKey2.szName);
                }
                break;
            }

            case 5:
            {
                CUseable cUseable = CUseableManager.CreateUseable(4, 0uL, rewardInfo.stRewardInfo.get_stHero().dwHeroID, (int)rewardInfo.stRewardInfo.get_stHero().dwCnt, 0);
                cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                ResHeroCfgInfo dataByKey3 = GameDataMgr.heroDatabin.GetDataByKey(rewardInfo.stRewardInfo.get_stHero().dwHeroID);
                if (dataByKey3 != null)
                {
                    name.text = StringHelper.UTF8BytesToString(ref dataByKey3.szName);
                }
                break;
            }

            case 6:
            {
                CUseable cUseable = CUseableManager.CreateUseable(5, 0uL, rewardInfo.stRewardInfo.get_stSymbol().dwSymbolID, (int)rewardInfo.stRewardInfo.get_stSymbol().dwCnt, 0);
                cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                ResSymbolInfo dataByKey4 = GameDataMgr.symbolInfoDatabin.GetDataByKey(rewardInfo.stRewardInfo.get_stSymbol().dwSymbolID);
                if (dataByKey4 != null)
                {
                    name.text = StringHelper.UTF8BytesToString(ref dataByKey4.szName);
                }
                break;
            }

            default:
                if (bType == 16)
                {
                    CUseable cUseable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDiamond, (int)rewardInfo.stRewardInfo.dwDiamond);
                    cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                    CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                    name.text = cUseable.m_name;
                }
                break;
            }
        }
Esempio n. 12
0
        public static void SetItemEtcCell(CUIFormScript form, GameObject item, Text name, COMDT_REWARD_INFO rewardInfo, COMDT_SETTLE_RESULT_DETAIL settleData)
        {
            byte bType = rewardInfo.bType;

            switch (bType)
            {
            case 1:
            {
                CUseable cUseable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, 0uL, rewardInfo.stRewardInfo.stItem.dwItemID, (int)rewardInfo.stRewardInfo.stItem.dwCnt, 0);
                cUseable.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable, true, false, false, false);
                ResPropInfo dataByKey = GameDataMgr.itemDatabin.GetDataByKey(rewardInfo.stRewardInfo.stItem.dwItemID);
                if (dataByKey != null)
                {
                    name.set_text(StringHelper.UTF8BytesToString(ref dataByKey.szName));
                }
                break;
            }

            case 2:
                break;

            case 3:
            {
                CUseable cUseable2 = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDianQuan, (int)rewardInfo.stRewardInfo.dwCoupons);
                cUseable2.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable2, true, false, false, false);
                name.set_text(cUseable2.m_name);
                break;
            }

            case 4:
            {
                CUseable cUseable3 = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMEQUIP, 0uL, rewardInfo.stRewardInfo.stEquip.dwEquipID, (int)rewardInfo.stRewardInfo.stEquip.dwCnt, 0);
                cUseable3.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable3, true, false, false, false);
                ResEquipInfo dataByKey2 = GameDataMgr.equipInfoDatabin.GetDataByKey(rewardInfo.stRewardInfo.stEquip.dwEquipID);
                if (dataByKey2 != null)
                {
                    name.set_text(StringHelper.UTF8BytesToString(ref dataByKey2.szName));
                }
                break;
            }

            case 5:
            {
                CUseable cUseable4 = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_HERO, 0uL, rewardInfo.stRewardInfo.stHero.dwHeroID, (int)rewardInfo.stRewardInfo.stHero.dwCnt, 0);
                cUseable4.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable4, true, false, false, false);
                ResHeroCfgInfo dataByKey3 = GameDataMgr.heroDatabin.GetDataByKey(rewardInfo.stRewardInfo.stHero.dwHeroID);
                if (dataByKey3 != null)
                {
                    name.set_text(StringHelper.UTF8BytesToString(ref dataByKey3.szName));
                }
                break;
            }

            case 6:
            {
                CUseable cUseable5 = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, 0uL, rewardInfo.stRewardInfo.stSymbol.dwSymbolID, (int)rewardInfo.stRewardInfo.stSymbol.dwCnt, 0);
                cUseable5.SetMultiple(ref settleData.stMultipleDetail, true);
                CUICommonSystem.SetItemCell(form, item, cUseable5, true, false, false, false);
                ResSymbolInfo dataByKey4 = GameDataMgr.symbolInfoDatabin.GetDataByKey(rewardInfo.stRewardInfo.stSymbol.dwSymbolID);
                if (dataByKey4 != null)
                {
                    name.set_text(StringHelper.UTF8BytesToString(ref dataByKey4.szName));
                }
                break;
            }

            default:
                if (bType == 16)
                {
                    CUseable cUseable6 = CUseableManager.CreateVirtualUseable(enVirtualItemType.enDiamond, (int)rewardInfo.stRewardInfo.dwDiamond);
                    cUseable6.SetMultiple(ref settleData.stMultipleDetail, true);
                    CUICommonSystem.SetItemCell(form, item, cUseable6, true, false, false, false);
                    name.set_text(cUseable6.m_name);
                }
                break;
            }
        }