天天0.1提交

tcx_xiyou_bt_ios
wangzhenxing 2024-06-03 18:53:06 +08:00
parent 8d999988f6
commit c8c7863e56
2 changed files with 13 additions and 178 deletions

View File

@ -310,6 +310,8 @@ ConfigName = {
AssistanceConfig = "AssistanceConfig",
AssistanceProperty = "AssistanceProperty",
Loading ="Loading",
EveryDayGift="EveryDayGift",
EveryDayGiftTask="EveryDayGiftTask",
}
require "Framework/GameDataBase"

View File

@ -6,7 +6,8 @@ local orginLayer = 0
local ActRewardConfig = ConfigManager.GetConfig(ConfigName.ActivityRewardConfig)--总表数据
local HeroConfig = ConfigManager.GetConfig(ConfigName.HeroConfig)
local ArtConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
local EightDayRewardConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.ActivityRewardConfig,"ActivityId",ActivityTypeDef.EightDayGift)--表内八日奖励数据
local rechargeCommodityConfig= ConfigManager.GetConfig(ConfigName.RechargeCommodityConfig)
local everyDayGiftConfig = ConfigManager.GetAllConfigsDataByKey(ConfigName.EveryDayGift,"GlobalActivity",12601)--表内八日奖励数据
local ItemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
local ItemList = {}--奖励List
local ItemViewList = {}
@ -16,17 +17,6 @@ local Live
local bgName
local day_picture ={--数字名、文字名、奖励id
[1] = {"b_baridenglu_slogan002",2043,"b_baridenglu_slogan02_zh",10043,{0.5,0.5,0.5},{0,-470.2,0}},
[2] = {"b_baridenglu_slogan002",2043,"b_baridenglu_slogan02_zh",10043,{0.5,0.5,0.5},{0,-470.2,0}},
[3] = {"b_baridenglu_slogan003",2503,"b_baridenglu_slogan03_zh",10022,{1,1,1},{-69,91,0}},
[4] = {"b_baridenglu_slogan008",2022,"b_baridenglu_slogan08_zh",10022,{0.6,0.6,0.6},{0,-470.2,0}},
[5] = {"b_baridenglu_slogan008",2022,"b_baridenglu_slogan08_zh",10022,{0.6,0.6,0.6},{0,-470.2,0}},
[6] = {"b_baridenglu_slogan008",2022,"b_baridenglu_slogan08_zh",10022,{0.6,0.6,0.6},{0,-470.2,0}},
[7] = {"b_baridenglu_slogan008",2022,"b_baridenglu_slogan08_zh",10022,{0.6,0.6,0.6},{0,-470.2,0}},
[8] = {"b_baridenglu_slogan008",2022,"b_baridenglu_slogan08_zh",10022,{0.6,0.6,0.6},{0,-470.2,0}},
}
--初始化组件(用于子类重写)
function ZeroPointOnePanel:InitComponent()
@ -63,113 +53,14 @@ end
function ZeroPointOnePanel:Refresh()
rewardData = ActivityGiftManager.GetActivityTypeInfo(ActivityTypeDef.zeroPointOneGift)
curDay = math.ceil((CalculateSecondsNowTo_N_OClock(0) + GetTimeStamp() - PlayerManager.userCreateTime)/86400)
-- LogYellow((CalculateSecondsNowTo_N_OClock(5) + GetTimeStamp() - PlayerManager.userCreateTime)/86400)
-- --LogGreen((CalculateSecondsNowTo_N_OClock(24) + GetTimeStamp() - PlayerManager.userCreateTime)/86400)
if curDay>8 then
curDay = 8
end
this.SetAllReward()
this:SetBg()
end
--设置背景
function ZeroPointOnePanel:SetBg(i)
-- body
local ren = Util.GetGameObject(this.gameObject,"panel/bg/ren")
local tip = Util.GetGameObject(this.gameObject,"panel/bg/tip"):GetComponent("Image")
local num,text,id
local bgScale = Vector3
local bgPos = Vector3
-- --加载天数、奖励文字、动效(第三天特殊处理)
ren:GetComponent("Image").enabled= false
ren.transform.localPosition = Vector3.New(0,310,0)
if i then
if i == 3 then
ren.transform.localPosition = Vector3.New(-74,100,0)
text = "b_baridenglu_slogan03_zh"--文字
id = day_picture[i][4]--itemviewId
bgName = "b_baridenglu_erridi"--动效资源名字
tip.sprite = this.spLoader:LoadSprite(text)
ren:GetComponent("Image").sprite = this.spLoader:LoadSprite(bgName)
ren:GetComponent("Image").enabled= true
this.btnPreview:SetActive(false)
elseif i > 3 then
ren.transform.localPosition = Vector3.New(-35,258,0)
text = "b_baridenglu_slogan08_zh_1_zh"--文字
id = day_picture[i][4]--itemviewId
bgName = "b_baridenglu_slogan08_4geren"--动效资源名字
tip.sprite = this.spLoader:LoadSprite(text)
ren:GetComponent("Image").sprite = this.spLoader:LoadSprite(bgName)
ren:GetComponent("Image").enabled= true
this.btnPreview:SetActive(false)
else
this.btnPreview:SetActive(false)
text = tostring(day_picture[i][3])--文字
id = day_picture[i][4]--itemviewId
bgName = ArtConfig[day_picture[i][2]].Name--动效资源名字
bgScale = day_picture[i][5]
bgPos = day_picture[i][6]
tip.sprite = this.spLoader:LoadSprite(text)
Util.AddOnceClick(this.btnPreview,function()
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, id, 10)
end)
Live = poolManager:LoadLive(bgName, ren.transform, Vector3.New(bgScale[1],bgScale[2],bgScale[3]), Vector3.New(bgPos[1],bgPos[2],bgPos[3]))
end
else
if curDay == 3 or (curDay ==2 and rewardData.mission[2].state == 1) then
this.btnPreview:SetActive(false)
ren.transform.localPosition = Vector3.New(-74,100,0)
text = "b_baridenglu_slogan03_zh"--文字
id = day_picture[3][4]--itemviewId
bgName = "b_baridenglu_erridi"--动效资源名字
tip.sprite = this.spLoader:LoadSprite(text)
ren:GetComponent("Image").sprite = this.spLoader:LoadSprite(bgName)
ren:GetComponent("Image").enabled= true
elseif curDay > 3 or (curDay == 3 and rewardData.mission[3].state == 1) then
this.btnPreview:SetActive(false)
ren.transform.localPosition = Vector3.New(-35,258,0)
text = "b_baridenglu_slogan08_zh_1_zh"--文字
id = day_picture[3][4]--itemviewId
bgName = "b_baridenglu_slogan08_4geren"--动效资源名字
tip.sprite = this.spLoader:LoadSprite(text)
ren:GetComponent("Image").sprite = this.spLoader:LoadSprite(bgName)
ren:GetComponent("Image").enabled= true
else
this.btnPreview:SetActive(false)
if rewardData.mission[curDay].state == 1 and curDay ~= 8 then
text = tostring(day_picture[curDay+1][3])
id = day_picture[curDay+1][4]
bgName = ArtConfig[day_picture[curDay+1][2]].Name
bgScale = day_picture[curDay+1][5]
bgPos = day_picture[curDay+1][6]
tip.sprite = this.spLoader:LoadSprite(text)
Util.AddOnceClick(this.btnPreview,function()
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, id, 10)
end)
Live = poolManager:LoadLive(bgName, ren.transform, Vector3.New(bgScale[1],bgScale[2],bgScale[3]), Vector3.New(bgPos[1],bgPos[2],bgPos[3]))
else
text = tostring(day_picture[curDay][3])
id = day_picture[curDay][4]
bgName = ArtConfig[day_picture[curDay][2]].Name
bgScale = day_picture[curDay][5]
bgPos = day_picture[curDay][6]
tip.sprite = this.spLoader:LoadSprite(text)
Util.AddOnceClick(this.btnPreview,function()
UIManager.OpenPanel(UIName.RoleGetInfoPopup, false, id, 10)
end)
Live = poolManager:LoadLive(bgName, ren.transform, Vector3.New(bgScale[1],bgScale[2],bgScale[3]), Vector3.New(bgPos[1],bgPos[2],bgPos[3]))
end
end
end
end
function ZeroPointOnePanel:SetAllReward()
for i=1, #EightDayRewardConfig do
for i=1, #everyDayGiftConfig do
local item = ItemList[i]
if not item then
item = newObject(this.itemPre)
@ -196,21 +87,16 @@ function ZeroPointOnePanel:SetSingleReward(item,i)
local redPoint = Util.GetGameObject(item,"kuang/Button/redPoint")
local mask = Util.GetGameObject(item,"kuang/reward/mask")
local isCanGet = rewardData.mission[i].state--是否可领取
name.text = GetLanguageStrById(EightDayRewardConfig[i].ContentsShow)--奖励名字
--这也要倒计时。。。
if i == curDay+1 then
this:SetRemainTime(day,i)
else
-- day.text = "第"..NumToSimplenessFont[i].."天"
day.text = string.format(Language[10528],GetLanguageStrById(NumToSimplenessFont[i]))
end
name.text = ""
--奖励的Icon
if not ItemViewList[i] then
local view = SubUIManager.Open(SubUIConfig.ItemView,icon.transform)
ItemViewList[i] = view
end
ItemViewList[i]:OnOpen(false,EightDayRewardConfig[i].Reward[1],0.85,false)
local recharge = rechargeCommodityConfig[everyDayGiftConfig[i].RechargeID]
ItemViewList[i]:OnOpen(false,recharge.RewardShow[1],0.85,false)
--2\3\8可领取的金框
if i == 2 or i == 3 or i == 8 then
@ -222,61 +108,8 @@ function ZeroPointOnePanel:SetSingleReward(item,i)
btnGet:GetComponent("Button").interactable = isCanGet == 0--不可点击
mask:SetActive(isCanGet == 1)
redPoint:SetActive(false)
if isCanGet == 0 then
if curDay >= i then
name.text = Language[10477]
redPoint:SetActive(true)
end
end
--领取按钮
if isCanGet == 0 then
Util.AddOnceClick(btnGet,function()
if curDay >= i then
--按钮状态置灰
Util.SetGray(btnGet,true)--已经领取置灰
btnGet:GetComponent("Button").interactable = true--不可点击
name.text = GetLanguageStrById(EightDayRewardConfig[i].ContentsShow)
redPoint:SetActive(false)
NetManager.GetActivityRewardRequest(rewardData.mission[i].missionId, rewardData.activityId, function(drop)
UIManager.OpenPanel(UIName.RewardItemPopup,drop,1,function()
ActivityGiftManager.sevenDayGetRewardState[i] = 1
this:SetAllReward()
Game.GlobalEvent:DispatchEvent(GameEvent.EightDay.GetRewardSuccess)
end)
end)
else
PopupTipPanel.ShowTip(Language[10527])
end
end)
end
--点击奖励时更改背景
Util.AddOnceClick(event,function()
if Live then
poolManager:UnLoadLive(bgName, Live)
Live = nil
end
this:SetBg(i)
if ItemConfig[EightDayRewardConfig[i].Reward[1][1]].ItemType == 13 then
UIManager.OpenPanel(UIName.SoulPrintPopUp,3,nil,EightDayRewardConfig[i].Reward[1][1],nil,nil)
elseif ItemConfig[EightDayRewardConfig[i].Reward[1][1]].ItemType == 20 then
UIManager.OpenPanel(UIName.RewardBoxPanel,nil,EightDayRewardConfig[i].Reward[1][1])
else
ItemViewList[i]:OnBtnCkickEvent(EightDayRewardConfig[i].Reward[1][1])
end
end)
Util.AddOnceClick(reward,function()
if Live then
poolManager:UnLoadLive(bgName, Live)
Live = nil
end
this:SetBg(i)
end)
end