Example #1
0
    private void OnGetDetail(CUIEvent cuiEvent)
    {
        CUIFormScript form = Singleton <CUIManager> .instance.GetForm("UGUI/Form/System/AddedSkill/Form_AddedSkill.prefab");

        if ((form != null) && !form.IsHided())
        {
            CAddSkillView.OnRefresh(form.gameObject, (ushort)cuiEvent.m_eventParams.tag);
        }
    }
Example #2
0
        private void OnOpenLvlUp(CUIEvent uiEvent)
        {
            int tag  = uiEvent.m_eventParams.tag;
            int tag2 = uiEvent.m_eventParams.tag2;

            if (tag2 > this._lastlvTarget)
            {
                CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(PVESettleSys.PATH_LEVELUP, false, true);

                if (cUIFormScript != null)
                {
                    PVESettleView.ShowPlayerLevelUp(cUIFormScript, tag, tag2);
                    uint key = 0u;
                    if (CAddSkillView.NewPlayerLevelUnlockAddSkill(tag2, tag, out key))
                    {
                        Transform transform = cUIFormScript.transform.FindChild("PlayerLvlUp/Panel/groupPanel/SkillPanel");
                        if (transform != null)
                        {
                            ResSkillCfgInfo dataByKey = GameDataMgr.skillDatabin.GetDataByKey(key);
                            if (dataByKey != null)
                            {
                                transform.gameObject.CustomSetActive(true);
                                Text component = transform.FindChild("Skill/SkillName").GetComponent <Text>();
                                if (component != null)
                                {
                                    component.text = Utility.UTF8Convert(dataByKey.szSkillName);
                                }
                                Image component2 = transform.FindChild("Skill/Icon").GetComponent <Image>();
                                if (component2 != null)
                                {
                                    string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                                    component2.SetSprite(prefabPath, cUIFormScript, true, false, false, false);
                                }
                            }
                        }
                    }
                    else
                    {
                        Transform transform2 = cUIFormScript.transform.FindChild("PlayerLvlUp/Panel/groupPanel/SkillPanel");
                        if (transform2 != null)
                        {
                            transform2.gameObject.CustomSetActive(false);
                        }
                    }
                }
                this._lastlvTarget = tag2;
            }
        }
Example #3
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);
    }
Example #4
0
    private void OnOpenForm(CUIEvent cuiEvent)
    {
        if (Singleton <CFunctionUnlockSys> .instance.FucIsUnlock(RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL))
        {
            CUIFormScript script = Singleton <CUIManager> .instance.OpenForm("UGUI/Form/System/AddedSkill/Form_AddedSkill.prefab", false, true);

            if (script != null)
            {
                CAddSkillView.OpenForm(script.gameObject);
            }
        }
        else
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey((uint)0x16);
            Singleton <CUIManager> .instance.OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1f, null, new object[0]);
        }
    }
Example #5
0
    private void OnOpenForm(CUIEvent cuiEvent)
    {
        if (Singleton <CFunctionUnlockSys> .get_instance().FucIsUnlock(22))
        {
            CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm("UGUI/Form/System/AddedSkill/Form_AddedSkill.prefab", false, true);

            if (cUIFormScript != null)
            {
                CAddSkillView.OpenForm(cUIFormScript.gameObject);
            }
        }
        else
        {
            ResSpecialFucUnlock dataByKey = GameDataMgr.specialFunUnlockDatabin.GetDataByKey(22u);
            Singleton <CUIManager> .get_instance().OpenTips(Utility.UTF8Convert(dataByKey.szLockedTip), false, 1.5f, null, new object[0]);
        }
        CMiShuSystem.SendUIClickToServer(enUIClickReprotID.rp_AddSkillBtn);
    }
    public static void OpenForm(GameObject form)
    {
        CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

        int num = GameDataMgr.addedSkiilDatabin.Count();
        CUIToggleListScript component = form.transform.Find("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();

        component.SetElementAmount(num);
        form.transform.Find("Panel_TopBg/LevelText").GetComponent <Text>().set_text((masterRoleInfo != null) ? Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[]
        {
            masterRoleInfo.PvpLevel.ToString()
        }) : Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_2", new string[]
        {
            "1"
        }));
        ResSkillUnlock dataByIndex;

        for (int i = 0; i < num; i++)
        {
            CUIListElementScript elemenet   = component.GetElemenet(i);
            CUIEventScript       component2 = elemenet.GetComponent <CUIEventScript>();
            dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(i);
            uint            dwUnlockSkillID = dataByIndex.dwUnlockSkillID;
            ResSkillCfgInfo dataByKey       = GameDataMgr.skillDatabin.GetDataByKey(dwUnlockSkillID);
            bool            flag            = masterRoleInfo == null || masterRoleInfo.PvpLevel < (uint)dataByIndex.wAcntLevel;
            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                Image  component3 = elemenet.transform.Find("Icon").GetComponent <Image>();
                component3.SetSprite(prefabPath, form.GetComponent <CUIFormScript>(), true, false, false, false);
                component2.m_onClickEventID         = enUIEventID.AddedSkill_GetDetail;
                component2.m_onClickEventParams.tag = (int)dataByIndex.wAcntLevel;
                elemenet.transform.Find("SkillNameTxt").GetComponent <Text>().set_text(Utility.UTF8Convert(dataByKey.szSkillName));
                elemenet.transform.Find("Lock").gameObject.CustomSetActive(flag);
                component3.set_color(flag ? CUIUtility.s_Color_GrayShader : Color.white);
                if (flag)
                {
                    Utility.GetComponetInChild <Text>(elemenet.gameObject, "Lock/Text").set_text(Singleton <CTextManager> .instance.GetText("Added_Skill_Common_Tips_3", new string[]
                    {
                        dataByIndex.wAcntLevel.ToString()
                    }));
                }
                if ((ulong)dwUnlockSkillID == (ulong)((long)CAddSkillSys.SendSkillId))
                {
                    CUICommonSystem.SetObjActive(elemenet.transform.FindChild("HelpBtn"), true);
                    if (masterRoleInfo.PvpLevel >= (uint)dataByIndex.wAcntLevel)
                    {
                        Singleton <CUINewFlagSystem> .GetInstance().AddNewFlag(elemenet.gameObject, enNewFlagKey.New_SendSkill_V14, enNewFlagPos.enTopRight, 1f, 0f, 0f, enNewFlagType.enNewFlag);
                    }
                }
            }
            else
            {
                DebugHelper.Assert(false, string.Format("ResSkillCfgInfo[{0}] can not be found!", dwUnlockSkillID));
            }
        }
        dataByIndex = GameDataMgr.addedSkiilDatabin.GetDataByIndex(0);
        if (dataByIndex != null)
        {
            component.SelectElement(0, true);
            CAddSkillView.OnRefresh(form, dataByIndex.wAcntLevel);
        }
        if (CSysDynamicBlock.bLobbyEntryBlocked)
        {
            CUIToggleListScript  component4 = form.transform.FindChild("Panel_Grid/ToggleList").GetComponent <CUIToggleListScript>();
            CUIListElementScript elemenet2  = component4.GetElemenet(10);
            if (elemenet2)
            {
                elemenet2.gameObject.CustomSetActive(false);
            }
            Transform transform = form.transform.FindChild("Skill-Send-Test");
            if (transform != null)
            {
                transform.gameObject.CustomSetActive(false);
            }
        }
    }