皮肤提交

dev_chengFeng
jiaoyangna 2020-11-06 20:36:38 +08:00
parent 98ff210ae2
commit 0a772f466b
5 changed files with 242 additions and 23 deletions

View File

@ -127,6 +127,10 @@ FASTFIGHTCHALLENGERESPONSE = protobuf.Descriptor();
FASTFIGHTCHALLENGERESPONSE_SCORE_FIELD = protobuf.FieldDescriptor();
FASTFIGHTCHALLENGERESPONSE_HURT_FIELD = protobuf.FieldDescriptor();
FASTFIGHTCHALLENGERESPONSE_FIGHTDATA_FIELD = protobuf.FieldDescriptor();
RECHARGEINFOINDICATION = protobuf.Descriptor();
RECHARGEINFOINDICATION_RECHARGEID_FIELD = protobuf.FieldDescriptor();
RECHARGEINFOINDICATION_BUYCOUNT_FIELD = protobuf.FieldDescriptor();
RECHARGEINFOINDICATION_LEFTTIME_FIELD = protobuf.FieldDescriptor();
FIGHTSTARTREQUEST_FIGHTTYPE_FIELD.name = "fightType"
FIGHTSTARTREQUEST_FIGHTTYPE_FIELD.full_name = ".com.ljsd.jieling.protocols.FightStartRequest.fightType"
@ -1294,6 +1298,43 @@ FASTFIGHTCHALLENGERESPONSE.enum_types = {}
FASTFIGHTCHALLENGERESPONSE.fields = {FASTFIGHTCHALLENGERESPONSE_SCORE_FIELD, FASTFIGHTCHALLENGERESPONSE_HURT_FIELD, FASTFIGHTCHALLENGERESPONSE_FIGHTDATA_FIELD}
FASTFIGHTCHALLENGERESPONSE.is_extendable = false
FASTFIGHTCHALLENGERESPONSE.extensions = {}
RECHARGEINFOINDICATION_RECHARGEID_FIELD.name = "rechargeId"
RECHARGEINFOINDICATION_RECHARGEID_FIELD.full_name = ".com.ljsd.jieling.protocols.RechargeInfoIndication.rechargeId"
RECHARGEINFOINDICATION_RECHARGEID_FIELD.number = 1
RECHARGEINFOINDICATION_RECHARGEID_FIELD.index = 0
RECHARGEINFOINDICATION_RECHARGEID_FIELD.label = 1
RECHARGEINFOINDICATION_RECHARGEID_FIELD.has_default_value = false
RECHARGEINFOINDICATION_RECHARGEID_FIELD.default_value = 0
RECHARGEINFOINDICATION_RECHARGEID_FIELD.type = 5
RECHARGEINFOINDICATION_RECHARGEID_FIELD.cpp_type = 1
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.name = "buyCount"
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.full_name = ".com.ljsd.jieling.protocols.RechargeInfoIndication.buyCount"
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.number = 2
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.index = 1
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.label = 1
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.has_default_value = false
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.default_value = 0
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.type = 5
RECHARGEINFOINDICATION_BUYCOUNT_FIELD.cpp_type = 1
RECHARGEINFOINDICATION_LEFTTIME_FIELD.name = "leftTime"
RECHARGEINFOINDICATION_LEFTTIME_FIELD.full_name = ".com.ljsd.jieling.protocols.RechargeInfoIndication.leftTime"
RECHARGEINFOINDICATION_LEFTTIME_FIELD.number = 3
RECHARGEINFOINDICATION_LEFTTIME_FIELD.index = 2
RECHARGEINFOINDICATION_LEFTTIME_FIELD.label = 1
RECHARGEINFOINDICATION_LEFTTIME_FIELD.has_default_value = false
RECHARGEINFOINDICATION_LEFTTIME_FIELD.default_value = 0
RECHARGEINFOINDICATION_LEFTTIME_FIELD.type = 5
RECHARGEINFOINDICATION_LEFTTIME_FIELD.cpp_type = 1
RECHARGEINFOINDICATION.name = "RechargeInfoIndication"
RECHARGEINFOINDICATION.full_name = ".com.ljsd.jieling.protocols.RechargeInfoIndication"
RECHARGEINFOINDICATION.nested_types = {}
RECHARGEINFOINDICATION.enum_types = {}
RECHARGEINFOINDICATION.fields = {RECHARGEINFOINDICATION_RECHARGEID_FIELD, RECHARGEINFOINDICATION_BUYCOUNT_FIELD, RECHARGEINFOINDICATION_LEFTTIME_FIELD}
RECHARGEINFOINDICATION.is_extendable = false
RECHARGEINFOINDICATION.extensions = {}
AdventureBossFindIndication = protobuf.Message(ADVENTUREBOSSFINDINDICATION)
AdventureBossInfoResponse = protobuf.Message(ADVENTUREBOSSINFORESPONSE)
@ -1321,6 +1362,7 @@ MainLevelFightUpdateIndication = protobuf.Message(MAINLEVELFIGHTUPDATEINDICATION
MainLevelRankInfoResponse = protobuf.Message(MAINLEVELRANKINFORESPONSE)
QuickStartMonsterFightRequest = protobuf.Message(QUICKSTARTMONSTERFIGHTREQUEST)
QuickStartMonsterFightResponse = protobuf.Message(QUICKSTARTMONSTERFIGHTRESPONSE)
RechargeInfoIndication = protobuf.Message(RECHARGEINFOINDICATION)
SweepRightRequest = protobuf.Message(SWEEPRIGHTREQUEST)
SweepRightResponse = protobuf.Message(SWEEPRIGHTRESPONSE)
TakeAventureRewardRequest = protobuf.Message(TAKEAVENTUREREWARDREQUEST)

View File

@ -0,0 +1,153 @@
local ShengYiTianJiang = quick_class("ShengYiTianJiang")
local allData={}
local itemsGrid = {}--item重复利用
local this=ShengYiTianJiang
local parent = {}
local properTypeConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
local rechargeConfigId = 0
local rechargeData = {}
function ShengYiTianJiang:ctor(mainPanel, gameObject)
self.mainPanel = mainPanel
self.gameObject = gameObject
self:InitComponent(gameObject)
self:BindEvent()
end
function ShengYiTianJiang:InitComponent(gameObject)
this.time = Util.GetGameObject(gameObject, "time/times"):GetComponent("Text")
this.buyBtn = Util.GetGameObject(gameObject, "layout/buyBtn")
this.reviewBtn = Util.GetGameObject(gameObject, "layout/reviewBtn")
this.scrollItem = Util.GetGameObject(gameObject, "scroller/grid")
this.proPertyText = Util.GetGameObject(gameObject, "layout/proPertyText"):GetComponent("Text")
this.buytimes = Util.GetGameObject(gameObject, "layout/buytimes"):GetComponent("Text")
end
--绑定事件(用于子类重写)
function ShengYiTianJiang:BindEvent()
Util.AddClick(this.buyBtn,function()
if rechargeData.buyTimes >= rechargeData.dynamicBuyTimes then
return
end
--直购商品
PayManager.Pay(rechargeConfigId, function(id)
this.RechargeSuccessFunc(id)
end) end)
Util.AddClick(this.reviewBtn,function() end)
end
function this.RechargeSuccessFunc(id)
FirstRechargeManager.RefreshAccumRechargeValue(id)
this.OnShowData()
end
--添加事件监听(用于子类重写)
function ShengYiTianJiang:AddListener()
end
--移除事件监听(用于子类重写)
function ShengYiTianJiang:RemoveListener()
end
local sortingOrder = 0
--界面打开时调用(用于子类重写)
function ShengYiTianJiang:OnOpen()
end
--界面打开或者重新打开后,界面刷新时调用(用于子类重写)
function ShengYiTianJiang:OnShow(_sortingOrder,_parent)
parent = _parent
sortingOrder = _sortingOrder
this:OnShowData()
ShengYiTianJiang:SetTime()
end
function ShengYiTianJiang:OnShowData()
local activityId = ActivityGiftManager.IsActivityTypeOpen(ActivityTypeDef.ShenYiTianJiang)
local activityConfig = ConfigManager.GetConfigData(ConfigName.GlobalActivity,activityId)
rechargeConfigId = activityConfig.CanBuyRechargeId[1]
allData = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,rechargeConfigId)
if not itemsGrid then
itemsGrid = {}
end
for k,v in ipairs(itemsGrid) do
v.gameObject:SetActive(false)
end
for k,v in ipairs(allData.RewardShow) do
if not itemsGrid[k] then
itemsGrid[k] = SubUIManager.Open(SubUIConfig.ItemView,this.scrollItem.transform)
end
itemsGrid[k].gameObject:SetActive(true)
itemsGrid[k]:OnOpen(false, {v[1],v[2]}, 1,false,false,false,sortingOrder)
end
local skinId = tonumber(activityConfig.ExpertDec)
local skinConfig = ConfigManager.GetConfigDataByKey(ConfigName.HeroSkin,"Type",skinId)
local heroSkinSingleProVal = {}
for _,v in ipairs(skinConfig.MonomerProperty) do
if not heroSkinSingleProVal[v[1]] then
heroSkinSingleProVal[v[1]] = 0
end
heroSkinSingleProVal[v[1]] = heroSkinSingleProVal[v[1]] + v[2]
end
this.proPertyText.text = "属性加成:"
for k,v in pairs(heroSkinSingleProVal) do
this.proPertyText.text = this.proPertyText.text..properTypeConfig[k].Info.."+"..GetPropertyFormatStr(properTypeConfig[k].Style,v)
end
rechargeData = OperatingManager.GetGiftGoodsInfo(GoodsTypeDef.DirectPurchaseGift, rechargeConfigId)
this.buytimes.text = "限购:"..rechargeData.buyTimes.."/"..rechargeData.dynamicBuyTimes
end
function ShengYiTianJiang:SetTime()
if self.timer then
self.timer:Stop()
self.timer = nil
end
local endTime = ActivityGiftManager.GetTaskEndTime(ActivityTypeDef.ShenYiTianJiang)
local timeDown = endTime - GetTimeStamp()
this.time.text = Language[12321]..TimeToDHMS(timeDown)
self.timer = Timer.New(function()
timeDown = timeDown - 1
if timeDown < 1 then
self.timer:Stop()
self.timer = nil
this.time.text = Language[12321]..TimeToDHMS(0)
end
this.time.text = Language[12321]..TimeToDHMS(timeDown)
end, 1, -1, true)
self.timer:Start()
end
--界面打开时调用(用于子类重写)
function ShengYiTianJiang:OnOpen()
end
function this.RechargeSuccessFunc(id)
FirstRechargeManager.RefreshAccumRechargeValue(id)
--OperatingManager.RefreshGiftGoodsBuyTimes(GoodsTypeDef.GiftBuy, id)
this.OnShowData()
end
function ShengYiTianJiang:OnClose()
end
--界面销毁时调用(用于子类重写)
function ShengYiTianJiang:OnDestroy()
if self.timer then
self.timer:Stop()
self.timer = nil
end
sortingOrder = 0
itemsGrid = {}
end
function ShengYiTianJiang:OnHide()
if self.timer then
self.timer:Stop()
self.timer = nil
end
sortingOrder = 0
end
return ShengYiTianJiang

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1c91db9554acf91418d9b9f151f62d1f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -300,8 +300,7 @@ function this:RightBtnOnClick()
this.curLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(oldIndexConfigData.position[1],oldIndexConfigData.position[2]), 0.5, false):SetEase(Ease.Linear)
this.rightLiveObj.transform:SetParent(this.curObj.transform)
this.rightLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(rightHeroData.position[1],rightHeroData.position[2]), 0.5, false):OnComplete(function ()
this:UpdateLiveList()
this:UpdateHeroInfoData()
this:UpdateLiveList()
if this.curLiveObj then
poolManager:UnLoadLive(this.curLiveObj.name, this.leftLiveObj)
this.curLiveObj = nil
@ -314,8 +313,10 @@ function this:RightBtnOnClick()
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
this.rightBtn:GetComponent("Button").enabled = true
isClickLeftOrRightBtn = true
this:UpdateHeroInfoData()
end):SetEase(Ease.Linear)
this:SetPanelBg(curHeroData.heroConfig)
end
--左切换按钮点击
@ -337,7 +338,6 @@ function this:LeftBtnOnClick()
this.leftLiveObj.transform:SetParent(this.curObj.transform)
this.leftLiveObj:GetComponent("RectTransform"):DOAnchorPos(Vector2.New(leftHeroData.position[1],leftHeroData.position[2]), 0.5, false):OnComplete(function ()
this:UpdateLiveList()
this:UpdateHeroInfoData()
if this.curLiveObj then
poolManager:UnLoadLive(this.curLiveObj.name, this.rightLiveObj)
this.curLiveObj = nil
@ -350,8 +350,10 @@ function this:LeftBtnOnClick()
SkeletonGraphic.AnimationState:SetAnimation(0, "touch", false)
this.leftBtn:GetComponent("Button").enabled = true
isClickLeftOrRightBtn = true
this:UpdateHeroInfoData()
end):SetEase(Ease.Linear)
this:SetPanelBg(curHeroData.heroConfig)
end
function this:UpdateBtnList()
@ -436,7 +438,7 @@ end
-- tab改变事件
function this:OnPageTabChange(index)
this:ChangeCurentHeroSkinLive()
_CurPageIndex = index
for i = 1, #this.PageList do
if this.PageList[i] then
@ -458,7 +460,7 @@ function this:UpdateHeroInfoData()
end
end
if LengthOfTable(HeoSkin) < 2 then
_CurPageIndex = _CurPageIndex - 1
_CurPageIndex = 1
end
end
@ -497,12 +499,7 @@ function this:UpdateHeroInfoData()
this.soulPrintBtn:SetActive(PlayerManager.level>=EquipSignUnlock[1][2] and curHeroData.heroConfig.Star >= EquipSignUnlock[2][2])
end
if this.curLiveObj then
this.dragView.gameObject:SetActive(true)
this.dragView:SetDragGO(this.curLiveObj)
else
this.dragView.gameObject:SetActive(false)
end
this:SetDragView()
local starSize = Vector2.New(60,60)
SetHeroStars(this.starGrid, curHeroData.star,2,starSize,-10,Vector2.New(0.5,0.5))
@ -545,6 +542,28 @@ function this:UpdateHeroInfoData()
this.force.text =allAddProVal[HeroProType.WarPower]
end
function this:ChangeCurentHeroSkinLive(herodata)
if this.curLiveObj then
poolManager:UnLoadLive(this.curLiveObj.name, this.curLiveObj)
this.curLiveObj = nil
end
if herodata then
this.curLiveObj=HeroManager.LoadHerolive1(herodata,this.curObj)
else
this.curLiveObj=HeroManager.LoadHerolive(curHeroData,this.curObj)
end
this:SetDragView()
end
function this:SetDragView()
if this.curLiveObj then
this.dragView.gameObject:SetActive(true)
this.dragView:SetDragGO(this.curLiveObj)
else
this.dragView.gameObject:SetActive(false)
end
end
local beginV3
local endV3
local distance

