dev_chengFeng
parent
070fb43964
commit
1b89e68c95
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
@ -1,5 +1,5 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 669b1ae14e19a69458d57a2aa3670f5d
|
||||
guid: 012fac0c8066e0244891b1240cc7bee5
|
||||
TextureImporter:
|
||||
fileIDToRecycleName: {}
|
||||
externalObjects: {}
|
|
@ -3,12 +3,19 @@ local sortingOrder = 0
|
|||
local itemConfig=ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
local listUpPre={} --
|
||||
local rate={}
|
||||
local panelType
|
||||
local detailText={
|
||||
[1] = HELP_TYPE.TimeLimitedCall,
|
||||
[2] = HELP_TYPE.QianKunBox,
|
||||
}
|
||||
|
||||
function ActivityDetail:ctor(gameObject)
|
||||
function ActivityDetail:ctor(gameObject,type)
|
||||
self.gameObject = gameObject
|
||||
panelType = type
|
||||
self:InitComponent(gameObject)
|
||||
self:BindEvent()
|
||||
self:OnShow()
|
||||
|
||||
end
|
||||
|
||||
function ActivityDetail:InitComponent(gameObject)
|
||||
|
@ -27,17 +34,30 @@ end
|
|||
|
||||
function ActivityDetail:OnShow()
|
||||
self.gameObject:SetActive(true)
|
||||
local str=ConfigManager.TryGetConfigData(ConfigName.QAConfig,HELP_TYPE.TimeLimitedCall).content
|
||||
-- LogRed(panelType)
|
||||
-- LogYellow(detailText[panelType])
|
||||
local str=ConfigManager.TryGetConfigData(ConfigName.QAConfig,detailText[panelType]).content--内容详情可以复用
|
||||
str = string.gsub(str,"{","<color=#D48A07>")
|
||||
str = string.gsub(str,"}","</color>")
|
||||
str = string.gsub(str,"|","\n")--换行
|
||||
self.content.text= str
|
||||
self:ReFreshUpHero()
|
||||
self:RefreshRate()
|
||||
local str=ActivityGiftManager.GetTimeStartToEnd(ActivityTypeDef.FindFairy)
|
||||
self.time.text=Language[12170]..str
|
||||
end
|
||||
local str2
|
||||
--判断抽取的类型
|
||||
if panelType == 1 then--破阵诛仙
|
||||
self:ReFreshUpHero()
|
||||
self:RefreshHeroRate()
|
||||
str2=ActivityGiftManager.GetTimeStartToEnd(ActivityTypeDef.FindFairy)
|
||||
elseif panelType==2 then--乾坤包囊
|
||||
self:ReFreshUpSoulPrint()
|
||||
str2=ActivityGiftManager.GetTimeStartToEnd(ActivityTypeDef.FindFairy)
|
||||
end
|
||||
|
||||
self.time.text=Language[12170]..str2
|
||||
end
|
||||
--============================乾坤包囊功能======================================
|
||||
function ActivityDetail:ReFreshUpSoulPrint()
|
||||
end
|
||||
--============================破阵诛仙功能======================================
|
||||
function ActivityDetail:ReFreshUpHero()
|
||||
local UpHero=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.TIME_LIMITED_UP)
|
||||
if(not listUpPre) then
|
||||
|
@ -52,7 +72,7 @@ function ActivityDetail:ReFreshUpHero()
|
|||
listUpPre[n] = SubUIManager.Open(SubUIConfig.ItemView,self.itemGrid.transform)
|
||||
end
|
||||
listUpPre[n]:OnOpen(false, {m.Reward[1], m.Reward[2]}, 1.1, true)
|
||||
local weight = self:ReculateUpRate(m.Reward[1])
|
||||
local weight = self:ReculateUpHeroRate(m.Reward[1])
|
||||
local tempName = listUpPre[n].name:GetComponent("Text").text
|
||||
listUpPre[n].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (weight/100000)*100) .."%</color>"
|
||||
listUpPre[n].gameObject:SetActive(true)
|
||||
|
@ -60,8 +80,7 @@ function ActivityDetail:ReFreshUpHero()
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
function ActivityDetail:ReculateUpRate(id)
|
||||
function ActivityDetail:ReculateUpHeroRate(id)
|
||||
local Hero=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.TIME_LIMITED)
|
||||
for n,m in ipairs(Hero) do
|
||||
if m and id==m.Reward[1] then
|
||||
|
@ -71,8 +90,7 @@ function ActivityDetail:ReculateUpRate(id)
|
|||
return 0
|
||||
end
|
||||
|
||||
|
||||
function ActivityDetail:RefreshRate()
|
||||
function ActivityDetail:RefreshHeroRate()
|
||||
local list3={}
|
||||
local list4={}
|
||||
local list5={}
|
||||
|
@ -111,6 +129,7 @@ function ActivityDetail:RefreshRate()
|
|||
|
||||
end
|
||||
|
||||
--通用计算权重功能
|
||||
function ActivityDetail:ReculateRate(list)
|
||||
local weight=0
|
||||
for index, v in ipairs(list) do
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
local QianKunBox = quick_class("QianKunBox")
|
||||
local ActivityDetail = require("Modules/Operating/ActivityDetail")--活动详情
|
||||
|
||||
function QianKunBox:ctor(mainPanel, gameObject)
|
||||
self.mainPanel = mainPanel
|
||||
|
@ -12,7 +13,8 @@ function QianKunBox:InitComponent(gameObject)
|
|||
--leftUp
|
||||
self.leftUp = Util.GetGameObject(gameObject,"leftUp")
|
||||
self.leftUpTime = Util.GetGameObject(self.leftUp,"tips/tips2/time"):GetComponent("Text")
|
||||
self.btnHelp= Util.GetGameObject(self.leftUp,"btnHelp")
|
||||
self.btnHelp= Util.GetGameObject(gameObject,"btnHelp")
|
||||
self.helpPosition=self.btnHelp:GetComponent("RectTransform").localPosition
|
||||
--rightUp
|
||||
self.rightUp = Util.GetGameObject(gameObject,"rightUp")
|
||||
self.btnReward = Util.GetGameObject(self.rightUp,"reward")
|
||||
|
@ -23,31 +25,41 @@ function QianKunBox:InitComponent(gameObject)
|
|||
self.bottom = Util.GetGameObject(gameObject,"bottom")
|
||||
self.btnOne = Util.GetGameObject(self.bottom,"btnOne")
|
||||
self.btnTime = Util.GetGameObject(self.bottom,"btnOne/di/time"):GetComponent("Text")
|
||||
self.btnTen = Util.GetGameObject(self.bottom,"btnTen")
|
||||
self.btnTen1 = Util.GetGameObject(self.bottom,"btnTen1")
|
||||
self.btnTen2 = Util.GetGameObject(self.bottom,"btnTen2")
|
||||
self.btnTimes= Util.GetGameObject(self.bottom,"btnTen2/di/times"):GetComponent("Text")
|
||||
self.limit = Util.GetGameObject(self.bottom,"limit")
|
||||
--detail
|
||||
self.detail = Util.GetGameObject(gameObject,"detail")
|
||||
|
||||
end
|
||||
|
||||
function QianKunBox:BindEvent()
|
||||
Util.AddClick(self.btnHelp,function()
|
||||
LogBlue("帮助按钮")
|
||||
UIManager.OpenPanel(UIName.HelpPopup,HELP_TYPE.QianKunBox,self.helpPosition.x,self.helpPosition.y)
|
||||
end)
|
||||
Util.AddClick(self.btnReward,function()
|
||||
LogBlue("奖励")
|
||||
LogGreen("奖励")
|
||||
ActivityDetail.new(self.detail,2)
|
||||
end)
|
||||
Util.AddClick(self.btnStore,function()
|
||||
LogBlue("魂印商店")
|
||||
LogRed("魂印商店")
|
||||
end)
|
||||
Util.AddClick(self.btnOne,function()
|
||||
LogBlue("单抽")
|
||||
LogPink("单抽")
|
||||
end)
|
||||
Util.AddClick(self.btnTen,function()
|
||||
LogBlue("十连")
|
||||
Util.AddClick(self.btnTen1,function()
|
||||
LogYellow("钥匙十连")
|
||||
end)
|
||||
Util.AddClick(self.btnTen2,function()
|
||||
LogPurple("妖晶十连")
|
||||
end)
|
||||
end
|
||||
|
||||
function QianKunBox:OnShow()
|
||||
self.gameObject:SetActive(true)
|
||||
self.btnTen2:SetActive(BagManager.GetItemCountById(16)>=2000)
|
||||
self.btnTen1:SetActive(BagManager.GetItemCountById(16)<2000)
|
||||
end
|
||||
|
||||
function QianKunBox:OnHide()
|
||||
|
|
Loading…
Reference in New Issue