Ejemplo n.º 1
0
        public void ShowDefeat()
        {
            if (this.m_allAchievements == null || this.m_allAchievements.Length != 8)
            {
                return;
            }
            CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(PvpAchievementForm.s_formSharePVPDefeatPath, false, true);

            if (cUIFormScript == null)
            {
                return;
            }
            Transform transform = cUIFormScript.transform.Find("ShareFrame/Image");

            if (transform)
            {
                MonoSingleton <ShareSys> .GetInstance().SetShareDefeatImage(transform, cUIFormScript);
            }
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_CloseSharePVPDefeat, new CUIEventManager.OnUIEventHandler(this.OnCloseSharePVPDefeat));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_ShareDefeatAddBarrage, new CUIEventManager.OnUIEventHandler(this.OnSharePVPDefeatAddBarrage));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_ShareDefeatSelectBarrage, new CUIEventManager.OnUIEventHandler(this.OnSharePVPDefeatSelectBarrage));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_ShareDefeatBarrageEnable, new CUIEventManager.OnUIEventHandler(this.OnBarrageEnable));

            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_CloseShareDefeatBarrage, new CUIEventManager.OnUIEventHandler(this.OnCloseBarrage));

            DatabinTable <ResDefeatBarrageText, ushort> databinTable = new DatabinTable <ResDefeatBarrageText, ushort>("Databin/Client/Text/DefeatBarrageText.bytes", "wID");

            for (int i = 0; i < this.m_allAchievements.Length; i++)
            {
                if (this.m_allAchievements[i])
                {
                    this.m_curAchievemnt = (RES_SHOW_ACHIEVEMENT_TYPE)i;
                    break;
                }
            }
            this.barrageList.Clear();
            if (databinTable != null)
            {
                Dictionary <long, object> .Enumerator enumerator = databinTable.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    KeyValuePair <long, object> current = enumerator.get_Current();
                    ResDefeatBarrageText        resDefeatBarrageText = (ResDefeatBarrageText)current.get_Value();
                    if ((RES_SHOW_ACHIEVEMENT_TYPE)resDefeatBarrageText.wAchievementType == this.m_curAchievemnt)
                    {
                        this.barrageList.Add(resDefeatBarrageText.szContent);
                    }
                }
            }
            MonoSingleton <ShareSys> .GetInstance().UpdateSharePVPForm(cUIFormScript, cUIFormScript.GetWidget(2));
        }
Ejemplo n.º 2
0
 public void LoadText(DatabinTable <ResText, ushort> textDataBin)
 {
     if (textDataBin != null)
     {
         this.m_textMap = new Dictionary <string, string>();
         Dictionary <long, object> .Enumerator enumerator = textDataBin.GetEnumerator();
         while (enumerator.MoveNext())
         {
             KeyValuePair <long, object> current = enumerator.Current;
             ResText text = (ResText)current.Value;
             this.m_textMap.Add(StringHelper.UTF8BytesToString(ref text.szKey), StringHelper.UTF8BytesToString(ref text.szValue));
         }
     }
 }
 public void LoadText(DatabinTable <ResText, ushort> textDataBin)
 {
     if (textDataBin == null)
     {
         return;
     }
     this.m_textMap = new Dictionary <int, string>();
     Dictionary <long, object> .Enumerator enumerator = textDataBin.GetEnumerator();
     while (enumerator.MoveNext())
     {
         KeyValuePair <long, object> current = enumerator.get_Current();
         ResText resText = (ResText)current.get_Value();
         this.m_textMap.Add(StringHelper.UTF8BytesToString(ref resText.szKey).JavaHashCode(), StringHelper.UTF8BytesToString(ref resText.szValue));
     }
 }
