购买战令界面

This commit is contained in:
chenxi 2023-05-17 14:40:54 +08:00
parent e07eb6a961
commit 6e33313f69
25 changed files with 1109 additions and 305 deletions

View File

@ -26,6 +26,7 @@ local LOCAL_DATA_KEY = {
DISTINCT_ID = "DISTINCT_ID",
LAST_LOGIN_TIME = "LAST_LOGIN_TIME",
GATE = "GATE",
BOUNTY_POP_TIME = "BOUNTY_POP_TIME",
}
LocalData.KEYS = LOCAL_DATA_KEY
@ -336,4 +337,12 @@ function LocalData:setLastLoginTime()
end
function LocalData:setBountyPopTime(time)
self:setInt(LOCAL_DATA_KEY.BOUNTY_POP_TIME, time)
end
function LocalData:getBountyPopTime()
return self:getInt(LOCAL_DATA_KEY.BOUNTY_POP_TIME, 0)
end
return LocalData

View File

@ -265,7 +265,6 @@ local buff = {
[36]={
["name"]="normal_attack_dec",
["buff_type"]=1,
["stack"]=2,
["decr"]=2,
["icon"]="normal_attack_dec",
["fx_continued"]={

View File

@ -40,24 +40,6 @@ local chapter = {
401,
501
},
["mystery_box"]={
{
1,
5
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -179,26 +161,9 @@ local chapter = {
1501
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
1
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
@ -369,22 +334,16 @@ local chapter = {
3001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
1,
3
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
@ -580,38 +539,6 @@ local chapter = {
4901,
5001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -819,38 +746,6 @@ local chapter = {
6901,
7001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -1058,38 +953,6 @@ local chapter = {
8901,
9001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -1297,38 +1160,6 @@ local chapter = {
10901,
11001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -1552,38 +1383,6 @@ local chapter = {
12901,
13001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -1807,38 +1606,6 @@ local chapter = {
14901,
15001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,
@ -2061,38 +1828,6 @@ local chapter = {
16901,
17001
},
["mystery_box"]={
{
1,
5
},
{
6,
10
}
},
["mystery_box_reward"]={
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
{
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
["wave_reward"]={
{
["type"]=1,

View File

@ -198,21 +198,6 @@ local chapter_board = {
0
}
},
["control_element"]={
3,
3,
2,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3
},
["control_element"]={
3,
3,
@ -292,7 +277,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -308,7 +293,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -427,6 +412,204 @@ local chapter_board = {
1,
0
}
},
["mystery_box_board"]={
{
1,
0
},
{
2,
0
},
{
0,
1
},
{
0,
2
},
{
0,
1
},
{
2,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
0,
3
},
{
0,
1
},
{
0,
3
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
14,
0
},
{
2,
0
},
{
2,
0
},
{
2,
0
},
{
14,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
2,
0
},
{
2,
0
},
{
2,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
2,
0
},
{
15,
0
},
{
2,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
}
}
},
[3]={
@ -552,7 +735,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -560,7 +743,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -716,7 +899,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -728,7 +911,7 @@ local chapter_board = {
0
},
{
3,
0,
0
},
{
@ -740,7 +923,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -764,7 +947,7 @@ local chapter_board = {
0
},
{
3,
2,
0
},
{
@ -827,6 +1010,204 @@ local chapter_board = {
1,
0
}
},
["mystery_box_board"]={
{
1,
0
},
{
2,
0
},
{
0,
1
},
{
0,
2
},
{
0,
1
},
{
2,
0
},
{
1,
0
},
{
1,
0
},
{
2,
0
},
{
0,
2
},
{
0,
1
},
{
0,
4
},
{
2,
0
},
{
1,
0
},
{
1,
0
},
{
2,
0
},
{
3,
0
},
{
0,
2
},
{
3,
0
},
{
2,
0
},
{
1,
0
},
{
14,
0
},
{
3,
0
},
{
2,
0
},
{
0,
0
},
{
2,
0
},
{
3,
0
},
{
14,
0
},
{
1,
0
},
{
2,
0
},
{
3,
0
},
{
2,
0
},
{
3,
0
},
{
2,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
15,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
}
}
},
[5]={
@ -888,7 +1269,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -912,7 +1293,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -928,7 +1309,7 @@ local chapter_board = {
0
},
{
2,
14,
0
},
{
@ -1139,6 +1520,188 @@ local chapter_board = {
3,
0
},
{
2,
0
},
{
14,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
14,
0
},
{
1,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
3,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
3,
0
},
{
14,
0
},
{
3,
0
},
{
1,
0
},
{
1,
0
}
},
["mystery_box_board"]={
{
1,
0
},
{
1,
0
},
{
0,
1
},
{
0,
2
},
{
0,
1
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
0,
2
},
{
0,
3
},
{
0,
2
},
{
1,
0
},
{
1,
0
},
{
1,
0
},
{
2,
0
},
{
0,
1
},
{
2,
0
},
{
0,
1
},
{
2,
0
},
{
1,
0
},
{
2,
0
},
{
3,
0
},
{
3,
0
@ -1156,7 +1719,11 @@ local chapter_board = {
0
},
{
3,
2,
0
},
{
14,
0
},
{
@ -1171,6 +1738,18 @@ local chapter_board = {
3,
0
},
{
3,
0
},
{
3,
0
},
{
14,
0
},
{
1,
0
@ -1184,7 +1763,7 @@ local chapter_board = {
0
},
{
3,
15,
0
},
{
@ -1212,7 +1791,7 @@ local chapter_board = {
0
},
{
3,
14,
0
},
{

109
lua/app/config/mail.lua Normal file
View File

@ -0,0 +1,109 @@
local mail = {
[1]={
["type"]=1,
["time_type"]=1,
["time_send"]={
0,
0,
0
},
["time"]=24,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[2]={
["type"]=2,
["time_type"]=1,
["time_send"]={
0,
0,
0
},
["time"]=24,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[3]={
["type"]=3,
["time_type"]=2,
["time_send"]={
5,
12,
0,
0
},
["time"]=24,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=30,
["num_for_nothing"]="VQg="
}
}
},
[4]={
["type"]=3,
["time_type"]=2,
["time_send"]={
6,
12,
0,
0
},
["time"]=24,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
}
}
},
[5]={
["type"]=3,
["time_type"]=2,
["time_send"]={
7,
12,
0,
0
},
["time"]=24,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=70,
["num_for_nothing"]="UQg="
}
}
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 26403a4c77be4584982691a5a64cc90f
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -76,7 +76,7 @@ local recharge = {
["price"]=9.99,
["price_cn"]=68,
["same_price"]=10,
["price_str"]="9.99",
["price_str"]="$9.99",
["score"]=10
},
[11]={
@ -84,7 +84,7 @@ local recharge = {
["price"]=11.99,
["price_cn"]=78,
["same_price"]=12,
["price_str"]="11.99",
["price_str"]="$11.99",
["score"]=12
},
[12]={
@ -148,7 +148,7 @@ local recharge = {
["price"]=199.99,
["price_cn"]=1298,
["same_price"]=200,
["price_str"]="199.99",
["price_str"]="$199.99",
["score"]=200
}
}

View File

@ -0,0 +1,24 @@
local mail = {
[1]={
["name"]="路边老爷爷的馈赠"
},
[2]={
["name"]="国王的日常补给"
},
[3]={
["name"]="哼哼哈嘿",
["desc"]="乐观的人总在不经意间获得意外之喜"
},
[4]={
["name"]="仁者无敌",
["desc"]="心地善良的人,会善有善报的"
},
[5]={
["name"]="风生水起",
["desc"]="精力充沛,运势良好,财运连连"
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 07c0eb9d579311240a0b9b3b1348bb43
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,21 @@
local mail = {
[1]={
},
[2]={
},
[3]={
},
[4]={
},
[5]={
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e26e5e7d841ab3a4c8c21aa4d8ab3a61
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,24 @@
local mail = {
[1]={
["name"]="Bestowal of the Elder"
},
[2]={
["name"]="Daily Allowance of the King"
},
[3]={
["name"]="Hey! See what's inside!",
["desc"]="An optimistic person is always surprised by the unexpected"
},
[4]={
["name"]="To my beloved...",
["desc"]="A good heart will be rewarded with good deeds"
},
[5]={
["name"]="Thrive!",
["desc"]="Good energy, good luck and good fortune"
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 08a7b69c149fe5943a502b8a91b933df
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,24 @@
local mail = {
[1]={
["name"]="Cadeau d'un grand-père au bord de la route"
},
[2]={
["name"]="Approvisionnement quotidien du roi"
},
[3]={
["name"]="Hoho hahé",
["desc"]="Une personne optimiste est toujours surprise par l'inattendu"
},
[4]={
["name"]="Le bienveillant invincible",
["desc"]="Une personne au bon cœur sera récompensée par de bonnes actions"
},
[5]={
["name"]="En plein forme",
["desc"]="Bonne énergie, bonne chance et bonne fortune"
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 71bf6f3e5fdd2b9419cfcbb212c0c5e1
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,21 @@
local mail = {
[1]={
},
[2]={
},
[3]={
},
[4]={
},
[5]={
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 77a44aaa25d3c4c49a24dd0ce83e84ef
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,24 @@
local mail = {
[1]={
["name"]="길 가던 할아버지가 던져 준 선물"
},
[2]={
["name"]="왕의 일상 보급품"
},
[3]={
["name"]="으랏차차!",
["desc"]="낙관적 인 사람은 항상 예상치 못한 것에 놀란다."
},
[4]={
["name"]="자비로운 자는 무적입니다.",
["desc"]="마음이 착한 사람은 선행으로 보상을받을 것입니다."
},
[5]={
["name"]="막힘없이 뻗어나가요!",
["desc"]="좋은 에너지, 행운과 행운"
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e4b1b6fe02323924683bfd93258bf4f0
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -0,0 +1,24 @@
local mail = {
[1]={
["name"]="路邊老爺爺的饋贈"
},
[2]={
["name"]="國王的日常補給"
},
[3]={
["name"]="哼哼哈嘿",
["desc"]="樂觀的人總在不經意間獲得意外之喜"
},
[4]={
["name"]="仁者無敵",
["desc"]="心地善良的人,會善有善報的"
},
[5]={
["name"]="風生水起",
["desc"]="精力充沛,運勢良好,財運連連"
}
}
local config = {
data=mail,count=5
}
return config

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: f0c9c665019032543baa38c9226146f2
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -5,6 +5,7 @@ function BountyManager:showBountyMainUI()
end
function BountyManager:showBountyBuyUI()
DataManager.BountyData:markPopBought()
UIManager:showUI("app/ui/bounty/bounty_buy_ui")
end

View File

@ -1,5 +1,9 @@
local BountyBuyUI = class("BountyBuyUI", BaseUI)
function BountyBuyUI:ctor()
self.endTime = DataManager.BountyData:getEndTime()
end
function BountyBuyUI:isFullScreen()
return false
end
@ -16,17 +20,78 @@ function BountyBuyUI:onLoadRootComplete()
self:closeUI()
end)
local buyBtn = uiMap["bounty_buy_ui.bg.buy_btn"]
self:initTitle()
self:initTime()
self:initRewards()
self:initBtns()
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
end
function BountyBuyUI:initTitle()
self.uiMap["bounty_buy_ui.bg.title_tx"]:setText("临时文本:黄金通行证")
end
function BountyBuyUI:initTime()
self.timeTx = self.uiMap["bounty_buy_ui.bg.time_tx"]
end
function BountyBuyUI:initRewards()
self.uiMap["bounty_buy_ui.bg.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.REWARD_DESC))
local preferredWidth = self.uiMap["bounty_buy_ui.bg.desc_tx"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
self.uiMap["bounty_buy_ui.bg.left_arrow"]:setAnchoredPositionX(-30 - preferredWidth/2)
self.uiMap["bounty_buy_ui.bg.right_arrow"]:setAnchoredPositionX(30 + preferredWidth/2)
local list = DataManager.BountyData:getAllProRewards()
for i = 1, 10 do
local cell = self.uiMap["bounty_buy_ui.bg.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
if list[i] then
cell:setVisible(true, 0.7)
cell:refreshByConfig(list[i])
else
cell:setVisible(false)
end
end
end
function BountyBuyUI:initBtns()
self.uiMap["bounty_buy_ui.bg.name_1"]:setText("临时文本:黄金通行证")
self.uiMap["bounty_buy_ui.bg.name_2"]:setText("临时文本:黄金通行证")
self.uiMap["bounty_buy_ui.bg.desc_tx_1"]:setText("临时文本:解锁奖励和奖励任务")
self.uiMap["bounty_buy_ui.bg.desc_tx_2"]:setText("临时文本:获得高级通行证,+10级立即获得更多奖励")
local rechargeId = DataManager.BountyData:getRechargeId(false)
self.uiMap["bounty_buy_ui.bg.buy_btn.tx"]:setText(GFunc.getFormatPrice(rechargeId))
local proRechargeId = DataManager.BountyData:getRechargeId(true)
self.uiMap["bounty_buy_ui.bg.buy_btn_advanced.tx"]:setText(GFunc.getFormatPrice(proRechargeId))
local buyBtn = self.uiMap["bounty_buy_ui.bg.buy_btn"]
buyBtn:addClickListener(function()
self:closeUI()
ModuleManager.BountyManager:buyBounty(false)
end)
local buyBtnAdvanced = uiMap["bounty_buy_ui.bg.buy_btn_advanced"]
local buyBtnAdvanced = self.uiMap["bounty_buy_ui.bg.buy_btn_advanced"]
buyBtnAdvanced:addClickListener(function()
self:closeUI()
ModuleManager.BountyManager:buyBounty(true)
end)
end
function BountyBuyUI:onRefresh()
end
function BountyBuyUI:updateTime()
local remainTime = self.endTime - Time:getServerTime()
if remainTime < 0 then
UIManager:closeUnderUI(self)
return self:closeUI()
end
self.timeTx:setText(GFunc.getTimeStr(remainTime))
end
return BountyBuyUI

View File

@ -49,6 +49,11 @@ function BountyMainUI:onLoadRootComplete()
self:initRewards()
self:bindData()
-- 没有购买通行证的话,每日首次打开战令界面主动弹通行证购买弹窗
if DataManager.BountyData:getIsPopBought() then
ModuleManager.BountyManager:showBountyBuyUI()
end
self:scheduleGlobal(function()
self:updateTime()
end, 1)

View File

@ -17,6 +17,7 @@ function BountyData:init(data)
self.level = data.level or 1
self.exp = data.exp or 0
self.bought = data.bought
self.popBoughtTime = LocalData:getBountyPopTime()
self.claimed = data.claimed or {}
self.claimedCount = 0
for k, v in pairs(self.claimed) do
@ -57,6 +58,11 @@ function BountyData:initBountyLevelCfg()
table.remove(self.bountyLevelCfg)
end
end
if self.proRewards then
for i = 1, #self.proRewards do
table.remove(self.proRewards)
end
end
local cfg = ConfigManager:getConfig("bounty_level")
for k, v in pairs(cfg) do
if v.season == self.season then
@ -162,6 +168,33 @@ function BountyData:getMaxLevel()
return #self.bountyLevelCfg
end
function BountyData:getBountyLevelCfg()
return self.bountyLevelCfg
end
function BountyData:getAllProRewards()
if self.proRewards and #self.proRewards > 0 then
return self.proRewards
end
local rewards = {}
for i = 1, #self.bountyLevelCfg do
local cfg = self.bountyLevelCfg[i]
if cfg.reward_pro then
table.insert(rewards, cfg.reward_pro)
end
end
self.proRewards = GFunc.mergeRewards(rewards)
local cfg = ConfigManager:getConfig("item")
table.sort(self.proRewards, function(a, b)
if cfg[a.id].type == cfg[b.id].type then
return a.id > b.id
else
return cfg[a.id].type > cfg[b.id].type
end
end)
return self.proRewards
end
function BountyData:getLevelState(lv)
return self.claimed[lv]
end
@ -283,4 +316,31 @@ function BountyData:getExpItemIcon()
return info.icon
end
function BountyData:getIsPopBought()
if not self:getIsOpen() then
return false
end
if self.bought then
return false
end
return self.popBoughtTime < Time:getBeginningOfServerToday()
end
function BountyData:markPopBought()
if self.popBoughtTime >= Time:getBeginningOfServerToday() then
return
end
self.popBoughtTime = Time:getBeginningOfServerToday()
LocalData:setBountyPopTime(self.popBoughtTime)
end
function BountyData:getRechargeId(advanced)
local cfg = ConfigManager:getConfig("act_gift")
local id = self:getGiftId(advanced)
if cfg[id] then
return cfg[id].recharge_id
end
return 0
end
return BountyData