Example #1
0
 private void OnClickBottomFold(CUIEvent evt)
 {
     if (WatchForm.IsNeedShowCampMidInterface())
     {
         CUIAnimatorScript componetInChild = Utility.GetComponetInChild <CUIAnimatorScript>(this._form.gameObject, "DetailControl");
         if (componetInChild && !this._isBottomInAnimDoing)
         {
             this._isBottomFold        = !this._isBottomFold;
             this._isBottomInAnimDoing = true;
             if (this._isBottomFold)
             {
                 componetInChild.PlayAnimator(this._isBottomLong ? "UpAndDown_1_1" : "UpAndDown_2_1");
             }
             else
             {
                 componetInChild.PlayAnimator(this._isBottomLong ? "UpAndDown_1_2" : "UpAndDown_2_2");
             }
         }
     }
     else
     {
         CUIAnimatorScript componetInChild2 = Utility.GetComponetInChild <CUIAnimatorScript>(this._form.gameObject, "HeroInfoHud");
         CUIAnimatorScript componetInChild3 = Utility.GetComponetInChild <CUIAnimatorScript>(this._form.gameObject, "ReplayControl");
         if (componetInChild2 && componetInChild3)
         {
             this._isBottomFold = !this._isBottomFold;
             componetInChild2.PlayAnimator(this._isBottomFold ? "Close" : "Open");
             componetInChild3.PlayAnimator(this._isBottomFold ? "Close" : "Open");
         }
     }
 }
Example #2
0
 private void OnHeroEpChange(PoolObjHandle <ActorRoot> hero, int iCurVal, int iMaxVal)
 {
     if (!WatchForm.IsNeedShowCampMidInterface() && this._heroInfoHud != null && hero.handle.ObjID == this._heroInfoHud.PickedHeroID)
     {
         this._heroInfoHud.ValidateEp();
     }
 }
Example #3
0
 public static string GetWatchFormName()
 {
     if (WatchForm.IsNeedShowCampMidInterface())
     {
         return("UGUI/Form/Battle/Form_Watch_Competition.prefab");
     }
     return("UGUI/Form/Battle/Form_Watch.prefab");
 }
Example #4
0
 private void OnSkillEnable(ref DefaultSkillEventParam _param)
 {
     if (WatchForm.IsNeedShowCampMidInterface())
     {
         HeroInfoSideItem heroInfoSideItem = null;
         if (this._heroWrapSideDict.TryGetValue(_param.actor.handle.ObjID, out heroInfoSideItem) && _param.slot == SkillSlotType.SLOT_SKILL_3)
         {
             heroInfoSideItem.ValidateSkill3();
         }
     }
 }
Example #5
0
 private void OnBattleEquipChange(uint actorObjectID, stEquipInfo[] equips, bool bIsAdd, int iEquipSlotIndex)
 {
     if (this._heroWrapDict.ContainsKey(actorObjectID))
     {
         this._heroWrapDict[actorObjectID].ValidateEquip();
     }
     if (!WatchForm.IsNeedShowCampMidInterface() && this._heroInfoHud != null && actorObjectID == this._heroInfoHud.PickedHeroID)
     {
         this._heroInfoHud.ValidateEquip();
     }
 }
Example #6
0
 private void OnBattleMoneyChange(PoolObjHandle <ActorRoot> actor, int changeValue, bool isIncome, PoolObjHandle <ActorRoot> target)
 {
     this.ValidateCampMoney();
     if (this._heroWrapDict.ContainsKey(actor.handle.ObjID))
     {
         this._heroWrapDict[actor.handle.ObjID].ValidateMoney();
     }
     if (!WatchForm.IsNeedShowCampMidInterface() && this._heroInfoHud != null && actor.handle.ObjID == this._heroInfoHud.PickedHeroID)
     {
         this._heroInfoHud.ValidateMoney();
     }
 }
Example #7
0
 private void OnClickBottomFold_End(CUIEvent evt)
 {
     if (WatchForm.IsNeedShowCampMidInterface())
     {
         this._form.m_sgameGraphicRaycaster.RefreshGameObject(Utility.FindChild(this._form.gameObject, "DetailControl"));
     }
     else
     {
         this._form.m_sgameGraphicRaycaster.RefreshGameObject(Utility.FindChild(this._form.gameObject, "HeroInfoHud"));
     }
     this._isBottomInAnimDoing = false;
 }
