Merge branch '0功能/灵兽系统' of http://60.1.1.230/gaoxin/JL_Client into 0功能/灵兽系统
commit
aa82e7f13f
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1812,6 +1812,7 @@ GENERAL_POPUP_TYPE={
|
|||
XuanYuanBuyTimes=21,--轩辕宝镜购买次数确认
|
||||
QinglongSerectTreasureBuyLevel = 22,--青龙秘宝购买等级
|
||||
HeavenUnlockExtraRewardPanel = 23, --青龙秘宝解锁
|
||||
PokemonUpZhenAddPro = 24, --灵兽战力加成
|
||||
}
|
||||
|
||||
--抽卡类型
|
||||
|
|
@ -2092,4 +2093,10 @@ FBSDKCustomEventType = {
|
|||
CarBonTypeId = {
|
||||
TRIAL = 1,
|
||||
ENDLESS = 2,
|
||||
}
|
||||
--通用弹窗类型
|
||||
Pokemon_Popup_Type={
|
||||
PokemonListPanel_UpWar=1,--出战
|
||||
PokemonListPanel_List=2,--列表
|
||||
PokemonListPanel_Fetter=3,--羁绊
|
||||
}
|
||||
|
|
@ -2,7 +2,11 @@
|
|||
local PokemonMainPanel = Inherit(BasePanel)
|
||||
local this = PokemonMainPanel
|
||||
local PokemonList = {}
|
||||
local PokemonDataList = {}
|
||||
local live2dList = {}
|
||||
local pokemonPosLocks = {
|
||||
80,80,90,90,100,100
|
||||
}
|
||||
--初始化组件(用于子类重写)
|
||||
function PokemonMainPanel:InitComponent()
|
||||
this.btnBack = Util.GetGameObject(self.transform, "btnBack")
|
||||
|
|
@ -37,22 +41,23 @@ function PokemonMainPanel:BindEvent()
|
|||
UIManager.OpenPanel(UIName.HelpPopup, HELP_TYPE.Adventure, pos.x, pos.y)
|
||||
end)
|
||||
Util.AddClick(this.btnShop, function()
|
||||
-- UIManager.OpenPanel(UIName.HelpPopup)
|
||||
JumpManager.GoJump(20003)
|
||||
end)
|
||||
Util.AddClick(this.btnInfo, function()
|
||||
-- UIManager.OpenPanel(UIName.HelpPopup)
|
||||
UIManager.OpenPanel(UIName.PokemonSummonPanel)
|
||||
end)
|
||||
Util.AddClick(this.btnWarAddPro, function()
|
||||
-- UIManager.OpenPanel(UIName.HelpPopup)
|
||||
UIManager.OpenPanel(UIName.GeneralPopup,GENERAL_POPUP_TYPE.PokemonUpZhenAddPro,{})
|
||||
end)
|
||||
Util.AddClick(this.btnOut, function()
|
||||
-- UIManager.OpenPanel(UIName.HelpPopup)
|
||||
end)
|
||||
Util.AddClick(this.btnFetter, function()
|
||||
-- UIManager.OpenPanel(UIName.HelpPopup)
|
||||
UIManager.OpenPanel(UIName.PokemonListPanel,Pokemon_Popup_Type.PokemonListPanel_Fetter)
|
||||
end)
|
||||
Util.AddClick(this.btnPokemonList, function()
|
||||
-- UIManager.OpenPanel(UIName.HelpPopup)
|
||||
UIManager.OpenPanel(UIName.PokemonListPanel,Pokemon_Popup_Type.PokemonListPanel_List)
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
@ -74,14 +79,16 @@ end
|
|||
|
||||
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
|
||||
function PokemonMainPanel:OnShow()
|
||||
-- this.ShowPokemonList()
|
||||
this.ShowPokemonList()
|
||||
end
|
||||
|
||||
|
||||
local nextOpenLockIndex = 0
|
||||
function this.ShowPokemonList()
|
||||
PokemonList = {}
|
||||
nextOpenLockIndex = 0
|
||||
PokemonDataList = {{},{},{},{},{},{}}
|
||||
LogPink("#PokemonList "..#PokemonDataList)
|
||||
for i = 1, #PokemonList do
|
||||
this.ShowSinglePokemonList(PokemonList[i],PokemonList[i],i)
|
||||
this.ShowSinglePokemonList(PokemonList[i],PokemonDataList[i],i)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -93,7 +100,34 @@ function this.ShowSinglePokemonList(go,singleData,liveIndex)
|
|||
upZhenInfo:SetActive(false)
|
||||
addInfo:SetActive(false)
|
||||
lockInfo:SetActive(false)
|
||||
if singleData.State == 1 then
|
||||
|
||||
local state = 1--1 未解锁 隐藏 2 即将解锁 3 已解锁 未上阵 4 已解锁 已上阵
|
||||
if pokemonPosLocks[liveIndex] <= PlayerManager.level then
|
||||
state = 3
|
||||
if singleData and singleData.dynamicId then
|
||||
state = 4
|
||||
end
|
||||
else
|
||||
if nextOpenLockIndex <= 0 then
|
||||
nextOpenLockIndex = liveIndex
|
||||
state = 2
|
||||
end
|
||||
end
|
||||
if state == 1 then
|
||||
--什么都不用做
|
||||
go:SetActive(false)
|
||||
elseif state == 2 then
|
||||
lockInfo:SetActive(true)
|
||||
Util.GetGameObject(go, "lockInfo/lvImage/Text"):GetComponent("Text").text = pokemonPosLocks[liveIndex].."级解锁"
|
||||
Util.AddOnceClick( Util.GetGameObject(go, "lockInfo/lockClick"), function()
|
||||
PopupTipPanel.ShowTip(pokemonPosLocks[liveIndex].."级解锁")
|
||||
end)
|
||||
elseif state == 3 then
|
||||
addInfo:SetActive(true)
|
||||
Util.AddOnceClick( Util.GetGameObject(go, "addInfo/addClick"), function()
|
||||
UIManager.OpenPanel(UIName.PokemonListPanel,Pokemon_Popup_Type.PokemonListPanel_UpWar)
|
||||
end)
|
||||
elseif state == 4 then
|
||||
upZhenInfo:SetActive(true)
|
||||
Util.GetGameObject(go, "upZhenInfo/titleImage/nameText"):GetComponent("Text").text = "名字"
|
||||
Util.GetGameObject(go, "upZhenInfo/lvImage/Text"):GetComponent("Text").text = "等级"
|
||||
|
|
@ -104,12 +138,13 @@ function this.ShowSinglePokemonList(go,singleData,liveIndex)
|
|||
live2dList[liveIndex] = nil
|
||||
end
|
||||
end
|
||||
local LiveName = GetResourcePath(heroConfig.Live)
|
||||
local LiveName = GetResourcePath(singleData.config.Live)
|
||||
local live2d = poolManager:LoadLive(LiveName, curPokemonLive.transform,Vector3.one * heroConfig.Scale, Vector3.New(heroConfig.Position[1],heroConfig.Position[2],0))
|
||||
live2dList[liveIndex] = {name=configData.Icon, go=live2d}
|
||||
this.SetStarGrid(Util.GetGameObject(go, "upZhenInfo/starGrid"),2)
|
||||
elseif singleData.State == 2 then
|
||||
|
||||
Util.AddOnceClick( Util.GetGameObject(go, "upZhenInfo/upZhenClick"), function()
|
||||
UIManager.OpenPanel(UIName.PokemonInfoPanel,singleData)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function this:OnSortingOrderChange(_sortingOrder)
|
|||
sortingOrder = _sortingOrder
|
||||
end
|
||||
function this:OnShow(...)
|
||||
this.ShowCurrPosTreasures()s
|
||||
this.ShowCurrPosTreasures()
|
||||
end
|
||||
|
||||
--显示当前阵营的宝物
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ local sortingOrder=0
|
|||
local equipStarsConfig = ConfigManager.GetConfig(ConfigName.EquipStarsConfig)
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local TabBox = require("Modules/Common/TabBox")
|
||||
local _TabData={ [1] = { default = "zbhc_sanji2", select = "zbhc_sanji1", name = "灵兽" },
|
||||
[2] = { default = "zbhc_sanji2", select = "zbhc_sanji1", name = "碎片" },
|
||||
local _TabData={ [1] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "灵兽" },
|
||||
[2] = { default = "r_hero_xuanze_002", select = "r_hero_xuanze_001", name = "碎片" },
|
||||
}
|
||||
local _TabFontColor = { default = Color.New(130 / 255, 128 / 255, 120 / 255, 1),
|
||||
select = Color.New(243 / 255, 235 / 255, 202 / 255, 1)}
|
||||
|
|
@ -17,14 +17,24 @@ local pokemonChipList = {}
|
|||
function this:InitComponent(gameObject)
|
||||
Util.GetGameObject(gameObject, "PokemonListPanel_List/name"):GetComponent("Text").text = "灵兽列表"
|
||||
this.tabBox = Util.GetGameObject(gameObject, "PokemonListPanel_List/TabBox")
|
||||
|
||||
this.ScrollParentView1 = Util.GetGameObject(gameObject, "PokemonListPanel_List/ScrollParentView1")
|
||||
this.ScrollParentView2 = Util.GetGameObject(gameObject, "PokemonListPanel_List/ScrollParentView2")
|
||||
|
||||
this.equipPre = Util.GetGameObject(gameObject, "PokemonListPanel_List/equipPre")
|
||||
local v2 = Util.GetGameObject(gameObject, "PokemonListPanel_List/scroll"):GetComponent("RectTransform").rect
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, Util.GetGameObject(gameObject, "PokemonListPanel_List/scroll").transform,
|
||||
this.equipPre, nil, Vector2.New(-v2.x*2, -v2.y*2), 1, 5, Vector2.New(15,15))
|
||||
this.ItemPre1 = Util.GetGameObject(gameObject, "PokemonListPanel_List/ItemPre1")
|
||||
local v2 = this.ScrollParentView1:GetComponent("RectTransform").rect
|
||||
this.ScrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.ScrollParentView1.transform,
|
||||
this.ItemPre1, nil, Vector2.New(-v2.x*2, -v2.y*2), 1, 5, Vector2.New(15,15))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 1
|
||||
|
||||
this.ItemPre2 = Util.GetGameObject(gameObject, "PokemonListPanel_List/ItemPre2")
|
||||
local v2 = this.ScrollParentView2:GetComponent("RectTransform").rect
|
||||
this.ScrollView2 = SubUIManager.Open(SubUIConfig.ScrollCycleView, this.ScrollParentView2.transform,
|
||||
this.ItemPre2, nil, Vector2.New(-v2.x*2, -v2.y*2), 1, 5, Vector2.New(15,15))
|
||||
this.ScrollView2.moveTween.MomentumAmount = 1
|
||||
this.ScrollView2.moveTween.Strength = 1
|
||||
|
||||
this.NoneImage = Util.GetGameObject(gameObject, "PokemonListPanel_List/NoneImage")
|
||||
this.NoneImageText = Util.GetGameObject(gameObject, "PokemonListPanel_List/NoneImage/TextImage/Text"):GetComponent("Text")
|
||||
end
|
||||
|
|
@ -58,19 +68,25 @@ end
|
|||
function this.OnClickTabBtn(_curIndex)
|
||||
curIndex = _curIndex
|
||||
if curIndex == 1 then
|
||||
this.ScrollParentView1:SetActive(true)
|
||||
this.ScrollParentView2:SetActive(false)
|
||||
pokemonList = {}
|
||||
this.ScrollView:SetData(pokemonList, function (index, go)
|
||||
this.SingPokemonDataShow(go, pokemonList[index])
|
||||
end)
|
||||
this.NoneImage:SetActive(#pokemonList > 0)
|
||||
this.NoneImage:SetActive(#pokemonList <= 0)
|
||||
this.NoneImageText.text = "未获得灵兽"
|
||||
LogPink("未获得灵兽 ")
|
||||
elseif curIndex == 2 then
|
||||
this.ScrollParentView1:SetActive(false)
|
||||
this.ScrollParentView2:SetActive(true)
|
||||
pokemonChipList = {}
|
||||
this.ScrollView:SetData(pokemonChipList, function (index, go)
|
||||
this.ScrollView2:SetData(pokemonChipList, function (index, go)
|
||||
this.SingPokemonChipDataShow(go, pokemonChipList[index])
|
||||
end)
|
||||
this.NoneImage:SetActive(#pokemonChipList > 0)
|
||||
this.NoneImage:SetActive(#pokemonChipList <= 0)
|
||||
this.NoneImageText.text = "未获得灵兽碎片"
|
||||
LogPink("未获得灵兽碎片 ")
|
||||
end
|
||||
-- this.ScrollView:ForeachItemGO(function(index, go)
|
||||
-- Timer.New(function()
|
||||
|
|
@ -119,10 +135,10 @@ function this.TabAdapter(tab, index, status)
|
|||
local tabLab = Util.GetGameObject(tab, "Text")
|
||||
local tabImage = Util.GetGameObject(tab,"Image")
|
||||
tabImage:GetComponent("Image").sprite = Util.LoadSprite(_TabData[index][status])
|
||||
tabImage:GetComponent("Image"):SetNativeSize()
|
||||
-- tabImage:GetComponent("Image"):SetNativeSize()
|
||||
tabLab:GetComponent("Text").text = _TabData[index].name
|
||||
tabLab:GetComponent("Text").color = _TabFontColor[status]
|
||||
tabImage.transform.localPosition = Vector3.New( tabImage.transform.localPosition.x, _TabImagePos[status], 0);
|
||||
-- tabImage.transform.localPosition = Vector3.New( tabImage.transform.localPosition.x, _TabImagePos[status], 0);
|
||||
end
|
||||
--切换视图
|
||||
function this.SwitchView(index)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,9 @@ function this:InitComponent(gameObject)
|
|||
this.ItemPre, nil, Vector2.New(-v2.x*2, -v2.y*2), 1, 5, Vector2.New(15,15))
|
||||
this.ScrollView.moveTween.MomentumAmount = 1
|
||||
this.ScrollView.moveTween.Strength = 1
|
||||
this.NoneImage = Util.GetGameObject(gameObject, "PokemonListPanel_UpWar/NoneImage")
|
||||
this.NoneImageText = Util.GetGameObject(gameObject, "PokemonListPanel_UpWar/NoneImage/TextImage/Text"):GetComponent("Text")
|
||||
this.NoneImageText.text = "无可出战灵兽!"
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
|
|
@ -33,6 +36,7 @@ function this:OnShow(...)
|
|||
this.ScrollView:SetData(polemonList, function (index, go)
|
||||
this.SingleItemDataShow(go, polemonList[index])
|
||||
end)
|
||||
this.NoneImage:SetActive(#polemonList <= 0)
|
||||
-- this.ScrollView:ForeachItemGO(function(index, go)
|
||||
-- Timer.New(function()
|
||||
-- go.gameObject:SetActive(true)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,8 @@ local contentScripts = {
|
|||
[21] = {view = require("Modules/Popup/View/GeneralPopup_BuyXuanYuanMirrorTims"), panelName = "GeneralPopup_BuyXuanYuanMirrorTims",type=GENERAL_POPUP_TYPE.XuanYuanBuyTimes},
|
||||
[22] = {view = require("Modules/Popup/View/GeneralPopup_QinglongSerectTreasureBuyLevel"), panelName = "GeneralPopup_QinglongSerectTreasureBuyLevel",type=GENERAL_POPUP_TYPE.QinglongSerectTreasureBuyLevel},
|
||||
[23] = {view = require("Modules/Popup/View/GeneralPopup_HeavenUnlockExtraRewardPanel"), panelName = "GeneralPopup_HeavenUnlockExtraRewardPanel",type=GENERAL_POPUP_TYPE.HeavenUnlockExtraRewardPanel},
|
||||
--灵兽战力加成
|
||||
[24] = {view = require("Modules/Popup/View/GeneralPopup_PokemonUpZhenAddPro"), panelName = "GeneralPopup_PokemonUpZhenAddPro",type=GENERAL_POPUP_TYPE.PokemonUpZhenAddPro},
|
||||
}
|
||||
--子模块预设
|
||||
local contentPrefabs={}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
----- 灵兽战力加成 -----
|
||||
local this = {}
|
||||
--传入父脚本模块
|
||||
local sortingOrder
|
||||
local parent
|
||||
local allProPre = {}
|
||||
local allProData = {}
|
||||
|
||||
function this:InitComponent(gameObject)
|
||||
Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text").text = "出战加成"
|
||||
Util.GetGameObject(gameObject,"Body/Text"):GetComponent("Text").text = "出战灵兽对神将加成"
|
||||
for i = 1, 4 do
|
||||
allProPre[i] = Util.GetGameObject(gameObject,"Root/singlePro ("..i..")")
|
||||
end
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
|
||||
end
|
||||
|
||||
function this:AddListener()
|
||||
end
|
||||
|
||||
function this:RemoveListener()
|
||||
end
|
||||
|
||||
function this:OnShow(_parent,...)
|
||||
parent=_parent
|
||||
sortingOrder = _parent.sortingOrder
|
||||
--不定参中包含的不定参 _args[1]为面板类型 _args[2]之后(包括)为打开面板后传入的不定参
|
||||
local _args = {...}
|
||||
allProData=_args[1]
|
||||
this.RefreshPanel()
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
end
|
||||
|
||||
|
||||
--刷新面板
|
||||
function this.RefreshPanel()
|
||||
for i, v in ipairs(allProData) do
|
||||
local go= allProPre[i]
|
||||
Util.GetGameObject(go,"Image"):GetComponent("Image").sprite= Util.LoadSprite(GetResourcePath(heroConfig[v.tmpId].Icon))
|
||||
Util.GetGameObject(go,"lv/proName"):GetComponent("Text").text=v.level
|
||||
Util.GetGameObject(go,"lv/proValue"):GetComponent("Text").text=v.level
|
||||
end
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 77cf1f44ec7949f449d5dec58187c93f
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Reference in New Issue