From ead905fecb94e4b6205befd3e342e981e23cf06f Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Fri, 28 Oct 2022 10:55:24 +0800 Subject: [PATCH] =?UTF-8?q?[gm]=3D=3D=3D=3D=3D=3D=3D=E8=BD=AC=E7=9B=98?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LuckyTurnTable/GMTurnTablePanel.lua | 10 +++++++++- .../LuckyTurnTable/LuckyTurnTableManager.lua | 18 +++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/GMTurnTablePanel.lua b/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/GMTurnTablePanel.lua index 2336c9dc8e..8f58fc50b9 100644 --- a/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/GMTurnTablePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/GMTurnTablePanel.lua @@ -102,6 +102,8 @@ function GMTurnTablePanel:InitComponent(gameObject) this.costItemNumText=Util.GetGameObject(this.detail,"CostItemNumText"):GetComponent("Text") this.freeRefreshTime=Util.GetGameObject(this.luckyTurnPanel,"FreeRefreshTime/Text"):GetComponent("Text") this.leftTimeTxt=Util.GetGameObject(this.luckyTurnPanel,"leftTimeTxt/Text1"):GetComponent("Text") + this.infoTxt=Util.GetGameObject(this.luckyTurnPanel,"Content/Text"):GetComponent("Text") + this.progressTxt=Util.GetGameObject(this.luckyTurnPanel,"Content/progress"):GetComponent("Text") -- 奖励预览 this.btnPreview = Util.GetGameObject(self.gameObject, "Panel/btnPreview") this.maxTimes = Util.GetGameObject(self.gameObject, "Panel/maxTimes"):GetComponent("Text") @@ -244,9 +246,13 @@ function this.SwitchTreasureType(treasureType) this.bg1.sprite=this.spLoader:LoadSprite(BgName[1]) this.bg2.sprite=this.spLoader:LoadSprite(BgName[2]) this.RrFreshInfo() - + local rewardConfig=ConfigManager.GetConfigDataByDoubleKey(ConfigName.DialRewardConfig,"ActivityId",treasureType,"Rank",1) + local aaa="保底"..rewardConfig.MaxGoalCount.."次中超级大奖" + this.infoTxt.text= aaa + this.progressTxt.text=leftTime.."/"..rewardConfig.MaxGoalCount --请求跑马灯物品数据 NetManager.GetLuckyWheelRequest(treasureType,function(msg) + LuckyTurnTableManager.luckyData=msg.dialInfo[1].rewardInfo this.SetItemViewShow(msg.dialInfo[1].rewardInfo,function() this.SetItemViewGray(msg.dialInfo[1].rewardInfo) end) @@ -436,7 +442,9 @@ end ---设置跑马灯物品置灰 function this.SetItemViewGray(data) for i = 1, #data do + --LogError("data[i].luckId=="..data[i].luckId) if LuckyTurnTableManager.dialRewardConfig[data[i].luckId].LimitNum~=0 then + --LogError("data[i].luckTimes=="..data[i].luckTimes) local isGray = data[i].luckTimes >= LuckyTurnTableManager.dialRewardConfig[data[i].luckId].LimitNum Util.SetGray(this.itemViewList[i].gameObject, isGray) this.itemViewList[i]:SetEffectShow(not isGray) diff --git a/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/LuckyTurnTableManager.lua b/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/LuckyTurnTableManager.lua index 3adf893722..0bb995ab16 100644 --- a/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/LuckyTurnTableManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/LuckyTurnTable/LuckyTurnTableManager.lua @@ -149,16 +149,16 @@ function this.GetLuckyTurnRankRequest(activityId,repeated,priId,func) NetManager.GetLuckyTurnRankRequest(activityId,repeated, priId,function(msg) --if activityId==TreasureType.Lucky then this.luckyTempData=msg --存储临时数据 主要包括Drop - this.luckyData=msg.dialInfo.rewardInfo + --this.luckyData=msg.dialInfo.rewardInfo --在登陆时 服务器会把所有物品数据推给我posInfos 包括已抽取次数 我可以把数据先保存下来 在每次请求数据时 通过回调的数据来动态改变现有数据的属性 - -- for i = 1, #this.luckyData do - -- --Log("原数据 位置"..this.luckyData[i].pos.." luckId"..this.luckyData[i].luckId.." 已抽次数"..this.luckyData[i].luckTimes) - -- for j = 1, #msg.posInfos do - -- if this.luckyData[i].luckId==msg.posInfos[j].luckId then - -- this.luckyData[i].luckTimes=msg.posInfos[j].luckTimes - -- end - -- end - -- end + for i = 1, #this.luckyData do + --Log("原数据 位置"..this.luckyData[i].pos.." luckId"..this.luckyData[i].luckId.." 已抽次数"..this.luckyData[i].luckTimes) + for j = 1, #msg.dialInfo.rewardInfo do + if this.luckyData[i].luckId==msg.dialInfo.rewardInfo[j].luckId then + this.luckyData[i].luckTimes=msg.dialInfo.rewardInfo[j].luckTimes + end + end + end --for i = 1, #this.luckyData do -- Log("现数据 位置"..this.luckyData[i].pos.." luckId"..this.luckyData[i].luckId.." 已抽次数"..this.luckyData[i].luckTimes) --end