Example #8
0
 public void ValidateMoney()
 {
     if (this._moneyText == null)
     {
         return;
     }
     if (WatchForm.IsNeedShowCampMidInterface())
     {
         this._moneyText.set_text(string.Format("{0:N1}k", (float)this._heroInfo.TotalCoin * 0.001f));
     }
     else
     {
         this._moneyText.set_text(this._heroInfo.TotalCoin.ToString());
     }
 }
Example #9
0
        public bool OpenForm()
        {
            this._form = Singleton <CUIManager> .GetInstance().OpenForm(WatchForm.GetWatchFormName(), false, true);

            if (null == this._form)
            {
                return(false);
            }
            this._scoreHud = new WatchScoreHud(Utility.FindChild(this._form.gameObject, "ScoreBoard"));
            if (WatchForm.IsNeedShowCampMidInterface())
            {
                this._detailPanel       = this._form.GetWidget(0);
                this._camp1BaseList     = Utility.GetComponetInChild <CUIListScript>(this._detailPanel, "BaseInfoList1");
                this._camp1EquipList    = Utility.GetComponetInChild <CUIListScript>(this._detailPanel, "EquipInfoList1");
                this._camp2BaseList     = Utility.GetComponetInChild <CUIListScript>(this._detailPanel, "BaseInfoList2");
                this._camp2EquipList    = Utility.GetComponetInChild <CUIListScript>(this._detailPanel, "EquipInfoList2");
                this._camp1List         = Utility.FindChild(this._form.gameObject, "CampInfoList_1");
                this._camp2List         = Utility.FindChild(this._form.gameObject, "CampInfoList_2");
                this._camp1BaseSideList = Utility.GetComponetInChild <CUIListScript>(this._camp1List, "BaseInfoList");
                this._camp2BaseSideList = Utility.GetComponetInChild <CUIListScript>(this._camp2List, "BaseInfoList");
            }
            else
            {
                this._camp1List         = Utility.FindChild(this._form.gameObject, "CampInfoList_1");
                this._camp1BaseList     = Utility.GetComponetInChild <CUIListScript>(this._camp1List, "BaseInfoList");
                this._camp1EquipList    = Utility.GetComponetInChild <CUIListScript>(this._camp1List, "EquipInfoList");
                this._camp2List         = Utility.FindChild(this._form.gameObject, "CampInfoList_2");
                this._camp2BaseList     = Utility.GetComponetInChild <CUIListScript>(this._camp2List, "BaseInfoList");
                this._camp2EquipList    = Utility.GetComponetInChild <CUIListScript>(this._camp2List, "EquipInfoList");
                this._camp1BaseSideList = null;
                this._camp2BaseSideList = null;
            }
            this._hideBtn       = Utility.FindChild(this._form.gameObject, "PanelBtn/HideBtn");
            this._showBtn       = Utility.FindChild(this._form.gameObject, "PanelBtn/ShowBtn");
            this.competitionBtn = Utility.FindChild(this._form.gameObject, "PanelBtn/competitionBtn");
            this.competitionBtn.CustomSetActive(Singleton <WatchController> .GetInstance().CanShowActorIRPosMap());
            if (!WatchForm.IsNeedShowCampMidInterface())
            {
                this._heroInfoHud   = new HeroInfoHud(Utility.FindChild(this._form.gameObject, "HeroInfoHud"));
                this._replayControl = new ReplayControl(Utility.FindChild(this._form.gameObject, "ReplayControl"));
            }
            else
            {
                this._heroInfoHud   = null;
                this._replayControl = new ReplayControl(Utility.FindChild(this._form.gameObject, "PanelBtn"));
            }
            return(true);
        }
Example #10
0
 public CUIFormScript LoadForm(CBattleSystem.FormType formType)
 {
     if (formType == CBattleSystem.FormType.Fight)
     {
         return(Singleton <CUIManager> .GetInstance().OpenForm(FightForm.s_battleUIForm, false, true));
     }
     if (formType == CBattleSystem.FormType.Watch)
     {
         if (Singleton <WatchController> .GetInstance().CanShowActorIRPosMap())
         {
             Singleton <CBattleStatCompetitionSystem> .GetInstance().PreLoadForm();
         }
         return(Singleton <CUIManager> .GetInstance().OpenForm(WatchForm.GetWatchFormName(), false, true));
     }
     return(null);
 }
