Exemplo n.º 1
0
        public override void Awake()
        {
            base.Awake();
            Instance = this;

            var t = controller.transform;

            ScreenCollider       = t.FindEx("Collider").gameObject;
            VictoryAnimation     = t.FindEx("VictoryObj").gameObject;
            DefeatRating         = t.FindEx("BattleDefeatRating").gameObject;
            DefeatAnimation      = t.FindEx("DefeatObj").gameObject;
            CampaignRating       = t.FindEx("CampaignRatingGM").gameObject;
            CommonCampaignRating = t.FindEx("CommonBuddyRatingGM").gameObject;
            LadderRating         = t.FindEx("LadderRatingGM").gameObject;
            ResInstanceRating    = t.FindEx("ResInstanceRatingGM").gameObject;
            ArenaRating          = t.FindEx("ArenaRatingGM").gameObject;
            WorldBossRating      = t.FindEx("WorldBoss").gameObject;
            HonorArenaResult     = t.FindEx("HonorArenaResult").gameObject;
            heroBattleResult     = t.GetMonoILRComponent <LTHeroBattleResultView>("HeroBattleResultGM");
            m_CombatResult       = eCombatOutcome.Win;
            DarkObj      = t.FindEx("Dark").gameObject;
            ContinueTips = t.FindEx("TipPanel/Tip").gameObject;
            timeTips     = t.GetComponent <UILabel>("TipPanel/Time");
            AnalyseBtn   = t.FindEx("TipPanel/BattleAnalyse").gameObject;
            AnalyseBtn.GetComponent <UIButton>().onClick.Add(new EventDelegate(OnAnalyseBtnClick));
            debugTest  = false;
            reviveCost = 5000;

            t.GetComponent <UIEventTrigger>("Collider").onClick.Add(new EventDelegate(OnContinueClick));
        }
Exemplo n.º 2
0
        public override void Awake()
        {
            base.Awake();

            var t = mDMono.transform;

            DefeatFX  = t.parent.FindEx("DefeatObj").gameObject;
            SkipPanel = t.FindEx("Grid").gameObject;
            PartnersDevelopRecommendMark             = t.FindEx("Grid/Item/Recommend").gameObject;
            PartnersEquipRecommendMark               = t.FindEx("Grid/Item (1)/Recommend").gameObject;
            PartnersIllustratedHandbookRecommendMark = t.FindEx("Grid/Item (2)/Recommend").gameObject;
            sDefeatSkip = false;

            t.GetComponent <UIButton>("Grid/Item/Frame").onClick.Add(new EventDelegate(OnGotoPartnersDevelop));
            t.GetComponent <UIButton>("Grid/Item (1)/Frame").onClick.Add(new EventDelegate(OnGotoPartnersEquip));
            t.GetComponent <UIButton>("Grid/Item (2)/Frame").onClick.Add(new EventDelegate(OnGotoPartnersIllustratedHandbook));

            _battleResultScreenController = t.parent.GetUIControllerILRComponent <BattleResultScreenController>();
        }
Exemplo n.º 3
0
 private void DealError(EB.Sparx.Response result)
 {
     if (result.error.ToString() == "ID_ERROR_NOT_IN_BATTLE")
     {
         LoadingSpinner.Hide();
         if (!LTCombatEventReceiver.Instance.IsBattleOver)
         {
             EB.Sparx.Request request2 = endPoint.Get("/playstate/getPlayState");
             endPoint.Service(request2, (result2) => {
                 if (result != null)
                 {
                     DataLookupsCache.Instance.CacheData(result2.hashtable);
                     LTCombatHudController.Instance.ShowBattleResultScreen(SceneLogic.BattleType, MainLandLogic.GetInstance().m_CombatOutCome, false);
                 }
             });
         }
     }
     else if (result.error.ToString().Contains("user is in another battle, combat_id = "))
     {
         BattleResultScreenController.DirectExitCombat();
     }
     else if (result.error.ToString().Contains("EndWrite failure") || result.error.ToString().Contains("ID_SPARX_ERROR_NOT_CONNECTED"))
     {
         SparxHub.Instance.Disconnect(false);
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_SPARX_ERROR_NOT_CONNECTED"));
     }
     else if (result.error.ToString().Contains("socket hang up") || result.error.ToString().Contains("connection timed out"))
     {
         EB.Debug.LogError(result.error);
         SparxHub.Instance.Disconnect(false);
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_SPARX_ERROR_NOT_CONNECTED"));
     }
     else
     {
         EB.Debug.LogError(result.error);
     }
 }
