【ID1010437】

【优化】开服玉帝御剑坐骑活动
dev_chengFeng
jiaoyangna 2021-10-14 12:14:26 +08:00
parent 4f580146bd
commit 3cbffeab4a
3 changed files with 1379 additions and 95 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,6 @@ function this.InitHaveEquipDatas(id,num)
this.HaveEquipDatas[id] = 0
end
this.HaveEquipDatas[id] = this.HaveEquipDatas[id] + num
LogGreen("this.HaveEquipDatas[id]:"..this.HaveEquipDatas[id].." id:"..id)
end
function this.GetHaveEquipDatas()

View File

@ -16,6 +16,8 @@ local curUserRideId
--初始化组件(用于子类重写)
function SettingPlayerRide:InitComponent(gameObject)
this.spLoader = SpriteLoader.New()
this.smallShow = Util.GetGameObject(gameObject, "Image")
this.jingqingqidai = Util.GetGameObject(gameObject, "notOpen")
this.live2dRootParent = Util.GetGameObject(gameObject, "live2dRootParent")
this.live2dRootParent2 = Util.GetGameObject(gameObject, "live2dRootParent2")
this.name = Util.GetGameObject(gameObject, "name/Text"):GetComponent("Text")
@ -51,11 +53,31 @@ function SettingPlayerRide:InitComponent(gameObject)
this.scrollViewPro.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
this.scrollViewPro.moveTween.MomentumAmount = 1
this.scrollViewPro.moveTween.Strength = 2
this.skillPre = Util.GetGameObject(gameObject, "skinProInfo/skillPre")
this.skillImage = Util.GetGameObject(gameObject, "skinProInfo/skillImage")
this.skillGrid = Util.GetGameObject(gameObject, "skinProInfo/skillGrid")
this.skillList = {}
this.skillDes = Util.GetGameObject(gameObject, "PokemonSkillInfoPopup")
this.skillDesClose = Util.GetGameObject(this.skillDes, "Button")
this.skillDesIcon = Util.GetGameObject(this.skillDes, "Content/IconBG/Icon"):GetComponent("Image")
this.skillDesTitle = Util.GetGameObject(this.skillDes, "Content/Title")
this.skillDesTitleText = Util.GetGameObject(this.skillDesTitle,"Text"):GetComponent("Text")
this.skillDesText = Util.GetGameObject(this.skillDes, "Content/curinfo"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function SettingPlayerRide:BindEvent()
Util.AddClick(this.skillDesClose,function()
this.skillDes.gameObject:SetActive(false)
end)
end
function this.SetSkillDes(data)
this.skillDesIcon.sprite = this.spLoader:LoadSprite(data.icon)
this.skillDesTitleText.text = data.title
this.skillDesText.text = data.des
end
--添加事件监听(用于子类重写)
@ -80,6 +102,7 @@ end
function this.ShowPanelData()
local rideList = ConfigManager.GetAllConfigsDataByKey(ConfigName.PlayerHeadIcon,"Type",PlayerHeadIconType.Ride)
LogGreen("rideList:"..#rideList)
--设置滚动区信息
curUserRideId = PlayerManager.GetPlayerRide()
curUserRideConFig = rideList[1]
@ -161,18 +184,69 @@ function this.SingleRideClickShowInfo(data,go)
if live2dRoot2 then
live2dRoot2:OnClose()
end
local curPlayerLiveViewData = {
skin = PlayerManager.GetPlayerSkin(),
sex = NameManager.roleSex,
ride = curPlayerHeadIconConfig.Id,
}
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
live2dRoot:OnOpen(GetPlayerRoleSingleConFig().Scale7,nil,WALK_DIR.IDLE_LEFT)
local ridePlayerLiveViewData = {
if curPlayerHeadIconConfig.Hide == 0 then
this.jingqingqidai.gameObject:SetActive(false)
this.smallShow.gameObject:SetActive(true)
this.live2dRootParent2.gameObject:SetActive(true)
this.live2dRootParent.gameObject:SetActive(true)
local curPlayerLiveViewData = {
skin = PlayerManager.GetPlayerSkin(),
sex = NameManager.roleSex,
ride = curPlayerHeadIconConfig.Id,
}
live2dRoot2 = PlayerLiveView:New(this.live2dRootParent2,2, ridePlayerLiveViewData)
live2dRoot2:OnOpen(GetPlayerRoleSingleConFig().Scale8,nil,WALK_DIR.IDLE_LEFT)
live2dRoot = PlayerLiveView:New(this.live2dRootParent,2, curPlayerLiveViewData)
live2dRoot:OnOpen(GetPlayerRoleSingleConFig().Scale7,nil,WALK_DIR.IDLE_LEFT)
local ridePlayerLiveViewData = {
ride = curPlayerHeadIconConfig.Id,
}
live2dRoot2 = PlayerLiveView:New(this.live2dRootParent2,2, ridePlayerLiveViewData)
live2dRoot2:OnOpen(GetPlayerRoleSingleConFig().Scale8,nil,WALK_DIR.IDLE_LEFT)
else
this.jingqingqidai.gameObject:SetActive(true)
this.smallShow.gameObject:SetActive(false)
this.live2dRootParent2.gameObject:SetActive(false)
this.live2dRootParent.gameObject:SetActive(false)
end
if not this.skillList then
this.skillList = {}
end
for k,v in ipairs(this.skillList) do
v.go.gameObject:SetActive(false)
end
if curPlayerHeadIconConfig.Icon then
this.skillGrid.gameObject:SetActive(true)
this.skillImage.gameObject:SetActive(true)
for i = 1,math.max(#this.skillList,#curPlayerHeadIconConfig.Icon) do
if not curPlayerHeadIconConfig.Icon[i] then
this.skillList[i].go.gameObject:SetActive(false)
else
if not this.skillList[i] then
this.skillList[i] = {}
this.skillList[i].go = newObjToParent(this.skillPre,this.skillGrid)
this.skillList[i].btn = Util.GetGameObject(this.skillList[i].go, "icon")
this.skillList[i].icon = this.skillList[i].btn:GetComponent("Image")
this.skillList[i].index = i
end
this.skillList[i].go.gameObject:SetActive(true)
this.skillList[i].icon.sprite = this.spLoader:LoadSprite(GetResourcePath(curPlayerHeadIconConfig.Icon[i]))
Util.AddOnceClick(this.skillList[i].btn,function()
this.skillDes.gameObject:SetActive(true)
local data = {}
data.icon = GetResourcePath(curPlayerHeadIconConfig.Icon[i])
local strs = string.split(curPlayerHeadIconConfig.SkillEffect,"|")
local strDes = string.split(strs[i],"#")
data.title = strDes[1]
data.des = strDes[2]
this.SetSkillDes(data)
end)
end
end
else
this.skillGrid.gameObject:SetActive(false)
this.skillImage.gameObject:SetActive(false)
end
Util.AddOnceClick(this.goToBtn, function()
if not isGet and not isUser then
@ -208,7 +282,7 @@ end
--界面销毁时调用(用于子类重写)
function SettingPlayerRide:OnDestroy()
this.spLoader:Destroy()
this.skillList = {}
end
return SettingPlayerRide