View File

@ -8,8 +8,6 @@ local porpertys = {}
local curHeroData = {}
local parent = {}
local curLiveName = ""
local isUnLoadLive = false
function RoleSkinPanel:InitComponent(gameObject)
this.gameObject = gameObject
this.skinPre = Util.GetGameObject(gameObject,"skinPre")
@ -45,7 +43,7 @@ function RoleSkinPanel:OnShow(_sortinglayer,_parent,_curHerodata)
local tempskins = {}
for i = 1 ,#configs do
LogGreen("configs[i].Type:"..configs[i].Type)
if not tempskins[configs[i].Type] then
if not tempskins[configs[i].Type] then
tempskins[configs[i].Type] = configs[i]
end
end
@ -79,6 +77,7 @@ function RoleSkinPanel:OnShow(_sortinglayer,_parent,_curHerodata)
index = index + 1
end
this:ShowTime()
end
function RoleSkinPanel:SetSingleData(go,data)
@ -89,6 +88,9 @@ function RoleSkinPanel:SetSingleData(go,data)
local infoGrid = Util.GetGameObject(go,"skinInfo/grid")
local skinName = Util.GetGameObject(go,"skinName/name"):GetComponent("Text")
skinName.text = data.ReadingName
if data.IsDefault == 1 then
skinName.text = "默认"
end
icon.sprite = Util.LoadSprite(artResConfig[data.Painting].Name)
if not porpertys then
porpertys = {}
@ -140,18 +142,14 @@ function RoleSkinPanel:BtnAction(skinId,data)
end
if HeroSkinManager.IsExist(skinId) or skinId == 0 then
NetManager.ChangeHeroSkin(curHeroData.dynamicId,skinId,function()
poolManager:UnLoadLive(curHeroData.live, parent.curLiveObj)
HeroManager.ChangeSkinId(curHeroData.dynamicId,skinId)
local tempdata = HeroManager.GetSingleHeroData(curHeroData.dynamicId)
curLiveName = tempdata.Live
parent.curLiveObj = HeroManager.LoadHerolive(tempdata,parent.curObj)
parent:ChangeCurentHeroSkinLive()
PopupTipPanel.ShowTip("已更换皮肤!")
this:OnShow(0,parent,tempdata)
end)
else
poolManager:UnLoadLive(curHeroData.live, parent.curLiveObj)
curLiveName = GetResourcePath(data.Live)
parent.curLiveObj = HeroManager.LoadHerolive1(data,parent.curObj)
parent:ChangeCurentHeroSkinLive(data)
PopupTipPanel.ShowTip("未获得此皮肤!")
end
end
@ -169,12 +167,12 @@ function this:ShowTime()
local skindata = HeroSkinManager.GetSkins(v.data.Type)
if v.data.IsDefault == 1 or not skindata then
Util.GetGameObject(v.obj,"skinTime"):SetActive(false)
elseif skindata.overTime == -1 then
Util.GetGameObject(v.obj,"skinTime/time"):GetComponent("Text").text = "永久"
elseif skindata.overTime < 0 then
Util.GetGameObject(v.obj,"skinTime"):SetActive(false)
else
local time = skindata.overTime
if time < 0 then
Util.GetGameObject(v.obj,"skinTime/time"):GetComponent("Text").text = 0
Util.GetGameObject(v.obj,"skinTime"):SetActive(false)
else
time = this:TimeToFormat(time)
Util.GetGameObject(v.obj,"skinTime/time"):GetComponent("Text").text = time