Example #11
0
 private void OnHeroLevelChange(PoolObjHandle <ActorRoot> hero, int level)
 {
     if (this._heroWrapDict.ContainsKey(hero.handle.ObjID))
     {
         this._heroWrapDict[hero.handle.ObjID].ValidateLevel();
     }
     if (WatchForm.IsNeedShowCampMidInterface())
     {
         if (this._heroWrapSideDict.ContainsKey(hero.handle.ObjID))
         {
             this._heroWrapSideDict[hero.handle.ObjID].ValidateLevel();
         }
     }
     else if (this._heroInfoHud != null && hero.handle.ObjID == this._heroInfoHud.PickedHeroID)
     {
         this._heroInfoHud.ValidateLevel();
     }
 }
Example #12
0
        private void OnSkillCDChanged(ref DefaultSkillEventParam _param)
        {
            if (this._heroInfoHud != null && _param.actor.handle.ObjID == this._heroInfoHud.PickedHeroID)
            {
                this._heroInfoHud.TheSkillHud.ValidateCD(_param.slot);
            }
            HeroInfoItem heroInfoItem = null;

            if (this._heroWrapDict.TryGetValue(_param.actor.handle.ObjID, out heroInfoItem))
            {
                heroInfoItem.ValidateCD(_param.slot, _param.actor);
            }
            if (WatchForm.IsNeedShowCampMidInterface())
            {
                HeroInfoSideItem heroInfoSideItem = null;
                if (this._heroWrapSideDict.TryGetValue(_param.actor.handle.ObjID, out heroInfoSideItem) && _param.slot == SkillSlotType.SLOT_SKILL_3)
                {
                    heroInfoSideItem.ValidateSkill3();
                }
            }
        }
Example #13
0
        private void OnBttleMatchInfoTabChange(CUIEvent uiEvent)
        {
            CUIListScript component = uiEvent.m_srcWidget.GetComponent <CUIListScript>();

            if (component == null)
            {
                return;
            }
            int selectedIndex = component.GetSelectedIndex();

            if (selectedIndex < 0 || selectedIndex >= component.GetElementAmount())
            {
                return;
            }
            this._defaultSelectIndex = selectedIndex;
            CUIFormScript statViewFormScript = this.m_statViewFormScript;

            if (statViewFormScript == null)
            {
                return;
            }
            if (statViewFormScript != null)
            {
                if (this.heroView == null && this.matchInfo == null && this.valueInfo == null)
                {
                    return;
                }
                this.SortHeroAndPlayer();
                if (this._defaultSelectIndex == 0)
                {
                    this.heroView.CustomSetActive(true);
                    this.matchInfo.CustomSetActive(true);
                    this.valueInfo.CustomSetActive(false);
                    this.sortByCoinBtn.CustomSetActive(true);
                    this.UpdateKDAView();
                    if (this.chartView != null)
                    {
                        this.chartView.Hide();
                    }
                }
                else if (this._defaultSelectIndex == 1)
                {
                    this.heroView.CustomSetActive(true);
                    this.matchInfo.CustomSetActive(false);
                    this.valueInfo.CustomSetActive(true);
                    this.sortByCoinBtn.CustomSetActive(true);
                    this.m_battleHeroPropertyChange = true;
                    this.UpdateBattleState(null);
                    if (this.chartView != null)
                    {
                        this.chartView.Hide();
                    }
                }
                else
                {
                    this.heroView.CustomSetActive(false);
                    this.matchInfo.CustomSetActive(false);
                    this.valueInfo.CustomSetActive(false);
                    this.sortByCoinBtn.CustomSetActive(false);
                    this.m_battleHeroPropertyChange = false;
                    WatchForm watchForm = Singleton <CBattleSystem> .GetInstance().WatchForm;

                    if (watchForm != null && this.chartView != null)
                    {
                        this.chartView.Show((this._defaultSelectIndex != 2) ? BattleStatView.ChartView.ChartType.MoneyTrend : BattleStatView.ChartView.ChartType.ExpTrend, (this._defaultSelectIndex != 2) ? watchForm.moneySample : watchForm.expSample, Singleton <CUIManager> .GetInstance().GetForm(BattleStatView.s_battleStateViewUIForm));
                    }
                }
            }
        }