Exemplo n.º 4
0
 public override void OnDestroy()
 {
     Instance = null;
 }
Exemplo n.º 5
0
        public void OnSceneTransition(object payload)
        {
            int       type          = EB.Dot.Integer("combatType", payload, 0);
            bool      isFastCombat  = EB.Dot.Bool("isFastCombat", payload, false);
            ArrayList battlerMetric = Hotfix_LT.EBCore.Dot.Array("battlerMetric", payload, Johny.ArrayListPool.Claim());

            DataLookupsCache.Instance.CacheData("battlerMetric", battlerMetric);

            DataLookupsCache.Instance.CacheData("honorBattleResult", EBCore.Dot.Array("honorBattleResult", payload, Johny.ArrayListPool.Claim()));

            if (isFastCombat)
            {
                if (type == (int)eBattleType.HonorArena)
                {
                    GlobalMenuManager.Instance.ComebackToMianMenu();
                    ShowQuickBattleResult(payload, type);
                }
                else if ((type == (int)eBattleType.LadderBattle))
                {
                    GlobalMenuManager.Instance.CloseMenu("LTHeroBattleMenu");
                    if (LadderController.Instance != null)
                    {
                        LadderController.Instance.StopMatch(true);
                    }
                    ShowQuickBattleResult(payload, type);
                }
                else
                {
                    SceneLogic.BattleType = eBattleType.ChallengeCampaign;
                    bool isCombatWon = EB.Dot.Bool("isCombatWon", payload, false);

                    System.Action callback = delegate()
                    {
                        Hotfix_LT.Messenger.Raise(EventName.ChallengeBattle, false);
                    };
                    if (isCombatWon)
                    {
                        //挑战副本在奖励界面关闭后再发送广播请求状态同步
                        var ht = Johny.HashtablePool.Claim();
                        ht.Add("reward", BattleResultScreenController.GetRewardItemDatas());
                        ht.Add("callback", callback);
                        GlobalMenuManager.Instance.Open("LTShowRewardView", ht);
                    }
                    else
                    {
                        callback();
                    }
                }

                return;
            }

            long combatid = EB.Dot.Long("combatId", payload, 0);

            if (combatid == m_currentCombatId || combatid == 0)
            {
                PlayerManagerForFilter.Instance.StopShowPlayer();
                if (MainLandLogic.GetInstance() != null)
                {
                    MainLandLogic.GetInstance().OnSceneTransitionResponse(payload as Hashtable);
                }
            }
            else if (type == (int)eBattleType.MainCampaignBattle || type == (int)eBattleType.ArenaBattle)
            {
                //快速战斗展示奖励
                ShowQuickBattleResult(payload, type);
            }
            else
            {
                for (int i = 0; i < m_combatQueue.Count; i++)
                {
                    if (m_combatQueue[i].combatid == combatid)
                    {
                        m_combatQueue.Remove(m_combatQueue[i]);
                        return;
                    }
                }
            }
        }
Exemplo n.º 6
0
 public override void Dispose()
 {
     Hotfix_LT.Messenger.RemoveListener <int, System.Action <EB.Sparx.Response> >(Hotfix_LT.EventName.CombatCleanUp, RequestExitCombat);
     Hotfix_LT.Messenger.RemoveListener(Hotfix_LT.EventName.DirectExitCombat, delegate() { BattleResultScreenController.DirectExitCombat(); });
     Hotfix_LT.Messenger.RemoveListener <string, Hashtable>(Hotfix_LT.EventName.DoDebugAction, DoDebugAction);
 }
Exemplo n.º 7
0
        public override void Initialize(EB.Sparx.Config config)
        {
            s_endpoint = SparxHub.Instance.ApiEndPoint;
            Hotfix_LT.Messenger.AddListener <int, System.Action <EB.Sparx.Response> >(Hotfix_LT.EventName.CombatCleanUp, RequestExitCombat);
            Hotfix_LT.Messenger.AddListener(Hotfix_LT.EventName.DirectExitCombat, delegate() { BattleResultScreenController.DirectExitCombat(); });
            Hotfix_LT.Messenger.AddListener <string, Hashtable>(Hotfix_LT.EventName.DoDebugAction, DoDebugAction);

            LT.MainMessenger.AddListener <int, Action <Response> >("CombatEditorRequestExitCombat", RequestExitCombat);
        }