神将置换功能提交
parent
27b390e8c2
commit
d13e485b05
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,110 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 67ee827eeb2373f4c8282a2141a2daf2
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 2
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 65
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: iPhone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 56
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 1
|
||||
androidETC2FallbackOverride: 0
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 02617fc4198c0e94b8bf745012f28eba
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag: PublicAtlas
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,88 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2a373bea193910b45b5723a93ad9c654
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
||||
serializedVersion: 9
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 2
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 8c0c075eed0222c4e9896a7a25cc5ee3
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ea116f278d3eef44b883a89414fd480e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1134,6 +1134,7 @@ ItemType = {
|
|||
GMxsZcq=46,--gm限时真充券
|
||||
GMBigZck =49, --gm直冲卡
|
||||
CommonChip=50,--通用碎片
|
||||
ReplaceCard=52,--神将置换卡
|
||||
}
|
||||
JumpType = {
|
||||
Lottery = 1, --招募
|
||||
|
|
|
@ -274,6 +274,7 @@ ConfigName = {
|
|||
SuperZhenChong="SuperZhenChong",
|
||||
RewardItemConfig="RewardItemConfig",
|
||||
HotRanking="HotRanking",
|
||||
HeroChange="HeroChange",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
|
|
@ -479,6 +479,7 @@ UIName = {
|
|||
GMShuaChongTeQuan=487,--GM礼包
|
||||
GMSong10WanPanel=488,--送10万真充
|
||||
ItemBoxDropPopup=489,--背包宝箱奖励道具掉落弹窗
|
||||
HeroReplacePopup=490,--神将置换弹窗
|
||||
}
|
||||
|
||||
SubUIConfig = {
|
||||
|
|
|
@ -335,6 +335,12 @@ UPGRADEGODTREEREQUEST = protobuf.Descriptor();
|
|||
UPGRADEGODTREEREQUEST_JEWELID_FIELD = protobuf.FieldDescriptor();
|
||||
UPGRADEGODTREEREQUEST_COUNT_FIELD = protobuf.FieldDescriptor();
|
||||
UPGRADEGODTREERESPONSE = protobuf.Descriptor();
|
||||
HEROCHANGEREQUEST = protobuf.Descriptor();
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD = protobuf.FieldDescriptor();
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD = protobuf.FieldDescriptor();
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD = protobuf.FieldDescriptor();
|
||||
HEROCHANGERESPONSE = protobuf.Descriptor();
|
||||
HEROCHANGERESPONSE_HEROS_FIELD = protobuf.FieldDescriptor();
|
||||
|
||||
GETHEROLISTINFOREQUEST_INDEX_FIELD.name = "index"
|
||||
GETHEROLISTINFOREQUEST_INDEX_FIELD.full_name = ".rpc.protocols.GetHeroListInfoRequest.index"
|
||||
|
@ -3346,6 +3352,61 @@ UPGRADEGODTREERESPONSE.enum_types = {}
|
|||
UPGRADEGODTREERESPONSE.fields = {}
|
||||
UPGRADEGODTREERESPONSE.is_extendable = false
|
||||
UPGRADEGODTREERESPONSE.extensions = {}
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.name = "heroID1"
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.full_name = ".rpc.protocols.HeroChangeRequest.heroID1"
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.number = 1
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.index = 0
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.label = 1
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.has_default_value = false
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.default_value = ""
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.type = 9
|
||||
HEROCHANGEREQUEST_HEROID1_FIELD.cpp_type = 9
|
||||
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.name = "heroID2"
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.full_name = ".rpc.protocols.HeroChangeRequest.heroID2"
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.number = 2
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.index = 1
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.label = 1
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.has_default_value = false
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.default_value = ""
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.type = 9
|
||||
HEROCHANGEREQUEST_HEROID2_FIELD.cpp_type = 9
|
||||
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.name = "itemID"
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.full_name = ".rpc.protocols.HeroChangeRequest.itemID"
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.number = 3
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.index = 2
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.label = 1
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.has_default_value = false
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.default_value = 0
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.type = 5
|
||||
HEROCHANGEREQUEST_ITEMID_FIELD.cpp_type = 1
|
||||
|
||||
HEROCHANGEREQUEST.name = "HeroChangeRequest"
|
||||
HEROCHANGEREQUEST.full_name = ".rpc.protocols.HeroChangeRequest"
|
||||
HEROCHANGEREQUEST.nested_types = {}
|
||||
HEROCHANGEREQUEST.enum_types = {}
|
||||
HEROCHANGEREQUEST.fields = {HEROCHANGEREQUEST_HEROID1_FIELD, HEROCHANGEREQUEST_HEROID2_FIELD, HEROCHANGEREQUEST_ITEMID_FIELD}
|
||||
HEROCHANGEREQUEST.is_extendable = false
|
||||
HEROCHANGEREQUEST.extensions = {}
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.name = "heros"
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.full_name = ".rpc.protocols.HeroChangeResponse.heros"
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.number = 1
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.index = 0
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.label = 3
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.has_default_value = false
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.default_value = {}
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.message_type = CommonProto_pb.HERO
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.type = 11
|
||||
HEROCHANGERESPONSE_HEROS_FIELD.cpp_type = 10
|
||||
|
||||
HEROCHANGERESPONSE.name = "HeroChangeResponse"
|
||||
HEROCHANGERESPONSE.full_name = ".rpc.protocols.HeroChangeResponse"
|
||||
HEROCHANGERESPONSE.nested_types = {}
|
||||
HEROCHANGERESPONSE.enum_types = {}
|
||||
HEROCHANGERESPONSE.fields = {HEROCHANGERESPONSE_HEROS_FIELD}
|
||||
HEROCHANGERESPONSE.is_extendable = false
|
||||
HEROCHANGERESPONSE.extensions = {}
|
||||
|
||||
AllBookEnableRequest = protobuf.Message(ALLBOOKENABLEREQUEST)
|
||||
CancelHeroChangeRequest = protobuf.Message(CANCELHEROCHANGEREQUEST)
|
||||
|
@ -3389,6 +3450,8 @@ GetSkinIndication = protobuf.Message(GETSKININDICATION)
|
|||
GetTransformationRequest = protobuf.Message(GETTRANSFORMATIONREQUEST)
|
||||
GetTransformationResponse = protobuf.Message(GETTRANSFORMATIONRESPONSE)
|
||||
GodDevilHeroSelectPropRequest = protobuf.Message(GODDEVILHEROSELECTPROPREQUEST)
|
||||
HeroChangeRequest = protobuf.Message(HEROCHANGEREQUEST)
|
||||
HeroChangeResponse = protobuf.Message(HEROCHANGERESPONSE)
|
||||
HeroComposeRequest = protobuf.Message(HEROCOMPOSEREQUEST)
|
||||
HeroComposeResponse = protobuf.Message(HEROCOMPOSERESPONSE)
|
||||
HeroGodSoulBindRequest = protobuf.Message(HEROGODSOULBINDREQUEST)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6941,5 +6941,33 @@ function NetManager.SendGmBuyGoodRequest(_id,func)
|
|||
end)
|
||||
end
|
||||
|
||||
---神将置换卡使用置换
|
||||
function NetManager.SendHeroChangeRequest(_heroDId1,_heroDId2,_itemId,func)
|
||||
local oldWarPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||
local data = HeroInfoProto_pb.HeroChangeRequest()
|
||||
data.heroID1=_heroDId1
|
||||
data.heroID2=_heroDId2
|
||||
data.itemID=_itemId
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.HERO_CHANGE_REQUEST,MessageTypeProto_pb.HERO_CHANGE_RESPONSE,msg,function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = HeroInfoProto_pb.HeroChangeResponse()
|
||||
msg:ParseFromString(data)
|
||||
for i = 1, #msg.heros do
|
||||
HeroManager.UpdateHeroDatas(msg.heros[i])
|
||||
end
|
||||
HeroPropManager.SetDirtyByType(_heroDId1, Hero_Prop_Type.Base)
|
||||
HeroPropManager.SetDirtyByType(_heroDId2, Hero_Prop_Type.Base)
|
||||
NetManager.RequestUserForceChange(FormationTypeDef.FORMATION_NORMAL)
|
||||
local tempPower = FormationManager.GetFormationPower(FormationTypeDef.FORMATION_NORMAL)
|
||||
if oldWarPower ~= tempPower then
|
||||
UIManager.OpenPanel(UIName.WarPowerChangeNotifyPanelV2,{oldValue = oldWarPower,newValue = tempPower})
|
||||
end
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
return this
|
|
@ -0,0 +1,221 @@
|
|||
require("Base/BasePanel")
|
||||
HeroReplacePopup = Inherit(BasePanel)
|
||||
----- --家园装备升级 -----
|
||||
local this = HeroReplacePopup
|
||||
local data=nil
|
||||
local gridIndex=1
|
||||
local selectHero1=nil
|
||||
local selectHero2=nil
|
||||
local useItemId=0
|
||||
local curSelectGridHero=nil
|
||||
function this:InitComponent()
|
||||
this.closeBtn=Util.GetGameObject(self.gameObject,"BG/BackBtn")
|
||||
local gameObject=Util.GetGameObject(self.transform,"GeneralPopup_HomeLandEquip")
|
||||
this.spLoader = SpriteLoader.New()
|
||||
this.titleText=Util.GetGameObject(gameObject,"TitleText"):GetComponent("Text")
|
||||
this.titleText.text="神将置换卡"
|
||||
this.replaceBtn = Util.GetGameObject(gameObject,"replaceBtn")
|
||||
this.cancelBtn = Util.GetGameObject(gameObject,"cancelBtn")
|
||||
|
||||
this.heroPre = Util.GetGameObject(this.gameObject, "Scroll/HeroPre")
|
||||
this.scroll = Util.GetGameObject(gameObject, "Scroll")
|
||||
this.scrollView = SubUIManager.Open(SubUIConfig.ScrollCycleView,this.scroll.transform,
|
||||
this.heroPre, this.scrollBar, Vector2.New(1010, 530), 1, 5, Vector2.New(25, 25))
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchoredPosition = Vector2.New(0, 0)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchorMin = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").anchorMax = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.gameObject:GetComponent("RectTransform").pivot = Vector2.New(0.5, 0.5)
|
||||
this.scrollView.moveTween.MomentumAmount = 1
|
||||
this.scrollView.moveTween.Strength = 2
|
||||
this.heroSelect=Util.GetGameObject(this.scroll,"Select")
|
||||
|
||||
this.curGridBtn=Util.GetGameObject(gameObject,"Content/Grid/curGrid/Mask")
|
||||
this.nextGridBtn=Util.GetGameObject(gameObject,"Content/Grid/nextGrid/Mask")
|
||||
this.curGridHero=Util.GetGameObject(gameObject,"Content/Grid/curGrid/HeroObj")
|
||||
this.nextGridHero=Util.GetGameObject(gameObject,"Content/Grid/nextGrid/HeroObj")
|
||||
this.gridSelect=Util.GetGameObject(gameObject,"Content/Grid/Select")
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.closeBtn,function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.replaceBtn,function()
|
||||
if selectHero1==nil or selectHero2==nil then
|
||||
PopupTipPanel.ShowTip("请选择置换神将!")
|
||||
return
|
||||
end
|
||||
if selectHero1==selectHero2 then
|
||||
PopupTipPanel.ShowTip("请不要选择同一个神将!")
|
||||
return
|
||||
end
|
||||
NetManager.SendHeroChangeRequest(selectHero1,selectHero2,useItemId,function()
|
||||
PopupTipPanel.ShowTip("置换成功!")
|
||||
self:ClosePanel()
|
||||
end)
|
||||
end)
|
||||
Util.AddClick(this.cancelBtn,function()
|
||||
self:ClosePanel()
|
||||
end)
|
||||
Util.AddClick(this.curGridBtn,function()
|
||||
gridIndex=1
|
||||
curSelectGridHero=this.curGridHero
|
||||
this.SetGridSelect(this.curGridBtn)
|
||||
end)
|
||||
Util.AddClick(this.nextGridBtn,function()
|
||||
gridIndex=2
|
||||
curSelectGridHero=this.nextGridHero
|
||||
this.SetGridSelect(this.nextGridBtn)
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
function this:OnOpen(_heroChangeId)
|
||||
useItemId=_heroChangeId
|
||||
local heroChangeConfig = ConfigManager.GetConfigData(ConfigName.HeroChange,useItemId)
|
||||
local _roleDatas = HeroManager.GetAllHeroDatas()
|
||||
local _showRoleDatas={}
|
||||
for k,v in pairs(_roleDatas) do
|
||||
if _showRoleDatas[v.heroConfig.Id]==nil then
|
||||
_showRoleDatas[v.heroConfig.Id]={}
|
||||
end
|
||||
table.insert(_showRoleDatas[v.heroConfig.Id],v)
|
||||
end
|
||||
local dataList={}
|
||||
for i = 1, #heroChangeConfig.HeroPool do
|
||||
if _showRoleDatas[heroChangeConfig.HeroPool[i]] then
|
||||
local _tdataArr=_showRoleDatas[heroChangeConfig.HeroPool[i]]
|
||||
for i = 1, #_tdataArr do
|
||||
table.insert(dataList,_tdataArr[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
this.SetHeroList(dataList)
|
||||
curSelectGridHero=this.curGridHero
|
||||
this.SetGridSelect(this.curGridBtn)
|
||||
gridIndex=1
|
||||
this.curGridHero:SetActive(false)
|
||||
this.nextGridHero:SetActive(false)
|
||||
end
|
||||
|
||||
function this.SetGridSelect(_gridObj)
|
||||
this.gridSelect.transform:SetParent(_gridObj.transform)
|
||||
this.gridSelect.transform.localPosition=Vector3.zero
|
||||
end
|
||||
|
||||
---设置显示英雄列表
|
||||
function this.SetHeroList(_roleDatas)
|
||||
HeroManager.SortHeroDatas(_roleDatas)
|
||||
this.scrollView:SetData(_roleDatas, function(index, go)
|
||||
-- if index==1 then
|
||||
-- this.SetHeroSelect(go)
|
||||
-- end
|
||||
-- 基础显示
|
||||
this.SingleHeroDataShow(go, _roleDatas[index])
|
||||
end, true,false)
|
||||
end
|
||||
|
||||
--英雄排序
|
||||
function this:SortHeroDatas(_heroDatas)
|
||||
--上阵最优先,星级优先,同星级等级优先,同星级同等级按sortId排序。排序时降序排序。
|
||||
table.sort(_heroDatas, function(a, b)
|
||||
if a.star == b.star then
|
||||
if a.heroConfig.Natural ==b.heroConfig.Natural then
|
||||
if a.lv == b.lv then
|
||||
return a.heroConfig.Id < b.heroConfig.Id
|
||||
else
|
||||
return a.lv > b.lv
|
||||
end
|
||||
else
|
||||
return a.heroConfig.Natural > b.heroConfig.Natural
|
||||
end
|
||||
else
|
||||
return a.star > b.star
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
--设置每条英雄数据
|
||||
function this.SingleHeroDataShow(_go, _heroData)
|
||||
local go=_go
|
||||
local heroData=_heroData
|
||||
this.SetHeroInfo(go, heroData)
|
||||
|
||||
Util.AddOnceClick(go, function()
|
||||
if gridIndex==1 then
|
||||
selectHero1=heroData.dynamicId
|
||||
else
|
||||
selectHero2=heroData.dynamicId
|
||||
end
|
||||
|
||||
this.Refresh(heroData)
|
||||
this.SetHeroSelect(go)
|
||||
end)
|
||||
end
|
||||
|
||||
function this.SetHeroInfo(_go, _heroData)
|
||||
local go=_go
|
||||
local heroData=_heroData
|
||||
local frame=Util.GetGameObject(go,"frame"):GetComponent("Image")
|
||||
local icon=Util.GetGameObject(go, "icon"):GetComponent("Image")
|
||||
local lv= Util.GetGameObject(go, "lv/Text"):GetComponent("Text")
|
||||
local pro= Util.GetGameObject(go, "proIcon"):GetComponent("Image")
|
||||
local pos= Util.GetGameObject(go, "posIcon"):GetComponent("Image")
|
||||
|
||||
Util.GetGameObject(go, "posIcon"):SetActive(this.curFormationIndex == FormationTypeDef.FIGHT_LEVEL or this.curFormationIndex == FormationTypeDef.FIGHT_ASSISTANTLEVEL or
|
||||
this.curFormationIndex == FormationTypeDef.FORMATION_QIJIESHILIAN)
|
||||
local starGrid = Util.GetGameObject(go, "star")
|
||||
local choosedObj = Util.GetGameObject(go, "choosed")
|
||||
choosedObj.gameObject:SetActive(false)
|
||||
if _heroData.property then
|
||||
pro.sprite= this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.property))
|
||||
else
|
||||
pro.sprite= this.spLoader:LoadSprite(GetProStrImageByProNum(heroData.heroConfig.PropertyName))
|
||||
end
|
||||
frame.sprite=this.spLoader:LoadSprite(GetHeroQuantityImageByquality(heroData.heroConfig.Quality,heroData.star))
|
||||
icon.sprite=this.spLoader:LoadSprite(heroData.icon)
|
||||
if HarmonyManager.IsChangeColor(heroData.dynamicId) then
|
||||
-- body
|
||||
lv.text="<color=#0f0>"..heroData.lv.."</color>"
|
||||
elseif HarmonyManager:IsEnvoy(heroData.dynamicId) and HarmonyManager:HongMengTowerUpLimit() >= HarmonyManager.TowerStartLimit then
|
||||
-- bod
|
||||
lv.text="<color=#ffbe22>"..heroData.lv.."</color>"
|
||||
else
|
||||
lv.text=heroData.lv
|
||||
end
|
||||
pos.sprite = this.spLoader:LoadSprite(heroData.professionIcon)
|
||||
local star,starType = heroData.GetStar(1)
|
||||
local starSize = Vector2.New(30,30)
|
||||
local starScale = -8
|
||||
if starType == 3 then
|
||||
starSize = Vector2.New(1,-15.65)
|
||||
starScale = -13
|
||||
elseif starType == 2 then
|
||||
starSize = Vector2.New(60,57)
|
||||
end
|
||||
SetHeroStars(this.spLoader, starGrid, star,starType,starSize,starScale)
|
||||
end
|
||||
|
||||
function this.Refresh(_heroData)
|
||||
this.SetHeroInfo(curSelectGridHero, _heroData)
|
||||
curSelectGridHero:SetActive(true)
|
||||
end
|
||||
|
||||
function this.SetHeroSelect(_heroObj)
|
||||
this.heroSelect.transform:SetParent(_heroObj.transform)
|
||||
this.heroSelect.transform.localPosition=Vector3.zero
|
||||
end
|
||||
|
||||
function this:OnClose()
|
||||
data=nil
|
||||
selectHero1=nil
|
||||
selectHero2=nil
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
this.SelectList = {}
|
||||
this.spLoader:Destroy()
|
||||
this.scrollView = nil
|
||||
end
|
||||
|
||||
return this
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 54bab42299b3294479f4129fc71e8b81
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -161,6 +161,8 @@ function RewardItemSingleShowPopup:BindEvent()
|
|||
end
|
||||
elseif itemConfigData.ItemType == ItemType.ChangeName then
|
||||
UIManager.OpenPanel(UIName.CreateNamePopup)
|
||||
elseif itemConfigData.ItemType == ItemType.ReplaceCard then
|
||||
UIManager.OpenPanel(UIName.HeroReplacePopup,itemConfigData.Id)
|
||||
elseif itemConfigData.ItemType == ItemType.Skin then
|
||||
local group = ConfigManager.GetConfigData(ConfigName.RewardGroup,tonumber(itemConfig[itemSid].ResolveReward)).ShowItem
|
||||
MsgPanel.ShowTwo(string.format(Language[11510],group[1][2],GetLanguageStrById(itemConfig[group[1][1]].Name)),function()
|
||||
|
@ -401,7 +403,8 @@ function RewardItemSingleShowPopup:OnShow()
|
|||
or itemConfigData.ItemType == ItemType.GMzcq
|
||||
or itemConfigData.ItemType == ItemType.GMxck
|
||||
or itemConfigData.ItemType == ItemType.GMxsZcq
|
||||
or itemConfigData.ItemType == ItemType.GMxjk)
|
||||
or itemConfigData.ItemType == ItemType.GMxjk
|
||||
or itemConfigData.ItemType == ItemType.ReplaceCard)
|
||||
then
|
||||
this.btnSure:SetActive(true)
|
||||
this.btnSureText.text = Language[10195]
|
||||
|
|
Loading…
Reference in New Issue