| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704 |
- local UIBattleView = require("UIBattle/UIBattleView_Generate")
- local UIChatRoot = require("UIChat/UIChatRoot")
- local BattleBossBloodPart = require("UIBattle/BattleBossBloodPart")
- local BattleHeadsBoxPart = require("UIBattle/BattleHeadsBoxPart")
- local BattleStatisticsPart = require("UIBattle/BattleStatisticsPart")
- local BattleReplayControlPart = require("UIBattle/BattleReplayControlPart")
- local LoopType = DG.Tweening.LoopType
- local NewBattleChatPart = require("UIBattle/NewBattleChatPart")
- local UIMainCtr = ManagerContainer.LuaUIMgr:GetViewCtrById(Enum.UIPageName.UIMain)
- local updateHandle
- local needRefreshMinimap = false
- local minimapCurTime = 0
- local minimapInterTime = 0.1
- local curSelectedData
- local stageGoalGridSpacing = {Vector2.New(0, 0), Vector2.New(-10, 0), Vector2.New(-20, 0)}
- local newStageCompeleted = false
- local levelIncreaseTimer
- local increaseIdx
- local bBossStage = false
- local bBoxState = false
- local bossFightCDRemainTime = 0
- local curRemainSecond = 0
- local bossMaskTimer
- local chatDisplayDurationTime
- local chatHideTimer
- local windowREPos
- local pageToggleData = {}
- function UIBattleView:OnAwake(data)
- self.controller = require("UIBattle/UIBattleCtr"):new()
- self.controller:Init(self)
- self.controller:SetData(data)
- end
- function UIBattleView:FillContent(data, uiBase)
- self.uiBase = uiBase
- local gameObject = self.uiBase:GetRoot()
- if gameObject ~= nil then
- self.gameObject = gameObject
- self.transform = gameObject.transform
- end
- self:InitGenerate(self.transform, data)
- if not updateHandle then
- updateHandle = UpdateBeat:CreateListener(self.Update, self)
- end
- UpdateBeat:AddListener(updateHandle)
- self.RewardBoxBtnPos = CommonUtil.ConvertUIPos2ScreenPos(self.RewardBoxBtn.transform.position)
- self.RewardBoxBtnPos.y =self.RewardBoxBtnPos.y;
- self:InitComs();
- self:Init()
- self:OnMapModeChange(ManagerContainer.LuaBattleMgr:GetBattleMode())
- needRefreshMinimap = true
- self.MapRootGo:SetActive(true)
- -- if ManagerContainer.LuaBattleMgr.GetCurSimpleLvID() >= 50018 then
- -- self.difficultBtn:SetActive(true)
- -- end
- --self.ProfitBoxGo:SetActive(true)
- end
- function UIBattleView:InitComs()
- -- self.levelNameGo:SetActive(false);
- self.exploringTrans:SetActive(false);
- self.rageBoxGo:SetActive(false);
- self.battleFailGo:SetActive(false);
- end
- function UIBattleView:Init()
- self.statTime1 = GlobalConfig.Instance:GetConfigIntValue(53) * 60000;
- self.statTime2 = GlobalConfig.Instance:GetConfigIntValue(54) * 60000;
- self.statTime3 = GlobalConfig.Instance:GetConfigIntValue(55) * 60000;
- self.statTime4 = GlobalConfig.Instance:GetConfigIntValue(56) * 60000;
- self.maxCruise = 10000;
- self.challengeAnimName = "BtnBoss1"
- self.controller:InitHeroData()
- self.recordSpeed = 1;
- self:OnRefreshEarnings();
- self:OnRefreshRewardTime();
- self:LoadMinimap()
- self:InitCruise()
- --self:RefreshChatBg()
- --self:RefreshStageGoalUI()
- --self:InitWorldChat()
- local openStatus = ManagerContainer.UIFuncUnlockMgr:GetNeedDisplayNewFuncStatus()
- if openStatus then
- self:FuncOpen1()
- else
- self.newOpen:SetActive(false)
- end
- self.btnAuto:SetActive(false)
- self:InitMinimapGoes()
- local curChatType = self.controller:GetChatChannelType()
- self.controller:SetChatChannelType(curChatType)
- --self:SetToggleGroupStatus(curChatType)
-
- if self.BossBloodPart == nil then
- self.BossBloodPart = BattleBossBloodPart:new()
- end
- if self.HeadsBoxPart == nil then
- self.HeadsBoxPart = BattleHeadsBoxPart:new()
- end
- if self.StatisticsPart == nil then
- self.StatisticsPart = BattleStatisticsPart:new()
- end
- if self.battleReplayPart == nil then
- self.battleReplayPart = BattleReplayControlPart:new()
- end
- if self.NewBattleChatPart == nil then
- self.NewBattleChatPart = NewBattleChatPart:new()
- end
- self.NewBattleChatPart:InitGo(self,self.uiBase:FindChildGo("UIBattle/NewBattleChat"),true,self.btnChat)
- self.BossBloodPart:InitGo(self,self.uiBase:FindChildGo("UIBattle/BattleBossBlood"))
- self.HeadsBoxPart:InitGo(self,self.uiBase:FindChildGo("UIBattle/BattleHeadsBox"))
- self.StatisticsPart:InitGo(self,self.uiBase:FindChildGo("UIBattle/BattleStatistics"))
- self.battleReplayPart:InitGo(self,self.uiBase:FindChildGo("UIBattle/BattleReplayControl"))
- self.BossBloodPart:Hide()
- self.HeadsBoxPart:Hide()
- self.StatisticsPart:Hide()
- self.battleReplayPart:Hide()
- self.chatView:SetActive(true)
- self.battleLogView:SetActive(false)
- self:RestoreSpeed()
- windowREPos = self.windowEnvelope.transform.position
- self:OnRedEnvelopeRemainTimeRefresh()
- self:RefreshOnlineRecordBtn()
- end
- function UIBattleView:InitMinimapGoes()
- self.miniMapGoes = {}
- self.miniMapGoes[#self.miniMapGoes+1] = self.minimap.rectTransform
- for idx=1,6 do
- self.miniMapGoes[#self.miniMapGoes+1] = self["enemy"..idx].rectTransform
- end
- end
- ------------------在线奖励
- --刷新时间
- function UIBattleView:RefreshOnlineTime()
- if nil == self.OnlineRewards then
- return
- end
- --临时处理 之后改为多解锁条件
- local IsActive = self.OnlineRewards.activeInHierarchy
- local IsBossFight = ManagerContainer.LuaBattleMgr:GetBossFightState()
- if IsBossFight then
- if IsActive then
- self.OnlineRewards:SetActive(false)
- end
- else
- local unlockState = ManagerContainer.UIFuncUnlockMgr:GetFuncLockStatusById(70)
- if unlockState and not IsActive then
- self.OnlineRewards:SetActive(true)
- self:RefreshOnlineRecordBtn(true)
- end
- end
- self:RefreshOnlineAnimRecord()
- local bIsOver,strTime = ManagerContainer.LuaBattleMgr:UpdateOnlineTime()
- if not bIsOver then
- self.btnOnlineRewards.OnlineTimeLbl.text.text = strTime
- end
- end
- --刷新按钮
- function UIBattleView:RefreshOnlineDownBtn(state)
- self.btnOnlineRewards.times:SetActive(false)
- self.btnOnlineRewards.getRewards:SetActive(false)
- self.btnOnlineRewards.tomorrow:SetActive(false)
- if state == Enum.EnumOnineState.RunTime then
- self.btnOnlineRewards.times:SetActive(true)
- elseif state == Enum.EnumOnineState.Receive then
- self.btnOnlineRewards.getRewards:SetActive(true)
- elseif state == Enum.EnumOnineState.ToDayFinished then
- self.btnOnlineRewards.tomorrow:SetActive(true)
- end
- end
- --刷新领取道具
- function UIBattleView:RefreshOnlineItem(state)
- local ItemId = nil
- local ItemCount = nil
- local Time,tbRwards = ManagerContainer.LuaBattleMgr:GetNextTotalOnlineTime()
- --LogError(Inspect(tbRwards))
- if tbRwards then
- ItemId = tbRwards[1][1]
- ItemCount = tbRwards[1][2]
- end
- if nil ~= ItemId then
- local ItemObj = self.OnlineRewards.iconSmallItem
- CommonUtil.SetRewardItemData(self,ItemId,ItemObj,ItemCount, self.OnClickItem)
- end
- self:RefreshOnlineAnimRecord()
- end
- --点击道具
- function UIBattleView:OnClickItem(btn,params)
- local state = ManagerContainer.LuaBattleMgr:GetOnlineState()
- if state == Enum.EnumOnineState.Receive then
- self:OnClickOnlineRecord()
- else
- local logicData = params[0]
- ManagerContainer.LuaUIMgr:OpenTips(logicData)
- end
- end
- --刷新奖励
- function UIBattleView:RefreshOnlineRecordBtn()
- local state = ManagerContainer.LuaBattleMgr:GetOnlineState()
- self:RefreshOnlineDownBtn(state)
- self:RefreshOnlineItem(state)
- end
- --获取在线奖励点击
- function UIBattleView:OnClickOnlineRecord()
- local state = ManagerContainer.LuaBattleMgr:GetOnlineState()
- if state == Enum.EnumOnineState.Receive then
- ManagerContainer.LuaBattleMgr:SendOnlineTimeRecord()
- elseif state == Enum.EnumOnineState.RunTime then
- --是否消耗金币
- local NeedItem = ManagerContainer.LuaBattleMgr:GetOnlineTimeGlod()
- local data = {"OnLineUseGold", {tostring(NeedItem)}, nil, self, self.SureOpenTipsWnd}
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UINoticeTips, data)
- elseif state == Enum.EnumOnineState.ToDayFinished then
-
- end
- end
- function UIBattleView:RefreshOnlineAnimRecord()
- local state = ManagerContainer.LuaBattleMgr:GetOnlineState()
- local strAnim = nil
- if state == Enum.EnumOnineState.Receive then
- strAnim = "RewardsShow"
- else
- strAnim = "RewardsKeep"
- end
- self:PlayAniRun(self.OnlineRewards.rewardsAnim.animator,strAnim)
- end
- function UIBattleView:PlayAniRun(Animator,AniName)
- if Animator then
- local showStateInfo = Animator:GetCurrentAnimatorStateInfo(0)
- if showStateInfo then
- local IsPlay = showStateInfo:IsName(AniName)
- if not IsPlay then
- Animator:Play(AniName)
- end
- end
- end
- end
- --提示 道具不足金币转换确定
- function UIBattleView:SureOpenTipsWnd()
- local IsCanUse = ManagerContainer.LuaBattleMgr:IsCanUseGoldOnline()
- if IsCanUse then
- ManagerContainer.LuaBattleMgr:SendOnlineTimeRecord()
- else
- self:PopErrorTips('SeasonLackGold')
- end
- end
- --Error弹窗
- function UIBattleView:PopErrorTips(Key)
- if not ManagerContainer.LuaUIMgr:GetPage(Enum.UIPageName.UIErrorTips) then
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIErrorTips, {errorId=Key}, nil, nil, nil, Enum.UISibling[Enum.UIType.Top + 1] + 11)
- else
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.ERROR_DESC_DISPLAY, {errorId=Key})
- end
- end
- function UIBattleView:OnRefreshOnlineState()
- self:RefreshOnlineRecordBtn()
- end
- ----------------------------
- function UIBattleView:Update()
- self:RefreshOnlineTime()
- if bossFightCDRemainTime > 0 then
- bossFightCDRemainTime = bossFightCDRemainTime - Time.unscaledDeltaTime
- if bossFightCDRemainTime <= 0 then
- bossFightCDRemainTime = 0
- self.challengeAnimName = bBossStage and "BtnBoss3" or "BtnBoss1"
- else
- local remain = math.ceil(bossFightCDRemainTime)
- --if remain ~= curRemainSecond then
- curRemainSecond = remain
- if self.btnChallenge then
- self.btnChallenge.remainCDTime.text.text = I18N.SetLanguageValue("FightCD", curRemainSecond)
- end
- --end
- self.challengeAnimName = bBossStage and "BtnBoss3" or "BtnBoss4"
- end
- if self.btnBossAnimator then
- self.btnBossAnimator.animator:Play(self.challengeAnimName)
- end
- end
- if not needRefreshMinimap then
- return
- end
- minimapCurTime = minimapCurTime + Time.unscaledDeltaTime
- if minimapCurTime >= minimapInterTime then
- minimapCurTime = 0
- self:RefreshMinimapInfo()
- end
- end
- function UIBattleView:AddEventListener()
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BOSS_SPAWNED,self,self.OnBossSpawned);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_Refresh_Boss_Dead,self,self.OnBossDead);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BATTLE_WIN,self,self.OnBattleWin);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BATTLE_FAILED,self,self.OnBattleFailed);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_FORCEBATTLE_FAILED,self,self.OnForceBattleFailed);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BATTLE_ERROR,self,self.OnBattleFailed);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_NEXT_BATTLE, self,self.OnBattleNewWave);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_CONTINUE_BATTLE, self,self.OnContinueBattle);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_SHOW_BOSS_RAGE,self, self.OnShowBossRage)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_SHOW_BOSS_RAGE_LEFTTIME, self,self.OnShowBossRageLeftTime);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_REFRESH_RAGE_LEFTTIME, self,self.RefreshRageTime);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BOSS_IN_RAGE, self,self.OnBossInRage);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_HIDE_LEVEL_NAME, self,self.OnHideLevelName);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_SHOW_BOSS_WARNING,self,self.OnShowBossWarning);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_REFRESH_REWARD_TIME,self,self.OnRefreshRewardTime);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BATTLE_INCOME_ACK,self,self.OnBattleIncomeAck);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_CRUISE_CHANGED,self,self.RefreshCruise);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_BOSS_Battle_End,self,self.BossBattleEnd);
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.UI_BATTLE_FUNC_OPEN_NTF, self, self.FuncOpen)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.UI_BATTLE_NORMAL_NTF, self, self.ShowBattleNormalUI)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.GOT_ANIM_TYPE_END_NOTIFY, self, self.PopGotAnimEnd)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.NEW_LEVEL_INCREASE_NTF, self, self.NewLevelIncrease)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.BATTLE_WIN_CLOSE, self, self.RewardBoxRefresh)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.BATTLE_LOADING_COMPELETED, self, self.BattleLoadingCompeleted)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_Challenge_Boss_Fight_ACK, self, self.OnChallengeBossAck)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.CLOSE_NEW_FUNC_PAGE, self, self.OnCloseNewOpen)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.BATTLE_CHALLENGE_TIME_REFRESH, self, self.OnRefreshBossChallengeTime)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_CHALLENGE_AUTO, self, self.OnStartAutoChallenge)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.RED_ENVELOPE_REMAIN_TIME_REFRESH, self, self.OnRedEnvelopeRemainTimeRefresh)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.EID_REFRESH_ONLINETIME_CHANGESTATE, self, self.OnRefreshOnlineState)
- ManagerContainer.LuaEventMgr:RegisterUIEvent(self.uiData.name, UIEventNames.MAP_MODE_CHANGE, self, self.OnMapModeChange)
- self.uiBase:AddUIEventHandlerClickListener(self.uIEventHandler, function (go)
- self:OnAutoChallengeClickEvent()
- end)
- end
- function UIBattleView:RemoveEventListener()
- ManagerContainer.LuaEventMgr:Unregister(self.uiData.name)
- end
- function UIBattleView:OnPlayerQuery()
- self.controller:SendPlayerQuery(curSelectedData.uid)
- self.funcbg:SetActive(false)
- end
- function UIBattleView:AddUIEventListener()
- self.uiBase:AddButtonEventListener(self.btnChallenge.button,self, self.OnClickChallengeBtn)
- self.uiBase:AddButtonEventListener(self.ReceiveGo.button,self,self.OnClickRewardBtn)
- self.uiBase:AddButtonEventListener(self.quickBattleBtn.button,self,self.OnClickQuickBtn)
- self.uiBase:AddButtonEventListener(self.miniMapBg.button,self,self.OnClickMiniMap)
- self.uiBase:AddButtonEventListener(self.btnOnlineRewards.button,self,self.OnClickOnlineRecord)
- -- self.uiBase:AddButtonEventListener(self.btnCruise.button,self,self.OnClickCruiseBtn)
- --self.uiBase:AddButtonEventListener(self.btnStageGoal.button, self, self.AwardOrJumpStageGoal)
- self.uiBase:AddButtonEventListener(self.newOpen.alpha.button, self, self.OnCloseNewOpen)
- self.uiBase:AddButtonEventListener(self.btnwarlog.button, self, self.OnClickBattleRecordBtn)
- self.uiBase:AddButtonEventListener(self.btnStatistics.button, self, self.OnClickBattleStatisticsBtn)
- self.uiBase:AddButtonEventListener(self.btnAuto.button, self, self.OnClickAutoChallenge)
- --self.uiBase:AddToggleEventListener(self.togworld.toggle, self, self.OnValueChangedToggle, 1)
- --self.uiBase:AddToggleEventListener(self.togguild.toggle, self, self.OnValueChangedToggle, 2)
- --self.uiBase:AddToggleEventListener(self.togsystem.toggle, self, self.OnValueChangedToggle, 3)
- --self.uiBase:AddToggleEventListener(self.togwarlog.toggle, self, self.OnValueChangedToggle, 4)
- self.BossBloodPart:AddUIEventListener()
- self.HeadsBoxPart:AddUIEventListener()
- self.StatisticsPart:AddUIEventListener()
- self.battleReplayPart:AddUIEventListener()
- self.NewBattleChatPart:AddUIEventListener()
- self.uiBase:AddButtonUniqueEventListener(self.btnRedEnvelope.button, self, self.OnNormalREClick)
- self.uiBase:AddButtonUniqueEventListener(self.windowEnvelope.button, self, self.OnHideWindowsEnvelope)
- self.uiBase:AddButtonUniqueEventListener(self.difficultBtn.button, self, self.OnClickDifficultBtn)
- self.uiBase:AddButtonUniqueEventListener(self.bgBtn.button,self,self.CloseMapModeSelectPanel)
- end
- function UIBattleView:OnClickDifficultBtn()
-
- -- if bBossStage then
- -- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("Fighting1")
- -- return;
- -- end
-
- -- local mapMode = ManagerContainer.LuaBattleMgr:GetBattleMode() == Enum.MapModeType.Difficulty and Enum.MapModeType.Simple or Enum.MapModeType.Difficulty
- -- ManagerContainer.LuaBattleMgr:SendChangeMapLevelTypeReq(mapMode)
-
- self.mapLevelModes:SetActive(true)
- self:RefMapModeBtn()
- end
- function UIBattleView:OnMapModeChange(mode)
- --self.difficultBtn.DifTxt
-
- local Btntxt = I18N.T("SelectMapModeTxt")
- -- if mode == 0 then
- -- Btntxt = I18N.T("DifficultMode")
- -- else
- -- Btntxt = I18N.T("SimpleMode")
- -- end
- --LogError("--------------------"..Btntxt)
- self.difficultBtn.DifTxt.text.text = Btntxt
-
- end
- function UIBattleView:RefMapModeBtn()
- local curMode = ManagerContainer.LuaBattleMgr:GetBattleMode()
- local AllMode = {0,1}
- local emUnlockLevel = GlobalConfig.Instance:GetConfigIntValue(365)
- local curLevel = ManagerContainer.LuaBattleMgr:GetCurDiffLvID()
- if(curLevel >= emUnlockLevel)then
- table.insert(AllMode,2)
- end
- local needShowModeBtn = {}
- for _, v in ipairs(AllMode) do
- if v ~= curMode then
- table.insert(needShowModeBtn,v)
- end
- end
- self.modeNode.loopVerticalScrollRect:ClearCells()
- CommonUtil.LoopGridViewEleCreateNew(self,
- self.modeNode.loopVerticalScrollRect,
- self.content.verticalLayoutGroup,
- needShowModeBtn,
- 0,
- self,
- self.UpdateModeNode,
- nil, nil, 0);
- end
- function UIBattleView:UpdateModeNode(_itemLua, _idx,_data)
- if not _itemLua or not _data then return end
- CommonUtil.UpdateItemPrefab(self, _itemLua, _data, nil,self,self.OnClickMapMode)
- end
- function UIBattleView:OnClickMapMode(btn,data)
- --LogError("点击 data = " ..Inspect(data))
- self:CloseMapModeSelectPanel()
- if bBossStage then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("Fighting1")
- return;
- end
- ManagerContainer.LuaBattleMgr:SendChangeMapLevelTypeReq(data[0])
- end
- function UIBattleView:CloseMapModeSelectPanel()
- self.mapLevelModes:SetActive(false)
- end
- function UIBattleView:OnHide()
- self.newFunc = nil
- self:DisposeNewLevelIncrease()
- self.recordSpeed = ManagerContainer.LuaGameMgr:GetGameSpeed();
- ManagerContainer.LuaGameMgr:SetGameSpeed(1)
- needRefreshMinimap = false
- if self.inited then
- self.chatView:SetActive(false)
- end
- if chatHideTimer then
- ManagerContainer.LuaTimerMgr:RemoveTimer(chatHideTimer)
- chatHideTimer = nil
- end
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- end
- function UIBattleView:OnShow()
- ManagerContainer.LuaGameMgr:SetGameSpeed(self.recordSpeed)
- self:InitComs();
- self:OnRefreshEarnings();
- self:LoadMinimap()
- self:InitCruise()
- --self:RefreshChatBg()
- if self.btnBossAnimator.activeInHierarchy then
- self.btnBossAnimator.animator:Play(self.challengeAnimName);
- end
- self:OnRefreshRewardTime();
- --self:RefreshStageGoalUI()
- local result = ManagerContainer.UIFuncUnlockMgr:GetNeedDisplayNewFuncStatus()
- if result then
- self:FuncOpen1()
- else
- self.newOpen:SetActive(false)
- end
- self.btnAuto:SetActive(false)
-
- needRefreshMinimap = true
- --self.chatView:SetActive(true)
- --self.battleLogView:SetActive(false)
- self.battleRootNew:SetActive(true)
- --self:HandleChatToggleBtns(1)
- if not ManagerContainer.LuaBattleMgr:GetBossFightState() then
- self.MapRootGo:SetActive(true)
- end
- self:RefreshOnlineRecordBtn()
- self:OnMapModeChange(ManagerContainer.LuaBattleMgr:GetBattleMode())
-
- end
- function UIBattleView:OnClose()
- DG.Tweening.DOTween.Kill(self.windowEnvelope.transform)
- if updateHandle ~= nil then
- UpdateBeat:RemoveListener(updateHandle)
- updateHandle = nil
- end
- self.logList = nil
- if chatHideTimer then
- ManagerContainer.LuaTimerMgr:RemoveTimer(chatHideTimer)
- chatHideTimer = nil
- end
- if self.inited then
- self.battleLogView.loopVerticalScrollRect:SetUpdateCellCallback(nil,nil)
- -- self:ClearBattleSkillTimer()
- if self.openRewardTimer ~= nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(self.openRewardTimer);
- self.openRewardTimer = nil
- end
- ManagerContainer.LuaGameMgr:SetGameSpeed(1)
- self.controller:SetChatChannelType(nil)
- end
- if self.BossBloodPart ~= nil then
- self.BossBloodPart:Dispose()
- self.BossBloodPart = nil
- end
- if self.HeadsBoxPart ~= nil then
- self.HeadsBoxPart:Dispose()
- self.HeadsBoxPart = nil
- end
- if self.StatisticsPart ~= nil then
- self.StatisticsPart:Dispose()
- self.StatisticsPart = nil
- end
- if self.battleReplayPart ~= nil then
- self.battleReplayPart:Dispose()
- self.battleReplayPart = nil
- end
- if self.NewBattleChatPart ~= nil then
- self.NewBattleChatPart:Dispose()
- self.NewBattleChatPart = nil
- end
- pageToggleData = nil
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- self.uIEventHandler:RemoveListener()
- end
- function UIBattleView:RefreshStageGoalUI(newProgress)
- local curGoal = ManagerContainer.DataMgr.StageGoalData:GetCurGoalData()
- self.btnStageGoal:SetActive(curGoal ~= nil and curGoal.taskId <= ManagerContainer.CfgMgr:LastTargetTaskId() and curGoal.state <= 1)
- if curGoal ~= nil then
- local goalCfgData = ManagerContainer.CfgMgr:GetTargetTaskDataById(curGoal.taskId)
- if goalCfgData == nil then
- return
- end
- local max = 0
- for _,v in pairs(CommonUtil.DeserializeCfgItemList(goalCfgData.TargetTaskCondition)) do
- max = max + v[#v]
- end
- local progress = ManagerContainer.DataMgr.StageGoalData:GetCurGoalDataProgress()
- local isCompleted = progress == max
- local func
- if not isCompleted then
- self.btnStageGoal.state:SetActive(false)
- func = self.ShowItemTips
- else
- if not newProgress then
- self.btnStageGoal.state:SetActive(true)
- func = self.AwardGoal
- else
- self.btnStageGoal.state:SetActive(false)
- func = self.ShowItemTips
- end
- end
- local data = {cfgId = goalCfgData.TargetReward[1][1], num = goalCfgData.TargetReward[1][2]}
- CommonUtil.UpdateItemPrefab(self, self.btnStageGoal.iconItem, data, Enum.ItemIEnterType.Bag, self, func)
- if max < 4 then
- self.btnStageGoal.points.gridLayoutGroup.spacing = stageGoalGridSpacing[1]
- elseif max == 4 then
- self.btnStageGoal.points.gridLayoutGroup.spacing = stageGoalGridSpacing[2]
- elseif max == 5 then
- self.btnStageGoal.points.gridLayoutGroup.spacing = stageGoalGridSpacing[3]
- end
- for i = 1, Constant.StageGoalMaxPoints do
- self["point"..i]:SetActive(i <= max)
- if i <= max then
- self["point"..i].light.animator:Play(i < progress and "CupKeep" or "CupEmpty")
- if newProgress then
- newStageCompeleted = newProgress
- else
- if i == progress then
- self["point"..i].light.animator:Play("CupKeep")
- end
- end
- end
- end
- end
- end
- function UIBattleView:NewStageCompletedNtf()
- if newStageCompeleted then
- newStageCompeleted = false
- local curGoal = ManagerContainer.DataMgr.StageGoalData:GetCurGoalData()
- if curGoal ~= nil then
- local goalCfgData = ManagerContainer.CfgMgr:GetTargetTaskDataById(curGoal.taskId)
- if goalCfgData == nil then
- return
- end
- local max = 0
- for _,v in pairs(CommonUtil.DeserializeCfgItemList(goalCfgData.TargetTaskCondition)) do
- max = max + v[#v]
- end
- if curGoal.state == Enum.TaskStateType.CompletedAndNoReceive then
- self.btnStageGoal.state:SetActive(true)
- local func = self.AwardGoal
- local data = {cfgId = goalCfgData.TargetReward[1][1], num = goalCfgData.TargetReward[1][2]}
- CommonUtil.UpdateItemPrefab(self, self.btnStageGoal.iconItem, data, Enum.ItemIEnterType.Bag, self, func)
- end
- local progress = ManagerContainer.DataMgr.StageGoalData:GetCurGoalDataProgress()
- for i = 1, Constant.StageGoalMaxPoints do
- if i == progress then
- self["point"..i].light.animator:Play("CupShow")
- end
- end
- end
- end
- end
- function UIBattleView:StageGoalAwarded(list)
- if #list == 0 then
- -- LogError("no item")
- return
- end
- local data = {cfgId = list[1].key, num = list[1].value}
- local data1 = {list = {data}, startPoses = {self.btnStageGoal.iconItem.transform.position}, enterType = Enum.ItemIEnterType.StageGoal}
- ManagerContainer.LuaUIMgr:POPGotAnimNotice(data1)
- self:RefreshStageGoalUI()
- end
- function UIBattleView:AwardOrJumpStageGoal(button, params)
- local curGoal = ManagerContainer.DataMgr.StageGoalData:GetCurGoalData()
- if curGoal ~= nil then
- if curGoal.state ~= 1 then
- local goalCfgData = ManagerContainer.CfgMgr:GetTargetTaskDataById(curGoal.taskId)
- local data = ManagerContainer.CfgMgr:GetUIJumpData(goalCfgData.SkipInterface)
- if data == nil then return end
- ManagerContainer.UIJumpMgr:CreateJumpTask(data)
- else
- self:AwardGoal()
- end
- end
- end
- function UIBattleView:AwardGoal()
- local curGoal = ManagerContainer.DataMgr.StageGoalData:GetCurGoalData()
- if curGoal ~= nil then
- if curGoal.state ~= 1 then
- local goalCfgData = ManagerContainer.CfgMgr:GetTargetTaskDataById(curGoal.taskId)
- local data = {cfgId = goalCfgData.TargetReward[1][1], num = goalCfgData.TargetReward[1][2]}
- --ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIItemTips, data)
- ManagerContainer.LuaUIMgr:OpenTips(data)
- else
- self.stageGoalNtf:SetActive(false)
- self.controller:SendGetMainTaskRewardReq()
- end
- end
- end
- function UIBattleView:ShowItemTips(button, params)
- --ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIItemTips, params[0])
- local data = params[0]
- ManagerContainer.LuaUIMgr:OpenTips(data)
- end
- function UIBattleView:OnDispose()
- self.battleLoadingState = nil
- self.chatView.loopListView:Dispose()
- self:DisposeNewLevelIncrease()
- if bossMaskTimer ~= nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(bossMaskTimer)
- bossMaskTimer = nil
- end
- needRefreshMinimap = false
- self.miniMapGoes = nil
- if updateHandle ~= nil then
- UpdateBeat:RemoveListener(updateHandle)
- updateHandle = nil
- end
- DG.Tweening.DOTween.Kill(self.transform)
- self.battleLogView.uIEventTriggerListener.onPointerUp = nil
- self.battleLogView.uIEventTriggerListener.onClick = nil
- UIMainCtr = nil
- end
- function UIBattleView:OnClickQuickBtn()
- if self.controller:IsUnlockQuickBattle() then
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIQuickBattle)
- else
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay(self.controller:UnlockQuickBattleCondition())
- end
- end
- function UIBattleView:OnClickRewardBtn()
- if bBossStage then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("Fighting2")
- return
- else
- ManagerContainer.LuaBattleMgr:SendBattleIncomeReq()
- end
- self.RewardBoxBtn.animator:Play("ChestPressedNew");
- end
- function UIBattleView:OnAutoChallengeClickEvent()
- if ManagerContainer.LuaBattleMgr:GetAutoChallengeState() and not bBossStage then
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- end
- end
- function UIBattleView:OnStartAutoChallenge()
- if not ManagerContainer.LuaBattleMgr:GetAutoChallengeState() then
- return
- end
- self:DisposeNewLevelIncrease()
- if bBossStage then
- return;
- end
- if bossFightCDRemainTime > 0 then
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- return;
- end
- local roleLv = ManagerContainer.DataMgr.UserData:GetRoleLv()
- local challengeLv = LuaBattleBridge.GetCurLevelChallengeLv()
- if roleLv < challengeLv then
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- return
- end
- local jobLv = ManagerContainer.DataMgr.UserData:GetJobLv()
- local maxJobLv = ManagerContainer.DataMgr.UserData:GetJobMaxLevel()
- local jobStage = ManagerContainer.DataMgr.UserData:GetJobStage()
- if jobStage<3 and jobLv>= maxJobLv then
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- return
- end
- --self.challengeAnimName = "BtnBoss2"
- --
- --if self.btnBossAnimator.activeInHierarchy then
- -- self.btnBossAnimator.animator:Play(self.challengeAnimName);
- --end
- local battleLoadingState,text = ManagerContainer.LuaBattleMgr:GetBattleLoadingState()
- if battleLoadingState then
- ManagerContainer.LuaBattleMgr:StopAutoChallenge(true)
- return
- end
- self:StartBattleBoss()
- end
- function UIBattleView:OnClickChallengeBtn(btn)
- self:DisposeNewLevelIncrease()
- local Levelmaxlvid = GlobalConfig.Instance:GetConfigIntValue(363)
- local dif_s_lid = ManagerContainer.LuaBattleMgr:GetCurDiff_S_LvID()
- local IsDiff_s_Limit = ManagerContainer.LuaBattleMgr:GetBattleMode() == 2 and dif_s_lid >= GlobalConfig.Instance:GetConfigIntValue(366)
- if(ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId() >= Levelmaxlvid) or IsDiff_s_Limit then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("289")
- return
- end
- if bBossStage then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("Fighting1")
- return;
- end
- if bossFightCDRemainTime > 0 then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplayWithParam("FightCD", math.ceil(bossFightCDRemainTime))
- return;
- end
- --======删除 等级限制==============================================
- local roleLv = ManagerContainer.DataMgr.UserData:GetRoleLv()
- local challengeLv = LuaBattleBridge.GetCurLevelChallengeLv()
- if roleLv < challengeLv then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay(I18N.SetLanguageValue("LevelLimit", challengeLv))
- return
- end
- local jobLv = ManagerContainer.DataMgr.UserData:GetJobLv()
- local maxJobLv = ManagerContainer.DataMgr.UserData:GetJobMaxLevel()
- local jobStage = ManagerContainer.DataMgr.UserData:GetJobStage()
- if jobStage<3 and jobLv>= maxJobLv then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay(I18N.T("JobLimit"))
- return
- end
- --======删除 等级限制==============================================
- --self.challengeAnimName = "BtnBoss2"
- --
- --if self.btnBossAnimator.activeInHierarchy then
- -- self.btnBossAnimator.animator:Play(self.challengeAnimName);
- --end
- local battleLoadingState,text = ManagerContainer.LuaBattleMgr:GetBattleLoadingState()
- if battleLoadingState then
- self.battleLoadingState = battleLoadingState
- self.btnChallenge.battleState.text.text = I18N.T(text)
- return
- end
- self:StartBattleBoss()
- end
- function UIBattleView:StartBattleBoss()
- local levelCfgId = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
-
- local levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(levelCfgId)
- if levelCfgData and levelCfgData.BossKey ~= "" then
- ManagerContainer.DataMgr.ChatData:AddLocalNewSystemData(levelCfgData.BossKey)
- end
- ManagerContainer.LuaBattleMgr:SendChallengeBossReq()
- end
- function UIBattleView:OnChallengeBossAck(factorList)
- local curLevelId = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
- local levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(curLevelId)
- bossFightCDRemainTime = levelCfgData.FightCD
- ManagerContainer.LuaUIMgr:OpenInputMask(9500)
- bBossStage = true
- bBoxState = true
- local battleFactors = System.Array.CreateInstance(Enum.TypeInfo.ValType, #factorList)
- for i = 1, #factorList do
- local factor = ValType.New(factorList[i].key,factorList[i].value)
- battleFactors[i-1] = factor
- end
- local teams = ManagerContainer.DataMgr.UserData:GetTeamData(true)
- for i = 1 , #teams do
- local actor = ManagerContainer.LuaActorDataMgr:GetActorsById(teams[i].uid,teams[i].id)
- --增加对应压制mark
- ManagerContainer.DataMgr.UserData:SetActorPveMark(teams[i].uid,actor)
- end
- LuaBattleBridge.ClickChallegeBoss(battleFactors);
- self.btnAuto:SetActive(Constant.OpenPay or false)
- local autoCState = ManagerContainer.LuaBattleMgr:GetAutoChallengeState()
- if autoCState then
- self.autoAnim.animator:Play("AutoIn")
- else
- self.autoAnim.animator:Play("AutoKeep")
- end
- end
- function UIBattleView:OnRefreshBossChallengeTime(time)
- bossFightCDRemainTime = time
- end
- function UIBattleView:BattleLoadingCompeleted()
- self.btnChallenge.battleState.text.text = I18N.T("BtnChallengeBOSS")
- if self.battleLoadingState then
- self.battleLoadingState = nil
- --self:StartBattleBoss()
- end
- end
- function UIBattleView:OnClickMiniMap()
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBigMap, {id = ManagerContainer.LuaBattleMgr:GetCurMapId()})
- end
- function UIBattleView:OnBossDead()
- self.rageBoxGo:SetActive(false)
- end
- function UIBattleView:OnBossSpawned(bossActor,bossName,life,maxLife,skillParam,isPlayRecord)
- if bossMaskTimer ~= nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(bossMaskTimer)
- bossMaskTimer = nil
- end
- bossMaskTimer = ManagerContainer.LuaTimerMgr:AddTimer(1500, 1, self, self.CloseInputMask, nil)
- self.exploringTrans:SetActive(false);
- if self.btnBossAnimator ~= nil then
- self.challengeAnimName = "BtnBoss3"
- self.btnBossAnimator.animator:Play(self.challengeAnimName);
- end
- self.quickBattleBtn.button.interactable = false
- if self.openRewardTimer~=nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(self.openRewardTimer)
- self.openRewardTimer = nil;
- end
- self:OnHideLevelName()
- self:SetBossBattleInfo()
- self.StatisticsPart:SetCanvasOrder(self.uiBase.SortingOrder-1)
- self.BossBloodPart:Show(bossActor,bossName,life,maxLife,skillParam)
- self.HeadsBoxPart:Show()
- self.StatisticsPart:Show(BattleMode.Normal,BattleSubMode.None)
- if isPlayRecord then
- self.battleReplayPart:SetCanvasOrder(self.uiBase.SortingOrder-1)
- local name = ManagerContainer.CfgMgr:GetCurLevelName()--ManagerContainer.LuaBattleMgr:GetCurrentLevelData().Name--GetLeveNameById
- self.battleReplayPart:Show(name)
- self.battleRootNew:SetActive(false)
- end
- self.dragBg:SetActive(false)
- ManagerContainer.LuaUIMgr:ClosePage(Enum.UIPageName.UIBattleReward)
- self:DisposeNewLevelIncrease()
- ManagerContainer.LuaGameMgr:SetGameSpeed(ManagerContainer.LuaGameMgr.GameSpeed)
- end
- function UIBattleView:CloseInputMask()
- ManagerContainer.LuaUIMgr:CloseInputMask()
- end
- function UIBattleView:BossBattleEnd(isPlayRecord)
- self.dragBg:SetActive(true)
- bBossStage = false
- bBoxState = false
- self:RefreshRedEnvelope()
- self:PlayChallengeBtnNormalAnim()
- if isPlayRecord then
- self.battleReplayPart:Hide()
- self.battleRootNew:SetActive(true)
- end
- self.btnAuto:SetActive(false)
- end
- function UIBattleView:SetBossBattleInfo()
- self.centerNode:SetActive(false)
- self.MapRootGo:SetActive(false)
- self.btnwarlog:SetActive(false)
- self.btnStatistics:SetActive(false)
- self:RefreshRedEnvelope()
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.BOSS_BATTLE_STATUS,true)
- end
- local remainTime = 2
- function UIBattleView:RefreshRedEnvelope()
- if not Constant.OpenPay then
- self.btnRedEnvelope:SetActive(false)
- self.windowEnvelope:SetActive(false)
- return
- end
- local curLevelId = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
- local levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(curLevelId)
- local reActItem = ManagerContainer.DataMgr.ActsDataMgr:GetActivityItemById(Enum.ActivityType.ACTIVITY_TYPE_CASH_SHOP)
- local state = reActItem and reActItem:IsUnlocked() and reActItem:IsOpened() and not reActItem:IsOutofDate()
- self.btnRedEnvelope:SetActive(state)
- self.windowEnvelope:SetActive(false)
- if state then
- if bBossStage then
- self:OnShowWindowsEnvelope()
- self.uiBase:AddButtonUniqueEventListener(self.btnRedEnvelope.button, self, self.OnBattleREClick)
- else
- self:OnHideWindowsEnvelope()
- self:OnRedEnvelopeRemainTimeRefresh()
- self.uiBase:AddButtonUniqueEventListener(self.btnRedEnvelope.button, self, self.OnNormalREClick)
- end
- else
- if self.btnRedEnvelope.activeSelf then
- self.btnRedEnvelope:SetActive(false)
- end
- if self.windowEnvelope.activeSelf then
- self.windowEnvelope:SetActive(false)
- end
- end
- end
- function UIBattleView:OnHideWindowsEnvelope()
- self.windowEnvelope.transform:DOMove(self.btnRedEnvelope.transform.position, 0.3):SetEase(DG.Tweening.Ease.InQuint)
- self.windowEnvelope.transform:DOScale(0, 0.3):SetEase(DG.Tweening.Ease.InQuint):OnComplete(function()
- self.windowEnvelope:SetActive(false)
- DG.Tweening.DOTween.Kill(self.windowEnvelope.transform)
- self.btnRedEnvelope:SetActive(true)
- end)
- end
- function UIBattleView:OnShowWindowsEnvelope()
- DG.Tweening.DOTween.Kill(self.windowEnvelope.transform)
- local curLevelId = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
- local levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(curLevelId)
- if levelCfgData.Cash == 0 then
- self.btnRedEnvelope:SetActive(false)
- self.windowEnvelope:SetActive(false)
- return
- end
- self.windowEnvelope.transform.localScale = Vector3.zero
- self.windowEnvelope.cashNumber.text.text = levelCfgData.Cash
- self.windowEnvelope.textRank.uILocalizeScript:SetContentAndValues("CashReward01", {levelCfgData.PassNum})
- self.btnRedEnvelope:SetActive(false)
- self.windowEnvelope:SetActive(true)
- self.windowEnvelope.transform.position = self.btnRedEnvelope.transform.position
- self.windowEnvelope.transform:DOMove(windowREPos, 0.3):SetEase(DG.Tweening.Ease.OutQuint)
- self.windowEnvelope.transform:DOScale(1, 0.3):SetEase(DG.Tweening.Ease.OutBounce):OnComplete(function()
- remainTime = 2
- self.windowEnvelope.text.text.text = string.formatbykey("CashReward03", remainTime)
- self.windowEnvelope.transform:DOScale(1, 1):SetLoops(2):OnStepComplete(function ()
- remainTime = remainTime - 1
- self.windowEnvelope.text.text.text = string.formatbykey("CashReward03", remainTime)
- if remainTime == 0 then
- self.windowEnvelope.transform:DOMove(self.btnRedEnvelope.transform.position, 0.3):SetEase(DG.Tweening.Ease.InQuint)
- self.windowEnvelope.transform:DOScale(0, 0.3):SetEase(DG.Tweening.Ease.InQuint):OnComplete(function()
- self.windowEnvelope:SetActive(false)
- DG.Tweening.DOTween.Kill(self.windowEnvelope.transform)
- self.btnRedEnvelope:SetActive(true)
- end)
- end
- end)
- end)
- end
- function UIBattleView:OnRedEnvelopeRemainTimeRefresh()
- if not Constant.OpenPay then
- self.btnRedEnvelope:SetActive(false)
- self.windowEnvelope:SetActive(false)
- return
- end
- local reActItem = ManagerContainer.DataMgr.ActsDataMgr:GetActivityItemById(Enum.ActivityType.ACTIVITY_TYPE_CASH_SHOP)
- local state = reActItem and reActItem:IsUnlocked() and reActItem:IsOpened() and not reActItem:IsOutofDate()
- self.btnRedEnvelope:SetActive(state)
- if not state then
- self.windowEnvelope:SetActive(false)
- return
- end
- local curLevelId = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
- local levelCfgData = ManagerContainer.CfgMgr:GetLevelDataById(curLevelId)
- if levelCfgData.Cash == 0 and bBossStage then
- if self.btnRedEnvelope.activeSelf then
- self.btnRedEnvelope:SetActive(false)
- end
- if self.windowEnvelope.activeSelf then
- self.windowEnvelope:SetActive(false)
- end
- return
- end
- local leftSeconds = reActItem:LeftTime()
- if leftSeconds > 0 then
- if leftSeconds <= 60 then
- self.btnRedEnvelope.text.text.text = I18N.T("LessOneMinu")
- else
- local time = DateTimeUtil.convertSeconds2TimeStr1(leftSeconds, true, false)
- self.btnRedEnvelope.text.text.text = time
- end
- else
- if self.btnRedEnvelope.activeSelf then
- self.btnRedEnvelope:SetActive(false)
- end
- if self.windowEnvelope.activeSelf then
- self.windowEnvelope:SetActive(false)
- end
- end
- end
- function UIBattleView:OnBattleREClick()
- self:OnShowWindowsEnvelope()
- end
- function UIBattleView:OnNormalREClick()
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIREShop, nil, self.uiData.id)
- end
- function UIBattleView:ShowBattleNormalUI()
- if ManagerContainer.LuaUIMgr:HasOpenPage(Enum.UIPageName.UIBattle) then
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.BOSS_BATTLE_STATUS,false)
- end
- self.transform:DOScale(1, 0.8):OnComplete(function ()
- self:ShowBattleNormalUI1()
- end)
- end
- function UIBattleView:ShowBattleNormalUI1()
- --self.bottomNode:SetActive(true)
- self.centerNode:SetActive(true)
- --self.ProfitBoxGo:SetActive(true)
- if not ManagerContainer.LuaBattleMgr:GetBossFightState() then
- self.MapRootGo:SetActive(true)
- end
- self.btnwarlog:SetActive(true)
- self.btnStatistics:SetActive(true)
- -- self:OnValueChangedToggle(nil,1, true)
- end
- function UIBattleView:OnContinueBattle()
- bBoxState = false
- self.battleFailGo:SetActive(false);
- self:PlayRewardNormalAnim();
- end
- function UIBattleView:OnBattleWin()
- self:RestoreSpeed()
- self.BossBloodPart:Hide()
- self.HeadsBoxPart:Hide()
- self.StatisticsPart:Hide()
- self.rageBoxGo:SetActive(false)
- end
- function UIBattleView:OnBattleFailed(killboss,isPlayRecord)
- self:RestoreSpeed()
- -- self.battleFailGo:SetActive(true);
- self.BossBloodPart:Hide()
- self.HeadsBoxPart:Hide()
- self.StatisticsPart:Hide()
- self.rageBoxGo:SetActive(false)
- self:PlayChallengeBtnNormalAnim()
- self:PlayRewardNormalAnim()
- if killboss and (not isPlayRecord) then
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIClimbingTowerBattleFailed,Enum.UIPageName.UIBattle)
- else
- self.battleFailGo:SetActive(true)
- end
- --self:ShowBattleNormalUI()
- end
- function UIBattleView:OnForceBattleFailed(killboss,isPlayRecord)
- self:RestoreSpeed()
- -- self.battleFailGo:SetActive(true);
- self.BossBloodPart:Hide()
- self.HeadsBoxPart:Hide()
- self.StatisticsPart:Hide()
- self.rageBoxGo:SetActive(false)
- self:PlayChallengeBtnNormalAnim()
- self:PlayRewardNormalAnim()
- if killboss and (not isPlayRecord) then
- --ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIClimbingTowerBattleFailed,Enum.UIPageName.UIBattle)
- end
- self.battleFailGo:SetActive(false)
- end
- function UIBattleView:RestoreSpeed()
- ManagerContainer.LuaGameMgr:SetGameSpeed(1)
- end
- function UIBattleView:FuncOpen()
- self:PlayChallengeBtnNormalAnim()
- self:PlayRewardNormalAnim();
- self:OnRefreshEarnings();
- --if ManagerContainer.LuaUIMgr.CurrentPage.PageId == self.uiData.id then
- self:FuncOpen1()
- --end
- end
- function UIBattleView:FuncOpen1()
- if ManagerContainer.LuaBattleMgr:IsShowDifficultyTxt() then
- return
- end
- local levelId = ManagerContainer.LuaBattleMgr:GetCurLevelUniqueId()
- local newFuncs, nearFuncs, forceGuideList = ManagerContainer.UIFuncUnlockMgr:GetNewFuncAndNearFuncByLevelId(levelId)
- if newFuncs[1] == nil then
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.UI_FORCE_GUIDE_OVER, true)
- return
- end
- local newFunc = newFuncs[1]
- self.newFuncs = newFuncs
- if #forceGuideList > 0 then
- self.controller:SetNewForceId(forceGuideList[1])
- end
- local newFuncData = ManagerContainer.CfgMgr:GetUIFuncUnLockCfgDataById(newFunc)
- CommonUtil.LoadIcon(self, newFuncData.FunIcon, function (sprite)
- self.newOpen.image.image.sprite = sprite
- self.newOpen.imageLt.image.sprite = sprite
- end)
- self.newOpen.nameTxt.text.text = I18N.T(newFuncData.FunName)
- self.newOpen.dscTxt.text.text = I18N.T(newFuncData.FunDsc)
- local item = self.newOpen.item
- item:SetActive(nearFuncs[1] ~= nil)
- if nearFuncs[1] ~= nil then
- local nearData = ManagerContainer.CfgMgr:GetUIFuncUnLockCfgDataById(nearFuncs[1])
- CommonUtil.LoadIcon(self, nearData.FunIcon, function (sprite)
- item.image.image.sprite = sprite
- end)
- local result,val,content = ManagerContainer.UIFuncUnlockMgr:CheckConditionPassResult(nearData)
- --content = content and content or ""
- item.itemTxt.text.text = I18N.T(nearData.FunName).."("..content..")"
- end
- self.newOpen:SetActive(true)
- end
- function UIBattleView:OnTaskClick()
- ManagerContainer.DataMgr.TaskDataNew:OpenTaskPanel();
- end
- function UIBattleView:OnCloseNewOpen()
- self.newOpen:SetActive(false)
- if self.newFuncs then
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.RED_POINT_UNLOCK_NTF, self.newFuncs)
- self.newFuncs = nil
- end
- local newForceId = self.controller:GetNewForceId()
- if newForceId then
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.UI_FORCE_GUIDE_TRIGGER, Enum.ForceGuideTriggerEnum.FuncOpen, newForceId)
- self.controller:SetNewForceId()
- else
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.UI_FORCE_GUIDE_OVER, true)
- end
- end
- function UIBattleView:OnBattleNewWave(levelName)
- self.battleFailGo:SetActive(false);
- self:OnRefreshEarnings();
- end
- function UIBattleView:OnHideLevelName()
- end
- function UIBattleView:OnShowBossRage()
- self.rageBoxGo:SetActive(true)
- end
- function UIBattleView:OnShowBossRageLeftTime(leftTime)
- self:RefreshRageTime(leftTime)
- end
- function UIBattleView:OnBossInRage()
- self.rageBoxGo:SetActive(false)
- end
- function UIBattleView:PlayChallengeBtnNormalAnim()
- if self.btnBossAnimator~= nil then
- self.challengeAnimName = bossFightCDRemainTime <= 0 and "BtnBoss1" or "BtnBoss4"
- if self.btnBossAnimator.activeInHierarchy then
- self.btnBossAnimator.animator:Play(self.challengeAnimName);
- end
- if bossFightCDRemainTime > 0 then
- self.btnChallenge.remainCDTime.text.text = I18N.SetLanguageValue("FightCD", math.ceil(bossFightCDRemainTime))
- end
- end
- --self.ReceiveGo:SetActive(true);
- self.quickBattleBtn.button.interactable = true
- end
- function UIBattleView:PlayRewardNormalAnim()
- self:OnRefreshRewardTime();
- end
- function UIBattleView:RefreshRageTime(leftTime)
- if leftTime ~= nil then
- local spriteName = nil
- if leftTime == 10 then
- spriteName = "Alert_number_0"
- else
- spriteName = "Alert_number_"..leftTime
- end
- self.rageNum1.image.sprite = self.rageNum1.switchSprite:GetSprite(spriteName)
- self.rageNum2.image.sprite = self.rageNum2.switchSprite:GetSprite(spriteName)
- if leftTime == 1 then
- self.rageBoxGo.bg.animator:Play("BafengteAlertEnd")
- end
- end
- end
- function UIBattleView:OnShowBossWarning(vis)
- self.bossWarning.animator.gameObject:SetActive(vis)
- end
- function UIBattleView:OnRefreshEarnings()
- self.ExpLbl.text.text = ManagerContainer.LuaBattleMgr:CurLevelExp() .. "/" .. I18N.T("m") ;
- self.ZenyLbl.text.text = ManagerContainer.LuaBattleMgr:CurLevelZeny() .. "/" .. I18N.T("m");
- self.ParnterExpLbl.text.text = ManagerContainer.LuaBattleMgr:CurLevelParnterExp() .. "/" .. I18N.T("m");
- self.CruiseLbl.text.text = ManagerContainer.LuaBattleMgr:CurLevelCruise() .. "/" .. I18N.T("m");
- self.CurLevelName.text.text = ManagerContainer.LuaBattleMgr:CurLevelName();
- ManagerContainer.LuaBattleMgr:SetRewardDropPos(self.RewardBoxBtnPos);
- local lockState = ManagerContainer.UIFuncUnlockMgr:GetFuncLockStatusById(35)
- ManagerContainer.LuaUIMgr:SetBattleDropRootVisible(lockState)
- end
- function UIBattleView:OnRefreshRewardTime()
- local passedTime = ManagerContainer.LuaBattleMgr:AccumIncomeTime();
- local maxTime = ManagerContainer.LuaBattleMgr:MaxInComeTime() * 1000
- if passedTime >= maxTime then
- passedTime = maxTime
- end
- local leftTime,num = ManagerContainer.LuaBattleMgr:GetIncomeInfo()
- if num == nil then
- num = 0
- end
- self.rewardPoint:SetActive(num >= 1)
- if num > 999 then
- self.rewardPoint.num.text.text = "999+"
- else
- self.rewardPoint.num.text.text = tostring(num)
- end
- if passedTime >= maxTime then
- self.RewardTimeLbl.text.text = "Max";
- else
- self.RewardTimeLbl.text.text = DateTimeUtil.convertSeconds2TimeStr(leftTime,true);
- end
- self:CheckRewardBoxStatus(passedTime)
- ManagerContainer.LuaEventMgr:Dispatch(UIEventNames.EID_HANG_TIME,passedTime);
- end
- function UIBattleView:CheckRewardBoxStatus(passedTime)
- local animName = "Chest01New"
- if bBoxState then
- animName = "ChestClose"
- else
- if passedTime <= self.statTime1 then
- animName = "Chest01New"
- elseif passedTime <= self.statTime2 then
- animName = "Chest02New"
- elseif passedTime <= self.statTime3 then
- animName = "Chest03New"
- else
- animName = "Chest04New"
- end
- end
- if self.RewardBoxBtn.activeInHierarchy then
- self.RewardBoxBtn.animator:Play(animName);
- end
- end
- function UIBattleView:OnBattleIncomeAck(dropLoc)
- local zeny = ManagerContainer.LuaBattleMgr:GetRewardCnt(Enum.ItemType.Coin)
- local partnerExp = ManagerContainer.LuaBattleMgr:GetRewardCnt(Enum.ItemType.ParterExp)
- local exp = ManagerContainer.LuaBattleMgr:GetRewardCnt(Enum.ItemType.RoleBaseExp)
- local createZeny = false;
- local createExp=false;
- local createPartnerExp = false;
- if UIMainCtr == nil then
- UIMainCtr = ManagerContainer.LuaUIMgr:GetViewCtrById(Enum.UIPageName.UIMain)
- end
- local zenyPos = UIMainCtr:GeAnchoredPosition3DByType(Enum.ItemType.Coin)
- local expPos = UIMainCtr:GeAnchoredPosition3DByType(Enum.ItemType.RoleBaseExp)
- local bagPos = UIMainCtr:GeAnchoredPosition3DByType(Enum.ItemType.ParterExp)
- if zeny ~= nil and zeny > 0 then
- createZeny = true
- end
- if partnerExp~= nil and partnerExp > 0 then
- createPartnerExp = true
- end
- if exp ~= nil and exp > 0 then
- createExp = true
- end
- local itemIcons = {};
- for i =1, #ManagerContainer.LuaBattleMgr.rewardItemList do
- local item = ManagerContainer.LuaBattleMgr.rewardItemList[i];
- if item.key >= 100 then
- local itemCfg = ManagerContainer.CfgMgr:GetItemById(item.key)
- if itemCfg~= nil then
- itemIcons[#itemIcons+1] = itemCfg.Icon
- end
- end
- end
- self.dropType = dropLoc;
- if dropLoc == 0 then
- LuaBattleBridge.GenerateDropItems(self.RewardBoxBtnPos,createZeny,zenyPos,createExp,expPos,createPartnerExp,bagPos,false,Vector3.zero,0.15,0.25,unpack(itemIcons));
- else
- LuaBattleBridge.GenerateDropItems(Vector3.New(0, 0, 0),createZeny,zenyPos,createExp,expPos,createPartnerExp,bagPos,false,Vector3.zero,0.30,0.25,unpack(itemIcons));
- end
- if self.openRewardTimer ~= nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(self.openRewardTimer)
- self.openRewardTimer = nil
- end
- self.openRewardTimer = ManagerContainer.LuaTimerMgr:AddTimer(GlobalConfig.Instance:GetConfigFloatValue(78)*1000, 1, self, self.OnOpenRewardPage, nil)
- end
- function UIBattleView:OnOpenRewardPage()
- self.openRewardTimer = nil
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBattleReward,self.dropType)
- end
- function UIBattleView:LoadMinimap()
- local mapId = ManagerContainer.LuaBattleMgr:GetCurMapId()
- local mapCfgData = ManagerContainer.CfgMgr:GetMapData(mapId)
- local center = mapCfgData.Center
- self.mapCenter = Vector3.New(center[1], center[2], center[3])
- self.mapSizeX = mapCfgData.RealSizeX
- self.mapSizeZ = mapCfgData.RealSizeZ
- local scale = mapCfgData.MinimapScale *0.01
- self.minimap.transform.localScale = Vector3.New(scale, scale, scale)
- self.minimapSizeX = mapCfgData.MinimapSizeX * scale
- self.minimapSizeZ = mapCfgData.MinimapSizeZ * scale
- CommonUtil.LoadTexture(self, mapCfgData.MinimapIcon, function (texture)
- self.minimap.rawImage.texture = texture
- self:RefreshMinimapInfo()
- end)
- end
- function UIBattleView:WorldPos2MinimapPos(pos)
- local xRate = pos.x / self.mapSizeX
- local zRate = pos.z / self.mapSizeZ
- local x = self.minimapSizeX * xRate
- local z = self.minimapSizeZ * zRate
- return x,z
- end
- function UIBattleView:OnRefreshMinimap()
- self:RefreshMinimapInfo()
- end
- function UIBattleView:RefreshMinimapInfo()
- if self.miniMapGoes == nil then
- return
- end
- if ManagerContainer.LuaBattleMgr.isBattleing then
- return
- end
- LuaBattleBridge.RefreshMinimap(self.mapCenter, self.mapSizeX,self.mapSizeZ,self.minimapSizeX,self.minimapSizeZ, self.hero,unpack(self.miniMapGoes))
- end
- function UIBattleView:InitCruise()
- end
- function UIBattleView:RefreshCruise()
- end
- function UIBattleView:OnClickCruiseBtn()
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UITreasures)
- end
- function UIBattleView:OnClickMailBtn()
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIMailBox)
- end
- function UIBattleView:GeAnchoredPosition3DByType(type)
- if type ~= Enum.ItemType.RoleJobExp and type ~= Enum.ItemType.RoleBaseExp then
- return self.ReceiveGo.transform.position
- end
- return Vector3.zero
- end
- function UIBattleView:GetMiniMapPosition()
- return self.minimap.transform.parent.position
- end
- function UIBattleView:RewardBoxRefresh()
- bBoxState = false
- self:PlayRewardNormalAnim();
- end
- function UIBattleView:GetBattleState()
- return bBossStage
- end
- function UIBattleView:PopGotAnimEnd(type)
- if type == Enum.ItemIEnterType.BattleWin then
- self:PlayChallengeBtnNormalAnim()
- end
- end
- function UIBattleView:NewLevelIncrease()
- if levelIncreaseTimer ~= nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(levelIncreaseTimer)
- levelIncreaseTimer = nil
- end
- if bBossStage then return end
- local count = 0
- local list = {}
- local lastLevelZeny = ManagerContainer.LuaBattleMgr.lastLevelZeny
- local curLevelZeny = ManagerContainer.LuaBattleMgr:CurLevelZeny()
- if lastLevelZeny < curLevelZeny then
- count = count + 1
- local data = {iconPath = Enum.LevelIncreaseType.Zeny, lastNum = lastLevelZeny, newNum = curLevelZeny}
- list[#list + 1] = data
- end
- local lastLevelExp = ManagerContainer.LuaBattleMgr.lastLevelExp
- local curLevelExp = ManagerContainer.LuaBattleMgr:CurLevelExp()
- if lastLevelExp < curLevelExp then
- count = count + 1
- local data = {iconPath = Enum.LevelIncreaseType.BaseExp, lastNum = lastLevelExp, newNum = curLevelExp}
- list[#list + 1] = data
- end
- local lastLevelPartnerExp = ManagerContainer.LuaBattleMgr.lastLevelPartnerExp
- local curLevelPartnerExp = ManagerContainer.LuaBattleMgr:CurLevelParnterExp()
- if lastLevelPartnerExp < curLevelPartnerExp then
- count = count + 1
- local data = {iconPath = Enum.LevelIncreaseType.Zeny, lastNum = lastLevelPartnerExp, newNum = curLevelPartnerExp}
- list[#list + 1] = data
- end
- local lastLevelCruise = ManagerContainer.LuaBattleMgr.lastLevelCruise
- local curLevelCruise = ManagerContainer.LuaBattleMgr:CurLevelCruise()
- if lastLevelCruise < curLevelCruise then
- count = count + 1
- local data = {iconPath = Enum.LevelIncreaseType.Zeny, lastNum = lastLevelCruise, newNum = curLevelCruise}
- list[#list + 1] = data
- end
- if #list > 0 then
- increaseIdx = 0
- self:ShowLevelIncrease(0, list)
- if #list > 1 then
- levelIncreaseTimer = ManagerContainer.LuaTimerMgr:AddTimer(500, #list - 1, self, self.ShowLevelIncrease, list)
- end
- end
- end
- function UIBattleView:ShowLevelIncrease(idx, list)
- increaseIdx = increaseIdx + 1
- local data = list[increaseIdx]
- ManagerContainer.GoPoolMgr:SpawnGo(Enum.PrefabNames.LevelIncreaseItem, function(itemlua)
- CommonUtil.BatchCreateItems(self, itemlua, self.centerNode.transform, data)
- end)
- end
- function UIBattleView:DisposeNewLevelIncrease()
- if levelIncreaseTimer ~= nil then
- ManagerContainer.LuaTimerMgr:RemoveTimer(levelIncreaseTimer)
- levelIncreaseTimer = nil
- end
- CommonUtil.RecycleFromBatchItemsByPrefabName(self, Enum.PrefabNames.LevelIncreaseItem)
- end
- function UIBattleView:IsSomeFrameCount(keyName)
- local value = self[keyName]
- if value and value >= Time.frameCount then
- return true
- end
- self[keyName] = Time.frameCount
- return false
- end
- function UIBattleView:OnClickBattleRecordBtn()
- ManagerContainer.LuaBattleMgr:SendBattleRecordReq()
- end
- function UIBattleView:OnClickBattleStatisticsBtn()
- if LuaBattleBridge.HasStatistics(BattleMode.Normal,BattleSubMode.None) then
- ManagerContainer.LuaUIMgr:Open(Enum.UIPageName.UIBattleStatistics,{BattleMode.Normal,BattleSubMode.None})
- else
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("NullBattleInformation1")
- end
- end
- function UIBattleView:OnClickAutoChallenge()
- if not ManagerContainer.DataMgr.RuneShopDataMgr:GetRoPassAutoBattle() then
- ManagerContainer.LuaUIMgr:ErrorNoticeDisplay("nomonthcard")
- ManagerContainer.LuaBattleMgr:StopAutoChallenge()
- return
- end
- if ManagerContainer.LuaBattleMgr:GetAutoChallengeState() then
- self.autoAnim.animator:Play("AutoKeep")
- ManagerContainer.LuaBattleMgr:StopAutoChallenge()
- else
- self.autoAnim.animator:Play("AutoIn")
- ManagerContainer.LuaBattleMgr:SetAutoChallengeState(true)
- end
-
- end
- function UIBattleView:FindTaskCompeleted1(id, owner, ownerCB)
- local page = ManagerContainer.LuaUIMgr:GetPage(Enum.UIPageName.UIPOPGot)
- if page then
- local pop = page.MLuaTable
- pop:UIClose()
- end
- local target = self.btnChallenge
- if target == nil then
- if owner and ownerCB then
- ownerCB(owner)
- end
- return
- end
- if owner and ownerCB then
- ownerCB(owner, target)
- end
- end
- return UIBattleView
|