【四灵试炼】预设提交
parent
a446b83908
commit
8b7a227a54
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a322d3045ac07af48a2922e137b09c36
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f4ea471902f6dc84dbe0dc3b07222e3f
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -1897,6 +1897,8 @@ GENERAL_POPUP_TYPE={
|
|||
--大号通用弹窗
|
||||
YiJingBaoKu = 30,--易经宝库
|
||||
YiJingBaoKuRewardPreview = 32,--易经宝库奖励预览
|
||||
FourElementReturnLook = 33,--四灵试炼回放界面
|
||||
FourElementHelpFight = 34,--四灵试炼助战
|
||||
}
|
||||
|
||||
--抽卡类型
|
||||
|
@ -2118,6 +2120,7 @@ EXPEDITON_POPUP_TYPE={
|
|||
Monster=3,--普通 精英 boss
|
||||
Trail=4,--试炼
|
||||
Greed = 5,--贪婪
|
||||
FourElementMonster = 6,--贪婪
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ local contentScripts = {
|
|||
[4]= {view=require("Modules/Expedition/View/ExpeditionMonsterInfo_Trail"),panelName="ExpeditionMonsterInfo_Trail",type=EXPEDITON_POPUP_TYPE.Trail},
|
||||
--贪婪
|
||||
[5]= {view=require("Modules/Expedition/View/ExpeditionMonsterInfo_Greed"),panelName="ExpeditionMonsterInfo_Greed",type=EXPEDITON_POPUP_TYPE.Greed},
|
||||
[6]= {view=require("Modules/Expedition/View/MonsterFormationInfo"),panelName="ExpeditionMonsterInfo_Monster",type = EXPEDITON_POPUP_TYPE.FourElementMonster},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
|
|
@ -0,0 +1,187 @@
|
|||
----- 远征怪节点弹窗 -----
|
||||
local this = {}
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
--传入特效层级
|
||||
local sortingOrder=0
|
||||
local fun
|
||||
--item容器
|
||||
local itemList = {}
|
||||
local heroListGo = {}
|
||||
local monsterData = {}
|
||||
local rewardData = {}
|
||||
local type = 1 --1 前往 2 放弃
|
||||
local liveNodes = {}
|
||||
local liveNames = {}
|
||||
local curNodeConFig
|
||||
local roleConfig=ConfigManager.GetConfig(ConfigName.RoleConfig)
|
||||
function this:InitComponent(gameObject)
|
||||
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
||||
this.power = Util.GetGameObject(gameObject, "Power/Value"):GetComponent("Text")
|
||||
this.sureBtn=Util.GetGameObject(gameObject,"sureBtn")
|
||||
this.sureBtnText=Util.GetGameObject(gameObject,"sureBtn/Text"):GetComponent("Text")
|
||||
--滚动条根节点
|
||||
this.root = Util.GetGameObject(gameObject, "Root")
|
||||
for i = 1, 6 do
|
||||
heroListGo[i] = Util.GetGameObject(gameObject, "RoleGrid/Bg"..i.."/Hero"..i)
|
||||
end
|
||||
this.backBtn=Util.GetGameObject(gameObject,"BackBtn")
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.sureBtn, function()
|
||||
this:BtnClickEvent()
|
||||
end)
|
||||
Util.AddClick(this.backBtn, function()
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
end
|
||||
function this:BtnClickEvent()
|
||||
if type == 1 then
|
||||
parent:ClosePanel()
|
||||
elseif type == 2 then
|
||||
parent:ClosePanel()
|
||||
end
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
function this:OnShow(_parent,...)
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||
local args = {...}
|
||||
monsterData = args[1]
|
||||
type = args[2]
|
||||
fun = args[3]
|
||||
|
||||
--组数据
|
||||
rewardData = {}
|
||||
local curRewardData = {}
|
||||
--curNodeConFig = ConfigManager.TryGetConfigData(ConfigName.ExpeditionNodeConfig,monsterData.type)
|
||||
local Reward --= ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.ExpeditionFloorConfig,"Floor",ExpeditionManager.expeditionLeve,"FloorLay",monsterData.lay - 1)
|
||||
if Reward and Reward.Reward and #Reward.Reward > 0 then
|
||||
for i = 1, #Reward.Reward do
|
||||
local rewardGroupConfig = ConfigManager.TryGetConfigData(ConfigName.RewardGroup,Reward.Reward[i])
|
||||
if rewardGroupConfig and #rewardGroupConfig.ShowItem > 0 then
|
||||
for j = 1, #rewardGroupConfig.ShowItem do
|
||||
local v = rewardGroupConfig.ShowItem[j]
|
||||
if curRewardData[v[1]] then
|
||||
curRewardData[v[1]] = {v[1],curRewardData[v[1]][2] + v[2]}
|
||||
else
|
||||
curRewardData[v[1]] = {v[1],v[2]}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
for i, v in pairs(curRewardData) do
|
||||
if curNodeConFig and curNodeConFig.Reward and curNodeConFig.Reward > 0 then
|
||||
v = {v[1],math.floor(v[2] * curNodeConFig.Reward)}
|
||||
end
|
||||
table.insert(rewardData,v)
|
||||
end
|
||||
this:FormationAdapter()
|
||||
end
|
||||
-- 编队数据匹配
|
||||
function this:FormationAdapter()
|
||||
if type == 1 then
|
||||
this.sureBtnText.text = Language[10508]
|
||||
elseif type == 2 then
|
||||
this.sureBtnText.text = Language[10512]
|
||||
end
|
||||
|
||||
this.titleText.text=Language[10513]
|
||||
|
||||
if monsterData == nil then LogError(Language[10511]) return end
|
||||
this.power.text = monsterData.bossTeaminfo.totalForce
|
||||
for i = 1, #heroListGo do
|
||||
heroListGo[i]:SetActive(false)
|
||||
end
|
||||
for i = 1, #heroListGo do
|
||||
if(monsterData.bossTeaminfo.hero[i]) then
|
||||
local pos = monsterData.bossTeaminfo.hero[i].position
|
||||
this.SetCardSingleData(heroListGo[pos],monsterData.bossTeaminfo.hero[i],pos)
|
||||
heroListGo[pos]:SetActive(true)
|
||||
end
|
||||
end
|
||||
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,5,1,sortingOrder,false,rewardData)
|
||||
end
|
||||
|
||||
function this.OnSortingOrderChange()
|
||||
for i = 1, #heroListGo do
|
||||
Util.AddParticleSortLayer(heroListGo[i], self.sortingOrder - sortingOrder)
|
||||
end
|
||||
sortingOrder = self.sortingOrder
|
||||
end
|
||||
|
||||
--设置单个上阵英雄信息
|
||||
function this.SetCardSingleData(o,monsterId, _pos)
|
||||
o.transform.parent:GetComponent("Image").sprite=Util.LoadSprite("bd_xinkapaifan")
|
||||
local heroConfig = ConfigManager.GetConfigData(ConfigName.HeroConfig, monsterId.heroTid)
|
||||
local bg=Util.GetGameObject(o,"Bg1"):GetComponent("Image")
|
||||
local fg=Util.GetGameObject(o,"Bg2"):GetComponent("Image")
|
||||
-- local live=Util.GetGameObject(o,"Mask/Live")
|
||||
local lv=Util.GetGameObject(o,"lv/Text"):GetComponent("Text")
|
||||
local pro=Util.GetGameObject(o,"Pro/Image"):GetComponent("Image")
|
||||
local starGrid=Util.GetGameObject(o,"StarGrid")
|
||||
local name=Util.GetGameObject(o,"Name/Text"):GetComponent("Text")
|
||||
-- local pos=Util.GetGameObject(o,"Pos"):GetComponent("Image")
|
||||
local yuanImage=Util.GetGameObject(o,"yuanImage")
|
||||
local hp = Util.GetGameObject(o,"hpProgress/hp"):GetComponent("Image")
|
||||
local hpPass = Util.GetGameObject(o,"hpProgress/hpPass"):GetComponent("Image")
|
||||
local rage = Util.GetGameObject(o,"rageProgress/rage"):GetComponent("Image")
|
||||
|
||||
local live = Util.GetGameObject(o, "Mask/icon"):GetComponent("RawImage")
|
||||
local liveName = GetResourcePath(heroConfig.Live)
|
||||
local roleConfig = ConfigManager.GetConfigData(ConfigName.RoleConfig, heroConfig.Id)
|
||||
local scale = roleConfig.play_liveScale
|
||||
local livePos = Vector3.New(roleConfig.offset[1], roleConfig.offset[2], 0)
|
||||
live.texture = CardRendererManager.GetSpineTexture(_pos, liveName, Vector3.one * scale, livePos, true)
|
||||
live.transform.localScale = Vector3.one
|
||||
live.transform.localPosition = Vector3.zero
|
||||
|
||||
local zs = Util.GetGameObject(o, "zs")
|
||||
local zsName = GetHeroCardStarZs[heroConfig.Star]
|
||||
if zsName == "" then
|
||||
zs:SetActive(false)
|
||||
else
|
||||
zs:SetActive(true)
|
||||
zs:GetComponent("Image").sprite = Util.LoadSprite(zsName)
|
||||
end
|
||||
|
||||
yuanImage:SetActive(false)
|
||||
lv.text=monsterId.level
|
||||
|
||||
bg.sprite = Util.LoadSprite(GetHeroCardStarBg[heroConfig.Star])
|
||||
fg.sprite = Util.LoadSprite(GetHeroCardStarFg[heroConfig.Star])
|
||||
|
||||
pro.sprite=Util.LoadSprite(GetProStrImageByProNum(heroConfig.PropertyName))
|
||||
SetCardStars(starGrid,heroConfig.Star)
|
||||
if heroConfig.Star > 9 then
|
||||
Util.GetGameObject(o,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(true)
|
||||
else
|
||||
Util.GetGameObject(o,"UI_Effect_jinkuang_KaPai").gameObject:SetActive(false)
|
||||
end
|
||||
name.text=heroConfig.ReadingName
|
||||
end
|
||||
function this:OnClose()
|
||||
if fun then
|
||||
fun()
|
||||
fun = nil
|
||||
end
|
||||
for i, v in pairs(liveNodes) do
|
||||
if v then
|
||||
poolManager:UnLoadLive(liveNames[i],v)
|
||||
liveNames[i]= nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8c15d58f96d3ff14a94881ce62b062ef
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -10,6 +10,8 @@ local contentScripts = {
|
|||
[1] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKu"), panelName = "GeneralBigPopup_YiJingBaoKu",type=GENERAL_POPUP_TYPE.YiJingBaoKu},
|
||||
--易经宝库奖励预览
|
||||
[2] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_YiJingBaoKuRewardPreview"), panelName = "GeneralBigPopup_YiJingBaoKuRewardPreview",type=GENERAL_POPUP_TYPE.YiJingBaoKuRewardPreview},
|
||||
--易经宝库奖励预览
|
||||
[3] = {view = require("Modules/GeneralPanel/View/GeneralBigPopup_FourElementHelpFight"), panelName = "GeneralBigPopup_FourElementHelpFight",type=GENERAL_POPUP_TYPE.FourElementHelpFight},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
----- 易经宝库弹窗 -----
|
||||
local this = {}
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
--传入特效层级
|
||||
local sortingOrder=0
|
||||
local curId = nil--当前已选择的物品的Id
|
||||
local ActData = {}
|
||||
local itemList = {}--克隆预制体列表
|
||||
local goList = {}--勾选按钮列表
|
||||
local itemIconList={}--ItemView的List
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local _args
|
||||
local func
|
||||
|
||||
function this:InitComponent(gameObject)
|
||||
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
||||
this.itemPre = Util.GetGameObject(gameObject, "itemPre")
|
||||
this.ConfirmBtn = Util.GetGameObject(gameObject, "ConfirmBtn")
|
||||
this.Scroll = Util.GetGameObject(gameObject, "Scroll")
|
||||
|
||||
local rootHight = this.Scroll.transform.rect.height
|
||||
local width = this.Scroll.transform.rect.width
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.Scroll.transform,
|
||||
this.itemPre, nil, Vector2.New(width, rootHight), 1, 2, Vector2.New(0, 0))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 2
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.ConfirmBtn,function()
|
||||
if curId and curId ~= 0 then
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.YiJingBaoKuConfirm,curId,function()
|
||||
NetManager.SelectFinalRewardRequest(curId,ActData.activityId,function ()
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
end)
|
||||
else
|
||||
PopupTipPanel.ShowTip(Language[11796])
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent,...)
|
||||
|
||||
itemList={}
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||
_args = {...}
|
||||
ActData = _args[1]
|
||||
func = _args[2]
|
||||
this.titleText.text = "选择最终奖励"
|
||||
curId = ActData.selectId or nil
|
||||
local RewardConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.BlessingRewardPoolNew,"PoolId",ActData.curFinalPool)
|
||||
this.ScrollView:SetData(RewardConfig, function(index, go)
|
||||
this:SetSingleData(index,go, RewardConfig[index])
|
||||
end)
|
||||
|
||||
end
|
||||
|
||||
function this:SetSingleData(index,item,data)
|
||||
itemList[index] = item
|
||||
local icon = Util.GetGameObject(item,"icon")
|
||||
local name = Util.GetGameObject(item,"name"):GetComponent("Text")
|
||||
local num = Util.GetGameObject(item,"text"):GetComponent("Text")
|
||||
local limit1 = Util.GetGameObject(item,"limit1"):GetComponent("Text")
|
||||
local limit2 = Util.GetGameObject(item,"limit2"):GetComponent("Text")
|
||||
local select = Util.GetGameObject(item,"select")
|
||||
local go = Util.GetGameObject(item,"select/Go")
|
||||
|
||||
goList[index] = go
|
||||
|
||||
item:SetActive(true)
|
||||
if not itemIconList[item] then
|
||||
local view = SubUIManager.Open(SubUIConfig.ItemView, icon.transform)
|
||||
itemIconList[item] = view
|
||||
end
|
||||
itemIconList[item]:OnOpen(false,data.Reward,0.9,false)
|
||||
name.text = itemConfig[data.Reward[1]].Name
|
||||
|
||||
--判断是否选了该物品
|
||||
if curId == data.Id then
|
||||
go:SetActive(true)
|
||||
else
|
||||
go:SetActive(false)
|
||||
end
|
||||
--选择一个物品
|
||||
Util.AddOnceClick(select,function()
|
||||
if go.gameObject.activeSelf then
|
||||
go:SetActive(false)
|
||||
curId = nil
|
||||
else
|
||||
for index, value in ipairs(goList) do
|
||||
goList[index]:SetActive(false)
|
||||
end
|
||||
go:SetActive(true)
|
||||
curId = data.Id
|
||||
end
|
||||
end)
|
||||
|
||||
local t1 = true
|
||||
local t2 = true
|
||||
local t3 = true
|
||||
--判断是否可以选择
|
||||
if PlayerManager.level >= data.LevelLimit then
|
||||
num.gameObject:SetActive(true)
|
||||
limit1.gameObject:SetActive(false)
|
||||
select:SetActive(true)
|
||||
else
|
||||
limit1.gameObject:SetActive(true)
|
||||
limit1.text = data.LevelLimit.."级可选"
|
||||
t1 = false
|
||||
end
|
||||
if ActData.curLevel >= data.FloorLimit then
|
||||
num.gameObject:SetActive(true)
|
||||
limit2.gameObject:SetActive(false)
|
||||
select:SetActive(true)
|
||||
else
|
||||
limit2.gameObject:SetActive(true)
|
||||
limit2.text = "第"..data.FloorLimit.."层可选"
|
||||
t2 = false
|
||||
end
|
||||
-- LogRed(ActData.allData[index].rewardId..":"..tostring(ActData.allData[index].progress))
|
||||
if ActData.allData[index].progress > data.InitializeNum then
|
||||
t3 = false
|
||||
elseif ActData.allData[index].progress == data.InitializeNum and ActData.curLevel > data.InitializeNum then
|
||||
t3 = false
|
||||
num.text = "<color=red>"..(data.InitializeNum-ActData.allData[index].progress).."/"..data.InitializeNum.."</color>"
|
||||
else
|
||||
t3 = true
|
||||
num.text = (data.InitializeNum-ActData.allData[index].progress).."/"..data.InitializeNum
|
||||
end
|
||||
|
||||
num.gameObject:SetActive(t1 and t2)
|
||||
select:SetActive(t1 and t2 and t3)
|
||||
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
itemIconList={}
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 127288e91a36f4c4496783ccac80f25b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,68 @@
|
|||
require("Base/BasePanel")
|
||||
MonsterCampMainPanel = Inherit(BasePanel)
|
||||
local this = MonsterCampMainPanel
|
||||
local orginLayer
|
||||
local monsterGroup = ConfigManager.GetConfig(ConfigName.MonsterGroup)
|
||||
local monsterConfig = ConfigManager.GetConfig(ConfigName.MonsterConfig)
|
||||
|
||||
--初始化组件(用于子类重写)
|
||||
function MonsterCampMainPanel:InitComponent()
|
||||
orginLayer = 0
|
||||
this.btnBack = Util.GetGameObject(self.gameObject, "btnBack")
|
||||
this.waveNum = Util.GetGameObject(self.gameObject, "Bg/waveImg/wave"):GetComponent("Text")
|
||||
|
||||
this.nextWave = Util.GetGameObject(self.gameObject, "Bg/btnWave")
|
||||
this.UpView = SubUIManager.Open(SubUIConfig.UpView, self.gameObject.transform)
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function MonsterCampMainPanel:BindEvent()
|
||||
Util.AddClick(this.btnBack, function ()
|
||||
-- UIManager.OpenPanel(UIName.MainPanel)
|
||||
PlayerManager.carbonType = 1
|
||||
UIManager.OpenPanel(UIName.CarbonTypePanelV2)
|
||||
self:ClosePanel()
|
||||
end)
|
||||
|
||||
Util.AddClick(this.nextWave, function ()
|
||||
JumpManager.GoJump(1011)
|
||||
end)
|
||||
|
||||
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function MonsterCampMainPanel:AddListener()
|
||||
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function MonsterCampMainPanel:RemoveListener()
|
||||
|
||||
end
|
||||
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function MonsterCampMainPanel:OnOpen(...)
|
||||
SoundManager.PlayMusic(SoundConfig.BGM_Carbon)
|
||||
|
||||
this.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.MonsterCamp })
|
||||
this.waveNum.text =MonsterCampManager.monsterWave
|
||||
end
|
||||
|
||||
function MonsterCampMainPanel:OnSortingOrderChange()
|
||||
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function MonsterCampMainPanel:OnClose()
|
||||
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function MonsterCampMainPanel:OnDestroy()
|
||||
SubUIManager.Close(this.UpView)
|
||||
|
||||
end
|
||||
|
||||
return MonsterCampMainPanel
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c7fc4521ff8f8984f8d70ecc2f94b78e
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,97 @@
|
|||
require("Base/BasePanel")
|
||||
FourElementMonsterCampPanel = Inherit(BasePanel)
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local this = FourElementMonsterCampPanel
|
||||
this.monsterInfoList = {}
|
||||
this.rewardList = {}
|
||||
this.grid = {}
|
||||
local callBack
|
||||
--初始化组件(用于子类重写)
|
||||
function FourElementMonsterCampPanel:InitComponent()
|
||||
this.btnBack = Util.GetGameObject(self.gameObject, "infoRoot/btnBack")
|
||||
this.pre = Util.GetGameObject(self.gameObject, "infoRoot/pre")
|
||||
end
|
||||
|
||||
--绑定事件(用于子类重写)
|
||||
function FourElementMonsterCampPanel:BindEvent()
|
||||
Util.AddClick(this.btnBack, function ()
|
||||
self:ClosePanel()
|
||||
if callBack then callBack() end
|
||||
end)
|
||||
end
|
||||
|
||||
--添加事件监听(用于子类重写)
|
||||
function FourElementMonsterCampPanel:AddListener()
|
||||
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function FourElementMonsterCampPanel:RemoveListener()
|
||||
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
function FourElementMonsterCampPanel:OnOpen(func)
|
||||
this.InitShowReward()
|
||||
this.InitMonsterShow()
|
||||
if func then
|
||||
callBack = func
|
||||
end
|
||||
end
|
||||
|
||||
-- 初始化奖励显示
|
||||
function this.InitShowReward()
|
||||
for i = 1, 5 do
|
||||
this.monsterInfoList[i]:SetActive(false)
|
||||
if not this.rewardList[i] then
|
||||
this.rewardList[i] = {}
|
||||
for j = 1, 6 do
|
||||
this.rewardList[i][j] = SubUIManager.Open(SubUIConfig.ItemView, this.grid[i].transform)
|
||||
this.rewardList[i][j].gameObject:SetActive(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this.InitMonsterShow()
|
||||
local monsterInfo = MonsterCampManager.GetNextWaveMonsterInfo()
|
||||
local curWave = MonsterCampManager.monsterWave
|
||||
for i = 1, 5 do -- 5 只妖怪
|
||||
if not monsterInfo[i + curWave] then Log(Language[11576])
|
||||
return
|
||||
end
|
||||
local waveNum = Util.GetGameObject(this.monsterInfoList[i], "bg/num"):GetComponent("Text")
|
||||
local icon = Util.GetGameObject(this.monsterInfoList[i], "bg/frame/icon"):GetComponent("Image")
|
||||
local name = Util.GetGameObject(this.monsterInfoList[i], "bg/nameFrame/name"):GetComponent("Text")
|
||||
local rewardData = monsterInfo[i + curWave].rewardShow
|
||||
|
||||
waveNum.text = Language[10311] ..curWave + i .. Language[10316]
|
||||
icon.sprite = monsterInfo[i + curWave].icon
|
||||
name.text = monsterInfo[i + curWave].name
|
||||
|
||||
-- 显示奖励
|
||||
for j = 1, #rewardData do
|
||||
local item = {}
|
||||
local itemId = rewardData[j][1]
|
||||
item[#item + 1] = itemId
|
||||
item[#item + 1] = rewardData[j][2]
|
||||
|
||||
this.rewardList[i][j]:OnOpen(false, item, 0.9)
|
||||
this.rewardList[i][j].gameObject:SetActive(true)
|
||||
end
|
||||
this.monsterInfoList[i]:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
||||
--界面关闭时调用(用于子类重写)
|
||||
function FourElementMonsterCampPanel:OnClose()
|
||||
|
||||
end
|
||||
|
||||
--界面销毁时调用(用于子类重写)
|
||||
function FourElementMonsterCampPanel:OnDestroy()
|
||||
this.monsterInfoList = {}
|
||||
this.rewardList = {}
|
||||
end
|
||||
|
||||
return FourElementMonsterCampPanel
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 63cf6b4d9178a3d44b61f4eafcbd8744
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -63,7 +63,9 @@ local contentScripts = {
|
|||
[30] = {view = require("Modules/Popup/View/GeneralPopup_YiJingBaoKuConfirm"), panelName = "GeneralPopup_YiJingBaoKuConfirm",type=GENERAL_POPUP_TYPE.YiJingBaoKuConfirm},
|
||||
--灵兽宝阁选择神兽
|
||||
[31] = {view = require("Modules/Popup/View/GeneralPopup_LingShouBaoGe"), panelName = "GeneralPopup_LingShouBaoGe",type=GENERAL_POPUP_TYPE.LingShouBaoGe},
|
||||
}
|
||||
--灵兽宝阁选择神兽
|
||||
[32] = {view = require("Modules/Popup/View/GeneralPopup_FightReturnLookFourEle"), panelName = "GeneralPopup_FightReturnLookFourEle",type=GENERAL_POPUP_TYPE.FourElementReturnLook},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
--打开弹窗类型
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
----- 归元弹窗 -----
|
||||
local this = {}
|
||||
--传入父脚本模块
|
||||
local parent
|
||||
--层级
|
||||
local sortingOrder = 0
|
||||
--传入不定参
|
||||
local _args = {}
|
||||
--传入选择英雄计算返回奖励数据列表
|
||||
local dropList = {}
|
||||
--item容器
|
||||
local itemList = {}
|
||||
--传入选择英雄
|
||||
local selectHeroData
|
||||
local heroConfig=ConfigManager.GetConfig(ConfigName.HeroConfig)
|
||||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
|
||||
function this:InitComponent(gameObject)
|
||||
this.titleText = Util.GetGameObject(gameObject, "TitleText"):GetComponent("Text")
|
||||
this.bodyText = Util.GetGameObject(gameObject, "BodyText"):GetComponent("Text")
|
||||
this.cancelBtn = Util.GetGameObject(gameObject, "CancelBtn")
|
||||
this.confirmBtn = Util.GetGameObject(gameObject, "ConfirmBtn")
|
||||
--滚动条根节点
|
||||
this.root = Util.GetGameObject(gameObject, "Root/Viewport/Content")
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.cancelBtn,function()
|
||||
parent:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.confirmBtn,function()
|
||||
local data
|
||||
for k,v in pairs(selectHeroData) do
|
||||
data=v.dynamicId
|
||||
break
|
||||
end
|
||||
NetManager.HeroRetureEvent(data, function(msg)
|
||||
HeroManager.ResetHero(data)
|
||||
PopupTipPanel.ShowTip(Language[12276])
|
||||
parent:ClosePanel()
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function ()
|
||||
ResolvePanel.SwitchView(2)
|
||||
end,0,nil,nil,1)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent,...)
|
||||
parent=_parent
|
||||
sortingOrder =_parent.sortingOrder
|
||||
local args = {...}
|
||||
dropList = args[1]
|
||||
selectHeroData=args[2]
|
||||
this.root.transform:GetComponent("RectTransform"):DOAnchorPosX(0, 0)
|
||||
|
||||
this.titleText.text=Language[11645]
|
||||
--返还比
|
||||
local num=tonumber(ConfigManager.GetConfigData(ConfigName.SpecialConfig,34).Value)/100
|
||||
this.bodyText.text = Language[11646]--string.format(Language[11646], num, "%")
|
||||
|
||||
local _data={}
|
||||
for i=1,#dropList do
|
||||
_data[i] = {dropList[i].id,dropList[i].num,nil,dropList[i].star}
|
||||
end
|
||||
FindFairyManager.ResetItemView(this.root,this.root.transform,itemList,8,1,sortingOrder,false,_data)
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6b1101535b7a47c44b9cbf6547ae9d1a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue