2021-04-21 13:12:04 +08:00
|
|
|
|
require("Base/BasePanel")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
FightPointPassMainPanel = Inherit(BasePanel)
|
|
|
|
|
local this = FightPointPassMainPanel
|
|
|
|
|
-- 外地入侵模块
|
|
|
|
|
local invadeMonster = require("Modules/Fight/View/InvadeMonsterView")
|
|
|
|
|
-- 小人行动
|
|
|
|
|
--local roleWalkView = require("Modules/Fight/View/RoleShowView")
|
|
|
|
|
-- 小地图
|
|
|
|
|
local fightMap = require("Modules/Fight/View/FightPointMapView")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local fightOnHook = require("Modules/Fight/View/FightPointMapOnHook")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local fightLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
|
|
|
|
|
local fightLevelSetConfig = ConfigManager.GetConfig(ConfigName.MainLevelSettingConfig)
|
2021-05-27 20:45:20 +08:00
|
|
|
|
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local points = {}
|
|
|
|
|
local isCounting = false
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local orginLayer = 0
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local hasLoad = false
|
2021-04-22 13:40:04 +08:00
|
|
|
|
local hasMap = false
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.funcBtnList = {}
|
|
|
|
|
local curMianTaskData = {}
|
|
|
|
|
local timePressStarted
|
|
|
|
|
local callBack
|
|
|
|
|
|
|
|
|
|
local count = 1
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local maxKillNum = 10
|
|
|
|
|
local curKillNum = 0
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local timeImg = {
|
|
|
|
|
[1] = "r_guanka_daojishi_01",
|
|
|
|
|
[2] = "r_guanka_daojishi_02",
|
|
|
|
|
[3] = "r_guanka_daojishi_03",
|
|
|
|
|
[4] = "r_guanka_daojishi_04",
|
|
|
|
|
[5] = "r_guanka_daojishi_05",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- 关卡颜色文字
|
|
|
|
|
local textColor = {
|
|
|
|
|
[FightDifficultyState.SimpleLevel] = "F1E1C0FF",
|
|
|
|
|
[FightDifficultyState.NrmalLevel] = "F1E1C0FF",
|
|
|
|
|
[FightDifficultyState.DifficultyLevel] = "F1E1C0FF",
|
|
|
|
|
[FightDifficultyState.HellLevel] = "F1E1C0FF",
|
|
|
|
|
[FightDifficultyState.NightmareLevel] = "F1E1C0FF",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- 是否激活了动画
|
|
|
|
|
local isAnimActive = false
|
|
|
|
|
local chooseAnim = 0
|
|
|
|
|
-- 转场动画
|
|
|
|
|
local fightAnimRes = "live2d_guaji_yuguai"
|
|
|
|
|
-- local fightSkeleton
|
|
|
|
|
local fightAnim = {
|
|
|
|
|
[2] = "diban",
|
|
|
|
|
[3] = "xiaoguai",
|
|
|
|
|
[4] = "bnoss",
|
|
|
|
|
[1] = "idle",
|
|
|
|
|
}
|
2021-03-27 20:01:39 +08:00
|
|
|
|
-- local mapNpc = "live2d_npc_map"
|
|
|
|
|
-- local mapNpc2 = "live2d_npc_map_nv"
|
|
|
|
|
-- local npc
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
--初始化组件(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:InitComponent()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.battleSceneLogicGameObject, this.battleSceneGameObject = BattleManager.CreateBattleScene(nil, nil) --创建战场Prefab
|
|
|
|
|
--local battleCamera = Util.GetGameObject(self.battleSceneGameObject, "CameraRoot/CameraPos/Camera"):GetComponent(
|
|
|
|
|
--"Camera")
|
|
|
|
|
--local canvas = self.battleSceneLogicGameObject:GetComponent("Canvas")
|
|
|
|
|
--canvas.camera = battleCamera
|
|
|
|
|
fightOnHook:InitComponent(self.gameObject, this, this.battleSceneLogicGameObject, this.battleSceneGameObject)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
invadeMonster:InitComponent(self.gameObject, this)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--this.RawBG = Util.GetGameObject(self.gameObject, "RawImage"):GetComponent("RawImage")
|
|
|
|
|
local battleCamera = Util.GetGameObject(self.battleSceneGameObject, "CameraRoot/CameraPos/Camera"):GetComponent(
|
|
|
|
|
"Camera")
|
|
|
|
|
--battleCamera.targetTexture = this.RawBG.texture
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader = SpriteLoader.New()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
isAnimActive = false
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap:InitComponent(self.gameObject, this)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 通关豪礼入口
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.pgBtn = Util.GetGameObject(self.gameObject, "LeftUp/box/passGift")
|
|
|
|
|
this.pgFrame = Util.GetGameObject(this.pgBtn, "frame"):GetComponent("Image")
|
|
|
|
|
this.pgHead = Util.GetGameObject(this.pgBtn, "head"):GetComponent("Image")
|
|
|
|
|
this.pgGive = Util.GetGameObject(this.pgBtn, "give"):GetComponent("Text")
|
|
|
|
|
this.pgName = Util.GetGameObject(this.pgBtn, "name"):GetComponent("Text")
|
|
|
|
|
this.pgInfo = Util.GetGameObject(this.pgBtn, "info"):GetComponent("Text")
|
|
|
|
|
this.pgEffect = Util.GetGameObject(this.pgBtn, "effect")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
-- 四个小按钮
|
|
|
|
|
this.btnDailyMission = Util.GetGameObject(self.gameObject, "Bg/btnGroup/btnDailyMission")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.GetGameObject(self.gameObject, "Bg/btnGroup/btnDailyMission/Image"):GetComponent("Image").sprite = this
|
|
|
|
|
.spLoader:LoadSprite("UI_hz_lm_05")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.btnRank = Util.GetGameObject(self.gameObject, "Bg/btnGroup/btnRank")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.GetGameObject(self.gameObject, "Bg/btnGroup/btnRank/Image"):GetComponent("Image").sprite = this.spLoader
|
|
|
|
|
:LoadSprite("UI_hz_zhonghe05_14")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 关卡小地图
|
|
|
|
|
this.btnMap = Util.GetGameObject(self.gameObject, "Bg/btnArea")
|
2020-06-03 19:09:01 +08:00
|
|
|
|
this.btnMapRadarBG = Util.GetGameObject(self.gameObject, "Bg/btnArea/RadarBG/RadarBG"):GetComponent("Image")
|
|
|
|
|
this.RadarBGText = Util.GetGameObject(self.gameObject, "Bg/btnArea/RadarBGTextBg/RadarBGText"):GetComponent("Text")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.areaName = Util.GetGameObject(self.gameObject, "Bg/chapter/areaName"):GetComponent("Text")
|
2023-11-10 14:42:52 +08:00
|
|
|
|
this.chapterName = Util.GetGameObject(self.gameObject, "Bg/chapter/chapterName"):GetComponent("Text")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
SetEnglishActive(this.chapterName)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.map = Util.GetGameObject(self.gameObject, "Bg/btnArea/MapMask/Map"):GetComponent("RectTransform")
|
|
|
|
|
this.mapImage = Util.GetGameObject(self.gameObject, "Bg/btnArea/MapMask/Map"):GetComponent("Image")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
for i = 1, 20 do
|
2024-10-10 16:52:39 +08:00
|
|
|
|
points[i] = Util.GetGameObject(self.gameObject, "Bg/btnArea/MapMask/Map/mapAreaPre (" .. i .. ")")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 挂机奖励
|
|
|
|
|
this.rewardList = {}
|
|
|
|
|
this.rewardItemPre = Util.GetGameObject(self.gameObject, "Bg/rewardContent/item")
|
|
|
|
|
this.rewardGrid = Util.GetGameObject(self.gameObject, "Bg/rewardContent")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.btnrewardDetail = Util.GetGameObject(self.gameObject, "Bg/btnRdDetail/click")
|
2024-12-24 16:34:23 +08:00
|
|
|
|
this.btnreward = Util.GetGameObject(self.gameObject, "Bg/getBoxReward/getBoxReward/btn")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
this.btnFight = Util.GetGameObject(self.gameObject, "Bg/btnDown/btnFight")
|
|
|
|
|
this.fightText = Util.GetGameObject(this.btnFight, "Text"):GetComponent("Text")
|
2021-04-08 18:16:28 +08:00
|
|
|
|
this.fightSaoGuang = Util.GetGameObject(this.btnFight, "saoguang")
|
2022-01-14 16:02:10 +08:00
|
|
|
|
this.fightGuideEffect = Util.GetGameObject(this.btnFight, "GuideEffect")
|
2021-02-26 17:16:37 +08:00
|
|
|
|
LanguageFontSizeFilter(this.fightText, 50)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 你要变强
|
|
|
|
|
this.btnGetForce = Util.GetGameObject(self.gameObject, "Bg/btnDown/btnIWantMilk")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.GetGameObject(self.gameObject, "Bg/btnDown/btnIWantMilk/Text"):GetComponent("Text").text = "推荐阵容"
|
|
|
|
|
this.milkRed = Util.GetGameObject(self.gameObject, "Bg/btnDown/btnIWantMilk/redPoint")
|
2022-11-22 18:19:37 +08:00
|
|
|
|
this.hookKill = Util.GetGameObject(self.gameObject, "Bg/btnDown/hookKill")
|
|
|
|
|
this.hookKillText = Util.GetGameObject(self.gameObject, "Bg/btnDown/hookKill/Text"):GetComponent("Text")
|
2022-11-24 18:28:48 +08:00
|
|
|
|
this.red_light = Util.GetGameObject(self.gameObject, "Bg/red_light")
|
|
|
|
|
this.red_light:SetActive(false)
|
|
|
|
|
this.red_wei = Util.GetGameObject(self.gameObject, "Bg/red_light/wei")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.hookSkillBtn = Util.GetGameObject(self.gameObject, "Bg/red_light/skillBtn")
|
|
|
|
|
|
2021-03-30 19:54:19 +08:00
|
|
|
|
|
|
|
|
|
if not this.playerInfoView then
|
|
|
|
|
this.playerInfoView = SubUIManager.Open(SubUIConfig.PlayerInfoView, this.transform)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.BtView = SubUIManager.Open(SubUIConfig.BtView, self.gameObject.transform)
|
|
|
|
|
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
|
|
|
|
|
|
|
|
|
-- 红点
|
|
|
|
|
this.dailyRedPoint = Util.GetGameObject(this.btnDailyMission, "redPoint")
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--this.rankRedPoint = Util.GetGameObject(this.btnRank, "redPoint")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
--this.funcBtnList[16] = invadeMonster.btnRewardOnline
|
|
|
|
|
--this.funcBtnList[19] = invadeMonster.btnRewrdChapter
|
|
|
|
|
this.funcBtnList[12] = this.btnDailyMission
|
|
|
|
|
|
|
|
|
|
-- 主线任务显示
|
|
|
|
|
this.mainTask = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask")
|
2021-05-21 11:01:37 +08:00
|
|
|
|
this.goVipButton = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/progressLayout")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.titleText = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/progressLayout/titleText"):GetComponent(
|
|
|
|
|
"Text")
|
|
|
|
|
this.progressText = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/progressLayout/progressText")
|
|
|
|
|
:GetComponent("Text")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.getRewardButton = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/getRewardButton")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.mainTaskGRewardImage = Util.GetGameObject(self.gameObject,
|
|
|
|
|
"Bg/RightDown/mainTask/getRewardButton/getRewardImage")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.mainTaskJumpImage = Util.GetGameObject(self.gameObject, "Bg/RightDown/mainTask/getRewardButton/jumpImage")
|
2021-12-26 19:12:25 +08:00
|
|
|
|
-- 解锁提示
|
|
|
|
|
this.OpenTips = Util.GetGameObject(self.gameObject, "Bg/RightDown/OpenTips")
|
|
|
|
|
this.OpenTipsTxt = Util.GetGameObject(self.gameObject, "Bg/RightDown/OpenTips/Image/Text"):GetComponent("Text")
|
2020-05-25 19:16:23 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.GuideEffectGo = poolManager:LoadAsset("GuideEffect", PoolManager.AssetType.GameObject)
|
|
|
|
|
this.GuideEffectGo.transform:SetParent(this.mainTaskGRewardImage.transform)
|
|
|
|
|
this.GuideEffectGo.transform.localPosition = Vector3.zero
|
|
|
|
|
this.GuideEffectGo.transform.localScale = Vector3.one
|
|
|
|
|
Util.GetGameObject(this.GuideEffectGo, "GameObject"):SetActive(false)
|
|
|
|
|
this.GuideJumpEffectGo = poolManager:LoadAsset("GuideEffect", PoolManager.AssetType.GameObject)
|
|
|
|
|
this.GuideJumpEffectGo.transform:SetParent(this.mainTaskJumpImage.transform)
|
|
|
|
|
this.GuideJumpEffectGo.transform.localPosition = Vector3.zero
|
|
|
|
|
this.GuideJumpEffectGo.transform.localScale = Vector3.one
|
|
|
|
|
Util.GetGameObject(this.GuideJumpEffectGo, "GameObject"):SetActive(false)
|
|
|
|
|
this.GuideJumpEffectGo:SetActive(false)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-25 19:16:23 +08:00
|
|
|
|
this.fightRP = Util.GetGameObject(this.btnFight, "redPoint")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 按钮
|
|
|
|
|
this.fightLock = Util.GetGameObject(this.btnFight, "lock")
|
|
|
|
|
this.lockText = Util.GetGameObject(this.fightLock, "Text"):GetComponent("Text")
|
|
|
|
|
|
|
|
|
|
--倒计时5秒
|
|
|
|
|
this.timeRoot = Util.GetGameObject(this.btnFight, "countRoot")
|
|
|
|
|
this.timeImg = Util.GetGameObject(this.timeRoot, "time"):GetComponent("Image")
|
|
|
|
|
this.timeRoot:SetActive(false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- -- 转场动画
|
|
|
|
|
-- local idle = function()
|
|
|
|
|
-- if not isAnimActive then return end
|
|
|
|
|
-- --Log("第 " .. count .. " 次执行这个函数" )
|
|
|
|
|
-- if count == 2 then
|
|
|
|
|
-- --isAnimActive = false
|
|
|
|
|
-- --count = 1
|
|
|
|
|
-- --fightSkeleton.AnimationState:SetAnimation(0, fightAnim[1], false)
|
|
|
|
|
-- --this.SetAnimPanelState(false)
|
|
|
|
|
|
|
|
|
|
-- else
|
|
|
|
|
-- fightSkeleton.AnimationState:SetAnimation(0, fightAnim[chooseAnim], false)
|
|
|
|
|
-- count = count + 1
|
|
|
|
|
|
|
|
|
|
-- this.animTimer = nil
|
|
|
|
|
-- this.animTimer = Timer.New(function ()
|
|
|
|
|
-- isAnimActive = false
|
|
|
|
|
-- count = 1
|
|
|
|
|
-- fightSkeleton.AnimationState:SetAnimation(0, fightAnim[1], false)
|
|
|
|
|
-- this.SetAnimPanelState(false)
|
|
|
|
|
-- UIManager.OpenPanel(UIName.FormationPanel, FORMATION_TYPE.STORY, FightPointPassManager.curOpenFight)
|
|
|
|
|
-- end, 1)
|
|
|
|
|
-- this.animTimer:Start()
|
|
|
|
|
|
|
|
|
|
-- -- 第一个动画播放完毕之后
|
|
|
|
|
-- this.PlayInfoAnim(false, FightPointPassManager.IsFightBoss())
|
|
|
|
|
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
-- this.swicthPanel = Util.GetGameObject(self.gameObject, "SwitchAnim")
|
|
|
|
|
|
|
|
|
|
-- this.animGo = poolManager:LoadLive(fightAnimRes, this.swicthPanel.transform, Vector3.one, Vector3.one)
|
|
|
|
|
-- fightSkeleton = this.animGo:GetComponent("SkeletonGraphic")
|
|
|
|
|
-- fightSkeleton.AnimationState.Complete = fightSkeleton.AnimationState.Complete + idle
|
|
|
|
|
-- poolManager:SetLiveClearCall(fightAnimRes, this.animGo, function()
|
|
|
|
|
-- fightSkeleton.AnimationState.Complete = fightSkeleton.AnimationState.Complete - idle
|
|
|
|
|
-- end)
|
|
|
|
|
|
|
|
|
|
-- this.fightInfo = Util.GetGameObject(self.gameObject, "Bg/Image/info"):GetComponent("Text")
|
|
|
|
|
-- this.imgInfo = Util.GetGameObject(self.gameObject, "Bg/Image")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FightPointPassManager.GetLastFightID()
|
|
|
|
|
--寻宝入口
|
|
|
|
|
this.btnFindTreasure = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/btnFindTreasure/Button")
|
2024-10-14 11:34:01 +08:00
|
|
|
|
this.btnFindTreasure:GetComponent("Image").sprite = this.spLoader:LoadSprite("hiddenweapon_icon1")
|
2024-11-13 10:29:52 +08:00
|
|
|
|
--this.btnFindTreasureImage = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/btnFindTreasure/Button/RadarBG")
|
|
|
|
|
--:GetComponent("Image")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.btnFindTreasureText = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/btnFindTreasure/Image/num")
|
|
|
|
|
:GetComponent("Text")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.btnFindTreasureredPoint = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/btnFindTreasure/redPoint")
|
2020-10-19 20:37:53 +08:00
|
|
|
|
--逍遥游入口
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.btnXiaoYao = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/xiaoyaoBtn")
|
|
|
|
|
this.btnXiaoYao:GetComponent("Image").sprite = this.spLoader:LoadSprite("x_xiaoyaoyou_daanniu_zh")
|
|
|
|
|
this.xiaoyaoRedPoint = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/xiaoyaoBtn/redPoint")
|
2020-10-19 22:56:05 +08:00
|
|
|
|
this.funcBtnList[FUNCTION_OPEN_TYPE.XiaoYaoYou] = this.btnXiaoYao
|
2022-07-11 15:43:04 +08:00
|
|
|
|
--数字游戏按钮
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.numberGameBtn = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/numberGameBtn")
|
|
|
|
|
this.numberGameRed = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/numberGameBtn/redPoint")
|
2022-07-18 16:05:39 +08:00
|
|
|
|
this.funcBtnList[FUNCTION_OPEN_TYPE.Number_Game] = this.numberGameBtn
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--解锁功能
|
|
|
|
|
this.openFun = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.openFunNeedInfo = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun/needInfo"):GetComponent(
|
|
|
|
|
"Text")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.openFunFunInfo = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/openFun/funInfo"):GetComponent("Text")
|
2021-06-15 20:08:14 +08:00
|
|
|
|
--世界等级
|
|
|
|
|
Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/worldLv/Text"):GetComponent("Text").text = "世界等级:"
|
|
|
|
|
this.worldLv = Util.GetGameObject(self.gameObject, "Bg/RightUpVertical/worldLv/lv"):GetComponent("Text")
|
2020-06-03 19:09:01 +08:00
|
|
|
|
-- 开服福利
|
2023-11-10 11:48:41 +08:00
|
|
|
|
--this.UI_Effect_MuBiaoJiangLi = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnOpenSeverWelfare/UI_Effect_MuBiaoJiangLi")
|
2024-11-13 10:29:52 +08:00
|
|
|
|
this.btnOpenSeverWelfare = Util.GetGameObject(self.gameObject, "Bg/btnGroup/btnOpenSeverWelfare")
|
2022-06-30 18:17:58 +08:00
|
|
|
|
this.btnFirstRechar = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnFirstRecharge")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.GetGameObject(this.btnFirstRechar, "Image"):GetComponent("Image").sprite = this.spLoader:LoadSprite(
|
2024-10-14 11:48:06 +08:00
|
|
|
|
"X1_zhucheng_chaozhishouchong")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.firstRedPoint = Util.GetGameObject(this.btnFirstRechar, "redPoint")
|
2024-11-13 10:29:52 +08:00
|
|
|
|
this.OpenSeverWelfare = Util.GetGameObject(self.gameObject, "Bg/btnGroup/btnOpenSeverWelfare/bg")
|
2023-11-10 11:48:41 +08:00
|
|
|
|
--this.OpenSeverWelfareicon = Util.GetGameObject(this.UI_Effect_MuBiaoJiangLi, "UI_MuBiaoJiangLi_Import_05"):GetComponent("Image")
|
|
|
|
|
--this.OpenSeverWelfareiconText = Util.GetGameObject(this.OpenSeverWelfare, "iconText"):GetComponent("Image")
|
2022-10-17 16:13:47 +08:00
|
|
|
|
this.OpenSeverWelfareProgressBg = Util.GetGameObject(this.OpenSeverWelfare, "progressBg")
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.OpenSeverWelfareProgressText = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progress"):GetComponent(
|
|
|
|
|
"Text")
|
|
|
|
|
this.OpenSeverWelfareProgressImage = Util.GetGameObject(this.OpenSeverWelfare, "progressBg/progressImage")
|
2024-11-13 14:31:41 +08:00
|
|
|
|
:GetComponent("Slider")
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.OpenSeverWelfareTimeText = Util.GetGameObject(this.OpenSeverWelfare, "time"):GetComponent("Text")
|
2022-10-17 16:13:47 +08:00
|
|
|
|
this.OpenSeverWelfareTimeText.gameObject:SetActive(false)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.OpenSeverWelfareInfoText = Util.GetGameObject(this.OpenSeverWelfare, "info"):GetComponent("Text")
|
|
|
|
|
this.OpenSeverWelfareRed = Util.GetGameObject(this.OpenSeverWelfare, "redpot")
|
2020-08-31 20:52:50 +08:00
|
|
|
|
this.battleUpLvTip = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip")
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleUpLvTipImg = this.battleUpLvTip:GetComponent("Image")
|
2021-12-27 13:11:33 +08:00
|
|
|
|
this.battleUpLvTipTxt = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip/Text"):GetComponent("Text")
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleLockGo = Util.GetGameObject(self.gameObject, "Bg/btnDown/battleUpLvTip/Image")
|
2024-01-20 11:44:58 +08:00
|
|
|
|
--山河社稷图OpenPanel
|
2021-05-11 15:12:37 +08:00
|
|
|
|
this.btnFightLevel = Util.GetGameObject(self.gameObject, "Bg/LeftUp/box/btnFightLevel")
|
2021-07-23 15:22:51 +08:00
|
|
|
|
this.btnFightLevel:SetActive(false)
|
|
|
|
|
-- this.funcBtnList[FUNCTION_OPEN_TYPE.FIGHTLEVEL] = this.btnFightLevel
|
|
|
|
|
-- this.btnFightLevelRedPoint = Util.GetGameObject(this.btnFightLevel, "redPoint")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--绑定事件(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:BindEvent()
|
|
|
|
|
invadeMonster:BindEvent()
|
|
|
|
|
|
|
|
|
|
-- 日常任务
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnDailyMission, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
FightPointPassManager.isBeginFight = true
|
2020-08-31 17:10:33 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.MissionDailyPanel)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- 关卡排行
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnRank, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--PopupTipPanel.ShowTip("关卡排行!")
|
|
|
|
|
FightPointPassManager.isBeginFight = true
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--UIManager.OpenPanel(UIName.FightPointPassRankPopup)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.RankingSingleListPanel, rankKingList[38])
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
-- 挂机奖励
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnrewardDetail, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.FightAreaRewardPopup)
|
|
|
|
|
end)
|
|
|
|
|
|
2024-12-24 16:34:23 +08:00
|
|
|
|
Util.AddClick(this.btnreward, function()
|
|
|
|
|
UIManager.OpenPanel(UIName.FightAreaRewardPopup)
|
|
|
|
|
end)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 我要喝牛奶变强
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnGetForce, function()
|
|
|
|
|
--UIManager.OpenPanel(UIName.GiveMePowerPanel)
|
|
|
|
|
UIManager.OpenPanel(UIName.FormationExamplePopup)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end)
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnFight, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.ExcuteBattle()
|
|
|
|
|
end)
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.hookSkillBtn, function()
|
2022-11-22 18:19:37 +08:00
|
|
|
|
this:PlayerKillAllSkill()
|
|
|
|
|
end)
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnMap, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if not FightPointPassManager.IsChapterClossState() then
|
|
|
|
|
UIManager.OpenPanel(UIName.FightSmallChoosePanel, FightPointPassManager.lastPassFightId)
|
|
|
|
|
else
|
|
|
|
|
UIManager.OpenPanel(UIName.FightSmallChoosePanel, FightPointPassManager.curOpenFight)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
--通关豪礼
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.pgBtn, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
FightPointPassManager.isBeginFight = true
|
|
|
|
|
UIManager.OpenPanel(UIName.PassGiftPopup)
|
|
|
|
|
end)
|
|
|
|
|
--寻宝
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnFindTreasure, function()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.FINDTREASURE) then
|
|
|
|
|
UIManager.OpenPanel(UIName.FindTreasureMainPanel)
|
|
|
|
|
else
|
|
|
|
|
PopupTipPanel.ShowTip(ActTimeCtrlManager.GetFuncTip(FUNCTION_OPEN_TYPE.FINDTREASURE))
|
|
|
|
|
end
|
|
|
|
|
end)
|
2020-10-19 20:37:53 +08:00
|
|
|
|
--逍遥游
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.btnXiaoYao, function()
|
2020-10-19 20:37:53 +08:00
|
|
|
|
XiaoYaoManager.OpenMapList()
|
|
|
|
|
end)
|
2022-07-11 15:43:04 +08:00
|
|
|
|
--数字游戏
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddClick(this.numberGameBtn, function()
|
2022-07-25 15:06:04 +08:00
|
|
|
|
--RatioNumberManager.SelectInit()
|
2022-07-11 15:43:04 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.RatioNumberLevelPanel)
|
|
|
|
|
end)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
Util.AddClick(this.btnOpenSeverWelfare, function()
|
|
|
|
|
UIManager.OpenPanel(UIName.OpenSeverWelfarePanel)
|
|
|
|
|
end)
|
2021-05-11 15:12:37 +08:00
|
|
|
|
|
2021-07-23 15:22:51 +08:00
|
|
|
|
-- Util.AddClick(this.btnFightLevel, function()
|
|
|
|
|
-- UIManager.OpenPanel(UIName.FightLevelChapterPanel)
|
|
|
|
|
-- end)
|
2021-05-11 15:12:37 +08:00
|
|
|
|
|
2021-05-21 11:01:37 +08:00
|
|
|
|
Util.AddClick(this.goVipButton, function()
|
|
|
|
|
UIManager.OpenPanel(UIName.VipPanelV2)
|
|
|
|
|
end)
|
2022-06-30 18:17:58 +08:00
|
|
|
|
Util.AddClick(this.btnFirstRechar, function()
|
|
|
|
|
UIManager.OpenPanel(UIName.FirstRechargePanel)
|
|
|
|
|
end)
|
2021-05-21 11:01:37 +08:00
|
|
|
|
|
2021-05-20 21:00:29 +08:00
|
|
|
|
Util.AddClick(this.getRewardButton, function()
|
|
|
|
|
local t, task = VipManager.GetVipTaskShowInFight()
|
|
|
|
|
if t == 1 and task.state == VipTaskStatusDef.NotFinished then
|
|
|
|
|
local taskConfigInfo = ConfigManager.GetConfigData(ConfigName.TaskConfig, task.missionId)
|
|
|
|
|
JumpManager.GoJump(taskConfigInfo.Jump[1])
|
|
|
|
|
else
|
|
|
|
|
UIManager.OpenPanel(UIName.VipPanelV2)
|
|
|
|
|
end
|
|
|
|
|
end)
|
|
|
|
|
|
2020-06-08 13:57:30 +08:00
|
|
|
|
BindRedPointObject(RedPointType.DailyTaskMain, this.dailyRedPoint)
|
2020-05-25 19:16:23 +08:00
|
|
|
|
BindRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP)
|
2020-10-19 20:29:49 +08:00
|
|
|
|
BindRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint)
|
2022-06-30 18:17:58 +08:00
|
|
|
|
BindRedPointObject(RedPointType.FirstRecharge, this.firstRedPoint)
|
2022-07-25 15:06:04 +08:00
|
|
|
|
BindRedPointObject(RedPointType.numberGame, this.numberGameRed)
|
2023-01-10 16:39:58 +08:00
|
|
|
|
BindRedPointObject(RedPointType.tuijianzhenrong, this.milkRed)
|
2021-09-14 17:37:14 +08:00
|
|
|
|
-- BindRedPointObject(RedPointType.FightLevel, this.btnFightLevelRedPoint)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.SetInitAnim()
|
|
|
|
|
-- 隐藏界面特效
|
|
|
|
|
-- count = 1
|
|
|
|
|
-- this.GuideEffectGo:SetActive(false)
|
|
|
|
|
-- this.GuideJumpEffectGo:SetActive(false)
|
|
|
|
|
-- this.swicthPanel:SetActive(true)
|
|
|
|
|
-- this.SetAnimPanelState(true)
|
|
|
|
|
-- fightSkeleton.AnimationState:SetAnimation(0, fightAnim[2], false)
|
|
|
|
|
-- isAnimActive = true
|
|
|
|
|
-- chooseAnim = FightPointPassManager.IsFightBoss() and 4 or 3
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap.StopAction()
|
|
|
|
|
fightOnHook.StopAction()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.FightLevelSwitchPopup, true)
|
|
|
|
|
end
|
|
|
|
|
|
2022-11-22 18:19:37 +08:00
|
|
|
|
function this:PlayerKillAllSkill()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local offset = Vector3.zero
|
2022-11-22 18:19:37 +08:00
|
|
|
|
local go = BattleManager.LoadAsset("Effect_c_jw_0003_attack_01", 10)
|
|
|
|
|
go.transform:SetParent(self.gameObject.transform)
|
|
|
|
|
go.transform.localScale = Vector3.one
|
2024-10-10 16:52:39 +08:00
|
|
|
|
go.transform.localPosition = offset
|
2022-11-22 18:19:37 +08:00
|
|
|
|
go:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--this.skillTimer = Timer.New(function()
|
|
|
|
|
--fightMap.AllBattleEnd()
|
|
|
|
|
--end, 3)
|
2022-11-22 18:19:37 +08:00
|
|
|
|
this.skillTimer:Start()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Timer.New(function()
|
2022-11-22 18:19:37 +08:00
|
|
|
|
destroy(go)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
end, 5):Start()
|
2022-11-22 18:19:37 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 隐藏显示面板
|
|
|
|
|
-- function this.SetAnimPanelState(isShow)
|
|
|
|
|
-- local offset = isShow and 0 or 2000
|
|
|
|
|
-- this.swicthPanel.transform.localPosition = Vector3.New(offset, 0, 0 )
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--添加事件监听(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:AddListener()
|
|
|
|
|
invadeMonster:AddListener()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap:AddListener()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen)
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum)
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTreasureRedPoint)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Mission.GetOpenServerRewardRefreshFightPoint, this.UpdateOpenSeverWelfare)
|
2020-08-31 20:52:50 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Player.OnShowBattleUpLvTip, this.RefreshBattleUpLvTip)
|
2021-04-01 16:21:35 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, this.SetFightBtnText)
|
2021-12-26 19:12:25 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Player.OnPlayerLvChange, this.RefreshOpenTips)
|
2021-05-21 13:55:40 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.DynamicTask.OnMissionChange, this.refreshVipTask)
|
2021-06-15 20:08:14 +08:00
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.JumpServerHeightLadder.UpdateWordLv, this.UpdateWordLv)
|
2022-01-18 11:38:00 +08:00
|
|
|
|
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.UI.OnOpen, this.OnUIOpen)
|
|
|
|
|
Game.GlobalEvent:AddEvent(GameEvent.Guide.FuncGuideDone, this.OnFuncGuideDone)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--移除事件监听(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:RemoveListener()
|
|
|
|
|
invadeMonster:RemoveListener()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap:RemoveListener()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.FunctionCtrl.OnFunctionOpen, this.BtnsIsOpen)
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Bag.BagGold, this.UpdateFindTreasureMaterialNum)
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.FindTreasure.RefreshFindTreasureRedPot, this.RefreshFindTre3asureRedPoint)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Mission.GetOpenServerRewardRefreshFightPoint, this.UpdateOpenSeverWelfare)
|
2020-08-31 20:52:50 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnShowBattleUpLvTip, this.RefreshBattleUpLvTip)
|
2021-04-01 16:21:35 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, this.SetFightBtnText)
|
2021-12-26 19:12:25 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Player.OnPlayerLvChange, this.RefreshOpenTips)
|
2021-05-21 13:55:40 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.DynamicTask.OnMissionChange, this.refreshVipTask)
|
2021-06-15 20:08:14 +08:00
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.JumpServerHeightLadder.UpdateWordLv, this.UpdateWordLv)
|
2022-01-18 11:38:00 +08:00
|
|
|
|
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.UI.OnOpen, this.OnUIOpen)
|
|
|
|
|
Game.GlobalEvent:RemoveEvent(GameEvent.Guide.FuncGuideDone, this.OnFuncGuideDone)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面打开时调用(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:OnOpen(func)
|
|
|
|
|
this.UpView:OnOpen({ showType = UpViewOpenType.ShowRight, panelType = PanelType.FightPointPass })
|
2021-04-22 13:40:04 +08:00
|
|
|
|
this.BtView:OnOpen(self, { sortOrder = self.sortingOrder, panelType = PanelTypeView.JieLing })
|
2020-05-09 13:31:21 +08:00
|
|
|
|
callBack = nil
|
2020-05-15 16:52:35 +08:00
|
|
|
|
if func then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
callBack = func
|
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2022-10-17 16:13:47 +08:00
|
|
|
|
function FightPointPassMainPanel:OnFocus()
|
|
|
|
|
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if activityId and activityId ~= 0 and ActTimeCtrlManager.SingleFuncState(1) then
|
2022-10-17 16:13:47 +08:00
|
|
|
|
this.btnFirstRechar:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
this.btnFirstRechar:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 从战斗出来会加载两次
|
|
|
|
|
function FightPointPassMainPanel:OnShow()
|
2024-10-11 15:57:22 +08:00
|
|
|
|
UIManager.camera.clearFlags = CameraClearFlags.Depth
|
2020-10-19 20:29:49 +08:00
|
|
|
|
CheckRedPointStatus(RedPointType.XiaoYaoYouRedPoint)
|
2022-07-25 15:06:04 +08:00
|
|
|
|
CheckRedPointStatus(RedPointType.numberGame)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if this.battleSceneLogicGameObject ~= nil then
|
|
|
|
|
this.battleSceneLogicGameObject:SetActive(true)
|
|
|
|
|
end
|
|
|
|
|
if this.battleSceneGameObject ~= nil then
|
|
|
|
|
this.battleSceneGameObject:SetActive(true)
|
|
|
|
|
end
|
2022-06-30 18:17:58 +08:00
|
|
|
|
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.FirstRecharge)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if activityId and activityId ~= 0 and ActTimeCtrlManager.SingleFuncState(1) then
|
2022-06-30 18:17:58 +08:00
|
|
|
|
this.btnFirstRechar:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
this.btnFirstRechar:SetActive(false)
|
|
|
|
|
end
|
2022-11-22 18:19:37 +08:00
|
|
|
|
local curFightId = FightPointPassManager.curOpenFight
|
2020-09-07 15:38:12 +08:00
|
|
|
|
-- 功能引导存在时不再显示成长界面
|
|
|
|
|
if FightPointPassManager.GetIsOpenRewardUpTip() and not GuideManager.IsFunctionGuideExist() then
|
2021-05-22 14:08:34 +08:00
|
|
|
|
local oldLevelId = FightPointPassManager.lastPassFightId
|
2022-11-22 18:19:37 +08:00
|
|
|
|
local curLevelId = curFightId
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local oldLevelConFig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, oldLevelId)
|
|
|
|
|
local curLevelConFig = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, curLevelId)
|
2021-05-22 14:08:34 +08:00
|
|
|
|
local data = {}
|
|
|
|
|
data.title = "g_guanka_jianglitishen_zh"
|
|
|
|
|
data.itemList = {}
|
|
|
|
|
data.type = 1
|
|
|
|
|
for i = 1, #curLevelConFig.RewardShowMin do
|
|
|
|
|
local oldsinglePro = oldLevelConFig.RewardShowMin[i]
|
|
|
|
|
local cursinglePro = curLevelConFig.RewardShowMin[i]
|
|
|
|
|
local singleItem = {}
|
|
|
|
|
singleItem.icon = cursinglePro[1]
|
|
|
|
|
singleItem.proName = GetLanguageStrById(itemConfig[cursinglePro[1]].Name)
|
|
|
|
|
singleItem.proValue = oldsinglePro[2]
|
|
|
|
|
if cursinglePro[2] - oldsinglePro[2] > 0 then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
singleItem.proValue1 = "<color=#529864>" .. cursinglePro[2] .. "</color>" .. Language[11567]
|
2021-05-22 14:08:34 +08:00
|
|
|
|
else
|
2024-10-10 16:52:39 +08:00
|
|
|
|
singleItem.proValue1 = "<color=#C8AD83>" .. cursinglePro[2] .. Language[11568]
|
2021-05-22 14:08:34 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
table.insert(data.itemList, singleItem)
|
2021-05-22 14:08:34 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.GeneralPopup, GENERAL_POPUP_TYPE.Onhook, data)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.RefreshLittleMap()
|
|
|
|
|
this.RefreshPassGiftShow()
|
|
|
|
|
SoundManager.PlayMusic(SoundConfig.BGM_Main)
|
2020-10-19 20:37:53 +08:00
|
|
|
|
-- 调用onshow
|
2020-05-09 13:31:21 +08:00
|
|
|
|
invadeMonster:OnShow()
|
|
|
|
|
|
2022-11-22 18:19:37 +08:00
|
|
|
|
local curName = GetLanguageStrById(fightLevelConfig[curFightId].Name)
|
|
|
|
|
local curDifficulty = fightLevelConfig[curFightId].Difficulty
|
2021-12-02 01:06:34 +08:00
|
|
|
|
local chapterId = 0
|
|
|
|
|
local str = ""
|
|
|
|
|
if not FightPointPassManager.IsChapterClossState() then
|
|
|
|
|
chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000)
|
|
|
|
|
str = GetLanguageStrById(fightLevelConfig[FightPointPassManager.lastPassFightId].Name)
|
|
|
|
|
else
|
|
|
|
|
str = string.format("<color=#%s>%s</color> ", textColor[curDifficulty], curName)
|
|
|
|
|
chapterId = FightPointPassManager.GetCurChapterIndex()
|
|
|
|
|
end
|
|
|
|
|
this.areaName.text = str
|
|
|
|
|
if GetCurLanguage() ~= 0 then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.areaName.gameObject.transform.localPosition = Vector2.New(0, 0)
|
2021-12-02 01:06:34 +08:00
|
|
|
|
end
|
|
|
|
|
this.chapterName.text = GetLanguageStrById(fightLevelSetConfig[chapterId].Name)
|
|
|
|
|
|
2021-12-02 04:18:13 +08:00
|
|
|
|
-- 奖励预览
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.IntiReward()
|
2021-12-02 04:18:13 +08:00
|
|
|
|
-- 刷新关卡按钮状态
|
|
|
|
|
this.SetFightBtnText()
|
|
|
|
|
|
2024-10-17 19:57:06 +08:00
|
|
|
|
local loadMapName = fightLevelConfig[FightPointPassManager.curOpenFight].BG
|
|
|
|
|
LogError("@@@@@@"..loadMapName)
|
|
|
|
|
if this.mapName ~= loadMapName then
|
|
|
|
|
this.mapName = loadMapName
|
|
|
|
|
if this.mapGameObject ~= nil then
|
|
|
|
|
GameObject.Destroy(this.mapGameObject)
|
|
|
|
|
end
|
|
|
|
|
this.mapGameObject = BattleManager.CreateMap(this.battleSceneGameObject, loadMapName)
|
|
|
|
|
fightOnHook:UpdateMap(this.mapGameObject)
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if not hasLoad then
|
|
|
|
|
timePressStarted = Time.realtimeSinceStartup
|
|
|
|
|
isAnimActive = false
|
2024-10-10 16:52:39 +08:00
|
|
|
|
fightOnHook.Init()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
isCounting = false
|
|
|
|
|
-- 加载地图数据
|
2021-04-22 13:40:04 +08:00
|
|
|
|
coroutine.start(function()
|
2021-04-22 17:54:03 +08:00
|
|
|
|
-- coroutine.wait(0.01)
|
2021-04-22 13:40:04 +08:00
|
|
|
|
if UIManager.IsOpen(UIName.FightPointPassMainPanel) then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap:Init()
|
2021-04-22 13:40:04 +08:00
|
|
|
|
hasMap = true
|
|
|
|
|
end
|
|
|
|
|
end)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
FightPointPassManager.isBattleBack = false
|
|
|
|
|
hasLoad = true
|
|
|
|
|
|
|
|
|
|
this:Update()
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if callBack then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
callBack()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
callBack = nil
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-17 19:57:06 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.BtnsIsOpen()
|
|
|
|
|
--寻宝显示
|
|
|
|
|
this.UpdateFindTreasureMaterialNum()
|
2021-06-15 20:08:14 +08:00
|
|
|
|
this.worldLv.text = PlayerManager.worldLeve
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local openFunConFig = this.GetNextFightOpenFun()
|
|
|
|
|
if openFunConFig then
|
|
|
|
|
this.openFun:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.openFunNeedInfo.text = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, openFunConFig.OpenRules[2])
|
|
|
|
|
.Name
|
|
|
|
|
this.openFunFunInfo.text = Language[12163] .. openFunConFig.Name
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
|
|
|
|
this.openFun:SetActive(false)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
end --开服福利显示
|
|
|
|
|
this.UpdateOpenSeverWelfare()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-08-31 20:52:50 +08:00
|
|
|
|
PlayerManager.StarBattleUpLvTipTime(2)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.GetGameObject(this.btnXiaoYao, "curValue/num"):GetComponent("Text").text = string.format("%d/%d",
|
|
|
|
|
BagManager.GetItemCountById(UpViewRechargeType.YunYouVle), PrivilegeManager.GetPrivilegeNumber(39))
|
|
|
|
|
|
2021-03-30 20:46:47 +08:00
|
|
|
|
-- 刷新一次编队战斗力
|
|
|
|
|
FormationManager.RefreshMainFormationPower()
|
2021-05-06 18:08:53 +08:00
|
|
|
|
PatFaceManager.RefreshPatface()
|
2021-05-20 21:00:29 +08:00
|
|
|
|
|
|
|
|
|
-- 刷新任务显示
|
|
|
|
|
this.refreshVipTask()
|
2021-12-26 19:12:25 +08:00
|
|
|
|
-- 刷新解锁信息显示
|
|
|
|
|
this.RefreshOpenTips()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--
|
2021-12-27 13:11:33 +08:00
|
|
|
|
this.battleUpLvTip:SetActive(false)
|
|
|
|
|
this.RefreshBattleUpLvTip(true)
|
2022-11-25 15:43:42 +08:00
|
|
|
|
this.hookSkillBtn.gameObject:SetActive(false)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local hangArr = fightLevelConfig[curFightId].Hang
|
|
|
|
|
if hangArr and hangArr[1] > 0 then
|
|
|
|
|
maxKillNum = hangArr[2]
|
2022-11-22 18:19:37 +08:00
|
|
|
|
this.btnFight.gameObject:SetActive(false)
|
|
|
|
|
this.hookKill.gameObject:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
curKillNum = 0
|
|
|
|
|
this.hookKillText.text = string.format("%s/%s", curKillNum, maxKillNum)
|
2022-11-24 18:28:48 +08:00
|
|
|
|
this.red_light:SetActive(true)
|
2022-11-24 19:00:24 +08:00
|
|
|
|
this.red_light:GetComponent("Image"):DOFade(1, 0)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.red_light:GetComponent("Image"):DOFade(0, 1):SetEase(Ease.Linear):SetLoops(-1, 1)
|
2022-11-22 18:19:37 +08:00
|
|
|
|
else
|
|
|
|
|
this.btnFight.gameObject:SetActive(true)
|
|
|
|
|
this.hookKill.gameObject:SetActive(false)
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2022-11-24 19:00:24 +08:00
|
|
|
|
---播放“危”动画
|
2022-11-24 18:28:48 +08:00
|
|
|
|
function this.PlayWeiAnim()
|
|
|
|
|
this.red_wei:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.red_wei:GetComponent("Image"):DOFade(0, 0.5):SetEase(Ease.Linear):SetLoops(4, 1):OnComplete(function()
|
2022-11-24 18:28:48 +08:00
|
|
|
|
this.red_wei:SetActive(false)
|
2022-11-24 19:00:24 +08:00
|
|
|
|
this.hookSkillBtn.gameObject:SetActive(true)
|
2022-11-24 18:28:48 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2021-05-20 21:00:29 +08:00
|
|
|
|
-- 刷新任务显示
|
|
|
|
|
function this.refreshVipTask()
|
|
|
|
|
local t, task = VipManager.GetVipTaskShowInFight()
|
|
|
|
|
-- 满级后不再显示
|
2022-11-09 10:24:03 +08:00
|
|
|
|
--this.mainTask:SetActive(t ~= -1)
|
|
|
|
|
this.mainTask:SetActive(false)
|
2021-05-20 21:00:29 +08:00
|
|
|
|
if t == 0 then
|
|
|
|
|
-- 能激活时显示激活特权
|
|
|
|
|
this.titleText.text = "前往升级特权"
|
|
|
|
|
this.progressText.text = ""
|
|
|
|
|
elseif t == 1 then
|
|
|
|
|
-- 不能激活时显示任务
|
|
|
|
|
local taskConfigInfo = ConfigManager.GetConfigData(ConfigName.TaskConfig, task.missionId)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local color = task.state == VipTaskStatusDef.CanReceive and UIColorStr.GREEN or UIColorStr.YELLOW
|
2021-05-21 11:57:59 +08:00
|
|
|
|
this.titleText.text = GetLanguageStrById(taskConfigInfo.Desc)
|
|
|
|
|
-- 避免显示的太长
|
|
|
|
|
if tonumber(taskConfigInfo.TaskValue[2][1]) < 10000 then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.titleText.text = this.titleText.text ..
|
|
|
|
|
string.format("<color=%s>(%s/%s)</color>", color, task.progress, taskConfigInfo.TaskValue[2][1])
|
2021-05-21 11:57:59 +08:00
|
|
|
|
end
|
2021-05-20 21:00:29 +08:00
|
|
|
|
this.progressText.text = ""
|
|
|
|
|
this.mainTaskGRewardImage:SetActive(task.state ~= VipTaskStatusDef.NotFinished)
|
|
|
|
|
this.mainTaskJumpImage:SetActive(task.state == VipTaskStatusDef.NotFinished)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2021-12-26 19:12:25 +08:00
|
|
|
|
-- 刷新提示文字显示
|
|
|
|
|
function this.RefreshOpenTips()
|
|
|
|
|
local tips = FightPointPassManager.GetCurLevelTips()
|
|
|
|
|
if tips then
|
2022-07-21 13:43:03 +08:00
|
|
|
|
---不显示该提示
|
|
|
|
|
this.OpenTips:SetActive(false)
|
2021-12-26 19:12:25 +08:00
|
|
|
|
this.OpenTipsTxt.text = tips
|
|
|
|
|
else
|
|
|
|
|
this.OpenTips:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--寻宝显示
|
|
|
|
|
function this.UpdateFindTreasureMaterialNum()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local mazeTreasureMax = ConfigManager.GetConfigData(ConfigName.PlayerLevelConfig, PlayerManager.level)
|
|
|
|
|
.MazeTreasureMax
|
2024-11-13 10:29:52 +08:00
|
|
|
|
--this.btnFindTreasureImage.fillAmount = BagManager.GetItemCountById(FindTreasureManager.materialItemId) /
|
|
|
|
|
--mazeTreasureMax
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.btnFindTreasureText.text = BagManager.GetItemCountById(FindTreasureManager.materialItemId)
|
|
|
|
|
this.RefreshFindTreasureRedPoint()
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
function this.RefreshFindTreasureRedPoint()
|
|
|
|
|
this.btnFindTreasureredPoint:SetActive(FindTreasureManager.RefreshFindTreasureRedPoint())
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- -- 小怪 258 boss 570
|
|
|
|
|
-- -- 播放那个动画
|
|
|
|
|
-- function this.PlayInfoAnim(isInit, isBoss)
|
|
|
|
|
-- if isInit then
|
|
|
|
|
-- this.imgInfo.transform.localPosition = Vector3.New(0, -187, 0)
|
|
|
|
|
-- this.imgInfo:SetActive(false)
|
|
|
|
|
-- else
|
|
|
|
|
-- this.imgInfo:SetActive(true)
|
|
|
|
|
-- local targetPos = Vector3.zero
|
|
|
|
|
-- targetPos = isBoss and Vector3.New(0, 570, 0) or Vector3.New(0, 288, 0)
|
|
|
|
|
-- this.imgInfo:GetComponent("RectTransform"):DOAnchorPos(targetPos, 0.3, false):OnComplete(function ()
|
|
|
|
|
-- --this.imgInfo:SetActive(false)
|
|
|
|
|
-- end)
|
|
|
|
|
|
|
|
|
|
-- this.imgInfo:GetComponent("Image"):DOFade(1, 0.3):OnComplete(function ()
|
|
|
|
|
|
|
|
|
|
-- end)
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
|
|
|
|
|
local isCanShowMainTaskJumpEffect = true
|
|
|
|
|
function this:Update()
|
|
|
|
|
if curMianTaskData and curMianTaskData.state == 0 then
|
|
|
|
|
if isCanShowMainTaskJumpEffect then
|
|
|
|
|
if Time.realtimeSinceStartup - timePressStarted > 5 then
|
|
|
|
|
isCanShowMainTaskJumpEffect = false
|
|
|
|
|
this.GuideJumpEffectGo:SetActive(true)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if Input.GetMouseButtonDown(0) then
|
|
|
|
|
timePressStarted = Time.realtimeSinceStartup
|
|
|
|
|
isCanShowMainTaskJumpEffect = true
|
|
|
|
|
this.GuideJumpEffectGo:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
fightOnHook.Update()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
2020-05-15 16:52:35 +08:00
|
|
|
|
--按钮开启限制
|
2020-05-09 13:31:21 +08:00
|
|
|
|
function this.BtnsIsOpen()
|
|
|
|
|
for i, v in pairs(this.funcBtnList) do
|
2024-10-10 16:52:39 +08:00
|
|
|
|
LogError("i===" .. i)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local isOpen = ActTimeCtrlManager.SingleFuncState(i)
|
|
|
|
|
v:SetActive(isOpen)
|
|
|
|
|
end
|
2020-05-15 16:52:35 +08:00
|
|
|
|
this.btnRank.gameObject:SetActive(ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING))
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function this.IntiReward()
|
2020-07-21 20:20:39 +08:00
|
|
|
|
local rewardData
|
|
|
|
|
if FightPointPassManager.isOpenNewChapter then
|
|
|
|
|
rewardData = fightLevelConfig[FightPointPassManager.curOpenFight].RewardShowMin
|
|
|
|
|
else
|
|
|
|
|
rewardData = fightLevelConfig[FightPointPassManager.lastPassFightId].RewardShowMin
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
for i = 1, #rewardData do
|
|
|
|
|
if not this.rewardList[i] then
|
|
|
|
|
local go = {}
|
|
|
|
|
go.item = newObjToParent(this.rewardItemPre, this.rewardGrid)
|
|
|
|
|
go.icon = Util.GetGameObject(go.item, "iconBg/icon"):GetComponent("Image")
|
|
|
|
|
go.text = Util.GetGameObject(go.item, "rewardbg/context"):GetComponent("Text")
|
|
|
|
|
this.rewardList[i] = go
|
|
|
|
|
end
|
|
|
|
|
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.rewardList[i].icon.sprite = SetIcon(this.spLoader, rewardData[i][1])
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
local addValue = FightPointPassManager.GetItemVipValue(rewardData[i][1])
|
2022-03-10 17:04:37 +08:00
|
|
|
|
-- local totalCurNum,totalLv,totalNum = LikabilityManager.GetTotalHeroLikeLv(-1)
|
|
|
|
|
-- local prolist = {}
|
|
|
|
|
-- if totalLv > 0 then
|
|
|
|
|
-- prolist = LikabilityManager.GetPrivilageProData(1,-1,totalLv)
|
|
|
|
|
-- local priId = _ItemIdToVipPrivilege[rewardData[i][1]]
|
|
|
|
|
-- if prolist[priId] then
|
|
|
|
|
-- addValue = addValue + (prolist[priId]/10000)
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
2021-09-26 20:23:08 +08:00
|
|
|
|
local baseValue = rewardData[i][2]
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if addValue - 1 <= 0 then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.rewardList[i].text.text = "+" .. rewardData[i][2]
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local valueShow = math.round((addValue - 1) * baseValue)
|
|
|
|
|
this.rewardList[i].text.text = string.format("+%s\n<color=#00FF00>(+%s)</color>", baseValue, valueShow)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--刷新通关豪礼主界面显示
|
|
|
|
|
function this.RefreshPassGiftShow()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local mainLevelEndId = ConfigManager.TryGetConfigDataByKey(ConfigName.MainLevelConfig, "NextLevel", -1).Id --最高关卡
|
|
|
|
|
if FightPointPassManager.curOpenFight == mainLevelEndId then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.pgBtn:SetActive(false)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
if ActTimeCtrlManager.IsQualifiled(56) then
|
|
|
|
|
this.pgBtn:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
this.pgBtn:SetActive(false)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local liveId, tarPointId = ActivityGiftManager.GetNextHeroInfo()
|
|
|
|
|
if liveId == 0 or tarPointId == 0 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.pgBtn:SetActive(false)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--通过立绘id在itemconfig表中读出herostar 已确定该id在heroconfig中的唯一值
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local heroStar = ConfigManager.GetConfigData(ConfigName.ItemConfig, liveId).HeroStar[1]
|
|
|
|
|
local heroData = ConfigManager.GetConfigData(ConfigName.HeroConfig, heroStar)
|
|
|
|
|
|
|
|
|
|
this.pgHead.sprite = this.spLoader:LoadSprite(GetResourcePath(heroData.Icon))
|
|
|
|
|
this.pgFrame.sprite = SetFrame(this.spLoader, liveId)
|
|
|
|
|
if heroData.Natural == 13 or heroData.Natural == 14 then
|
|
|
|
|
this.pgGive.text = Language[10613]
|
|
|
|
|
elseif heroData.Natural == 11 or heroData.Natural == 12 then
|
|
|
|
|
this.pgGive.text = Language[10614]
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.pgName.text = GetLanguageStrById(heroData.ReadingName)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.pgInfo.text = Language[10309] .. GetLanguageStrById(ActivityGiftManager.mainLevelConfig[tarPointId].Name)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
2022-01-18 11:38:00 +08:00
|
|
|
|
-- 打开引导界面时关闭小手提示
|
|
|
|
|
function this.OnUIOpen(id)
|
|
|
|
|
if id == UIName.GuidePanel then
|
|
|
|
|
this.fightGuideEffect:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2022-01-18 11:38:00 +08:00
|
|
|
|
-- 引导结束再显示小手
|
|
|
|
|
function this.OnFuncGuideDone()
|
|
|
|
|
this.fightGuideEffect:SetActive(not GuideManager.IsInMainGuide() and not GuideManager.IsFunctionGuideExist())
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
-- 设置挑战按钮文字
|
|
|
|
|
function this.SetFightBtnText()
|
|
|
|
|
this.fightLock:SetActive(false)
|
2021-04-08 18:16:28 +08:00
|
|
|
|
this.fightSaoGuang:SetActive(true)
|
2022-01-14 16:02:10 +08:00
|
|
|
|
-- 没在主线引导种就显示小手
|
2022-01-17 11:02:33 +08:00
|
|
|
|
this.fightGuideEffect:SetActive(not GuideManager.IsInMainGuide() and not GuideManager.IsFunctionGuideExist())
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local isPass = FightPointPassManager.IsCanFight(FightPointPassManager.curOpenFight)
|
|
|
|
|
if not isCounting then
|
|
|
|
|
if not isPass then
|
|
|
|
|
this.fightLock:SetActive(true)
|
2021-04-08 18:16:28 +08:00
|
|
|
|
this.fightSaoGuang:SetActive(false)
|
2022-01-14 16:02:10 +08:00
|
|
|
|
this.fightGuideEffect:SetActive(false)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.lockText.text = FightPointPassManager.GetBtnText()
|
|
|
|
|
else
|
|
|
|
|
this.fightText.text = FightPointPassManager.GetBtnText()
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 执行关卡战斗
|
|
|
|
|
function this.ExcuteBattle()
|
|
|
|
|
if not FightPointPassManager.IsChapterClossState() then
|
2024-01-20 11:44:58 +08:00
|
|
|
|
-- fightMap.StopAction()
|
|
|
|
|
-- if hasMap then
|
|
|
|
|
-- LogGreen("关闭挂机")
|
|
|
|
|
-- fightMap:OnClose()
|
|
|
|
|
-- hasMap = false
|
|
|
|
|
-- end
|
2023-11-15 14:53:42 +08:00
|
|
|
|
-- UIManager.OpenPanel(UIName.FightMiddleChoosePanel, FightPointPassManager.curOpenFight, true,function ()
|
|
|
|
|
-- --- 临时代码
|
|
|
|
|
-- --FightPointPassManager.SetChapterOpenState(false)
|
|
|
|
|
-- end)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
-- 章节解锁时添加对话
|
|
|
|
|
FightPointPassManager.SetChapterOpenState(false)
|
|
|
|
|
LogError("FightPointPassManager.lastPassFightId==" .. FightPointPassManager.lastPassFightId)
|
|
|
|
|
LogError("FightPointPassManager.GetCurFightId()" .. FightPointPassManager.GetCurFightId())
|
|
|
|
|
local chapterId = math.floor(FightPointPassManager.lastPassFightId / 1000)
|
|
|
|
|
LogError("chapterid===================" .. chapterId)
|
|
|
|
|
local curChapterId = fightLevelSetConfig[chapterId].EventId
|
|
|
|
|
if curChapterId > 0 then
|
|
|
|
|
StoryManager.EventTrigger(curChapterId, function()
|
2023-12-12 11:43:32 +08:00
|
|
|
|
LogGreen("打开挂机界面")
|
|
|
|
|
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
|
|
|
|
|
end)
|
|
|
|
|
else
|
2023-11-15 14:53:42 +08:00
|
|
|
|
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
|
2023-12-12 11:43:32 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
2023-12-12 11:43:32 +08:00
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if isCounting then
|
|
|
|
|
PopupTipPanel.ShowTip(Language[10615])
|
|
|
|
|
return
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local curFightId = FightPointPassManager.curOpenFight
|
|
|
|
|
local state, tip = FightPointPassManager.IsCanFight(curFightId)
|
|
|
|
|
if state == -1 then
|
|
|
|
|
PopupTipPanel.ShowTip(tip)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if not state then
|
|
|
|
|
PopupTipPanel.ShowTip(tip)
|
|
|
|
|
return
|
|
|
|
|
end
|
2021-12-02 01:06:34 +08:00
|
|
|
|
-- 判断是否是剧情节点
|
|
|
|
|
if fightLevelConfig[curFightId].StoryId > 0 then
|
|
|
|
|
StoryManager.EventTrigger(fightLevelConfig[curFightId].StoryId, function()
|
|
|
|
|
FightPointPassManager.ExecuteFightStory(curFightId, function(drop)
|
|
|
|
|
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1, function()
|
|
|
|
|
this:OnShow()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
end, 1)
|
2021-12-02 01:06:34 +08:00
|
|
|
|
end)
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
-- 检测是否有前置引导
|
|
|
|
|
GuideManager.BeforeFightCheck(curFightId, function()
|
2023-11-10 17:24:48 +08:00
|
|
|
|
--屏蔽弹怪追认的动画
|
|
|
|
|
--this.SetInitAnim()
|
|
|
|
|
local isBoss = FightPointPassManager.IsFightBoss()
|
|
|
|
|
local sound = isBoss and SoundConfig.Sound_FightArea_Boss or SoundConfig.Sound_FightArea_Monster
|
|
|
|
|
SoundManager.PlaySound(sound, AUDIO_FADE_TYPE.FADE_OUT_NOT_IN, AUDIO_RUN_TYPE.CONC, nil, 20)
|
|
|
|
|
UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.STORY, FightPointPassManager.curOpenFight)
|
2021-12-02 01:06:34 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
2022-11-22 18:19:37 +08:00
|
|
|
|
function this.RefreshFightBtnShow()
|
|
|
|
|
local curFightId = FightPointPassManager.curOpenFight
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local hangArr = fightLevelConfig[curFightId].Hang
|
|
|
|
|
if hangArr and hangArr[1] > 0 then
|
|
|
|
|
curKillNum = curKillNum + 1
|
|
|
|
|
this.hookKillText.text = string.format("%s/%s", curKillNum, maxKillNum)
|
|
|
|
|
if curKillNum >= maxKillNum then
|
2022-11-22 18:19:37 +08:00
|
|
|
|
this.btnFight.gameObject:SetActive(true)
|
|
|
|
|
this.hookKill.gameObject:SetActive(false)
|
2022-11-24 18:28:48 +08:00
|
|
|
|
this.red_light:SetActive(false)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
curKillNum = 0
|
2022-11-22 18:19:37 +08:00
|
|
|
|
FightPointPassManager.ExecuteFightStory(curFightId, function(drop)
|
|
|
|
|
UIManager.OpenPanel(UIName.RewardItemPopup, drop, 1, function()
|
|
|
|
|
this:OnShow()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
end, 1)
|
2022-11-22 18:19:37 +08:00
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
function FightPointPassMainPanel:OnSortingOrderChange()
|
|
|
|
|
invadeMonster:OnSortingOrderChange()
|
|
|
|
|
Util.AddParticleSortLayer(this.GuideEffectGo, self.sortingOrder - orginLayer)
|
|
|
|
|
Util.AddParticleSortLayer(this.GuideJumpEffectGo, self.sortingOrder - orginLayer)
|
|
|
|
|
Util.AddParticleSortLayer(this.pgEffect, self.sortingOrder - orginLayer)
|
2023-11-10 11:48:41 +08:00
|
|
|
|
--Util.AddParticleSortLayer(this.UI_Effect_MuBiaoJiangLi, self.sortingOrder - orginLayer)
|
2021-04-08 18:16:28 +08:00
|
|
|
|
Util.SetParticleSortLayer(this.fightSaoGuang, self.sortingOrder + 1)
|
2022-01-14 16:02:10 +08:00
|
|
|
|
Util.SetParticleSortLayer(this.fightGuideEffect, self.sortingOrder + 2)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap:OnSortingOrderChange(self.sortingOrder)
|
|
|
|
|
fightOnHook:OnSortingOrderChange(self.sortingOrder)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
orginLayer = self.sortingOrder
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.BtView:SetOrderStatus({ sortOrder = self.sortingOrder })
|
2020-09-25 21:19:01 +08:00
|
|
|
|
-- 头像层级
|
2021-03-30 19:54:19 +08:00
|
|
|
|
if this.playerInfoView then
|
|
|
|
|
this.playerInfoView:SetLayer(self.sortingOrder)
|
2020-09-25 21:19:01 +08:00
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面关闭时调用(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:OnClose()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if this.battleSceneLogicGameObject ~= nil then
|
|
|
|
|
this.battleSceneLogicGameObject:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if this.battleSceneGameObject ~= nil then
|
|
|
|
|
this.battleSceneGameObject:SetActive(false)
|
|
|
|
|
end
|
2020-12-24 21:02:20 +08:00
|
|
|
|
PatFaceManager.isLogin = false
|
2020-08-31 20:52:50 +08:00
|
|
|
|
PlayerManager.StopBattleUpLvTipTime()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
hasLoad = false
|
|
|
|
|
invadeMonster:OnClose()
|
2021-04-22 13:40:04 +08:00
|
|
|
|
if hasMap then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--fightMap:OnClose()
|
2021-04-22 13:40:04 +08:00
|
|
|
|
hasMap = false
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
fightOnHook:Dispose()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if this.animTimer then
|
|
|
|
|
this.animTimer:Stop()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
this.animTimer = nil
|
|
|
|
|
if this.liveNode then
|
2021-03-27 20:01:39 +08:00
|
|
|
|
this.liveNode:OnClose()
|
|
|
|
|
end
|
|
|
|
|
if this.liveNode then
|
|
|
|
|
this.liveNode:OnClose()
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
2020-06-08 13:57:30 +08:00
|
|
|
|
if this.timer then
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
2022-11-22 18:19:37 +08:00
|
|
|
|
|
|
|
|
|
if this.skillTimer then
|
|
|
|
|
this.skillTimer:Stop()
|
|
|
|
|
this.skillTimer = nil
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--界面销毁时调用(用于子类重写)
|
|
|
|
|
function FightPointPassMainPanel:OnDestroy()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
orginLayer = 0
|
2020-05-09 13:31:21 +08:00
|
|
|
|
invadeMonster:OnDestroy()
|
2021-04-21 13:12:04 +08:00
|
|
|
|
this.spLoader:Destroy()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
fightOnHook:OnDestroy()
|
2021-05-20 21:00:29 +08:00
|
|
|
|
-- poolManager:UnLoadAsset("GuideEffect", this.GuideEffectGo, PoolManager.AssetType.GameObject)
|
|
|
|
|
-- poolManager:UnLoadAsset("GuideEffect", this.GuideJumpEffectGo, PoolManager.AssetType.GameObject)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
poolManager:UnLoadLive(fightAnimRes, this.animGo, PoolManager.AssetType.GameObject)
|
|
|
|
|
SubUIManager.Close(this.UpView)
|
|
|
|
|
SubUIManager.Close(this.BtView)
|
2021-06-03 20:33:08 +08:00
|
|
|
|
ClearRedPointObject(RedPointType.DailyTaskMain, this.dailyRedPoint)
|
2020-05-25 19:16:23 +08:00
|
|
|
|
ClearRedPointObject(RedPointType.SecretTer_IsCanFight, this.fightRP)
|
2020-10-19 20:29:49 +08:00
|
|
|
|
ClearRedPointObject(RedPointType.XiaoYaoYouRedPoint, this.xiaoyaoRedPoint)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
ClearRedPointObject(RedPointType.numberGame, this.numberGameBtn)
|
2022-06-30 18:17:58 +08:00
|
|
|
|
ClearRedPointObject(RedPointType.FirstRecharge, this.firstRedPoint)
|
2023-01-10 16:39:58 +08:00
|
|
|
|
ClearRedPointObject(RedPointType.tuijianzhenrong, this.milkRed)
|
2021-09-14 17:37:14 +08:00
|
|
|
|
-- ClearRedPointObject(RedPointType.FightLevel, this.btnFightLevelRedPoint)
|
2021-03-30 19:54:19 +08:00
|
|
|
|
-- 头像层级
|
|
|
|
|
if this.playerInfoView then
|
|
|
|
|
SubUIManager.Close(this.playerInfoView)
|
|
|
|
|
this.playerInfoView = nil
|
|
|
|
|
end
|
2021-05-26 14:59:25 +08:00
|
|
|
|
points = {}
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--销毁战场
|
|
|
|
|
if this.battleSceneLogicGameObject ~= nil then
|
|
|
|
|
GameObject.Destroy(this.battleSceneLogicGameObject)
|
|
|
|
|
this.battleSceneLogicGameObject = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
this.mapGameObject = nil
|
2024-10-17 19:57:06 +08:00
|
|
|
|
this.mapName = nil
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if this.battleSceneGameObject ~= nil then
|
|
|
|
|
GameObject.Destroy(this.battleSceneGameObject)
|
|
|
|
|
this.battleSceneGameObject = nil
|
|
|
|
|
end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--跳转显示新手提示圈
|
|
|
|
|
function FightPointPassMainPanel.ShowGuideGo(btnIndex)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if btnIndex == 1 then --关卡
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if this.btnFight then
|
|
|
|
|
JumpManager.ShowGuide(UIName.FightPointPassMainPanel, this.btnFight)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif btnIndex == 6 then --在线
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if invadeMonster.btnRewardOnline then
|
|
|
|
|
JumpManager.ShowGuide(UIName.FightPointPassMainPanel, invadeMonster.btnRewardOnline)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif btnIndex == 5 then --章节奖励
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if invadeMonster.btnRewrdChapter then
|
|
|
|
|
JumpManager.ShowGuide(UIName.FightPointPassMainPanel, invadeMonster.btnRewrdChapter)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif btnIndex == 2 then --极速探索
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if invadeMonster.btnFastExplore then
|
|
|
|
|
JumpManager.ShowGuide(UIName.FightPointPassMainPanel, invadeMonster.btnFastExplore)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif btnIndex == 3 then --召唤外敌
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if invadeMonster.callMonsterBtn then
|
|
|
|
|
JumpManager.ShowGuide(UIName.FightPointPassMainPanel, invadeMonster.callMonsterBtn)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif btnIndex == 4 then --挂机宝箱
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if invadeMonster.rewardBox then
|
|
|
|
|
JumpManager.ShowGuide(UIName.FightPointPassMainPanel, invadeMonster.rewardBox)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--刷新小地图
|
|
|
|
|
function this.RefreshLittleMap()
|
|
|
|
|
--获取数据
|
|
|
|
|
if not FightPointPassManager.IsChapterClossState() then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.integer, this.decimal = math.modf(FightPointPassManager.lastPassFightId / 1000) --确定区域id
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.integer, this.decimal = math.modf(FightPointPassManager.curOpenFight / 1000)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local data = ConfigManager.GetConfigData(ConfigName.MainLevelSettingConfig, this.integer) --获取这一区域所有数据
|
|
|
|
|
local difficulty = FightPointPassManager.curOpenFight % 10 --确定当前区域难度
|
2020-06-03 19:09:01 +08:00
|
|
|
|
local curAllLevelNum = 0
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--根据当前难度 检查对应区域数据
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if difficulty == 1 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.CheckMapPointsData(data.SimpleLevel)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
curAllLevelNum = #data.SimpleLevel
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif difficulty == 2 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.CheckMapPointsData(data.NormalLevel)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
curAllLevelNum = #data.NormalLevel
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif difficulty == 3 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.CheckMapPointsData(data.DifficultyLevel)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
curAllLevelNum = #data.DifficultyLevel
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif difficulty == 4 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.CheckMapPointsData(data.HellLevel)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
curAllLevelNum = #data.HellLevel
|
2024-10-10 16:52:39 +08:00
|
|
|
|
elseif difficulty == 5 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.CheckMapPointsData(data.NightmareLevel)
|
2020-06-03 19:09:01 +08:00
|
|
|
|
curAllLevelNum = #data.NightmareLevel
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--计算小地图当前点位 更换地图
|
|
|
|
|
local sonPoint = FightPointPassManager.GetLevelPointPosition()
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local parentPosX, parentPosY = FightPointPassManager.CalculateMapPointPos(this.map.transform, sonPoint)
|
|
|
|
|
this.map.transform.anchoredPosition3D = Vector3(parentPosX, parentPosY - 52.4, 0) --52.4是策划的选择!!
|
|
|
|
|
this.mapImage.sprite = this.spLoader:LoadSprite(data.ChapterBg)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
--加载立绘
|
2021-03-27 20:01:39 +08:00
|
|
|
|
-- if this.liveNode then
|
|
|
|
|
-- return
|
|
|
|
|
-- end
|
|
|
|
|
-- npc = NameManager.roleSex == ROLE_SEX.BOY and mapNpc or mapNpc2
|
|
|
|
|
-- scale = NameManager.roleSex == ROLE_SEX.BOY and Vector3.one * 0.14 or Vector3.one * 0.07
|
2020-06-03 19:09:01 +08:00
|
|
|
|
local curLevel = 0
|
|
|
|
|
if not FightPointPassManager.IsChapterClossState() then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
curLevel = math.floor(FightPointPassManager.lastPassFightId / 10) % 100
|
2020-06-03 19:09:01 +08:00
|
|
|
|
else
|
2024-10-10 16:52:39 +08:00
|
|
|
|
curLevel = math.floor(FightPointPassManager.curOpenFight / 10) % 100
|
2020-06-03 19:09:01 +08:00
|
|
|
|
end
|
|
|
|
|
this.btnMapRadarBG.fillAmount = curLevel / curAllLevelNum
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.RadarBGText.text = curLevel .. "/" .. curAllLevelNum
|
2021-03-27 20:01:39 +08:00
|
|
|
|
-- this.liveNode = poolManager:LoadLive(npc, this.btnMap.transform, scale, Vector3.New(0,-52.4,0))
|
|
|
|
|
-- local SkeletonGraphic = this.liveNode:GetComponent("SkeletonGraphic")
|
|
|
|
|
-- if SkeletonGraphic then
|
|
|
|
|
-- SkeletonGraphic.AnimationState:SetAnimation(0, "move2", true)
|
|
|
|
|
-- if FightPointPassManager.GetRoleDirection()==1 then
|
|
|
|
|
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 180, 0)
|
|
|
|
|
-- else
|
|
|
|
|
-- SkeletonGraphic.transform.localEulerAngles = Vector3.New(0, 0, 0)
|
|
|
|
|
-- end
|
|
|
|
|
-- end
|
|
|
|
|
if this.liveNode then
|
|
|
|
|
this.liveNode:OnClose()
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
this.liveNode = PlayerLiveView:New(this.btnMap.transform, 1, nil, orginLayer, NPCPosType.smallMap)
|
|
|
|
|
this.liveNode:OnOpen(GetPlayerRoleSingleConFig().Scale3, Vector3.New(0, -40, 0))
|
|
|
|
|
if FightPointPassManager.GetRoleDirection() == 1 then
|
2021-03-27 20:01:39 +08:00
|
|
|
|
this.liveNode:SetWalkDir(WALK_DIR.RUN_LEFT)
|
|
|
|
|
else
|
|
|
|
|
this.liveNode:SetWalkDir(WALK_DIR.RUN_RIGHT)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--检查地图点数据
|
|
|
|
|
function this.CheckMapPointsData(pointsData)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
for i = 1, math.max(#pointsData, #points) do
|
2020-05-09 13:31:21 +08:00
|
|
|
|
local go = points[i]
|
|
|
|
|
if not go then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
go = newObject(points[1])
|
|
|
|
|
go.transform:SetParent(Util.GetGameObject(this.btnMap, "MapMask/Map").transform)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
go.transform.localScale = Vector3.one
|
2024-10-10 16:52:39 +08:00
|
|
|
|
go.transform.localPosition = Vector3.zero;
|
|
|
|
|
go.gameObject.name = "mapAreaPre (" .. i .. ")"
|
2020-05-09 13:31:21 +08:00
|
|
|
|
points[i] = go
|
|
|
|
|
end
|
|
|
|
|
go.gameObject:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
--位置赋值
|
|
|
|
|
for i = 1, #pointsData do
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local data = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, pointsData[i])
|
|
|
|
|
points[i].transform.anchoredPosition3D = Vector3(data.LevelPointPosition[1], data.LevelPointPosition[2], 0)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.GetGameObject(points[i].transform, "icon"):SetActive((math.floor((data.Id % 100) / 10)) % 5 ~= 0)
|
|
|
|
|
Util.GetGameObject(points[i].transform, "icon2"):SetActive((math.floor((data.Id % 100) / 10)) % 5 == 0)
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
--显示位置点
|
|
|
|
|
for i = 1, #pointsData do
|
|
|
|
|
points[i]:SetActive(true)
|
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
--预先显示玩家等级 解锁的功能list
|
|
|
|
|
function this.GetNextFightOpenFun()
|
|
|
|
|
local nextFightId = 0
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local nextFightSortId = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, FightPointPassManager.curOpenFight)
|
|
|
|
|
.SortId - 1
|
2020-05-09 13:31:21 +08:00
|
|
|
|
for i, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.GlobalSystemConfig)) do
|
|
|
|
|
if v.OpenRules then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if v.OpenRules[1] == 1 then --1关卡开启
|
|
|
|
|
local OpenRulesSortId = ConfigManager.GetConfigData(ConfigName.MainLevelConfig, v.OpenRules[2]).SortId
|
|
|
|
|
if OpenRulesSortId > nextFightSortId and v.IsOpen == 1 and v.IsShow == 1 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if nextFightId == 0 then
|
|
|
|
|
nextFightId = v.OpenRules[2]
|
|
|
|
|
else
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if ConfigManager.GetConfigData(ConfigName.MainLevelConfig, nextFightId).SortId > OpenRulesSortId then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
nextFightId = v.OpenRules[2]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
for i, v in ConfigPairs(ConfigManager.GetConfig(ConfigName.GlobalSystemConfig)) do
|
|
|
|
|
if v.OpenRules then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if v.OpenRules[1] == 1 then --1关卡开启
|
|
|
|
|
if v.OpenRules[2] == nextFightId and v.IsOpen == 1 and v.IsShow == 1 then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
return v
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
return nil
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--开服福利显示 开始
|
|
|
|
|
local OpenSeverWelfareRewardShow = {
|
2024-10-10 16:52:39 +08:00
|
|
|
|
[16] = { image1 = "r_guanka_guankajiangliyaojin", image2 = "r_guanka_guankajiangli01_zh" },
|
|
|
|
|
[19] = { image1 = "r_guanka_guankajianglishenfu", image2 = "r_guanka_guankajiangli02_zh" },
|
|
|
|
|
[81128] = { image1 = "r_guanka_guankajianglibaoxiang", image2 = "r_guanka_guankajiangli03_zh" },
|
|
|
|
|
[11023] = { image1 = "r_guanka_guankajianglishunwukong", image2 = "r_guanka_guankajiangli04_zh" },
|
|
|
|
|
[11014] = { image1 = "c_nz_00029_t1", image2 = "r_guanka_guankajiangli03_zh" },
|
|
|
|
|
[11033] = { image1 = "c_h_0007_t1", image2 = "r_guanka_guankajiangli03_zh" },
|
|
|
|
|
[87] = { image1 = "r_Material_Mineral_0003", image2 = "" },
|
2020-06-08 13:57:30 +08:00
|
|
|
|
}
|
|
|
|
|
function this.UpdateOpenSeverWelfare()
|
|
|
|
|
local mainLevelConfig = ConfigManager.GetConfig(ConfigName.MainLevelConfig)
|
|
|
|
|
local activityRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)
|
2022-10-17 16:13:47 +08:00
|
|
|
|
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.SongWuXianChou)
|
|
|
|
|
local activityData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.SongWuXianChou)
|
2020-06-13 11:47:13 +08:00
|
|
|
|
--LogGreen("#activityData.mission "..#activityData.mission)
|
2020-06-08 20:18:49 +08:00
|
|
|
|
if activityId and activityId > 0 and activityData and #activityData.mission > 0 then
|
2022-10-17 16:13:47 +08:00
|
|
|
|
--ActivityGiftManager.OpenSeverWelfareRewardTabsSort(activityData.mission)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
local curMissionConfig = nil
|
2022-10-17 16:13:47 +08:00
|
|
|
|
local isShowRed = false
|
2020-06-08 13:57:30 +08:00
|
|
|
|
for i = 1, #activityData.mission do
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if activityData.mission[i].state == 0 and not curMissionConfig then
|
2020-06-08 13:57:30 +08:00
|
|
|
|
curMissionConfig = activityRewardConfig[activityData.mission[i].missionId]
|
2022-10-17 16:13:47 +08:00
|
|
|
|
--LogError("activityData.mission[i].missionId=="..activityData.mission[i].missionId)
|
|
|
|
|
-- local value = curMissionConfig.Values[2][1]
|
|
|
|
|
-- local isPass = FightPointPassManager.IsFightPointPass2(value)
|
|
|
|
|
-- if isPass then
|
|
|
|
|
-- isShowRed=true
|
|
|
|
|
-- end
|
2020-06-08 13:57:30 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if activityData.mission[i].state == 1 then
|
2022-10-17 16:13:47 +08:00
|
|
|
|
isShowRed = true
|
2020-06-08 20:18:49 +08:00
|
|
|
|
end
|
2020-06-08 13:57:30 +08:00
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
local isAll = false
|
|
|
|
|
if not curMissionConfig then
|
|
|
|
|
isAll = true
|
2022-10-17 16:13:47 +08:00
|
|
|
|
curMissionConfig = activityRewardConfig[20016]
|
|
|
|
|
end
|
|
|
|
|
if activityData and activityData.mission then
|
|
|
|
|
this.btnOpenSeverWelfare:SetActive(true)
|
|
|
|
|
else
|
|
|
|
|
this.btnOpenSeverWelfare:SetActive(false)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2022-10-17 16:13:47 +08:00
|
|
|
|
|
2021-12-07 17:10:43 +08:00
|
|
|
|
-- 奖励图
|
2023-11-10 11:48:41 +08:00
|
|
|
|
-- this.OpenSeverWelfareicon.sprite = this.spLoader:LoadSprite(OpenSeverWelfareRewardShow[curMissionConfig.Reward[1][1]].image1)
|
|
|
|
|
-- this.OpenSeverWelfareicon:SetNativeSize()
|
|
|
|
|
-- -- 文字
|
|
|
|
|
-- local imgName2 = OpenSeverWelfareRewardShow[curMissionConfig.Reward[1][1]].image2
|
|
|
|
|
-- if imgName2 and imgName2 ~= "" then
|
|
|
|
|
-- this.OpenSeverWelfareiconText.sprite = this.spLoader:LoadSprite(imgName2)
|
|
|
|
|
-- this.OpenSeverWelfareiconText.gameObject:SetActive(true)
|
|
|
|
|
-- this.OpenSeverWelfareiconText:SetNativeSize()
|
|
|
|
|
-- else
|
|
|
|
|
-- this.OpenSeverWelfareiconText.gameObject:SetActive(false)
|
|
|
|
|
-- end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
LogError("FightPointPassManager.lastPassFightId==" .. FightPointPassManager.lastPassFightId)
|
|
|
|
|
local curPassLevelSortId = FightPointPassManager.lastPassFightId ~= FightPointPassManager.curOpenFight and
|
|
|
|
|
mainLevelConfig[FightPointPassManager.lastPassFightId].SortId or 0
|
2022-10-17 16:13:47 +08:00
|
|
|
|
local getRewardLevelSortId = mainLevelConfig[curMissionConfig.Values[2][1]].SortId
|
|
|
|
|
this.OpenSeverWelfareRed:SetActive(isShowRed)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
if isAll then
|
2022-10-17 16:13:47 +08:00
|
|
|
|
this.OpenSeverWelfareProgressText.gameObject:SetActive(false)
|
|
|
|
|
this.OpenSeverWelfareProgressBg:SetActive(false)
|
|
|
|
|
this.OpenSeverWelfareInfoText.gameObject:SetActive(false)
|
|
|
|
|
else
|
|
|
|
|
this.OpenSeverWelfareProgressText.gameObject:SetActive(true)
|
|
|
|
|
this.OpenSeverWelfareProgressBg:SetActive(true)
|
|
|
|
|
this.OpenSeverWelfareInfoText.gameObject:SetActive(true)
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
curPassLevelSortId = curPassLevelSortId >= getRewardLevelSortId and getRewardLevelSortId or curPassLevelSortId
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.OpenSeverWelfareProgressText.text = curPassLevelSortId .. "/" .. getRewardLevelSortId
|
2024-11-13 14:31:41 +08:00
|
|
|
|
this.OpenSeverWelfareProgressImage.value = curPassLevelSortId / getRewardLevelSortId
|
2021-01-26 17:08:39 +08:00
|
|
|
|
this.OpenSeverWelfareInfoText.text = GetLanguageStrById(curMissionConfig.ContentsShow)
|
2022-10-17 16:13:47 +08:00
|
|
|
|
--this.RemainTimeDown(this.btnOpenSeverWelfare,this.OpenSeverWelfareTimeText,activityData.endTime - GetTimeStamp())
|
2020-06-08 13:57:30 +08:00
|
|
|
|
else
|
|
|
|
|
this.btnOpenSeverWelfare:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.timer = Timer.New()
|
|
|
|
|
--刷新倒计时显示
|
2024-10-10 16:52:39 +08:00
|
|
|
|
function this.RemainTimeDown(_timeTextExpertgo, _timeTextExpert, timeDown)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
if timeDown > 0 then
|
|
|
|
|
if _timeTextExpertgo then
|
|
|
|
|
_timeTextExpertgo:SetActive(true)
|
|
|
|
|
end
|
|
|
|
|
if _timeTextExpert then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
_timeTextExpert.text = GetLeftTimeStrByDeltaTime2(timeDown)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
end
|
|
|
|
|
if this.timer then
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
|
|
|
|
this.timer = Timer.New(function()
|
|
|
|
|
if _timeTextExpert then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
_timeTextExpert.text = GetLeftTimeStrByDeltaTime2(timeDown)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
end
|
|
|
|
|
if timeDown < 0 then
|
|
|
|
|
if _timeTextExpertgo then
|
|
|
|
|
_timeTextExpertgo:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
this.timer:Stop()
|
|
|
|
|
this.timer = nil
|
|
|
|
|
end
|
|
|
|
|
timeDown = timeDown - 1
|
|
|
|
|
end, 1, -1, true)
|
|
|
|
|
this.timer:Start()
|
|
|
|
|
else
|
|
|
|
|
if _timeTextExpertgo then
|
|
|
|
|
_timeTextExpertgo:SetActive(false)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2021-12-27 13:11:33 +08:00
|
|
|
|
function this.RefreshBattleUpLvTip(isShowUIOpen)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--
|
2021-12-27 13:11:33 +08:00
|
|
|
|
Util.AddOnceClick(this.battleUpLvTip, function() end)
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleUpLvTip:SetActive(false)
|
|
|
|
|
this.battleUpLvTipImg.enabled = false
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(false)
|
|
|
|
|
this.battleLockGo:SetActive(false)
|
2021-12-27 13:11:33 +08:00
|
|
|
|
-- 么解锁章节不显示
|
|
|
|
|
if not FightPointPassManager.IsChapterClossState() then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
return
|
2021-12-27 13:11:33 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 判断状态
|
|
|
|
|
local curFightId = FightPointPassManager.GetCurFightId()
|
|
|
|
|
local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(curFightId)
|
|
|
|
|
|
|
|
|
|
-- 可以挑战显示 挑战关卡快速升级
|
|
|
|
|
if not isShowUIOpen and isOk then
|
|
|
|
|
this.battleUpLvTip:SetActive(true)
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleUpLvTipImg.enabled = true
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(true)
|
|
|
|
|
this.battleLockGo:SetActive(false)
|
|
|
|
|
|
|
|
|
|
this.battleUpLvTipTxt.text = Language[10610]
|
2021-12-27 13:11:33 +08:00
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 没有解锁条件不显示
|
|
|
|
|
local openRule = fightLevelConfig[curFightId].OpenRule
|
|
|
|
|
if not openRule then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- 没有数据不显示
|
|
|
|
|
if not lockState then
|
2024-10-10 16:52:39 +08:00
|
|
|
|
return
|
2021-12-27 13:11:33 +08:00
|
|
|
|
end
|
|
|
|
|
|
2024-10-10 16:52:39 +08:00
|
|
|
|
--
|
2021-12-27 13:11:33 +08:00
|
|
|
|
for index, state in ipairs(lockState) do
|
|
|
|
|
if not state and openRule[index] then
|
|
|
|
|
local ruleType = openRule[index][1]
|
|
|
|
|
if ruleType then
|
|
|
|
|
if ruleType == 1 then
|
|
|
|
|
-- 山河社稷图
|
|
|
|
|
this.battleUpLvTip:SetActive(true)
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleUpLvTipImg.enabled = false
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(false)
|
|
|
|
|
this.battleLockGo:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddOnceClick(this.battleUpLvTip, function()
|
2021-12-27 13:11:33 +08:00
|
|
|
|
JumpManager.GoJump(36023)
|
|
|
|
|
end)
|
|
|
|
|
elseif ruleType == 2 then
|
|
|
|
|
-- 心魔试炼
|
|
|
|
|
this.battleUpLvTip:SetActive(true)
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleUpLvTipImg.enabled = false
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(false)
|
|
|
|
|
this.battleLockGo:SetActive(true)
|
2021-12-27 13:11:33 +08:00
|
|
|
|
Util.AddOnceClick(this.battleUpLvTip, function()
|
|
|
|
|
JumpManager.GoJump(1011)
|
|
|
|
|
end)
|
|
|
|
|
elseif ruleType == 4 then
|
2021-12-20 15:43:54 +08:00
|
|
|
|
-- 背包 装备
|
|
|
|
|
this.battleUpLvTip:SetActive(true)
|
|
|
|
|
this.battleUpLvTipImg.enabled = false
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(false)
|
|
|
|
|
this.battleLockGo:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddOnceClick(this.battleUpLvTip, function()
|
2021-12-20 15:43:54 +08:00
|
|
|
|
JumpManager.GoJump(1007)
|
|
|
|
|
end)
|
|
|
|
|
elseif ruleType == 5 then
|
|
|
|
|
-- 好感度
|
|
|
|
|
this.battleUpLvTip:SetActive(true)
|
|
|
|
|
this.battleUpLvTipImg.enabled = false
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(false)
|
|
|
|
|
this.battleLockGo:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddOnceClick(this.battleUpLvTip, function()
|
2021-12-20 15:43:54 +08:00
|
|
|
|
JumpManager.GoJump(40033)
|
|
|
|
|
end)
|
|
|
|
|
elseif ruleType == 7 then
|
2021-12-27 13:11:33 +08:00
|
|
|
|
-- 获取神将
|
|
|
|
|
this.battleUpLvTip:SetActive(true)
|
2021-12-27 16:55:17 +08:00
|
|
|
|
this.battleUpLvTipImg.enabled = false
|
|
|
|
|
this.battleUpLvTipTxt.gameObject:SetActive(false)
|
|
|
|
|
this.battleLockGo:SetActive(true)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
Util.AddOnceClick(this.battleUpLvTip, function()
|
2021-12-27 13:11:33 +08:00
|
|
|
|
JumpManager.GoJump(22001)
|
|
|
|
|
end)
|
2024-10-10 16:52:39 +08:00
|
|
|
|
end
|
2021-12-27 13:11:33 +08:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
2020-08-31 20:52:50 +08:00
|
|
|
|
end
|
2020-10-19 22:56:05 +08:00
|
|
|
|
|
2021-06-15 20:08:14 +08:00
|
|
|
|
function this.UpdateWordLv()
|
|
|
|
|
this.worldLv.text = PlayerManager.worldLeve
|
|
|
|
|
end
|
2024-10-10 16:52:39 +08:00
|
|
|
|
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--开服福利显示 结束
|
2021-04-21 13:12:04 +08:00
|
|
|
|
return FightPointPassMainPanel
|