Example #14
0
 private void OnToggleHide(CUIEvent uiEvent)
 {
     if (this._form && this._form.gameObject)
     {
         this._isViewHide = !this._isViewHide;
         this.SwitchCameraZoom();
         if (!WatchForm.IsNeedShowCampMidInterface())
         {
             this._hideBtn.CustomSetActive(!this._isViewHide);
             this._showBtn.CustomSetActive(this._isViewHide);
             this.DisableAnimator(Utility.FindChild(this._camp1List, "EquipInfoList"));
             this._camp1List.CustomSetActive(!this._isViewHide);
             this.DisableAnimator(Utility.FindChild(this._camp2List, "EquipInfoList"));
             this._camp2List.CustomSetActive(!this._isViewHide);
             if (!WatchForm.IsNeedShowCampMidInterface())
             {
                 this.DisableAnimator(this._heroInfoHud.Root);
                 this._heroInfoHud.Root.CustomSetActive(!this._isViewHide);
             }
             if (this._replayControl != null && !WatchForm.IsNeedShowCampMidInterface())
             {
                 this.DisableAnimator(this._replayControl.Root);
                 this._replayControl.Root.CustomSetActive(!this._isViewHide);
             }
         }
         else if (!this._isBottomInAnimDoing)
         {
             CUIAnimatorScript componetInChild = Utility.GetComponetInChild <CUIAnimatorScript>(this._form.gameObject, "CampInfoList_1");
             if (componetInChild)
             {
                 bool flag = this._isCampFold_1 != this._isViewHide;
                 this._isCampFold_1 = this._isViewHide;
                 if (flag)
                 {
                     componetInChild.PlayAnimator(this._isCampFold_1 ? "Hide_Left_1" : "Hide_Left_2");
                 }
             }
             CUIAnimatorScript componetInChild2 = Utility.GetComponetInChild <CUIAnimatorScript>(this._form.gameObject, "CampInfoList_2");
             if (componetInChild2)
             {
                 bool flag2 = this._isCampFold_2 != this._isViewHide;
                 this._isCampFold_2 = this._isViewHide;
                 if (flag2)
                 {
                     componetInChild2.PlayAnimator(this._isCampFold_2 ? "Hide_Right_1" : "Hide_Right_2");
                 }
             }
             CUIAnimatorScript componetInChild3 = Utility.GetComponetInChild <CUIAnimatorScript>(this._form.gameObject, "DetailControl");
             if (componetInChild3)
             {
                 bool flag3 = this._isBottomFold != this._isViewHide;
                 this._isBottomFold = this._isViewHide;
                 if (flag3)
                 {
                     this._isBottomInAnimDoing = true;
                     if (this._isBottomFold)
                     {
                         componetInChild3.PlayAnimator(this._isBottomLong ? "UpAndDown_1_1" : "UpAndDown_2_1");
                     }
                     else
                     {
                         componetInChild3.PlayAnimator(this._isBottomLong ? "UpAndDown_1_2" : "UpAndDown_2_2");
                     }
                 }
             }
         }
         this.m_targetScaleVal = (this._isViewHide ? 1.6f : 1.2f);
     }
 }