Ejemplo n.º 4
0
 public void Load_HeroSelect_ChatTemplate()
 {
     if (this.selectHeroTemplateList.Count == 0)
     {
         DatabinTable <ResTextData, uint> selectHeroChatDatabin = GameDataMgr.m_selectHeroChatDatabin;
         if (selectHeroChatDatabin != null)
         {
             Dictionary <long, object> .Enumerator enumerator = selectHeroChatDatabin.GetEnumerator();
             while (enumerator.MoveNext())
             {
                 KeyValuePair <long, object> current = enumerator.Current;
                 ResTextData data = (ResTextData)current.Value;
                 this.selectHeroTemplateList.Add(StringHelper.UTF8BytesToString(ref data.szContent));
             }
         }
     }
 }
Ejemplo n.º 5
0
        public void ShowDefeat()
        {
            if ((this.m_allAchievements != null) && (this.m_allAchievements.Length == 8))
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().OpenForm(s_formSharePVPDefeatPath, false, true);

                if (form != null)
                {
                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_CloseSharePVPDefeat, new CUIEventManager.OnUIEventHandler(this.OnCloseSharePVPDefeat));

                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_ShareDefeatAddBarrage, new CUIEventManager.OnUIEventHandler(this.OnSharePVPDefeatAddBarrage));

                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_ShareDefeatSelectBarrage, new CUIEventManager.OnUIEventHandler(this.OnSharePVPDefeatSelectBarrage));

                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_ShareDefeatBarrageEnable, new CUIEventManager.OnUIEventHandler(this.OnBarrageEnable));

                    Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.SettlementSys_CloseShareDefeatBarrage, new CUIEventManager.OnUIEventHandler(this.OnCloseBarrage));

                    DatabinTable <ResDefeatBarrageText, ushort> table = new DatabinTable <ResDefeatBarrageText, ushort>("Databin/Client/Text/DefeatBarrageText.bytes", "wID");
                    for (int i = 0; i < this.m_allAchievements.Length; i++)
                    {
                        if (this.m_allAchievements[i])
                        {
                            this.m_curAchievemnt = (RES_SHOW_ACHIEVEMENT_TYPE)i;
                            break;
                        }
                    }
                    this.barrageList.Clear();
                    if (table != null)
                    {
                        Dictionary <long, object> .Enumerator enumerator = table.GetEnumerator();
                        while (enumerator.MoveNext())
                        {
                            KeyValuePair <long, object> current = enumerator.Current;
                            ResDefeatBarrageText        text    = (ResDefeatBarrageText)current.Value;
                            if (((RES_SHOW_ACHIEVEMENT_TYPE)text.wAchievementType) == this.m_curAchievemnt)
                            {
                                this.barrageList.Add(text.szContent);
                            }
                        }
                    }
                    MonoSingleton <ShareSys> .GetInstance().UpdateSharePVPForm(form, form.GetWidget(2));
                }
            }
        }
Ejemplo n.º 6
0
 public void Load_HeroSelect_ChatTemplate()
 {
     if (this.selectHeroTemplateList.get_Count() == 0)
     {
         DatabinTable <ResHeroSelectTextData, uint> selectHeroChatDatabin = GameDataMgr.m_selectHeroChatDatabin;
         if (selectHeroChatDatabin == null)
         {
             return;
         }
         Dictionary <long, object> .Enumerator enumerator = selectHeroChatDatabin.GetEnumerator();
         while (enumerator.MoveNext())
         {
             KeyValuePair <long, object>     current = enumerator.get_Current();
             ResHeroSelectTextData           resHeroSelectTextData = (ResHeroSelectTextData)current.get_Value();
             CChatModel.HeroChatTemplateInfo heroChatTemplateInfo  = new CChatModel.HeroChatTemplateInfo(0);
             heroChatTemplateInfo.dwID           = (int)resHeroSelectTextData.dwID;
             heroChatTemplateInfo.dwGroupID      = (int)resHeroSelectTextData.dwGroupID;
             heroChatTemplateInfo.dwTag          = (int)resHeroSelectTextData.dwTag;
             heroChatTemplateInfo.templateString = StringHelper.UTF8BytesToString(ref resHeroSelectTextData.szContent);
             this.selectHeroTemplateList.Add(heroChatTemplateInfo);
         }
     }
 }