local FirstCharge_Controller = {} local SHOW_EXP_KEY = "FirstCharge_Enter_Exp" local private = {} local EventSystem = require('Event/EventSystem') function FirstCharge_Controller.InitShowState() local state = PersistentData.PlayerData:Get(SHOW_EXP_KEY,0) == 1 private.SetEnterExpState(state) end function private.SetEnterExpState(state) private.hasShowExp = state PersistentData.PlayerData:Set(SHOW_EXP_KEY, state and 1 or 0,true) end --在玩家未达到第一档充值条件时,玩家每日首次打开该弹窗,播放武将展示动画 function private.ShowEnterExp() local info = MDL.FirstCharge.GetFirstChargeInfo() local isCharge = info.gifts and #info.gifts > 0 or false if isCharge == true then return false end if private.hasShowExp == false then local heroID = DataSheetManager.ConstData:GetDataByID("FirstChargeHero").IntValue CTL.HeroSelect.ShowHeroExpression(heroID, nil, FirstCharge_Controller.OpenFirstCharge) private.SetEnterExpState(true) return true end return false end function FirstCharge_Controller.OpenFirstCharge() if MDL.FirstCharge.HasEntry() then if private.ShowEnterExp() == false then if MDL.FirstCharge.IsNeedShowAlipay() then CTL.HomeMain.AddTownHomeDelayView(Const_UI_Lua.UIEnum.UIFirstChargeAlipayPanel) else if GameAppInfo.IsVietnamPackage() then CTL.HomeMain.AddTownHomeDelayView(Const_UI_Lua.UIEnum.UIFirstChargePanelVN) elseif GameAppInfo.IsChinesePackage() then CTL.HomeMain.AddTownHomeDelayView(Const_UI_Lua.UIEnum.UIFirstChargePanelNew) else CTL.HomeMain.AddTownHomeDelayView(Const_UI_Lua.UIEnum.UIFirstChargePanel) end end end end end return FirstCharge_Controller