diff --git a/Assets/ManagedResources/~Lua/Message/PlayerInfoProto_pb.lua b/Assets/ManagedResources/~Lua/Message/PlayerInfoProto_pb.lua index bcef163886..d2a648352c 100644 --- a/Assets/ManagedResources/~Lua/Message/PlayerInfoProto_pb.lua +++ b/Assets/ManagedResources/~Lua/Message/PlayerInfoProto_pb.lua @@ -70,6 +70,7 @@ GETPLAYERINFORESPONSE_DAILYREDPACK_FIELD = protobuf.FieldDescriptor(); GETPLAYERINFORESPONSE_PRACTICELEVEL_FIELD = protobuf.FieldDescriptor(); GETPLAYERINFORESPONSE_SEALLIST_FIELD = protobuf.FieldDescriptor(); GETPLAYERINFORESPONSE_RANDOMCOUNT_FIELD = protobuf.FieldDescriptor(); +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD = protobuf.FieldDescriptor(); GETITEMINFOREQUEST = protobuf.Descriptor(); GETITEMINFOREQUEST_INDEX_FIELD = protobuf.FieldDescriptor(); GETITEMINFORESPONSE = protobuf.Descriptor(); @@ -1196,11 +1197,21 @@ GETPLAYERINFORESPONSE_RANDOMCOUNT_FIELD.default_value = 0 GETPLAYERINFORESPONSE_RANDOMCOUNT_FIELD.type = 5 GETPLAYERINFORESPONSE_RANDOMCOUNT_FIELD.cpp_type = 1 +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.name = "drawTimes" +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.full_name = ".rpc.protocols.GetPlayerInfoResponse.drawTimes" +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.number = 44 +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.index = 42 +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.label = 1 +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.has_default_value = false +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.default_value = 0 +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.type = 5 +GETPLAYERINFORESPONSE_DRAWTIMES_FIELD.cpp_type = 1 + GETPLAYERINFORESPONSE.name = "GetPlayerInfoResponse" GETPLAYERINFORESPONSE.full_name = ".rpc.protocols.GetPlayerInfoResponse" GETPLAYERINFORESPONSE.nested_types = {} GETPLAYERINFORESPONSE.enum_types = {} -GETPLAYERINFORESPONSE.fields = {GETPLAYERINFORESPONSE_PLAYER_FIELD, GETPLAYERINFORESPONSE_NEWPLAYERGUIDEPOINT_FIELD, GETPLAYERINFORESPONSE_PRIVILEGE_FIELD, GETPLAYERINFORESPONSE_GIFTGOODSINFO_FIELD, GETPLAYERINFORESPONSE_BUYGOODSID_FIELD, GETPLAYERINFORESPONSE_SUDDENLYBOSSINFO_FIELD, GETPLAYERINFORESPONSE_VIPLEVETAKE_FIELD, GETPLAYERINFORESPONSE_USERCREATETIME_FIELD, GETPLAYERINFORESPONSE_REDTYPE_FIELD, GETPLAYERINFORESPONSE_RANDCOUNT_FIELD, GETPLAYERINFORESPONSE_HEROHANDBOOK_FIELD, GETPLAYERINFORESPONSE_EQUIPHANDBOOK_FIELD, GETPLAYERINFORESPONSE_TOWERRECEIVEDREWARD_FIELD, GETPLAYERINFORESPONSE_GOODSTYPEDURATION_FIELD, GETPLAYERINFORESPONSE_TREASURELEVEL_FIELD, GETPLAYERINFORESPONSE_HADBUYTREASURE_FIELD, GETPLAYERINFORESPONSE_SIGNININFO_FIELD, GETPLAYERINFORESPONSE_FIRSTTENTH_FIELD, GETPLAYERINFORESPONSE_MONSTERATTACKTIME_FIELD, GETPLAYERINFORESPONSE_ISDAYFIRST_FIELD, GETPLAYERINFORESPONSE_PLAYERBINDPHONE_FIELD, GETPLAYERINFORESPONSE_QUESTIONSTATE_FIELD, GETPLAYERINFORESPONSE_SOULEQUIPPOOL_FIELD, GETPLAYERINFORESPONSE_PLAYEDMAPTYPES_FIELD, GETPLAYERINFORESPONSE_AMOUNT_FIELD, GETPLAYERINFORESPONSE_VIPDAILY_FIELD, GETPLAYERINFORESPONSE_MISSINGREFRESHCOUNT_FIELD, GETPLAYERINFORESPONSE_MONTHINFOS_FIELD, GETPLAYERINFORESPONSE_DAILYCHALLENGEINFO_FIELD, GETPLAYERINFORESPONSE_EXPEDITIONLEVE_FIELD, GETPLAYERINFORESPONSE_HADLUCKTIME_FIELD, GETPLAYERINFORESPONSE_HADADVANCELUCKTIME_FIELD, GETPLAYERINFORESPONSE_WORLDLEVE_FIELD, GETPLAYERINFORESPONSE_DEMONSTRIALREWARDINFO_FIELD, GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD, GETPLAYERINFORESPONSE_USERSKINLIST_FIELD, GETPLAYERINFORESPONSE_USERTITLELIST_FIELD, GETPLAYERINFORESPONSE_USERMOUNTLIST_FIELD, GETPLAYERINFORESPONSE_DAILYREDPACK_FIELD, GETPLAYERINFORESPONSE_PRACTICELEVEL_FIELD, GETPLAYERINFORESPONSE_SEALLIST_FIELD, GETPLAYERINFORESPONSE_RANDOMCOUNT_FIELD} +GETPLAYERINFORESPONSE.fields = {GETPLAYERINFORESPONSE_PLAYER_FIELD, GETPLAYERINFORESPONSE_NEWPLAYERGUIDEPOINT_FIELD, GETPLAYERINFORESPONSE_PRIVILEGE_FIELD, GETPLAYERINFORESPONSE_GIFTGOODSINFO_FIELD, GETPLAYERINFORESPONSE_BUYGOODSID_FIELD, GETPLAYERINFORESPONSE_SUDDENLYBOSSINFO_FIELD, GETPLAYERINFORESPONSE_VIPLEVETAKE_FIELD, GETPLAYERINFORESPONSE_USERCREATETIME_FIELD, GETPLAYERINFORESPONSE_REDTYPE_FIELD, GETPLAYERINFORESPONSE_RANDCOUNT_FIELD, GETPLAYERINFORESPONSE_HEROHANDBOOK_FIELD, GETPLAYERINFORESPONSE_EQUIPHANDBOOK_FIELD, GETPLAYERINFORESPONSE_TOWERRECEIVEDREWARD_FIELD, GETPLAYERINFORESPONSE_GOODSTYPEDURATION_FIELD, GETPLAYERINFORESPONSE_TREASURELEVEL_FIELD, GETPLAYERINFORESPONSE_HADBUYTREASURE_FIELD, GETPLAYERINFORESPONSE_SIGNININFO_FIELD, GETPLAYERINFORESPONSE_FIRSTTENTH_FIELD, GETPLAYERINFORESPONSE_MONSTERATTACKTIME_FIELD, GETPLAYERINFORESPONSE_ISDAYFIRST_FIELD, GETPLAYERINFORESPONSE_PLAYERBINDPHONE_FIELD, GETPLAYERINFORESPONSE_QUESTIONSTATE_FIELD, GETPLAYERINFORESPONSE_SOULEQUIPPOOL_FIELD, GETPLAYERINFORESPONSE_PLAYEDMAPTYPES_FIELD, GETPLAYERINFORESPONSE_AMOUNT_FIELD, GETPLAYERINFORESPONSE_VIPDAILY_FIELD, GETPLAYERINFORESPONSE_MISSINGREFRESHCOUNT_FIELD, GETPLAYERINFORESPONSE_MONTHINFOS_FIELD, GETPLAYERINFORESPONSE_DAILYCHALLENGEINFO_FIELD, GETPLAYERINFORESPONSE_EXPEDITIONLEVE_FIELD, GETPLAYERINFORESPONSE_HADLUCKTIME_FIELD, GETPLAYERINFORESPONSE_HADADVANCELUCKTIME_FIELD, GETPLAYERINFORESPONSE_WORLDLEVE_FIELD, GETPLAYERINFORESPONSE_DEMONSTRIALREWARDINFO_FIELD, GETPLAYERINFORESPONSE_HEADFRAMEBAG_FIELD, GETPLAYERINFORESPONSE_USERSKINLIST_FIELD, GETPLAYERINFORESPONSE_USERTITLELIST_FIELD, GETPLAYERINFORESPONSE_USERMOUNTLIST_FIELD, GETPLAYERINFORESPONSE_DAILYREDPACK_FIELD, GETPLAYERINFORESPONSE_PRACTICELEVEL_FIELD, GETPLAYERINFORESPONSE_SEALLIST_FIELD, GETPLAYERINFORESPONSE_RANDOMCOUNT_FIELD, GETPLAYERINFORESPONSE_DRAWTIMES_FIELD} GETPLAYERINFORESPONSE.is_extendable = false GETPLAYERINFORESPONSE.extensions = {} GETITEMINFOREQUEST_INDEX_FIELD.name = "index" diff --git a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_WishDraw.lua b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_WishDraw.lua index 2f25c4a795..db4ef48114 100644 --- a/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_WishDraw.lua +++ b/Assets/ManagedResources/~Lua/Modules/GeneralPanel/View/GeneralBigPopup_WishDraw.lua @@ -2,6 +2,7 @@ local this = {} local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig) local heroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig) +local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig) function this:InitComponent(gameObject) self.spLoader = SpriteLoader.New() @@ -52,14 +53,17 @@ end function this:OnShow(_parent,...) self.parent=_parent self.sortingOrder = _parent.sortingOrder - self.curSelect = 1 - NetManager.ChoiceWishHeroRequest(nil,function () + self.curSelect = RecruitManager.CheckIndex() this:Refresh(true,true) end) end function this:Refresh(isTop,isAni) + local data = tonumber(specialConfig[119].Value) + if RecruitManager.drawTimes < data then + self.parent:ClosePanel() + end self.selectBtn:GetComponent("RectTransform").localPosition = self.tabListObj[self.curSelect]:GetComponent("RectTransform").localPosition this:SetHeroList(isTop,isAni) this:SetUpHero() @@ -89,6 +93,7 @@ function this:SetUpHero() if RecruitManager.WishCardData[i].status == 1 then PopupTipPanel.ShowTip("同系神将每日只可选择一位获取一次概率提升~") elseif RecruitManager.WishCardData[i].status == 0 then + LogYellow("heroId:"..tostring(heroId)) RecruitManager.ChangeHero(2,heroId,function () this:Refresh(false,false) end)--英雄变更:1增加、2卸下 @@ -99,6 +104,10 @@ function this:SetUpHero() proIcon.gameObject:SetActive(false) starGrid:SetActive(false) icon.sprite = self.spLoader:LoadSprite("lingshou_jiahao") + Util.AddOnceClick(go,function () + self.curSelect = RecruitManager.CheckIndex() + this:Refresh(false,false) + end) end end end diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index e9620094b3..33d49f009e 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -111,7 +111,7 @@ function this.PlayerInfoRequest(func) PlayerManager.curMapId = msg.player.curMapId MapManager.Mapping = false --PlayerManager.curMapId ~= 0 and PlayerManager.curMapId > 100 PlayerManager.maxForce = msg.player.maxForce - -- RecruitManager.randCount = msg.randCount % 100 --钻石抽卡已招募次数 用不上了 协议没删 + RecruitManager.drawTimes = msg.drawTimes % 100 --钻石抽卡已招募次数 RecruitManager.isTenRecruit = msg.firstTenth --首次十连 PlayerManager.userCreateTime = msg.userCreateTime PatFaceManager.SetisFirstLogVal(msg.isDayFirst) diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua index 25cf7decb8..f09b668861 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitManager.lua @@ -23,7 +23,7 @@ function this.GetRecruit3MustCount() return this.recruit3MustCount end function this.Initialize() - this.randCount = 0 --英雄抽卡已招募次数 + this.drawTimes = {} --英雄抽卡已招募次数 this.isCanOpenBox = false this.boxReward = {} this.recruitFreeUseTime = 0 --现在只剩下秘盒招募在用了 @@ -425,10 +425,16 @@ end --===================心愿抽卡界面逻辑=================== function this.GetWishCardData(infoList) - -- for i = 1, #infoList do - -- LogPink("Id:"..tostring(infoList[i].id).." heroIid:"..tostring(infoList[i].heroTid).." status:"..tostring(infoList[i].status)) - -- end - this.WishCardData = infoList + this.WishCardData = {} + for i = 1, #infoList do + this.WishCardData[i] = {} + this.WishCardData[i].id = infoList[i].id + this.WishCardData[i].heroTid = infoList[i].heroTid + this.WishCardData[i].status = infoList[i].status + LogPink("Id:"..tostring(infoList[i].id).." heroIid:"..tostring(infoList[i].heroTid).." status:"..tostring(infoList[i].status)) + this.WishCardData[i].PropertyName = infoList[i].heroTid > 0 and heroConfig[infoList[i].heroTid].PropertyName or nil + end + -- this.WishCardData = infoList end function this.GetCurHeroList(curIndex) @@ -450,7 +456,7 @@ function this.CheckCurHeroState(_heroTid) end end for i = 1, #this.WishCardData do - if this.WishCardData[i].heroTid > 0 and heroConfig[this.WishCardData[i].heroTid].PropertyName == heroConfig[_heroTid].PropertyName then + if this.WishCardData[i].heroTid > 0 and this.WishCardData[i].PropertyName == heroConfig[_heroTid].PropertyName then --如果上方存在和当前英雄相同阵营的就置灰 return 0 end @@ -483,8 +489,6 @@ function this.ChangeHero(type,_heroTid,func) if this.WishCardData[i].heroTid == _heroTid then this.WishCardData[i].heroTid = 0 break - else - Log("未找到需要卸下的神将") end end end @@ -495,4 +499,27 @@ function this.ChangeHero(type,_heroTid,func) end) end +function this.CheckIndex() + + local num = 0 + for i = 1, #this.WishCardData do + if this.WishCardData[i].heroTid > 0 then + num = num + 1 + end + end + if num == 3 then + return 1 + end + + local num2 = {1,2,3,4} + for i = 4, 1,-1 do + for j = 1, #this.WishCardData do + if this.WishCardData[j].PropertyName == num2[i] then + table.remove(num2,i) + end + end + end + return num2[1] +end + return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanel.lua b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanel.lua index 5e0e93a3f6..c9263960fc 100644 --- a/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Recruit/RecruitPanel.lua @@ -10,6 +10,7 @@ local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig) local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local lotterySetting=ConfigManager.GetConfig(ConfigName.LotterySetting) local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig) +local specialConfig = ConfigManager.GetConfig(ConfigName.SpecialConfig) local orginLayer = 0 --抽卡类型 @@ -94,7 +95,12 @@ function RecruitPanel:BindEvent() end) --心愿抽卡界面 Util.AddClick(this.wishBtn, function() - UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.WishDraw) + local data = tonumber(specialConfig[119].Value) + if RecruitManager.drawTimes >= data then + UIManager.OpenPanel(UIName.GeneralBigPopup,GENERAL_POPUP_TYPE.WishDraw) + else + PopupTipPanel.ShowTip(string.format("%s次神将召唤后,开启心愿抽卡!",data - RecruitManager.drawTimes)) + end end) end