Example #15
0
        public void LateUpdate()
        {
            if (this._heroWrapDict == null)
            {
                return;
            }
            if (!Singleton <WatchController> .GetInstance().IsWatching)
            {
                this.CloseForm();
                bool flag = true;
                if (flag)
                {
                    Singleton <SettlementSystem> .GetInstance().ShowSettlementPanel(true);
                }
                Singleton <GameBuilder> .GetInstance().EndGame();

                return;
            }
            uint curFrameNum = Singleton <FrameSynchr> .GetInstance().CurFrameNum;

            if (curFrameNum < this._lastUpdateFrame + 3u)
            {
                return;
            }
            this._lastUpdateFrame = curFrameNum;
            DictionaryView <uint, HeroInfoItem> .Enumerator enumerator = this._heroWrapDict.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, HeroInfoItem> current = enumerator.Current;
                current.get_Value().LateUpdate();
                if (this._kdaChanged)
                {
                    KeyValuePair <uint, HeroInfoItem> current2 = enumerator.Current;
                    current2.get_Value().ValidateKDA();
                }
            }
            if (WatchForm.IsNeedShowCampMidInterface())
            {
                DictionaryView <uint, HeroInfoSideItem> .Enumerator enumerator2 = this._heroWrapSideDict.GetEnumerator();
                while (enumerator2.MoveNext())
                {
                    KeyValuePair <uint, HeroInfoSideItem> current3 = enumerator2.Current;
                    current3.get_Value().LateUpdate();
                }
            }
            if (this._heroInfoHud != null)
            {
                this._heroInfoHud.LateUpdate();
                if (this._kdaChanged)
                {
                    this._heroInfoHud.ValidateKDA();
                }
            }
            if (this._scoreHud != null)
            {
                this._scoreHud.LateUpdate();
            }
            if (this._replayControl != null)
            {
                this._replayControl.LateUpdate();
            }
            this._kdaChanged = false;
        }
Example #16
0
        public void BattleStart()
        {
            if (this._heroWrapDict != null)
            {
                return;
            }
            this._lastUpdateFrame = 0u;
            this.TargetHeroId     = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain.handle.ObjID;

            this._heroWrapDict = new DictionaryView <uint, HeroInfoItem>();
            if (WatchForm.IsNeedShowCampMidInterface())
            {
                this._heroWrapSideDict = new DictionaryView <uint, HeroInfoSideItem>();
            }
            List <HeroKDA> list          = new List <HeroKDA>();
            List <HeroKDA> list2         = new List <HeroKDA>();
            CPlayerKDAStat playerKDAStat = Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat;

            DictionaryView <uint, PlayerKDA> .Enumerator enumerator = playerKDAStat.GetEnumerator();
            while (enumerator.MoveNext())
            {
                KeyValuePair <uint, PlayerKDA> current = enumerator.Current;
                PlayerKDA value = current.get_Value();
                if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                {
                    ListView <HeroKDA> .Enumerator enumerator2 = value.GetEnumerator();
                    while (enumerator2.MoveNext())
                    {
                        list.Add(enumerator2.Current);
                    }
                }
                else if (value.PlayerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_2)
                {
                    ListView <HeroKDA> .Enumerator enumerator3 = value.GetEnumerator();
                    while (enumerator3.MoveNext())
                    {
                        list2.Add(enumerator3.Current);
                    }
                }
            }
            this.InitCampInfoUIList(COM_PLAYERCAMP.COM_PLAYERCAMP_1, list, this._camp1BaseList, this._camp1EquipList, this._camp1BaseSideList);
            this.InitCampInfoUIList(COM_PLAYERCAMP.COM_PLAYERCAMP_2, list2, this._camp2BaseList, this._camp2EquipList, this._camp2BaseSideList);
            Singleton <WatchController> .GetInstance().SwitchObserveCamp(COM_PLAYERCAMP.COM_PLAYERCAMP_COUNT);

            this.FocusHero(this.TargetHeroId);
            this.ValidateCampMoney();
            if (this._heroInfoHud != null)
            {
                this._heroInfoHud.FightStart();
            }
            this.RegisterEvents();
            this._isBottomFold = false;
            this._isCampFold_1 = false;
            this.OnClickCampFold_1(null);
            this._isCampFold_2 = false;
            this.OnClickCampFold_2(null);
            this._isBottomLong = true;
            this.OnClickBottomEquipFold(null);
            this._isViewHide = false;
            float step = 150u * Singleton <WatchController> .GetInstance().FrameDelta * 0.001f;

            this.moneySample = new SampleData(step);
            this.expSample   = new SampleData(step);
            this.dragonKillInfos.Clear();
            this._lastSampleTime = 0f;
            Moba_Camera mobaCamera = MonoSingleton <CameraSystem> .GetInstance().MobaCamera;

            this.m_targetScaleVal = 1.2f;
            if (null != mobaCamera)
            {
                mobaCamera.currentZoomRate = 1.2f;
                mobaCamera.CameraUpdate();
            }
        }