diff --git a/Assets/ManagedResources/~Lua/Message/MapInfoProto_pb.lua b/Assets/ManagedResources/~Lua/Message/MapInfoProto_pb.lua index dc6e353499..af82f4f01b 100644 --- a/Assets/ManagedResources/~Lua/Message/MapInfoProto_pb.lua +++ b/Assets/ManagedResources/~Lua/Message/MapInfoProto_pb.lua @@ -154,6 +154,8 @@ ENDLESSMAPCHANGE_MAPID_FIELD = protobuf.FieldDescriptor(); ENDLESSMAPCHANGE_WORLDLEVEL_FIELD = protobuf.FieldDescriptor(); TRIALHEROINFOSAVEREQUEST = protobuf.Descriptor(); TRIALHEROINFOSAVEREQUEST_HEROIDS_FIELD = protobuf.FieldDescriptor(); +TRIALHEROINFOSAVERESPONSE = protobuf.Descriptor(); +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD = protobuf.FieldDescriptor(); GETTRIALBOXREWARDREQUEST = protobuf.Descriptor(); GETTRIALBOXREWARDREQUEST_TYPE_FIELD = protobuf.FieldDescriptor(); GETTRIALBOXREWARDRESPONSE = protobuf.Descriptor(); @@ -1630,6 +1632,24 @@ TRIALHEROINFOSAVEREQUEST.enum_types = {} TRIALHEROINFOSAVEREQUEST.fields = {TRIALHEROINFOSAVEREQUEST_HEROIDS_FIELD} TRIALHEROINFOSAVEREQUEST.is_extendable = false TRIALHEROINFOSAVEREQUEST.extensions = {} +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.name = "heroes" +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.full_name = ".rpc.protocols.TrialHeroInfoSaveResponse.heroes" +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.number = 1 +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.index = 0 +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.label = 3 +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.has_default_value = false +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.default_value = {} +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.message_type = TRIALHEROINFO +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.type = 11 +TRIALHEROINFOSAVERESPONSE_HEROES_FIELD.cpp_type = 10 + +TRIALHEROINFOSAVERESPONSE.name = "TrialHeroInfoSaveResponse" +TRIALHEROINFOSAVERESPONSE.full_name = ".rpc.protocols.TrialHeroInfoSaveResponse" +TRIALHEROINFOSAVERESPONSE.nested_types = {} +TRIALHEROINFOSAVERESPONSE.enum_types = {} +TRIALHEROINFOSAVERESPONSE.fields = {TRIALHEROINFOSAVERESPONSE_HEROES_FIELD} +TRIALHEROINFOSAVERESPONSE.is_extendable = false +TRIALHEROINFOSAVERESPONSE.extensions = {} GETTRIALBOXREWARDREQUEST_TYPE_FIELD.name = "type" GETTRIALBOXREWARDREQUEST_TYPE_FIELD.full_name = ".rpc.protocols.GetTrialBoxRewardRequest.type" GETTRIALBOXREWARDREQUEST_TYPE_FIELD.number = 1 @@ -2315,6 +2335,7 @@ TowerRewardRequest = protobuf.Message(TOWERREWARDREQUEST) TowerRewardResponse = protobuf.Message(TOWERREWARDRESPONSE) TrialHeroInfo = protobuf.Message(TRIALHEROINFO) TrialHeroInfoSaveRequest = protobuf.Message(TRIALHEROINFOSAVEREQUEST) +TrialHeroInfoSaveResponse = protobuf.Message(TRIALHEROINFOSAVERESPONSE) UseAddHpItemRequest = protobuf.Message(USEADDHPITEMREQUEST) UseTowerBuffRequest = protobuf.Message(USETOWERBUFFREQUEST) UseTowerBuffResponse = protobuf.Message(USETOWERBUFFRESPONSE) diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua index e79713ced9..12173d66df 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationEditPopup.lua @@ -79,8 +79,9 @@ function FormationEditPopup:BindEvent() table.insert(dids,v.did) end if #choosedList <= maxNum and #choosedList > 0 then - NetManager.TrialHeroInfoSaveRequest(dids,function() + NetManager.TrialHeroInfoSaveRequest(dids,function(msg) PopupTipPanel.ShowTip(Language[10669]) + MapManager.trialHeroInfo = msg.heroes if func~=nil then --保存完毕后 将英雄did合集传递过去 此时我拥有这些英雄 不用担心英雄已被删除 func(dids) end diff --git a/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua b/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua index 2845c44c46..693e55189a 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/TrialMapPanel.lua @@ -498,14 +498,15 @@ function this.SetSelectHero(isFirstIn,isFirstData,isMainIn) local itemId=trialSetting[1].HealingId[1] local itemNum=trialSetting[1].HealingId[2] this.selectHero:SetActive((true) and (MapManager.curCarbonType == CarBonTypeId.TRIAL)) - local d={} - if isFirstIn then--若是第一次进 此时我必有该英雄 不用担心是已删除英雄 通过HeroDid去获取数据 - for n, did in ipairs(isFirstData) do - local h=HeroManager.GetSingleHeroData(did) - table.insert(MapManager.trialHeroInfo,{heroId=h.dynamicId,tmpId=h.id,star=h.star,heroHp=10000,level=h.lv,skinId = h.skinId}) - end - end - d = MapManager.trialHeroInfo + -- local d={} + -- if isFirstIn then--若是第一次进 此时我必有该英雄 不用担心是已删除英雄 通过HeroDid去获取数据 + -- for n, did in ipairs(isFirstData) do + -- local h=HeroManager.GetSingleHeroData(did) + -- table.insert(MapManager.trialHeroInfo,{heroId=h.dynamicId,tmpId=h.id,star=h.star,heroHp=10000,level=h.lv,skinId = h.skinId}) + -- end + -- end + -- d = MapManager.trialHeroInfo + local d = MapManager.trialHeroInfo for k = 1, this.s_grid.transform.childCount do this.s_grid.transform:GetChild(k-1).gameObject:SetActive(false) end diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index 4795a1f255..4724091a3c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -4162,6 +4162,8 @@ function NetManager.TrialHeroInfoSaveRequest(heroIds,func) local msg = data:SerializeToString() Network:SendMessageWithCallBack(MessageTypeProto_pb.TRIAL_HERO_INFO_SAVE_REQUEST, MessageTypeProto_pb.TRIAL_HERO_INFO_SAVE_RESPONSE, msg, function(buffer) local data = buffer:DataByte() + local msg = MapInfoProto_pb.TrialHeroInfoSaveResponse() + msg:ParseFromString(data) if func then func(msg) end