This commit is contained in:
puxuan 2025-09-25 11:40:28 +08:00
parent 56936f582b
commit 35059a2f70
116 changed files with 11447 additions and 3156 deletions

View File

@ -29,7 +29,6 @@ function DataManager:init()
self:initManager("TaskData", "app/userdata/task/task_data")
self:initManager("DailyTaskData", "app/userdata/task/daily_task_data")
self:initManager("IdleData", "app/userdata/idle/idle_data")
self:initManager("GrowthFundData", "app/userdata/fund/growth_fund_data")
self:initManager("SevenDayData", "app/userdata/activity/seven_day/seven_day_data")
self:initManager("ShopData", "app/userdata/shop/shop_data")
self:initManager("SummonData", "app/userdata/summon/summon_data")
@ -44,6 +43,11 @@ function DataManager:init()
self:initManager("TalentData", "app/userdata/talent/talent_data")
self:initManager("GiftPopData", "app/userdata/gift_pop/gift_pop_data")
self:initManager("PaymentData", "app/userdata/payment/payment_data")
self:initManager("FundLevelData", "app/userdata/fund_level/fund_level_data")
self:initManager("SignWeekData", "app/userdata/sign/sign_week_data")
self:initManager("SignMonthData", "app/userdata/sign/sign_month_data")
self:initManager("ChapterFundData", "app/userdata/chapter_fund/chapter_fund_data")
end
function DataManager:initManager(name, path)
@ -104,39 +108,9 @@ function DataManager:clear()
self.cacheTimer = nil
end
self.cdCallBack = {}
self.PlayerData:clear()
self.ChapterData:clear()
self.DailyChallengeData:clear()
self.DungeonData:clear()
self.ArenaData:clear()
self.CollectionData:clear()
self.HeroData:clear()
self.BagData:clear()
self.EquipData:clear()
self.SkinData:clear()
self.FormationData:clear()
self.ActivityData:clear()
self.MailData:clear()
self.GoldPigData:clear()
self.BountyData:clear()
self.ArenaBountyData:clear()
self.DailyTaskData:clear()
self.IdleData:clear()
self.GrowthFundData:clear()
self.SevenDayData:clear()
self.ShopData:clear()
self.SummonData:clear()
self.FullMoonData:clear()
self.TournWaveData:clear()
self.TournArenaData:clear()
-- 任务数据最后清理
self.TaskData:clear()
self.AIHelperData:clear()
self.HeroFundData:clear()
self.ActBossRushData:clear()
self.FourteenDayData:clear()
self.ActPvpData:clear()
self.TalentData:clear()
for _, v in pairs(self._cacheManager) do
v:clear()
end
ModuleManager.TaskManager:clear()
self:clearTryOpenFunc()
self.activityBountyLevelMap = nil
@ -180,7 +154,6 @@ function DataManager:initWithServerData(data)
-- 任务要在BountyData之后初始化依赖BountyData的数据
self.DailyTaskData:init(data.task_daily, data.task_achievement)
self.IdleData:init(data.idle)
self.SevenDayData:init(data.seven_day)
self.ShopData:init()
-- self.ShopData:refreshChapterShop(data.mall_chapter)
-- self.ShopData:refreshCoreSoulShop(data.soul)
@ -197,6 +170,11 @@ function DataManager:initWithServerData(data)
-- self.ShopData:initGrowUpGift(data.act_grow_up_gift2) -- 成长礼包
-- self.ShopData:initLevelUpGift(data.act_level_up_gift) -- 助力/金币礼包
-- self.ShopData:initIntroductGift(data.act_introductory_gift) -- 入门礼包
-- 基金
self.FundLevelData:initData(data.fund) -- levelGiftData要放到PaymentData后面因为要处理数据
self.ChapterFundData:initData(data.chapter_fund)
self.SignWeekData:initData(data.sign)
self.SignMonthData:initData(data.sign_30)
-- 活动要在礼包后初始化
self.ActivityData:init()
-- 商店礼包都初始化完了后检查一下每日红点
@ -332,6 +310,7 @@ function DataManager:scheduleGlobal()
end
end
ModuleManager.TaskManager:addTaskProgress(GConst.TaskConst.TASK_TYPE.X_LOGIN_DAY)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CROSS_DAY)
end
end, 1)
end

View File

@ -79,6 +79,8 @@ EventManager.CUSTOM_EVENT = {
FORCE_SUMMON_NEXT_FINISH = "FORCE_SUMMON_NEXT_FINISH",
FORCE_SUMMON_CHECK_PATH = "FORCE_SUMMON_CHECK_PATH",
FORCE_SUMMON_CHECK_PATH_GM = "FORCE_SUMMON_CHECK_PATH_GM",
CROSS_DAY = "CROSS_DAY",-- 跨天
}
-- 此方法不能直接在外部调用请使用例如BaseUIBaseModule等封装好的接口

View File

@ -92,6 +92,12 @@ local MODULE_PATHS = {
BagManager = "app/module/bag/bag_manager",
-- 战力/攻击力toast
PowerToastManager = "app/ui/common/power_toast_manager",
-- 成长基金
FundLevelManager = "app/module/fund_level/fund_level_manager",
-- 关卡基金
FundChapterManager = "app/module/fund_chapter/fund_chapter_manager",
-- 签到
SignManager = "app/module/sign/sign_manager",
}
-- 这里的key对应func_open里的id
@ -107,7 +113,6 @@ ModuleManager.MODULE_KEY = {
MALL = "mall", -- 商城
MALL_DAILY = "mall_daily", -- 每日商城
DAILY_CHALLENGE = "daily_challenge", -- 每日挑战
FUND = "act_level_gift", -- 成长基金
ACT_GIFT_SHOW_OPEN = "act_gift_show_open", -- 弹窗礼包通用开启条件
FIRST_RECHARGE = "first_charge", -- 首充礼包
BEGINNER_GIFT = "new_player_gift", -- 新手礼包
@ -128,8 +133,13 @@ ModuleManager.MODULE_KEY = {
TALENT_OPEN = "talent_open", -- 天赋功能开启条件
DUNGEON_OPEN = "dungeon_open", -- 玩法入口页签开启条件
SUMMON_OPEN = "summon_open", -- 英雄抽卡功能开启条件(包括普通和高级抽)
-- 战力/攻击力toast
PowerToastManager = "app/ui/common/power_toast_manager",
BOUNTY = "bounty",
-- 基金
ACT_LEVEL_GIFT = "act_level_gift", -- 成长基金
CHAPTER_FUND = "fund_chapter", -- 关卡基金
-- 签到
SIGN_BOUNTY = "signin_bounty",
SIGN_MONTH = "signin_30",
}
local _moduleMgrs = {}

2606
lua/app/config/act_level_gift.lua Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 17647bcfe606b834e9aca8d6c64249aa
guid: ce80dee30975f4877bfe3c876f16cbe5
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -0,0 +1,338 @@
local act_month_signin = {
[1]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[2]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
}
},
[3]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[4]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=67,
["id_for_nothing"]="UA8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[5]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[6]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
[7]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["count_reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
[8]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=16,
["id_for_nothing"]="Vw4=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[9]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=67,
["id_for_nothing"]="UA8=",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
[10]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[11]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=3,
["num_for_nothing"]="VQ=="
}
},
[12]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=150,
["num_for_nothing"]="Vw1c"
}
},
[13]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[14]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=67,
["id_for_nothing"]="UA8=",
["num"]=3,
["num_for_nothing"]="VQ=="
},
["count_reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[15]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
[16]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=4,
["num_for_nothing"]="Ug=="
}
},
[17]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
}
},
[18]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=17,
["id_for_nothing"]="Vw8=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[19]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=67,
["id_for_nothing"]="UA8=",
["num"]=4,
["num_for_nothing"]="Ug=="
}
},
[20]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
[21]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=5,
["num_for_nothing"]="Uw=="
},
["count_reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
[22]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=250,
["num_for_nothing"]="VA1c"
}
},
[23]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=49,
["id_for_nothing"]="UgE=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[24]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=67,
["id_for_nothing"]="UA8=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
},
[25]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=3,
["num_for_nothing"]="VQ=="
}
},
[26]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=6,
["num_for_nothing"]="UA=="
}
},
[27]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
}
},
[28]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=49,
["id_for_nothing"]="UgE=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
[29]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=67,
["id_for_nothing"]="UA8=",
["num"]=6,
["num_for_nothing"]="UA=="
}
},
[30]={
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=3,
["num_for_nothing"]="VQ=="
},
["count_reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=19,
["id_for_nothing"]="VwE=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
}
local config = {
data=act_month_signin,count=30
}
return config

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: cb54eb5ca6d0d4fcdbd53a0bd5f8abac
guid: 511ad595efd404f33972f2647e5b5d59
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -0,0 +1,286 @@
local act_week_signin = {
[101]={
["season"]=1,
["day"]=1,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=600,
["num_for_nothing"]="UAhc"
}
},
[102]={
["season"]=1,
["day"]=2,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=20,
["num_for_nothing"]="VAg="
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=4,
["id_for_nothing"]="Ug==",
["num"]=60,
["num_for_nothing"]="UAg="
}
},
[103]={
["season"]=1,
["day"]=3,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=8,
["num_for_nothing"]="Xg=="
}
},
[104]={
["season"]=1,
["day"]=4,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=12,
["id_for_nothing"]="Vwo=",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=12,
["id_for_nothing"]="Vwo=",
["num"]=300,
["num_for_nothing"]="VQhc"
}
},
[105]={
["season"]=1,
["day"]=5,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=600,
["num_for_nothing"]="UAhc"
}
},
[106]={
["season"]=1,
["day"]=6,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=5000,
["num_for_nothing"]="UwhcAw=="
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=1,
["id_for_nothing"]="Vw==",
["num"]=20000,
["num_for_nothing"]="VAhcA2U="
}
},
[107]={
["season"]=1,
["day"]=7,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=2,
["num_for_nothing"]="VA=="
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=8,
["num_for_nothing"]="Xg=="
}
},
[201]={
["season"]=2,
["day"]=1,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
}
},
[202]={
["season"]=2,
["day"]=2,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
},
[203]={
["season"]=2,
["day"]=3,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
}
},
[204]={
["season"]=2,
["day"]=4,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
},
[205]={
["season"]=2,
["day"]=5,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=200,
["num_for_nothing"]="VAhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=2000,
["num_for_nothing"]="VAhcAw=="
}
},
[206]={
["season"]=2,
["day"]=6,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=100,
["num_for_nothing"]="Vwhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
},
[207]={
["season"]=2,
["day"]=7,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=300,
["num_for_nothing"]="VQhc"
},
["reward_pro"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=3000,
["num_for_nothing"]="VQhcAw=="
}
}
}
local config = {
data=act_week_signin,count=14
}
return config

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: aa3c399f1f548114d8da14ef274abaec
guid: 73141c97e37c640d7932768309e31c32
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -491,6 +491,18 @@ local const = {
}
}
},
["act_bounty_buy_cost"]={
["cost"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=50,
["num_for_nothing"]="Uwg="
}
}
},
["dungeon_rune_buylimit"]={
["value"]=5
},
@ -605,6 +617,12 @@ local const = {
["dungeon_gold_times"]={
["value"]=2
},
["bounty_duration"]={
["value"]=30.0
},
["bounty_point"]={
["value"]=1.0
},
["dungeon_res_times"]={
["value"]=2
}

View File

@ -7,12 +7,24 @@ local func_open = {
["stage"]=3,
["pop_ups"]=1
},
["bounty"]={
["stage"]=3,
["pop_ups"]=1
},
["signin_bounty"]={
["stage"]=3,
["pop_ups"]=1
},
["task"]={
["stage"]=3,
["icon"]="module_unlock_task"
},
["act_level_gift"]={
["level"]=999,
["level"]=1,
["icon"]="module_unlock_fund"
},
["fund_chapter"]={
["level"]=1,
["icon"]="module_unlock_fund"
},
["idle_drop"]={

3706
lua/app/config/fund_chapter.lua Executable file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 8dd7055ab84edb943bc20cde80b80559
guid: c8874bc88e9fc468496eb86760de9381
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -753,6 +753,60 @@ local LocalizationGlobalConst =
EQUIP_QLT_SELECT_ALL_2 = "EQUIP_QLT_SELECT_ALL_2",
REBACK_MATERIAL_DESC = "REBACK_MATERIAL_DESC",
DAILY_CHALLENGE_DESC_9 = "DAILY_CHALLENGE_DESC_9",
FIRST_CHARGE_TITLE_1 = "FIRST_CHARGE_TITLE_1",
FIRST_CHARGE_TITLE_2 = "FIRST_CHARGE_TITLE_2",
FIRST_CHARGE_TITLE_3 = "FIRST_CHARGE_TITLE_3",
FIRST_CHARGE_TIPS_1 = "FIRST_CHARGE_TIPS_1",
FIRST_CHARGE_TIPS_2 = "FIRST_CHARGE_TIPS_2",
FIRST_CHARGE_TIPS_3 = "FIRST_CHARGE_TIPS_3",
FIRST_CHARGE_1 = "FIRST_CHARGE_1",
FIRST_CHARGE_2 = "FIRST_CHARGE_2",
FIRST_CHARGE_3 = "FIRST_CHARGE_3",
FIRST_CHARGE_4 = "FIRST_CHARGE_4",
FUND_DESC_1 = "FUND_DESC_1",
FUND_CHAPTER_DESC_1 = "FUND_CHAPTER_DESC_1",
FUND_CHAPTER_DESC_2 = "FUND_CHAPTER_DESC_2",
FUND_CHAPTER_DESC_3 = "FUND_CHAPTER_DESC_3",
FUND_CHAPTER_DESC_4 = "FUND_CHAPTER_DESC_4",
FUND_CHAPTER_DESC_5 = "FUND_CHAPTER_DESC_5",
FUND_CHAPTER_DESC_6 = "FUND_CHAPTER_DESC_6",
FUND_DESC_2 = "FUND_DESC_2",
FUND_DESC_3 = "FUND_DESC_3",
FUND_DESC_4 = "FUND_DESC_4",
FUND_DESC_5 = "FUND_DESC_5",
FUND_DESC_6 = "FUND_DESC_6",
FUND_DESC_7 = "FUND_DESC_7",
FUND_TAG_DESC_1 = "FUND_TAG_DESC_1",
FUND_TAG_DESC_2 = "FUND_TAG_DESC_2",
FUND_TAG_DESC_3 = "FUND_TAG_DESC_3",
FUND_TAG_DESC_4 = "FUND_TAG_DESC_4",
FUND_TAG_DESC_5 = "FUND_TAG_DESC_5",
FUND_TAG_DESC_6 = "FUND_TAG_DESC_6",
FUND_TAG_DESC_7 = "FUND_TAG_DESC_7",
FUND_TAG_DESC_8 = "FUND_TAG_DESC_8",
FUND_TAG_DESC_9 = "FUND_TAG_DESC_9",
FUND_TAG_DESC_10 = "FUND_TAG_DESC_10",
FUND_TAG_DESC_11 = "FUND_TAG_DESC_11",
FUND_TAG_DESC_12 = "FUND_TAG_DESC_12",
FUND_TAG_DESC_13 = "FUND_TAG_DESC_13",
FUND_TAG_DESC_14 = "FUND_TAG_DESC_14",
FUND_TAG_DESC_15 = "FUND_TAG_DESC_15",
CHAPTER_TEAM_DESC_2 = "CHAPTER_TEAM_DESC_2",
ACT_BOUNTY_SIGNIN_DESC_1 = "ACT_BOUNTY_SIGNIN_DESC_1",
ACT_BOUNTY_SIGNIN_DESC_2 = "ACT_BOUNTY_SIGNIN_DESC_2",
ACT_BOUNTY_SIGNIN_DESC_3 = "ACT_BOUNTY_SIGNIN_DESC_3",
ACT_BOUNTY_SIGNIN_DESC_4 = "ACT_BOUNTY_SIGNIN_DESC_4",
ACT_BOUNTY_SIGNIN_DESC_5 = "ACT_BOUNTY_SIGNIN_DESC_5",
ACT_BOUNTY_SIGNIN_DESC_6 = "ACT_BOUNTY_SIGNIN_DESC_6",
ACT_BOUNTY_SIGNIN_DESC_7 = "ACT_BOUNTY_SIGNIN_DESC_7",
ACT_BOUNTY_SIGNIN_DESC_8 = "ACT_BOUNTY_SIGNIN_DESC_8",
ACT_BOUNTY_SIGNIN_DESC_9 = "ACT_BOUNTY_SIGNIN_DESC_9",
ACT_BOUNTY_SIGNIN_DESC_10 = "ACT_BOUNTY_SIGNIN_DESC_10",
ACT_30SIGNIN_1 = "ACT_30SIGNIN_1",
ACT_30SIGNIN_2 = "ACT_30SIGNIN_2",
ACT_30SIGNIN_3 = "ACT_30SIGNIN_3",
ACT_30SIGNIN_4 = "ACT_30SIGNIN_4",
ACT_30SIGNIN_5 = "ACT_30SIGNIN_5",
}
return LocalizationGlobalConst

View File

@ -753,6 +753,59 @@ local localization_global =
["EQUIP_QLT_SELECT_ALL_2"] = "所有部位",
["REBACK_MATERIAL_DESC"] = "分解获得",
["DAILY_CHALLENGE_DESC_9"] = "难度:{0}",
["FIRST_CHARGE_TITLE_1"] = "启程助力",
["FIRST_CHARGE_TITLE_2"] = "特惠臻选",
["FIRST_CHARGE_TITLE_3"] = "超值尊享",
["FIRST_CHARGE_TIPS_1"] = "购买获得强力输出<color=#ff9b59>雷神鼠尔</color>连续3天领好礼",
["FIRST_CHARGE_TIPS_2"] = "购买获得<color=#ff9b59>闪电树懒</color>,解锁电系合体英雄",
["FIRST_CHARGE_TIPS_3"] = "购买获得神话宝物-<color=#ff5d5d>许愿神灯</color>连续3天领好礼。",
["FIRST_CHARGE_1"] = "第{0}天",
["FIRST_CHARGE_2"] = "{0}首充",
["FIRST_CHARGE_3"] = "明日再来",
["FIRST_CHARGE_4"] = "首充",
["FUND_CHAPTER_DESC_1"] = "关卡基金",
["FUND_CHAPTER_DESC_2"] = "购买关卡基金后,可通过<color=#cd341b>通关主线章节</color>获得超值奖励。",
["FUND_CHAPTER_DESC_3"] = "2200%返利比",
["FUND_CHAPTER_DESC_4"] = "通关主线海量奖励",
["FUND_CHAPTER_DESC_5"] = "免费基金",
["FUND_CHAPTER_DESC_6"] = "高级基金",
["FUND_DESC_1"] = "成长基金",
["FUND_DESC_2"] = "购买成长基金后,可通过<color=#cd341b>提升等级</color>获得超值奖励。",
["FUND_DESC_3"] = "2000%返利比",
["FUND_DESC_4"] = "升级获得海量奖励",
["FUND_DESC_5"] = "免费基金",
["FUND_DESC_6"] = "高级基金",
["FUND_TAG_DESC_1"] = "成长基金",
["FUND_TAG_DESC_2"] = "成长基金2",
["FUND_TAG_DESC_3"] = "成长基金3",
["FUND_TAG_DESC_4"] = "成长基金4",
["FUND_TAG_DESC_5"] = "成长基金5",
["FUND_TAG_DESC_6"] = "成长基金6",
["FUND_TAG_DESC_7"] = "成长基金7",
["FUND_TAG_DESC_8"] = "成长基金8",
["FUND_TAG_DESC_9"] = "成长基金9",
["FUND_TAG_DESC_10"] = "成长基金10",
["FUND_TAG_DESC_11"] = "成长基金11",
["FUND_TAG_DESC_12"] = "成长基金12",
["FUND_TAG_DESC_13"] = "成长基金13",
["FUND_TAG_DESC_14"] = "成长基金14",
["FUND_TAG_DESC_15"] = "成长基金15",
["CHAPTER_TEAM_DESC_2"] = "主线关卡",
["ACT_BOUNTY_SIGNIN_DESC_1"] = "7日签到",
["ACT_BOUNTY_SIGNIN_DESC_2"] = "每日签到,领取奖励!",
["ACT_BOUNTY_SIGNIN_DESC_3"] = "返利 1350%",
["ACT_BOUNTY_SIGNIN_DESC_4"] = "签到天数:{0}",
["ACT_BOUNTY_SIGNIN_DESC_5"] = "解锁高级签到奖励!",
["ACT_BOUNTY_SIGNIN_DESC_6"] = "已解锁高级签到奖励!",
["ACT_BOUNTY_SIGNIN_DESC_7"] = "第{0}天",
["ACT_BOUNTY_SIGNIN_DESC_8"] = "签到",
["ACT_BOUNTY_SIGNIN_DESC_9"] = "可补签",
["ACT_BOUNTY_SIGNIN_DESC_10"] = "已签到",
["ACT_30SIGNIN_1"] = "30日签到",
["ACT_30SIGNIN_2"] = "7日签到",
["ACT_30SIGNIN_3"] = "领取完所有奖励后重置",
["ACT_30SIGNIN_4"] = "{0}天累计",
["ACT_30SIGNIN_5"] = "再领一次",
}
return localization_global

View File

@ -57,6 +57,7 @@ function Game:initOther()
BF.exports.LuaComponent = require "app/bf/component/lua_component"
BF.exports.BaseCell = require "app/ui/common/cell/base_cell"
BF.exports.SideBarBaseCell = require "app/ui/main_city/cell/side_bar_base_cell"
BF.exports.VersionCompatible = require "app/common/version_compatible"
BF.exports.Platform = require "app/common/platform"
BF.exports.ConfigManager = require "app/common/config_manager"

View File

@ -27,6 +27,8 @@ local CONST_PATHS = {
FullMoonConst = "app/module/activity/full_moon/full_moon_const",
TournWaveConst = "app/module/activity/tourn_wave/tourn_wave_const",
TournArenaConst = "app/module/activity/tourn_arena/tourn_arena_const",
BountyConst = "app/module/bounty/bounty_const",
SignConst = "app/module/sign/sign_const",
}
if EDITOR_MODE then

View File

@ -507,6 +507,16 @@ function GFunc.getConstReward(key)
return ConstCfg[key].reward[1]
end
--isGetList 为true时返回列表反之返回第一个元素
function GFunc.getConstCost(key, isGetList)
local ConstCfg = ConfigManager:getConfig("const")
if ConstCfg[key] == nil or ConstCfg[key].cost == nil or #ConstCfg[key].cost <= 0 then
return nil
end
return isGetList and ConstCfg[key].cost or ConstCfg[key].cost[1]
end
function GFunc.getTargetAnchoredPosition(targetGo, parent)
local rectTransform = targetGo:getComponent(GConst.TYPEOF_UNITY_CLASS.RECTTRANSFORM)
local rect = rectTransform.rect

View File

@ -0,0 +1,15 @@
local BountyConst = {}
BountyConst.ACT_GIFT_IDS = {
30102,
30202,
}
-- 奖励档位
BountyConst.REWARD_GEAR = {
FREE = 0,
PRO_1 = 1,
PRO_2 = 2,
}
return BountyConst

View File

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

143
lua/app/module/bounty/bounty_manager.lua Normal file → Executable file
View File

@ -1,116 +1,59 @@
local BountyManager = class("BountyManager", BaseModule)
function BountyManager:showBountyMainUI()
UIManager:showUI("app/ui/bounty/bounty_main_ui")
function BountyManager:showMainUI()
end
function BountyManager:showBountyBuyUI()
DataManager.BountyData:markPopBought()
UIManager:showUI("app/ui/bounty/bounty_buy_ui")
end
function BountyManager:claimReward(index, isPro)
local args = {
level = index,
is_pro = isPro,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.BountyRewardReq, args, {}, self.onClaimReward, BIReport.ITEM_GET_TYPE.BOUNTY_REWARD)
end
function BountyManager:onClaimReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.rewards then
-- 读表获取该层奖励 如果是箱子走单独奖励展示接口
local isOneKeyGet = false
local isSpecialBox = false
local index = result.reqData.level
local rewardId
if index == 0 then -- 一键领取
isOneKeyGet = true
else
local isPro = result.reqData.is_pro
local info = DataManager.BountyData:getSeasonInfoByLevel(index)
local rewardType
if info then
local reward = isPro and info.reward_pro or info.reward
rewardType = reward and reward.type
rewardId = reward and reward.id
if rewardType == GConst.REWARD_TYPE.ITEM then
local itemCfgInfo = ConfigManager:getConfig("item")[rewardId]
if itemCfgInfo and itemCfgInfo.type == GConst.ItemConst.ITEM_TYPE.BOX then
isSpecialBox = true
end
end
end
end
if isSpecialBox and not isOneKeyGet then
ModuleManager.ShopManager:showBoxOpenUI({type = GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY, params = rewardId, rewards = result.rewards})
local openType = BIReport.BOX_OPEN_OPEN_TYPE.BOUNTY
BIReport:postBoxOpen(rewardId, BIReport.BOX_OPEN_BOX_TYPE.ACTIVITY, openType, 0, result.rewards)
else
GFunc.showRewardBox(result.rewards)
end
end
if result.reqData.is_pro ~= nil then
local BountyData = DataManager.BountyData
local index = result.reqData.level
if index ~= 0 then
if result.reqData.is_pro then
BountyData:onClaimProReward(result.reqData.level)
else
BountyData:onClaimReward(result.reqData.level)
end
else
BountyData:onOneKeyClaimReward()
end
BIReport:postBountyReward(BountyData:getBountyReportType(), BountyData:getLevel(), BountyData:getExp(), BountyData:getSeason(), result.reqData.level, result.reqData.is_pro)
end
end
end
function BountyManager:buyBountyLevel()
if not DataManager.BountyData:getIfCanBuyLevel() then
-- 领取战令奖励
function BountyManager:reqGetAllRewards()
if not DataManager.BountyData:canGetRewards() then
return
end
local cost = DataManager.BountyData:getBuyBountyLevelCost()
local costId = GFunc.getRewardId(cost)
local costNum = GFunc.getRewardNum(cost)
if not GFunc.checkCost(costId, costNum, true) then
return
end
local params ={
titleTx = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_BUY_LEVEL_TITLE),
content = I18N:getGlobalText(I18N.GlobalConst.BOUNTY_BUY_LEVEL_COUNTENT),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
showToday = GConst.MESSAGE_BOX_SHOW_TODAY.BOUNTY_BUY_LEVEL,
costId = costId,
costNum = costNum,
okFunc = function()
self:sendMessage(ProtoMsgType.FromMsgEnum.BountyLevelUnlockReq, {}, {}, self.onBoughtBountyLevel, BIReport.ITEM_GET_TYPE.BOUNTY_UNLOCK_LEVEL)
end,
}
GFunc.showMessageBox(params)
self:sendMessage(ProtoMsgType.FromMsgEnum.BountyRewardReq, {season = DataManager.BountyData:getSeason()}, self.rspGetAllRewards, BIReport.ITEM_GET_TYPE.BOUNTY_REWARD)
end
function BountyManager:onBoughtBountyLevel(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.BountyData:onBoughtLevel()
end
end
function BountyManager:buyBounty(advanced)
if not DataManager.BountyData:getIsOpen() then
function BountyManager:rspGetAllRewards(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
local params = {
content = I18N:getGlobalText(I18N.GlobalConst.SERVER_DEC_16),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK,
okText = I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_OK),
}
GFunc.showMessageBox(params)
return
end
PayManager:purchasePackage(DataManager.BountyData:getGiftId(advanced), PayManager.PURCHARSE_TYPE.ACT_GIFT)
GFunc.showRewardBox(result.rewards)
DataManager.BountyData:onClaimAllRewards()
BIReport:postBountyOpt(BIReport.BOUNTY_OPT.REWARD)
end
function BountyManager:onBoughtBountyFinish(result)
if result.status == 0 then
DataManager.BountyData:setBought(result.season, result.level)
-- 领取遗留奖励
function BountyManager:reqGetPreviousAllRewards()
if not DataManager.BountyData:canGetPreviousRewards() then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BountyPreviousRewardReq, {}, self.rspGetPreviousAllRewards, BIReport.ITEM_GET_TYPE.BOUNTY_PREVIOUS_REWARD)
end
function BountyManager:rspGetPreviousAllRewards(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
DataManager.BountyData:onGotBountyPreviousReward()
BIReport:postBountyOpt(BIReport.BOUNTY_OPT.REWARD)
end
-- 解锁高级奖励
function BountyManager:onUnlockPro(type)
local id = DataManager.BountyData:getProRewardGiftId(type)
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
function BountyManager:rspBountyBoughtNtf(result)
DataManager.BountyData:onUnlockPro(result.season, result.bought)
end
return BountyManager

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 76093185a33754ea0aa979969327a894
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,43 @@
local FundChapterManager = class("FundChapterManager", BaseModule)
function FundChapterManager:getReward(stage)
if not DataManager.ChapterFundData:canGetRewards(stage) then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterFundClaimedReq, {id = 0, grade = 0, stage = stage}, self.onGetReward, BIReport.ITEM_GET_TYPE.ACT_CHAPTER_FUND_REWARD)
end
function FundChapterManager:onGetReward(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
local currStage = result.reqData.stage
local minId = DataManager.ChapterFundData:getMinUnclaimedRewardIndex(currStage)
local maxId = DataManager.ChapterFundData:getMaxUnclaimedRewardIndex(currStage)
minId = DataManager.ChapterFundData:getConfigIdByIndex(currStage, minId)
maxId = DataManager.ChapterFundData:getConfigIdByIndex(currStage, maxId)
local cur = DataManager.ChapterFundData:getMaxUnclaimedId()
GFunc.showRewardBox(result.rewards)
DataManager.ChapterFundData:initData(result.info)
BIReport:postChapterFund(currStage, minId, maxId, cur, result.rewards)
end
function FundChapterManager:onBuyLevelGift(id)
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
function BIReport:postChapterFund(stage, minId, maxId, curChapter, rewards)
local args = {
opt_type = "Reward",
fund_stage = stage,
min_id = minId,
max_id = maxId,
cur_chapter = curChapter,
reward_str = rewards and GFunc.getRewardsStr(rewards) or nil,
}
self:report(BIReport.EVENT_NAME_CHAPTER_FUND, args)
end
return FundChapterManager

View File

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

View File

@ -17,30 +17,14 @@ MainCityConst.BOTTOM_CLOSE_ICON = {
}
MainCityConst.LEFT_SIDE_BARS = {
-- "app/ui/main_city/cell/side_bar_idle_cell",
-- "app/ui/main_city/cell/side_bar_growth_fund_cell",
-- "app/ui/main_city/cell/side_bar_act_pvp_cell",
-- "app/ui/main_city/cell/side_bar_boss_rush_cell",
-- "app/ui/main_city/cell/side_bar_fourteen_day_cell",
-- "app/ui/main_city/cell/side_bar_hero_fund_cell",
-- "app/ui/main_city/cell/side_bar_seven_days_cell",
-- "app/ui/main_city/cell/side_bar_activity_cell",
-- "app/ui/main_city/cell/side_bar_full_moon_cell",
-- "app/ui/main_city/cell/side_bar_tourn_wave_cell",
-- "app/ui/main_city/cell/side_bar_tourn_arena_cell",
-- gm放最后一个
-- "app/ui/main_city/cell/side_bar_gm_cell"
-- "app/ui/main_city/cell/side_bar_gift_routine_cell", -- 礼包
-- "app/ui/main_city/cell/side_bar_privilege_cell", -- 特权
"app/ui/main_city/cell/side_bar_fund_cell", -- 基金
"app/ui/main_city/cell/side_bar_first_recharge_cell", -- 首充
}
MainCityConst.RIGHT_SIDE_BARS = {
-- "app/ui/main_city/cell/side_bar_gold_pig_cell",
-- "app/ui/main_city/cell/side_bar_first_recharge_cell", 已作废
-- "app/ui/main_city/cell/side_bar_introduct_gift_cell",
-- "app/ui/main_city/cell/side_bar_beginner_gift_cell",
-- "app/ui/main_city/cell/side_bar_discount_cell",
-- "app/ui/main_city/cell/side_bar_weapon_gift_cell",
-- "app/ui/main_city/cell/side_bar_armor_gift_cell",
-- "app/ui/main_city/cell/side_bar_grow_up_gift_cell",
"app/ui/main_city/cell/side_bar_sign_cell", -- 签到
}
return MainCityConst

View File

@ -71,7 +71,6 @@ ShopConst.FUND_SHOW_PAGE = {
BOUNTY = 3,
BOUNTY_COLLECTION = 4,
TOWER_BOUNTY = 5,
BOUNTY_GROWTH = 6,
}
-- 脚本路径
ShopConst.FUND_COMP = {
@ -80,7 +79,6 @@ ShopConst.FUND_COMP = {
[ShopConst.FUND_SHOW_PAGE.BOUNTY] = "app/ui/fund/bounty_comp",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION] = "app/ui/fund/bounty_collection_comp",
[ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY] = "app/ui/fund/tower_bounty_comp",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH] = "app/ui/bounty/bounty_growth_comp",
}
-- 预制体挂载的组件
ShopConst.FUND_COMP_NAME = {
@ -89,7 +87,6 @@ ShopConst.FUND_COMP_NAME = {
[ShopConst.FUND_SHOW_PAGE.BOUNTY] = "fund_main_ui.bounty_comp",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION] = "fund_main_ui.bounty_collection_comp",
[ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY] = "fund_main_ui.tower_bounty_comp",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH] = "fund_main_ui.bounty_growth_comp",
}
-- 动态加载的组件
ShopConst.FUND_COMP_PATH = {
@ -103,7 +100,6 @@ ShopConst.FUND_PAGE_BTN_ICON_ATLAS = {
[ShopConst.FUND_SHOW_PAGE.BOUNTY] = GConst.ATLAS_PATH.UI_ACT_COMMON,
[ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION] = GConst.ATLAS_PATH.UI_ACT_COMMON,
[ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY] = GConst.ATLAS_PATH.UI_ACT_COMMON,
[ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH] = GConst.ATLAS_PATH.UI_ACT_COMMON,
}
ShopConst.FUND_PAGE_BTN_ICON_1 = {
[ShopConst.FUND_SHOW_PAGE.FUND] = "act_common_btn_11_1",
@ -111,7 +107,6 @@ ShopConst.FUND_PAGE_BTN_ICON_1 = {
[ShopConst.FUND_SHOW_PAGE.BOUNTY] = "act_common_btn_5_1",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION] = "act_common_btn_6_1",
[ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY] = "act_common_btn_5_1",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH] = "act_common_btn_18_1",
}
ShopConst.FUND_PAGE_BTN_ICON_2 = {
[ShopConst.FUND_SHOW_PAGE.FUND] = "act_common_btn_11_2",
@ -119,7 +114,6 @@ ShopConst.FUND_PAGE_BTN_ICON_2 = {
[ShopConst.FUND_SHOW_PAGE.BOUNTY] = "act_common_btn_5_2",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION] = "act_common_btn_6_2",
[ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY] = "act_common_btn_5_2",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH] = "act_common_btn_18_2",
}
ShopConst.FUND_PAGE_BTN_DESC = {
[ShopConst.FUND_SHOW_PAGE.FUND] = "FUND_DESC_1",
@ -127,7 +121,6 @@ ShopConst.FUND_PAGE_BTN_DESC = {
[ShopConst.FUND_SHOW_PAGE.BOUNTY] = "BOUNTY_DESC_8",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION] = "COLLECTION_DESC_1",
[ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY] = "TOWER_DESC_1",
[ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH] = "FUND_GROWTH_TAG_DESC_1",
}
ShopConst.CORE_SOUL_TYPE = {

8
lua/app/module/sign.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 96044fcbf66ac42388523c45e0758252
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,65 @@
local SignConst = {}
SignConst.GIFT_ID = {
[1] = 50102,
[2] = 50202,
}
SignConst.REWARD_TYPE = {
FREE = 1,
PRO = 2,
}
SignConst.MONTH_REWARD_TYPE = {
BOX = 1,
SIGN = 2,
}
SignConst.SIGN_SHOW_PAGE = {
WEEK = 1,
MONTH = 2,
}
SignConst.SIGN_STATE = {
CAN_SIGN = 1, -- 可签到
CAN_SIGN_AD = 2, -- 可再次签到
SIGNEDIN = 3, -- 已签到
UNABLE_SIGN = 4, -- 不可签到
}
SignConst.BOX_STATE = {
UNABLE_CLAIM = 0, -- 不能领取
CAN_CLAIM = 1, -- 可以领取
CLAIMED = 2, -- 已经领取
}
SignConst.SIGN_MONTH_SLIDER_RANG ={
{0, 0.135},
{0.305,0.413},
{0.582,0.689},
{0.858,0.969}
}
-- 签到预制体挂载的组件
SignConst.SIGN_COMP = {
[SignConst.SIGN_SHOW_PAGE.WEEK] = "app/ui/sign/comp/sign_week_comp",
[SignConst.SIGN_SHOW_PAGE.MONTH] = "app/ui/sign/comp/sign_month_comp",
}
SignConst.SIGN_COMP_NAME = {
[SignConst.SIGN_SHOW_PAGE.WEEK] = "sign_main_ui.sign_week_comp",
[SignConst.SIGN_SHOW_PAGE.MONTH] = "sign_main_ui.sign_month_comp",
}
SignConst.SIGN_PAGE_BTN_ICON_ATLAS = {
[SignConst.SIGN_SHOW_PAGE.WEEK] = GConst.ATLAS_PATH.UI_ACT_COMMON,
[SignConst.SIGN_SHOW_PAGE.MONTH] = GConst.ATLAS_PATH.UI_ACT_COMMON,
}
SignConst.SIGN_PAGE_BTN_ICON_1 = {
[SignConst.SIGN_SHOW_PAGE.WEEK] = "act_common_btn_8_1",
[SignConst.SIGN_SHOW_PAGE.MONTH] = "act_common_btn_9_1",
}
SignConst.SIGN_PAGE_BTN_ICON_2 = {
[SignConst.SIGN_SHOW_PAGE.WEEK] = "act_common_btn_8_2",
[SignConst.SIGN_SHOW_PAGE.MONTH] = "act_common_btn_9_2",
}
SignConst.SIGN_PAGE_BTN_DESC = {
[SignConst.SIGN_SHOW_PAGE.WEEK] = I18N.GlobalConst.ACT_30SIGNIN_2,
[SignConst.SIGN_SHOW_PAGE.MONTH] = I18N.GlobalConst.ACT_30SIGNIN_1,
}
return SignConst

View File

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

View File

@ -0,0 +1,95 @@
local SignManager = class("SignManager", BaseModule)
-- 领取遗留奖励
function SignManager:reqSignAutoRewardsClaimed()
self:sendMessage(ProtoMsgType.FromMsgEnum.SignAutoRewardsClaimedReq, {}, {}, self.rspSignAutoRewardsClaimed, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_REWARD)
end
function SignManager:rspSignAutoRewardsClaimed(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
if result.rewards and #result.rewards > 0 then
BIReport:postSignBountyOpt(BIReport.SIGN_WEEK_OPT_TYPE.REWARD)
end
end
function SignManager:showSignUI(showPage, onlyShowPage, callback)
local params = {
showPage = showPage,
onlyShowPage = onlyShowPage,
callback = callback
}
UIManager:showUI("app/ui/sign/sign_main_ui", params)
end
-- 签到
function SignManager:reqSignClaimed(day, isAll)
local isUnlock = DataManager.SignWeekData:isUnlockPro(day)
self:sendMessage(ProtoMsgType.FromMsgEnum.SignClaimedReq, {day = day, pay = isUnlock, all = isAll}, self.rspSignClaimed, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_SIGH)
end
function SignManager:rspSignClaimed(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
DataManager.SignWeekData:initData(result.info)
BIReport:postSignBountyOpt(BIReport.SIGN_WEEK_OPT_TYPE.SIGN)
end
-- 补签
function SignManager:reqSignReCheckin(day)
self:sendMessage(ProtoMsgType.FromMsgEnum.SignReCheckinReq, {day = day}, self.rspSignReCheckin, BIReport.ITEM_GET_TYPE.SIGN_BOUNTY_RESIGH)
end
function SignManager:rspSignReCheckin(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
DataManager.SignWeekData:initData(result.info)
BIReport:postSignBountyOpt(BIReport.SIGN_WEEK_OPT_TYPE.RESIGN)
end
function SignManager:reqMonthSign(day)
self:sendMessage(ProtoMsgType.FromMsgEnum.Sign30ClaimReq, {day = day}, self.rspMonthSign, BIReport.ITEM_GET_TYPE.SIGN_MONTH)
end
function SignManager:rspMonthSign(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
BIReport:postSignBountyOpt(BIReport.SIGN_MONTH_OPT_TYPE.SIGN)
GFunc.showRewardBox(result.rewards)
DataManager.SignMonthData:setSignSucceed()
end
function SignManager:reqMonthSignAgain()
self:sendMessage(ProtoMsgType.FromMsgEnum.Sign30ClaimReq, {again = true}, self.rspSignMonthAgain, BIReport.ITEM_GET_TYPE.SIGN_MONTH_AGAIN)
end
function SignManager:rspSignMonthAgain(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
DataManager.SignMonthData:setSignAgainSucceed()
BIReport:postSignBountyOpt(BIReport.SIGN_MONTH_OPT_TYPE.SIGN_AGAIN)
end
function SignManager:reqMonthAccumClaim(day)
self:sendMessage(ProtoMsgType.FromMsgEnum.Sign30AccumClaimReq, {id = day}, self.rspMonthAccumClaim, BIReport.ITEM_GET_TYPE.SIGN_MONTH_ACCUM_CLAIM)
end
function SignManager:rspMonthAccumClaim(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
DataManager.SignMonthData:setAccumClaimSucceed(result.reqData.id)
BIReport:postSignBountyOpt(BIReport.SIGN_MONTH_OPT_TYPE.ACCUM_CLAIM)
end
return SignManager

View File

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

View File

@ -128,8 +128,8 @@ function CommonBoxUI:onRefresh()
cell:addClickListener(function()
self:onClickReward(index)
end)
else
cell:setClickShowTips()
-- else
-- cell:setClickShowTips()
end
end)
end

View File

@ -20,179 +20,144 @@ function BountyCollectionComp:init()
self.btnBuy1 = uiMap["bounty_collection_comp.btns.btn_buy_1"]
self.txBuy1 = uiMap["bounty_collection_comp.btns.btn_buy_1.tx_desc"]
self.pro1_Items = {}
self.pro1_TxCount = {}
self.pro1_ImgIcon = {}
for i = 1, 4 do
local item = uiMap["bounty_collection_comp.top.tips_1.groud.item_" .. i]
local txCount = uiMap["bounty_collection_comp.top.tips_1.groud.item_" .. i .. ".tx_count"]
local imgProg = uiMap["bounty_collection_comp.top.tips_1.groud.item_" .. i .. ".img_prog"]
table.insert(self.pro1_Items, item)
table.insert(self.pro1_TxCount, txCount)
table.insert(self.pro1_ImgIcon, imgProg)
end
-- self.btnBuy1 = uiMap["bounty_collection_comp.btns.btn_buy_1"]
-- self.txBuy1 = uiMap["bounty_collection_comp.btns.btn_buy_1.tx_desc"]
-- self.pro1_Items = {}
-- self.pro1_TxCount = {}
-- self.pro1_ImgIcon = {}
-- for i = 1, 4 do
-- local item = uiMap["bounty_collection_comp.top.tips_1.groud.item_" .. i]
-- local txCount = uiMap["bounty_collection_comp.top.tips_1.groud.item_" .. i .. ".tx_count"]
-- local imgProg = uiMap["bounty_collection_comp.top.tips_1.groud.item_" .. i .. ".img_prog"]
-- table.insert(self.pro1_Items, item)
-- table.insert(self.pro1_TxCount, txCount)
-- table.insert(self.pro1_ImgIcon, imgProg)
-- end
self.btnBuy2 = uiMap["bounty_collection_comp.btns.btn_buy_2"]
self.txBuy2 = uiMap["bounty_collection_comp.btns.btn_buy_2.tx_desc"]
self.pro2_Items = {}
self.pro2_TxCount = {}
self.pro2_ImgIcon = {}
for i = 1, 4 do
local item = uiMap["bounty_collection_comp.top.tips_2.groud.item_" .. i]
local txCount = uiMap["bounty_collection_comp.top.tips_2.groud.item_" .. i .. ".tx_count"]
local imgProg = uiMap["bounty_collection_comp.top.tips_2.groud.item_" .. i .. ".img_prog"]
table.insert(self.pro2_Items, item)
table.insert(self.pro2_TxCount, txCount)
table.insert(self.pro2_ImgIcon, imgProg)
end
-- self.btnBuy2 = uiMap["bounty_collection_comp.btns.btn_buy_2"]
-- self.txBuy2 = uiMap["bounty_collection_comp.btns.btn_buy_2.tx_desc"]
-- self.pro2_Items = {}
-- self.pro2_TxCount = {}
-- self.pro2_ImgIcon = {}
-- for i = 1, 4 do
-- local item = uiMap["bounty_collection_comp.top.tips_2.groud.item_" .. i]
-- local txCount = uiMap["bounty_collection_comp.top.tips_2.groud.item_" .. i .. ".tx_count"]
-- local imgProg = uiMap["bounty_collection_comp.top.tips_2.groud.item_" .. i .. ".img_prog"]
-- table.insert(self.pro2_Items, item)
-- table.insert(self.pro2_TxCount, txCount)
-- table.insert(self.pro2_ImgIcon, imgProg)
-- end
self.txTitle = uiMap["bounty_collection_comp.top.tx_title"]
self.txLevelTips = uiMap["bounty_collection_comp.top.level_node.content.tx_level_tips"]
self.txLevel = uiMap["bounty_collection_comp.scrollrect.title.tx_level"]
self.txCommon = uiMap["bounty_collection_comp.scrollrect.title.tx_common"]
self.txPro1 = uiMap["bounty_collection_comp.scrollrect.title.tx_pro_1"]
self.txPro2 = uiMap["bounty_collection_comp.scrollrect.title.tx_pro_2"]
self.txTips1 = uiMap["bounty_collection_comp.top.tips.tx_tips1"]
self.txTips2 = uiMap["bounty_collection_comp.top.btn_buy_2.tips_2.tx_tips"]
self.txDescInfo1 = uiMap["bounty_collection_comp.top.btn_buy_1.img.tx_desc_info"]
self.txDescInfo2 = uiMap["bounty_collection_comp.top.btn_buy_2.img.tx_desc_info"]
-- self.txTitle = uiMap["bounty_collection_comp.top.tx_title"]
-- self.txLevelTips = uiMap["bounty_collection_comp.top.level_node.content.tx_level_tips"]
-- self.txLevel = uiMap["bounty_collection_comp.scrollrect.title.tx_level"]
-- self.txCommon = uiMap["bounty_collection_comp.scrollrect.title.tx_common"]
-- self.txPro1 = uiMap["bounty_collection_comp.scrollrect.title.tx_pro_1"]
-- self.txPro2 = uiMap["bounty_collection_comp.scrollrect.title.tx_pro_2"]
-- self.txTips1 = uiMap["bounty_collection_comp.top.tips.tx_tips1"]
-- self.txTips2 = uiMap["bounty_collection_comp.top.btn_buy_2.tips_2.tx_tips"]
-- self.txDescInfo1 = uiMap["bounty_collection_comp.top.btn_buy_1.img.tx_desc_info"]
-- self.txDescInfo2 = uiMap["bounty_collection_comp.top.btn_buy_2.img.tx_desc_info"]
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_26))
self.txLevelTips:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_28))
self.txLevel:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_5))
self.txCommon:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_5))
self.txPro1:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_6))
self.txPro2:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_7))
self.txTips1:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_29))
self.txTips2:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_29))
self.txDescInfo1:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_30))
self.txDescInfo2:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_31))
-- self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_26))
-- self.txLevelTips:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_28))
-- self.txLevel:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_5))
-- self.txCommon:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_5))
-- self.txPro1:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_6))
-- self.txPro2:setText(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_7))
-- self.txTips1:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_29))
-- self.txTips2:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_29))
-- self.txDescInfo1:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_30))
-- self.txDescInfo2:setText(I18N:getGlobalText(I18N.GlobalConst.FORCE_DESC_31))
local cfg = DataManager.BagData:getRecoveryCfg(GConst.ItemConst.ITEM_ID_CHALLENGE_TEAM)
local add = cfg and cfg.bounty or 0
-- local cfg = DataManager.BagData:getRecoveryCfg(GConst.ItemConst.ITEM_ID_CHALLENGE_TEAM)
-- local add = cfg and cfg.bounty or 0
self.btnBuy1:addClickListener(function()
ModuleManager.ShopManager:showFundRewardUI({
txTitle = "提升等级,领取超值豪礼",
giftIds = DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1),
rewards = DataManager.BountyCollectionData:getAllRewards(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1),
func = function()
ModuleManager.CollectionManager:onUnlockPro(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1)
end,
})
end)
self.btnBuy2:addClickListener(function()
ModuleManager.ShopManager:showFundRewardUI({
txTitle = "提升等级,领取超值豪礼",
giftIds = DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2),
rewards = DataManager.BountyCollectionData:getAllRewards(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2),
func = function()
ModuleManager.CollectionManager:onUnlockPro(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2)
end,
})
end)
self.btnGet:addClickListener(function()
ModuleManager.CollectionManager:reqGetAllRewards()
end)
self.btnHelp:addClickListener(function()
-- ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_9), self.btnHelp)
end)
self:bind(DataManager.BountyCollectionData, "isDirty", function()
self:refresh()
end)
-- self.btnBuy1:addClickListener(function()
-- ModuleManager.ShopManager:showFundRewardUI({
-- txTitle = "提升等级,领取超值豪礼",
-- giftIds = DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1),
-- rewards = DataManager.BountyCollectionData:getAllRewards(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1),
-- func = function()
-- ModuleManager.CollectionManager:onUnlockPro(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1)
-- end,
-- })
-- end)
-- self.btnBuy2:addClickListener(function()
-- ModuleManager.ShopManager:showFundRewardUI({
-- txTitle = "提升等级,领取超值豪礼",
-- giftIds = DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2),
-- rewards = DataManager.BountyCollectionData:getAllRewards(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2),
-- func = function()
-- ModuleManager.CollectionManager:onUnlockPro(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2)
-- end,
-- })
-- end)
-- self.btnGet:addClickListener(function()
-- ModuleManager.CollectionManager:reqGetAllRewards()
-- end)
-- self.btnHelp:addClickListener(function()
-- -- ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.BOUNTY_DESC_9), self.btnHelp)
-- end)
-- self:bind(DataManager.BountyCollectionData, "isDirty", function()
-- self:refresh()
-- end)
self:updateTime()
local meshProComp = self.txTime:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
self.timeBg:setSizeDeltaX(meshProComp + 55)
-- self:updateTime()
-- local meshProComp = self.txTime:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
-- self.timeBg:setSizeDeltaX(meshProComp + 55)
end
function BountyCollectionComp:updateTime()
self.txTime:setText(I18N:getGlobalText(I18N.GlobalConst.NEXT_REFRESH_DESC, Time:formatNumTimeStr(DataManager.BountyCollectionData:getRemainTime())))
-- self.txTime:setText(I18N:getGlobalText(I18N.GlobalConst.NEXT_REFRESH_DESC, Time:formatNumTimeStr(DataManager.BountyCollectionData:getRemainTime())))
end
function BountyCollectionComp:refresh()
local lv = DataManager.BountyCollectionData:getLevel()
local exp = DataManager.BountyCollectionData:getExp()
local maxLv = DataManager.BountyCollectionData:getMaxLv()
if lv >= maxLv then
exp = 0
lv = maxLv
end
self.txLv:setText(lv)
local curExp = exp
local fullExp = DataManager.BountyCollectionData:getLvUpExp()
self.txProg:setText(curExp .. "/" .. fullExp)
self.imgProg.value = curExp / fullExp
-- local lv = DataManager.BountyCollectionData:getLevel()
-- local exp = DataManager.BountyCollectionData:getExp()
-- local maxLv = DataManager.BountyCollectionData:getMaxLv()
-- if lv >= maxLv then
-- exp = 0
-- lv = maxLv
-- end
-- self.txLv:setText(lv)
-- local curExp = exp
-- local fullExp = DataManager.BountyCollectionData:getLvUpExp()
-- self.txProg:setText(curExp .. "/" .. fullExp)
-- self.imgProg.value = curExp / fullExp
local gift1 = ConfigManager:getConfig("act_gift")[DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1)]
local gift2 = ConfigManager:getConfig("act_gift")[DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2)]
self.txBuy1:setText(GFunc.getFormatPrice(gift1.recharge_id))
self.txBuy2:setText(GFunc.getFormatPrice(gift2.recharge_id))
self.txPro:setText(gift2.value .. "%")
-- local gift1 = ConfigManager:getConfig("act_gift")[DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1)]
-- local gift2 = ConfigManager:getConfig("act_gift")[DataManager.BountyCollectionData:getProRewardGiftId(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2)]
-- self.txBuy1:setText(GFunc.getFormatPrice(gift1.recharge_id))
-- self.txBuy2:setText(GFunc.getFormatPrice(gift2.recharge_id))
-- self.txPro:setText(gift2.value .. "%")
self.btnGet:setActive(DataManager.BountyCollectionData:canGetRewards())
self.btnBuy1:setActive(not DataManager.BountyCollectionData:isUnlockReward(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1))
self.btnBuy2:setActive(not DataManager.BountyCollectionData:isUnlockReward(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2))
-- self.btnGet:setActive(DataManager.BountyCollectionData:canGetRewards())
-- self.btnBuy1:setActive(not DataManager.BountyCollectionData:isUnlockReward(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1))
-- self.btnBuy2:setActive(not DataManager.BountyCollectionData:isUnlockReward(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2))
if self.scrollRect == nil then
self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRect:addInitCallback(function()
return CELL
end)
self.scrollRect:addRefreshCallback(function(index, cell)
cell:refresh(index)
end)
end
local count = DataManager.BountyCollectionData:getMaxLv()
if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then
self.scrollRect:refillCells(count)
elseif self.scrollRect:getTotalCount() ~= count then
self.scrollRect:clearCells()
self.scrollRect:refillCells(count)
else
self.scrollRect:updateAllCell()
end
self.scrollRect:moveToIndex(DataManager.BountyCollectionData:getMoveIdx())
-- local rewards = DataManager.BountyCollectionData:getAllRewards(GConst.BountyCollectionConst.REWARD_GEAR.PRO_1)
-- for i,v in ipairs(self.pro1_Items) do
-- v:setActive(false)
-- if self.scrollRect == nil then
-- self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
-- self.scrollRect:addInitCallback(function()
-- return CELL
-- end)
-- self.scrollRect:addRefreshCallback(function(index, cell)
-- cell:refresh(index)
-- end)
-- end
-- local index = 0
-- for id, reward in pairs(rewards) do
-- index = index + 1
-- local item = self.pro1_Items[index]
-- local txCount = self.pro1_TxCount[index]
-- local imgProg = self.pro1_ImgIcon[index]
-- if reward then
-- item:setActive(true)
-- local itemNum = reward.num or 0
-- imgProg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, ModuleManager.ItemManager:getItemIcon(id))
-- txCount:setText(itemNum)
-- end
-- end
-- rewards = DataManager.BountyCollectionData:getAllRewards(GConst.BountyCollectionConst.REWARD_GEAR.PRO_2)
-- for i,v in ipairs(self.pro2_Items) do
-- v:setActive(false)
-- end
-- index = 0
-- for id, reward in pairs(rewards) do
-- index = index + 1
-- local item = self.pro2_Items[index]
-- local txCount = self.pro2_TxCount[index]
-- local imgProg = self.pro2_ImgIcon[index]
-- if reward then
-- item:setActive(true)
-- local itemNum = reward.num or 0
-- imgProg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, ModuleManager.ItemManager:getItemIcon(id))
-- txCount:setText(itemNum)
-- end
-- end
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.BOUNTY_COLLECTION)
-- local count = DataManager.BountyCollectionData:getMaxLv()
-- if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then
-- self.scrollRect:refillCells(count)
-- elseif self.scrollRect:getTotalCount() ~= count then
-- self.scrollRect:clearCells()
-- self.scrollRect:refillCells(count)
-- else
-- self.scrollRect:updateAllCell()
-- end
-- self.scrollRect:moveToIndex(DataManager.BountyCollectionData:getMoveIdx())
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.BOUNTY_COLLECTION)
end
return BountyCollectionComp

View File

@ -0,0 +1,96 @@
local FundChapterCell = class("FundChapterCell", BaseCell)
function FundChapterCell:init()
local uiMap = self:getUIMap()
self.progNode = uiMap["fund_chapter_cell.prog"]
self.imgProg = uiMap["fund_chapter_cell.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.lvNode = uiMap["fund_chapter_cell.level"]
self.txLv = uiMap["fund_chapter_cell.level.tx_lv"]
self.freeRewardCells = {}
for i = 1, 2 do
table.insert(self.freeRewardCells, uiMap["fund_chapter_cell.rewards_free.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.proRewardCells = {}
for i = 1, 2 do
table.insert(self.proRewardCells, uiMap["fund_chapter_cell.rewards_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.colorLight = BF.Color(0.6235294, 0.3137255, 0.1764706, 1)
self.colorGray = BF.Color(0.3568628, 0.3568628, 0.3568628, 1)
end
function FundChapterCell:refresh(id, isLast)
-- 刷新进度
local helf = self:getBaseObject():getSizeDeltaY() / 2
if self:getIndex() == 1 then
self.progNode:setAnchoredPositionY(-helf / 2)
self.progNode:setSizeDeltaY(helf)
elseif isLast then
self.progNode:setAnchoredPositionY(helf / 2)
self.progNode:setSizeDeltaY(helf)
else
self.progNode:setAnchoredPositionY(0)
self.progNode:setSizeDeltaY(self:getBaseObject():getSizeDeltaY())
end
local needChapter = DataManager.ChapterFundData:getNeedChapter(id)
local chapterId = DataManager.ChapterData:getChapterPage(needChapter)
local stageNum = DataManager.ChapterData:getChapterStage(needChapter)
local stage = DataManager.ChapterFundData:getStageById(id)
local value = DataManager.ChapterData:getChapterPassed(needChapter) and 1 or 0
self.imgProg.value = value
self.txLv:setText(chapterId .. "-" .. stageNum)
if value == 1 then
self.lvNode:setSprite(GConst.ATLAS_PATH.UI_CHAPTER_FUND, "fund_chapter_bg_2")
self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorLight
else
self.lvNode:setSprite(GConst.ATLAS_PATH.UI_CHAPTER_FUND, "fund_chapter_bg_3")
self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorGray
end
local freeRewards = DataManager.ChapterFundData:getFreeRewards(id)
local freeReceived = DataManager.ChapterFundData:getFreeGot(id)
local canGet = DataManager.ChapterFundData:getFreeCanGet(id)
for i, cell in ipairs(self.freeRewardCells) do
if freeRewards and freeRewards[i] then
cell:setActive(true)
cell:refreshByConfig(freeRewards[i], freeReceived, freeReceived)
if canGet then
cell:addClickListener(function()
ModuleManager.FundChapterManager:getReward(stage)
end)
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:setActive(false)
end
end
local proRewards = DataManager.ChapterFundData:getProRewards(id)
local proReceived = DataManager.ChapterFundData:getProGot(id)
local locked = not DataManager.ChapterFundData:getProBought(stage)
local canGet = DataManager.ChapterFundData:getProCanGet(id)
for i, cell in ipairs(self.proRewardCells) do
if proRewards and proRewards[i] then
cell:setActive(true)
cell:refreshByConfig(proRewards[i], proReceived, proReceived)
cell:showLock(locked)
if canGet then
cell:addClickListener(function()
ModuleManager.FundChapterManager:getReward(stage)
end)
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:setActive(false)
end
end
end
return FundChapterCell

View File

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

View File

@ -0,0 +1,91 @@
local FundLevelCell = class("FundLevelCell", BaseCell)
function FundLevelCell:init()
local uiMap = self:getUIMap()
self.progNode = uiMap["fund_level_cell.prog"]
self.imgProg = uiMap["fund_level_cell.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.lvNode = uiMap["fund_level_cell.level"]
self.txLv = uiMap["fund_level_cell.level.tx_lv"]
self.freeRewardCells = {}
for i = 1, 2 do
table.insert(self.freeRewardCells, uiMap["fund_level_cell.rewards_free.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.proRewardCells = {}
for i = 1, 2 do
table.insert(self.proRewardCells, uiMap["fund_level_cell.rewards_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.colorLight = BF.Color(0.6235294, 0.3137255, 0.1764706, 1)
self.colorGray = BF.Color(0.3568628, 0.3568628, 0.3568628, 1)
end
function FundLevelCell:refresh(id, isLast)
-- 刷新进度
local helf = self:getBaseObject():getSizeDeltaY() / 2
if self:getIndex() == 1 then
self.progNode:setAnchoredPositionY(-helf / 2)
self.progNode:setSizeDeltaY(helf)
elseif isLast then
self.progNode:setAnchoredPositionY(helf / 2)
self.progNode:setSizeDeltaY(helf)
else
self.progNode:setAnchoredPositionY(0)
self.progNode:setSizeDeltaY(self:getBaseObject():getSizeDeltaY())
end
local needLevel = DataManager.FundLevelData:getNeedLevel(id)
local stage = DataManager.FundLevelData:getStageById(id)
local value = DataManager.PlayerData:getLv() >= needLevel and 1 or 0
self.imgProg.value = value
self.txLv:setText(needLevel)
if value == 1 then
self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorLight
else
self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorGray
end
local freeRewards = DataManager.FundLevelData:getFreeRewards(id)
local freeReceived = DataManager.FundLevelData:getFreeGot(id)
local canGet = DataManager.FundLevelData:getFreeCanGet(id)
for i, cell in ipairs(self.freeRewardCells) do
if freeRewards and freeRewards[i] then
cell:setActive(true)
cell:refreshByConfig(freeRewards[i], freeReceived, freeReceived)
if canGet then
cell:addClickListener(function()
ModuleManager.FundLevelManager:getReward(stage)
end)
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:setActive(false)
end
end
local proRewards = DataManager.FundLevelData:getProRewards(id)
local proReceived = DataManager.FundLevelData:getProGot(id)
local locked = not DataManager.FundLevelData:getProBought(stage)
local canGet = DataManager.FundLevelData:getProCanGet(id)
for i, cell in ipairs(self.proRewardCells) do
if proRewards and proRewards[i] then
cell:setActive(true)
cell:refreshByConfig(proRewards[i], proReceived, proReceived)
cell:showLock(locked)
if canGet then
cell:addClickListener(function()
ModuleManager.FundLevelManager:getReward(stage)
end)
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:setActive(false)
end
end
end
return FundLevelCell

View File

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

View File

@ -1,95 +0,0 @@
local FundTowerCell = class("FundTowerCell", BaseCell)
function FundTowerCell:init()
local uiMap = self:getUIMap()
self.progNode = uiMap["fund_tower_cell.prog"]
self.imgProg = uiMap["fund_tower_cell.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.lvNode = uiMap["fund_tower_cell.level"]
self.txLv = uiMap["fund_tower_cell.level.tx_lv"]
self.freeRewardCells = {}
for i = 1, 2 do
table.insert(self.freeRewardCells, uiMap["fund_tower_cell.rewards_free.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.proRewardCells = {}
for i = 1, 2 do
table.insert(self.proRewardCells, uiMap["fund_tower_cell.rewards_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.colorLight = BF.Color(0.6235294, 0.3137255, 0.1764706, 1)
self.colorGray = BF.Color(0.3568628, 0.3568628, 0.3568628, 1)
end
function FundTowerCell:refresh(index, id, isLast)
-- 刷新进度
local helf = self:getBaseObject():getSizeDeltaY() / 2
if self:getIndex() == 1 then
self.progNode:setAnchoredPositionY(-helf / 2)
self.progNode:setSizeDeltaY(helf)
elseif isLast then
self.progNode:setAnchoredPositionY(helf / 2)
self.progNode:setSizeDeltaY(helf)
else
self.progNode:setAnchoredPositionY(0)
self.progNode:setSizeDeltaY(self:getBaseObject():getSizeDeltaY())
end
local needChapter = DataManager.TowerFundData:getNeedChapter(id)
local stage = DataManager.TowerFundData:getStageById(id)
local curLayer = DataManager.TowerData:getCurMaxLayer()
self.txLv:setText(needChapter)
if curLayer >= needChapter then
self.imgProg.value = 1
self.lvNode:setSprite(GConst.ATLAS_PATH.UI_TOUWE, "tower_dec_2")
-- self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorLight
else
self.imgProg.value = 0
self.lvNode:setSprite(GConst.ATLAS_PATH.UI_TOUWE, "tower_dec_3")
-- self.txLv:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).color = self.colorGray
end
local freeRewards = DataManager.TowerFundData:getFreeRewards(id)
local freeReceived = DataManager.TowerFundData:getFreeGot(id)
local canGet = DataManager.TowerFundData:getFreeCanGet(id)
for i, cell in ipairs(self.freeRewardCells) do
if freeRewards and freeRewards[i] then
cell:showCell()
cell:refreshByConfig(freeRewards[i], freeReceived, freeReceived)
if canGet then
cell:addClickListener(function()
ModuleManager.FundTowerManager:getReward(stage)
end)
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:hideCell()
end
end
local proRewards = DataManager.TowerFundData:getProRewards(id)
local proReceived = DataManager.TowerFundData:getProGot(id)
local locked = not DataManager.TowerFundData:getProBought(stage)
local canGet = DataManager.TowerFundData:getProCanGet(id)
for i, cell in ipairs(self.proRewardCells) do
if proRewards and proRewards[i] then
cell:showCell()
cell:refreshByConfig(proRewards[i], proReceived, proReceived)
cell:showLock(locked)
if canGet then
cell:addClickListener(function()
ModuleManager.FundTowerManager:getReward(stage)
end)
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:hideCell()
end
end
end
return FundTowerCell

View File

@ -1,6 +1,6 @@
local FundChapterComp = class("FundChapterComp", LuaComponent)
local CELL = "app/ui/privilege/cell/fund_chapter_cell"
local CELL = "app/ui/fund/cell/fund_chapter_cell"
local TAG_COMMON_TOTAL_SIZE = 640
local TAG_SIZE = 178
@ -31,7 +31,14 @@ function FundChapterComp:init()
self.tags = {}
self.tagImgs = {}
self.tagDescs = {}
for i = 1, 20 do
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_CHAPTER_DESC_1))
self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_CHAPTER_DESC_3))
self.txDesc2:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_CHAPTER_DESC_4))
self.txLevel:setText(I18N:getGlobalText(I18N.GlobalConst.CHAPTER_TEAM_DESC_2))
self.txCommon:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_CHAPTER_DESC_5))
self.txPro:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_CHAPTER_DESC_6))
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.ONE_KEY_GET_DESC))
for i = 1, 20 do
table.insert(self.tags, uiMap["fund_chapter_comp.tags.viewport.content.tag_" .. i])
table.insert(self.tagImgs, uiMap["fund_chapter_comp.tags.viewport.content.tag_" .. i .. ".img"])
table.insert(self.tagDescs, uiMap["fund_chapter_comp.tags.viewport.content.tag_" .. i .. ".img.tx_desc"])
@ -132,7 +139,7 @@ function FundChapterComp:refresh(isAuto)
end
self.scrollRect:moveToIndex(self.minIndex)
if self.curStage then
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.FUND_LEVEL .. self.curStage)
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.FUND_LEVEL .. self.curStage)
end
end

View File

@ -1,6 +1,6 @@
local FundLevelComp = class("FundLevelComp", LuaComponent)
local CELL = "app/ui/privilege/cell/fund_level_cell"
local CELL = "app/ui/fund/cell/fund_level_cell"
local TAG_COMMON_TOTAL_SIZE = 640
local TAG_SIZE = 178
@ -45,7 +45,7 @@ function FundLevelComp:init()
self.txLevel:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_5))
self.txCommon:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_DESC_5))
self.txPro:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_DESC_6))
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CLAIMALL))
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM_ALL))
self.btnBuy:addClickListener(function()
local giftId = DataManager.FundLevelData:getProActId(self.curStage)
@ -144,7 +144,7 @@ function FundLevelComp:refresh(isAuto)
self.scrollRect:moveToIndex(self.minIndex)
if self.curStage then
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.FUND_CHAPTER .. self.curStage)
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.FUND_CHAPTER .. self.curStage)
end
local count = 0
for i,id in ipairs(self.cfgList) do

View File

@ -85,21 +85,21 @@ function FundMainUI:onLoadRootComplete()
end
self:onRefresh()
end)
self:bind(DataManager.BountyData, "isDirty", function()
self:refreshRedPoint()
end)
self:bind(DataManager.BountyCollectionData, "isDirty", function()
self:refreshRedPoint()
end)
self:bind(DataManager.TowerData, "isDirty", function()
self:onRefresh()
end)
self:bind(DataManager.TowerFundData, "isDirty", function()
self:onRefresh()
end)
self:bind(DataManager.BountyGrowthData, "isDirty", function()
self:onRefresh()
end)
-- self:bind(DataManager.BountyData, "isDirty", function()
-- self:refreshRedPoint()
-- end)
-- self:bind(DataManager.BountyCollectionData, "isDirty", function()
-- self:refreshRedPoint()
-- end)
-- self:bind(DataManager.TowerData, "isDirty", function()
-- self:onRefresh()
-- end)
-- self:bind(DataManager.TowerFundData, "isDirty", function()
-- self:onRefresh()
-- end)
-- self:bind(DataManager.BountyGrowthData, "isDirty", function()
-- self:onRefresh()
-- end)
self:bind(DataManager.PaymentData, "isDirty", function()
self:onRefresh()
end)
@ -116,7 +116,7 @@ function FundMainUI:initComps()
if GConst.ShopConst.FUND_COMP_NAME[id] then
-- 预制体挂载
local obj = uiMap[GConst.ShopConst.FUND_COMP_NAME[id]]
self:initGlobalHelp(obj)
-- self:initGlobalHelp(obj)
obj:initPrefabHelper()
obj:genAllChildren()
local comp = obj:addLuaComponent(GConst.ShopConst.FUND_COMP[id])
@ -162,18 +162,21 @@ function FundMainUI:onChangePage(page)
end
function FundMainUI:switchOtherPage()
if DataManager.BountyData:showRedPoint() then
self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY
elseif DataManager.BountyCollectionData:showRedPoint() then
self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION
elseif DataManager.FundLevelData:getRedPoint() then
-- if DataManager.BountyData:showRedPoint() then
-- self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY
-- elseif DataManager.BountyCollectionData:showRedPoint() then
-- self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION
-- elseif DataManager.FundLevelData:getRedPoint() then
-- self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.FUND
-- elseif DataManager.ChapterFundData:getRedPoint() then
-- self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.CHAPTER_FUND
-- elseif DataManager.BountyGrowthData:getIsOpen() then
-- self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH
-- end
if DataManager.FundLevelData:getRedPoint() then
self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.FUND
elseif DataManager.ChapterFundData:getRedPoint() then
self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.CHAPTER_FUND
-- elseif DataManager.MonthlyCardData:getIsOpen() then
-- self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.MONTHLY_CARD
elseif DataManager.BountyGrowthData:getIsOpen() then
self.curPage = GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH
end
if self.curPage ~= nil then
@ -257,33 +260,41 @@ end
function FundMainUI:isOpen(type)
if type == GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY then
return DataManager.BountyData:isOpen()
-- return DataManager.BountyData:isOpen()
return false
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION then
return DataManager.BountyCollectionData:isOpen()
-- return DataManager.BountyCollectionData:isOpen()
return false
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.FUND then
return DataManager.FundLevelData:getIsOpen()
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.CHAPTER_FUND then
return DataManager.ChapterFundData:getIsOpen()
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY then
return DataManager.TowerData:isOpen()
-- return DataManager.TowerData:isOpen()
return false
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH then
return DataManager.BountyGrowthData:getIsOpen()
-- return DataManager.BountyGrowthData:getIsOpen()
return false
end
end
function FundMainUI:hasRedPoint(type)
if type == GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY then
return DataManager.BountyData:showRedPoint()
-- return DataManager.BountyData:showRedPoint()
return false
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_COLLECTION then
return DataManager.BountyCollectionData:showRedPoint()
-- return DataManager.BountyCollectionData:showRedPoint()
return false
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.FUND then
return DataManager.FundLevelData:getRedPoint()
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.CHAPTER_FUND then
return DataManager.ChapterFundData:getRedPoint()
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.TOWER_BOUNTY then
return DataManager.TowerFundData:getRedPoint()
-- return DataManager.TowerFundData:getRedPoint()
return false
elseif type == GConst.ShopConst.FUND_SHOW_PAGE.BOUNTY_GROWTH then
return DataManager.BountyGrowthData:getRedPoint()
-- return DataManager.BountyGrowthData:getRedPoint()
return false
end
end

View File

@ -11,115 +11,115 @@ end
function TowerBountyComp:init()
local uiMap = self:getUIMap()
self.banner = uiMap["tower_bounty_comp.bg.banner"]
self.bg = uiMap["tower_bounty_comp.top.bg"]
self.txDesc = uiMap["tower_bounty_comp.top.bg.desc_1"]
self.txDesc2 = uiMap["tower_bounty_comp.top.bg.desc_2"]
self.btnHelp = uiMap["tower_bounty_comp.top.tx_title.btn_help"]
self.scrollrect = uiMap["tower_bounty_comp.scrollrect"]
self.txLevel = uiMap["tower_bounty_comp.scrollrect.title.tx_level"]
self.txCommon = uiMap["tower_bounty_comp.scrollrect.title.tx_common"]
self.txPro = uiMap["tower_bounty_comp.scrollrect.title.tx_pro"]
self.btnGet = uiMap["tower_bounty_comp.btns.btn_get"]
self.txGet = uiMap["tower_bounty_comp.btns.btn_get.tx_desc"]
self.btnBuy = uiMap["tower_bounty_comp.btns.btn_buy"]
self.txCost = uiMap["tower_bounty_comp.btns.btn_buy.tx_cost"]
self.tagsNode = uiMap["tower_bounty_comp.tags"]
self.tagsViewport = uiMap["tower_bounty_comp.tags.viewport"]
self.tagsContent = uiMap["tower_bounty_comp.tags.viewport.content"]
self.tags = {}
self.tagImgs = {}
self.tagDescs = {}
for i = 1, 10 do
table.insert(self.tags, uiMap["tower_bounty_comp.tags.viewport.content.tag_" .. i])
table.insert(self.tagImgs, uiMap["tower_bounty_comp.tags.viewport.content.tag_" .. i .. ".img"])
table.insert(self.tagDescs, uiMap["tower_bounty_comp.tags.viewport.content.tag_" .. i .. ".img.tx_desc"])
end
-- self.banner = uiMap["tower_bounty_comp.bg.banner"]
-- self.bg = uiMap["tower_bounty_comp.top.bg"]
-- self.txDesc = uiMap["tower_bounty_comp.top.bg.desc_1"]
-- self.txDesc2 = uiMap["tower_bounty_comp.top.bg.desc_2"]
-- self.btnHelp = uiMap["tower_bounty_comp.top.tx_title.btn_help"]
-- self.scrollrect = uiMap["tower_bounty_comp.scrollrect"]
-- self.txLevel = uiMap["tower_bounty_comp.scrollrect.title.tx_level"]
-- self.txCommon = uiMap["tower_bounty_comp.scrollrect.title.tx_common"]
-- self.txPro = uiMap["tower_bounty_comp.scrollrect.title.tx_pro"]
-- self.btnGet = uiMap["tower_bounty_comp.btns.btn_get"]
-- self.txGet = uiMap["tower_bounty_comp.btns.btn_get.tx_desc"]
-- self.btnBuy = uiMap["tower_bounty_comp.btns.btn_buy"]
-- self.txCost = uiMap["tower_bounty_comp.btns.btn_buy.tx_cost"]
-- self.tagsNode = uiMap["tower_bounty_comp.tags"]
-- self.tagsViewport = uiMap["tower_bounty_comp.tags.viewport"]
-- self.tagsContent = uiMap["tower_bounty_comp.tags.viewport.content"]
-- self.tags = {}
-- self.tagImgs = {}
-- self.tagDescs = {}
-- for i = 1, 10 do
-- table.insert(self.tags, uiMap["tower_bounty_comp.tags.viewport.content.tag_" .. i])
-- table.insert(self.tagImgs, uiMap["tower_bounty_comp.tags.viewport.content.tag_" .. i .. ".img"])
-- table.insert(self.tagDescs, uiMap["tower_bounty_comp.tags.viewport.content.tag_" .. i .. ".img.tx_desc"])
-- end
self.btnBuy:addClickListener(function()
local giftId = DataManager.TowerFundData:getProGiftId(self.curStage)
ModuleManager.FundTowerManager:onBuyTowerBounty(giftId)
end)
self.btnGet:addClickListener(function()
ModuleManager.FundTowerManager:getReward(self.curStage)
end)
self.btnHelp:addClickListener(function()
ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.FUND_TOWER_DESC_2), self.btnHelp)
end)
self:bind(DataManager.TowerFundData, "isDirty", function()
if not DataManager.TowerFundData:getIsOpen() then
return
end
if not DataManager.TowerFundData:isStageUnlock(self.curStage) then
self.curStage = DataManager.TowerFundData:getCurStage()
end
if self.curStage == nil then
return
end
if not DataManager.TowerFundData:canGetRewards(self.curStage) then
local claimedStage = DataManager.TowerFundData:getMinUnclaimedStage()
if claimedStage ~= nil then
self.curStage = claimedStage
end
end
self:refresh(true)
end)
-- self.btnBuy:addClickListener(function()
-- local giftId = DataManager.TowerFundData:getProGiftId(self.curStage)
-- ModuleManager.FundTowerManager:onBuyTowerBounty(giftId)
-- end)
-- self.btnGet:addClickListener(function()
-- ModuleManager.FundTowerManager:getReward(self.curStage)
-- end)
-- self.btnHelp:addClickListener(function()
-- ModuleManager.TipsManager:showDescTips(I18N:getGlobalText(I18N.GlobalConst.FUND_TOWER_DESC_2), self.btnHelp)
-- end)
-- self:bind(DataManager.TowerFundData, "isDirty", function()
-- if not DataManager.TowerFundData:getIsOpen() then
-- return
-- end
-- if not DataManager.TowerFundData:isStageUnlock(self.curStage) then
-- self.curStage = DataManager.TowerFundData:getCurStage()
-- end
-- if self.curStage == nil then
-- return
-- end
-- if not DataManager.TowerFundData:canGetRewards(self.curStage) then
-- local claimedStage = DataManager.TowerFundData:getMinUnclaimedStage()
-- if claimedStage ~= nil then
-- self.curStage = claimedStage
-- end
-- end
-- self:refresh(true)
-- end)
end
function TowerBountyComp:refresh(isAuto)
if self.curStage == nil then
self.curStage = DataManager.TowerFundData:getMinUnclaimedStage() or DataManager.TowerFundData:getMaxUnclaimedStage()
isAuto = true
end
-- if self.curStage == nil then
-- self.curStage = DataManager.TowerFundData:getMinUnclaimedStage() or DataManager.TowerFundData:getMaxUnclaimedStage()
-- isAuto = true
-- end
self:updateData(self.curStage)
self:refreshStageTags()
if isAuto then
local stageList = DataManager.TowerFundData:getUnlockStageList()
local index
for k, v in pairs(stageList) do
if self.curStage == v then
index = k
end
end
if index then
self.tagsContent:setAnchoredPositionX(-self.tags[index]:getAnchoredPositionX())
end
end
-- self:updateData(self.curStage)
-- self:refreshStageTags()
-- if isAuto then
-- local stageList = DataManager.TowerFundData:getUnlockStageList()
-- local index
-- for k, v in pairs(stageList) do
-- if self.curStage == v then
-- index = k
-- end
-- end
-- if index then
-- self.tagsContent:setAnchoredPositionX(-self.tags[index]:getAnchoredPositionX())
-- end
-- end
if not DataManager.TowerFundData:getProBought(self.curStage) then
local giftId = DataManager.TowerFundData:getProGiftId(self.curStage)
local cfg = ConfigManager:getConfig("act_gift")[giftId]
self.txCost:setText(GFunc.getFormatPrice(cfg.recharge_id))
self.btnBuy:setActive(true)
else
self.btnBuy:setActive(false)
end
self.btnGet:setActive(DataManager.TowerFundData:canGetRewards(self.curStage))
self.maxIndex = #self.cfgList
self.minIndex = DataManager.TowerFundData:getMinUnclaimedRewardIndex(self.curStage)
if self.scrollRect == nil then
self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRect:addInitCallback(function()
return CELL
end)
self.scrollRect:addRefreshCallback(function(index, cell)
cell:refresh(index, self.cfgList[index], index == self.maxIndex)
end)
end
if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then
self.scrollRect:refillCells(self.maxIndex)
elseif self.scrollRect:getTotalCount() ~= self.maxIndex then
self.scrollRect:clearCells()
self.scrollRect:refillCells(self.maxIndex)
else
self.scrollRect:updateAllCell()
end
self.scrollRect:moveToIndex(self.minIndex)
-- if not DataManager.TowerFundData:getProBought(self.curStage) then
-- local giftId = DataManager.TowerFundData:getProGiftId(self.curStage)
-- local cfg = ConfigManager:getConfig("act_gift")[giftId]
-- self.txCost:setText(GFunc.getFormatPrice(cfg.recharge_id))
-- self.btnBuy:setActive(true)
-- else
-- self.btnBuy:setActive(false)
-- end
-- self.btnGet:setActive(DataManager.TowerFundData:canGetRewards(self.curStage))
-- self.maxIndex = #self.cfgList
-- self.minIndex = DataManager.TowerFundData:getMinUnclaimedRewardIndex(self.curStage)
-- if self.scrollRect == nil then
-- self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
-- self.scrollRect:addInitCallback(function()
-- return CELL
-- end)
-- self.scrollRect:addRefreshCallback(function(index, cell)
-- cell:refresh(index, self.cfgList[index], index == self.maxIndex)
-- end)
-- end
-- if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then
-- self.scrollRect:refillCells(self.maxIndex)
-- elseif self.scrollRect:getTotalCount() ~= self.maxIndex then
-- self.scrollRect:clearCells()
-- self.scrollRect:refillCells(self.maxIndex)
-- else
-- self.scrollRect:updateAllCell()
-- end
-- self.scrollRect:moveToIndex(self.minIndex)
if self.curStage then
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.TOWER_BOUNTY .. self.curStage)
end
-- if self.curStage then
-- -- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.TOWER_BOUNTY .. self.curStage)
-- end
end
function TowerBountyComp:updateData(stage)
@ -137,41 +137,41 @@ function TowerBountyComp:onClickStageTag(stage)
end
function TowerBountyComp:refreshStageTags()
local stageList = DataManager.TowerFundData:getUnlockStageList()
if #stageList <= 1 then
self.tagsNode:setActive(false)
return
end
self.tagsNode:setActive(true)
local totalWidth = #stageList * TAG_SIZE + (#stageList - 1) * 5
self.tagsContent:setSizeDeltaX(totalWidth)
self.tagsViewport:setSizeDeltaX(totalWidth < TAG_COMMON_TOTAL_SIZE and totalWidth or TAG_COMMON_TOTAL_SIZE)
-- local stageList = DataManager.TowerFundData:getUnlockStageList()
-- if #stageList <= 1 then
-- self.tagsNode:setActive(false)
-- return
-- end
-- self.tagsNode:setActive(true)
-- local totalWidth = #stageList * TAG_SIZE + (#stageList - 1) * 5
-- self.tagsContent:setSizeDeltaX(totalWidth)
-- self.tagsViewport:setSizeDeltaX(totalWidth < TAG_COMMON_TOTAL_SIZE and totalWidth or TAG_COMMON_TOTAL_SIZE)
for i, tag in ipairs(self.tags) do
local stage = stageList[i]
if stage then
tag:setActive(true)
local isSelect = self.curStage == stage
self.tagImgs[i]:setSprite(GConst.ATLAS_PATH.COMMON, isSelect and "common_menu_4" or "common_menu_5")
self.tagImgs[i]:setAnchoredPositionY(isSelect and 5 or 0)
self.tagDescs[i]:setText(I18N:getGlobalText(I18N.GlobalConst["FUND_TOWER_TAG_DESC_" .. stage]))
-- for i, tag in ipairs(self.tags) do
-- local stage = stageList[i]
-- if stage then
-- tag:setActive(true)
-- local isSelect = self.curStage == stage
-- self.tagImgs[i]:setSprite(GConst.ATLAS_PATH.COMMON, isSelect and "common_menu_4" or "common_menu_5")
-- self.tagImgs[i]:setAnchoredPositionY(isSelect and 5 or 0)
-- self.tagDescs[i]:setText(I18N:getGlobalText(I18N.GlobalConst["FUND_TOWER_TAG_DESC_" .. stage]))
if DataManager.TowerFundData:canGetRewards(stage) then
tag:addRedPoint(80, 33, 0.9)
else
tag:removeRedPoint()
end
-- if DataManager.TowerFundData:canGetRewards(stage) then
-- tag:addRedPoint(80, 33, 0.9)
-- else
-- tag:removeRedPoint()
-- end
tag:addClickListener(function()
if isSelect then
return
end
self:onClickStageTag(stage)
end)
else
tag:setActive(false)
end
end
-- tag:addClickListener(function()
-- if isSelect then
-- return
-- end
-- self:onClickStageTag(stage)
-- end)
-- else
-- tag:setActive(false)
-- end
-- end
end
return TowerBountyComp

View File

@ -1,50 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarActPvpCell = class("SideBarActPvpCell", SideBarBaseCellComp)
function SideBarActPvpCell:getModuleKey()
return nil
end
function SideBarActPvpCell:getHasPurchase()
return true
end
function SideBarActPvpCell:getIsOpen()
return DataManager.ActPvpData:getIsOpen()
end
function SideBarActPvpCell:getSpineName()
return "ui_main_btn_act_pvp"
end
function SideBarActPvpCell:onClick()
ModuleManager.ActPvpManager:showMainUI()
end
function SideBarActPvpCell:getIsShowRedPoint()
return DataManager.ActBossRushData:getRp()
end
function SideBarActPvpCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarActPvpCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarActPvpCell:_refreshTime()
local remainTime = DataManager.ActPvpData:getRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarActPvpCell

View File

@ -1,46 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarActivityCell = class("SideBarActivityCell", SideBarBaseCellComp)
function SideBarActivityCell:getModuleKey()
return ModuleManager.MODULE_KEY.ACTIVITY
end
function SideBarActivityCell:getIsOpen()
return DataManager.ActivityData:isOpen() and DataManager.ActivityData:isActive()
end
function SideBarActivityCell:getSpineName()
return "ui_main_btn_act_summer"
end
function SideBarActivityCell:onClick()
ModuleManager.ActivityManager:showActivityUI()
end
function SideBarActivityCell:getIsShowRedPoint()
return DataManager.ActivityData:hasEntryRedPoint()
end
function SideBarActivityCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarActivityCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarActivityCell:_refreshTime()
local remainTime = DataManager.ActivityData:getEndRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarActivityCell

View File

@ -1,50 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarArenaGiftCell = class("SideBarArenaGiftCell", SideBarBaseCellComp)
function SideBarArenaGiftCell:getModuleKey()
return ModuleManager.MODULE_KEY.ARENA_GIFT
end
function SideBarArenaGiftCell:getHasPurchase()
return true
end
function SideBarArenaGiftCell:getIsOpen()
return DataManager.ArenaData:getGiftId()
end
function SideBarArenaGiftCell:getSpineName()
return "ui_main_gift_arena"
end
function SideBarArenaGiftCell:onClick()
ModuleManager.ArenaManager:showGiftPopUI(BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
function SideBarArenaGiftCell:getIsShowRedPoint()
return false
end
function SideBarArenaGiftCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarArenaGiftCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarArenaGiftCell:_refreshTime()
local remainTime = DataManager.ArenaData:getGiftRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarArenaGiftCell

View File

@ -1,73 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarArmorGiftCell = class("SideBarArmorGiftCell", SideBarBaseCellComp)
local GIFT_TYPE = PayManager.PURCHARSE_ACT_TYPE.ARMOR_UPGRADE_GIFT
function SideBarArmorGiftCell:getIsOpen()
-- return DataManager.ShopData:hasGift(GIFT_TYPE)
return #DataManager.EquipData:getGiftIdsByType(GIFT_TYPE) > 0
end
function SideBarArmorGiftCell:getSpineName()
return "ui_main_equipgift"
end
function SideBarArmorGiftCell:getSpineAnimationName()
return "animation"
end
function SideBarArmorGiftCell:onClick()
-- local gift = DataManager.ShopData:getGift(GIFT_TYPE)
-- if gift then
-- ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, gift.id, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
-- end
local ids = DataManager.EquipData:getGiftIdsByType(GIFT_TYPE)
if #ids > 0 then
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, ids, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
end
function SideBarArmorGiftCell:getIsShowRedPoint()
return false
end
function SideBarArmorGiftCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarArmorGiftCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarArmorGiftCell:_refreshTime()
-- local gift = DataManager.ShopData:getGift(GIFT_TYPE)
-- if gift then
-- local cfgInfo = DataManager.ShopData:getActGiftConfig()[gift.id]
-- if cfgInfo then
-- local remainTime = DataManager.ShopData:getGiftRemainTime(GIFT_TYPE)
-- if remainTime >= 0 then
-- self.timeTx:setText(GFunc.getTimeStr(remainTime))
-- else
-- self.timeTx:setText("00:00:00")
-- end
-- else
-- self.timeTx:setText("00:00:00")
-- end
-- else
-- self.timeTx:setText("00:00:00")
-- end
local remainTime = DataManager.EquipData:getGiftNearestRemainTime(GIFT_TYPE)
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarArmorGiftCell

View File

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

397
lua/app/ui/main_city/cell/side_bar_base_cell.lua Normal file → Executable file
View File

@ -1,243 +1,197 @@
local SideBarBaseCellComp = class("SideBarBaseCellComp", BaseCell)
local SideBarBaseCell = class("SideBarBaseCell", BaseCell)
local DEFAULT_RED_POINT_POS_X = 30
local DEFAULT_RED_POINT_POS_Y = 30
local DEFAULT_RED_POINT_SCALE = 0.6
local DEFAULT_RED_POINT_SCALE = 1
-- 需要继承重写的部分 ***********************************************************
-- 模块key值对应ModuleManager.MODULE_KEY
function SideBarBaseCellComp:getModuleKey()
function SideBarBaseCell:getModuleKey()
return nil
end
function SideBarBaseCellComp:getHasPurchase()
return true
end
function SideBarBaseCellComp:getIsOpen()
function SideBarBaseCell:getIsOpen()
return false
end
-- 是否有内购
function SideBarBaseCell:getHasPurchase()
return true
end
function SideBarBaseCell:onClick()
end
function SideBarBaseCell:updateTime()
end
function SideBarBaseCell:onRefresh()
end
-- icon图标资源路径,为空时不显示
function SideBarBaseCellComp:getIconRes()
-- return nil
return "maincity_gm"
function SideBarBaseCell:getIconRes()
return nil
end
function SideBarBaseCell:getIconSize()
return nil
end
-- 图标动画资源路径,为空时不显示
function SideBarBaseCellComp:getSpineName()
function SideBarBaseCell:getSpineName()
return nil
end
-- 图标动画资源默认名称
function SideBarBaseCellComp:getSpineAnimationName()
function SideBarBaseCell:getSpineAnimationName()
return "idle"
end
-- 图标动画默认位置
function SideBarBaseCellComp:getSpinePositionY()
function SideBarBaseCell:getSpinePositionY()
return 0
end
-- 特效资源路径,为空时不显示
function SideBarBaseCellComp:getVfxRes()
return nil
end
-- 是否有shake效果
function SideBarBaseCellComp:getHasShake()
function SideBarBaseCell:getHasShake()
return false
end
function SideBarBaseCellComp:getIsShowRedPoint()
function SideBarBaseCell:getIsShowRedPoint()
return false
end
-- 红点偏移位置
function SideBarBaseCellComp:getRedPointPosition()
function SideBarBaseCell:getRedPointPosition()
return DEFAULT_RED_POINT_POS_X, DEFAULT_RED_POINT_POS_Y
end
-- 红点大小
function SideBarBaseCellComp:getRedPointScale()
function SideBarBaseCell:getRedPointScale()
return DEFAULT_RED_POINT_SCALE
end
-- 广告红点偏移位置
function SideBarBaseCellComp:getAdPointPosition()
function SideBarBaseCell:getAdPointPosition()
return DEFAULT_RED_POINT_POS_X, DEFAULT_RED_POINT_POS_Y
end
-- 广告红点大小
function SideBarBaseCellComp:getAdPointScale()
function SideBarBaseCell:getAdPointScale()
return DEFAULT_RED_POINT_SCALE
end
function SideBarBaseCellComp:refreshIcon()
if not self:getIconRes() then
self.icon:setVisible(false)
return
end
self.icon:setVisible(true)
self.icon:setSprite(GConst.ATLAS_PATH.MAIN, self:getIconRes())
end
function SideBarBaseCellComp:refreshSpine()
-- if not self:getSpineName() then
if true then
self.spine:getSkeletonGraphic().enabled = false
return
end
self.spine:setAnchoredPositionY(self:getSpinePositionY())
if not self.isInitSpine then
self.isInitSpine = true
self.spine:loadAssetAsync(self:getSpineName(), function()
self.spine:playAnim(self:getSpineAnimationName(), true, true, true)
if self.isActive then
self.spine:setActive(true)
else
self.spine:setActive(false)
end
if self.visible then
self.spine:getSkeletonGraphic().enabled = true
else
self.spine:getSkeletonGraphic().enabled = false
end
end, false)
else
if not self.spine:getIsLoadingAsset() then
self.spine:getSkeletonGraphic().enabled = true
end
end
end
function SideBarBaseCellComp:onClick()
end
function SideBarBaseCellComp:updateTime()
end
function SideBarBaseCellComp:onRefresh()
function SideBarBaseCell:getCellName()
end
-- 常规逻辑 ***********************************************************
function SideBarBaseCellComp:init()
function SideBarBaseCell:init()
local uiMap = self.baseObject:genAllChildren()
self.icon = uiMap["side_bar_cell.icon"]
self.spine = uiMap["side_bar_cell.ui_spine_obj"]
self.descBg = uiMap["side_bar_cell.desc_bg"]
self.descIcon = uiMap["side_bar_cell.desc_bg.icon"]
self.descTx = uiMap["side_bar_cell.desc_bg.text"]
self.timeBg = uiMap["side_bar_cell.time_bg"]
self.timeTx = uiMap["side_bar_cell.time_bg.text"]
self.descBg:setVisible(false)
self.timeBg:setVisible(false)
self.imgIcon = uiMap["side_bar_base_cell.img_icon"]
self.spineIcon = uiMap["side_bar_base_cell.spine_icon"]
self.timeBg = uiMap["side_bar_base_cell.time"]
self.txTime = uiMap["side_bar_base_cell.time.tx_time"]
self.txName = uiMap["side_bar_base_cell.tx_name"]
-- -- 金猪
-- self.nodePig = uiMap["side_bar_base_cell.node_pig"]
-- self.nodePigIcon = uiMap["side_bar_base_cell.node_pig.icon"]
-- self.nodePigDesc = uiMap["side_bar_base_cell.node_pig.desc"]
-- -- 功能预览
-- self.nodeFuncForeshow = uiMap["side_bar_base_cell.node_func_foreshow"]
-- self.nodeFuncForeshowLock = uiMap["side_bar_base_cell.node_func_foreshow.img_lock"]
-- self.nodeFuncForeshowName = uiMap["side_bar_base_cell.node_func_foreshow.tx_name"]
-- self.nodeFuncForeshowDesc = uiMap["side_bar_base_cell.node_func_foreshow.tx_desc"]
self.timeBg:setActive(false)
self.baseObject:addClickListener(function()
self:onClick()
end)
self:bindData()
end
function SideBarBaseCellComp:refresh()
function SideBarBaseCell:bindData()
end
function SideBarBaseCell:refresh()
self:refreshIcon()
self:refreshName()
self:refreshSpine()
self:refreshShake()
self:onRefresh()
-- 额外
-- self:refreshNodePig()
-- self:refreshNodeFuncForeshow()
end
-- function SideBarBaseCell:refreshNodePig()
-- self.nodePig:setActive(false)
-- end
-- function SideBarBaseCell:refreshNodeFuncForeshow()
-- self.nodeFuncForeshow:setActive(false)
-- end
function SideBarBaseCell:refreshIcon()
if not self:getIconRes() then
self.imgIcon:setActive(false)
return
end
self.imgIcon:setActive(true)
self.imgIcon:setSprite(GConst.ATLAS_PATH.UI_MAIN, self:getIconRes())
local width = self:getIconSize()
if width then
self.imgIcon:setSizeDelta(width, width)
end
end
function SideBarBaseCell:refreshName()
if self:getCellName() then
self.txName:setText(self:getCellName())
else
self.txName:setText(GConst.EMPTY_STRING)
end
end
function SideBarBaseCell:refreshSpine()
if not self:getSpineName() then
self.spineIcon:getSkeletonGraphic().enabled = false
return
end
self.spineIcon:setAnchoredPositionY(self:getSpinePositionY())
if not self.isInitSpine then
self.isInitSpine = true
self.spineIcon:loadAssetAsync(self:getSpineName(), function()
self.spineIcon:playAnim(self:getSpineAnimationName(), true, true, true)
if self.isActive then
self.spineIcon:setActive(true)
else
self.spineIcon:setActive(false)
end
if self.isVisible then
self.spineIcon:getSkeletonGraphic().enabled = true
else
self.spineIcon:getSkeletonGraphic().enabled = false
end
end, false)
else
if not self.spineIcon:getIsLoadingAsset() then
self.spineIcon:getSkeletonGraphic().enabled = true
end
end
end
function SideBarBaseCell:refreshShake()
if self:getHasShake() then
self:doShake()
else
self:stopShake()
end
self:onRefresh()
end
function SideBarBaseCellComp:setAnchoredPositionY(y)
self.baseObject:setAnchoredPositionY(y)
end
function SideBarBaseCellComp:setAnchoredPositionX(x)
self.baseObject:setAnchoredPositionX(x)
end
function SideBarBaseCellComp:setVisible(visible)
self.visible = visible
self.baseObject:setVisible(visible)
if not visible then
self:stopShake()
end
if self.isInitSpine and self:getSpineName() and not self.spine:getIsLoadingAsset() then
self.spine:getSkeletonGraphic().enabled = visible
end
end
function SideBarBaseCellComp:checkIsOpen()
-- 审核模式下大多数的带内购的侧边栏入口都不显示
if self:getHasPurchase() and GFunc.isShenhe() then
return false
end
return self:getIsOpen()
end
function SideBarBaseCellComp:getIsVisible()
return self.visible
end
function SideBarBaseCellComp:getEntrancePos()
if self:getIconRes() then
return self.icon:getPosition()
elseif self:getSpineName() then
return self.spine:getPosition()
end
return nil
end
function SideBarBaseCellComp:getCellPath()
return self.cellPath
end
function SideBarBaseCellComp:showRedPoint()
if self.redPoint then
return
end
self.redPoint = true
local x, y = self:getRedPointPosition()
self.baseObject:addRedPoint(x, y, self:getRedPointScale())
end
function SideBarBaseCellComp:hideRedPoint()
if self.redPoint == false then
return
end
self.redPoint = false
self.baseObject:removeRedPoint()
end
function SideBarBaseCellComp:initWithParentUI(parentUI, cellPath, isLeftSide)
self.parentUI = parentUI
self.cellPath = cellPath
self.isLeftSide = isLeftSide
end
function SideBarBaseCellComp:closeBtn()
if self.parentUI then
self.parentUI:closeSideBarBtn(self.isLeftSide)
end
end
function SideBarBaseCellComp:setActive(isActive)
if self.isActive == isActive then
return
end
self.isActive = isActive
if self.isInitSpine and self:getSpineName() and not self.spine:getIsLoadingAsset() then
self.spine:setActive(isActive)
end
end
function SideBarBaseCellComp:getIsActive()
return self.isActive
end
function SideBarBaseCellComp:doShake()
function SideBarBaseCell:doShake()
if self.shakeSeq then
self.shakeSeq:Restart()
return
@ -256,17 +210,114 @@ function SideBarBaseCellComp:doShake()
self.shakeSeq:SetLoops(-1)
end
function SideBarBaseCellComp:stopShake()
function SideBarBaseCell:stopShake()
if self.shakeSeq then
self.shakeSeq:Pause()
end
end
function SideBarBaseCellComp:onDestroy()
function SideBarBaseCell:refreshRedPoint()
if self:getIsShowRedPoint() then
self:showRedPoint()
else
self:hideRedPoint()
end
end
function SideBarBaseCell:showRedPoint()
if self.redPoint then
return
end
self.redPoint = true
local x, y = self:getRedPointPosition()
self.baseObject:addRedPoint(x, y, self:getRedPointScale())
end
function SideBarBaseCell:hideRedPoint()
if self.redPoint == false then
return
end
self.redPoint = false
self.baseObject:removeRedPoint()
end
function SideBarBaseCell:checkIsOpen()
-- 审核模式下大多数的带内购的侧边栏入口都不显示
if self:getHasPurchase() and GFunc.isShenhe() then
return false
end
return self:getIsOpen()
end
function SideBarBaseCell:getEntrancePos()
if self:getIconRes() then
return self.imgIcon:getPosition()
elseif self:getSpineName() then
return self.spineIcon:getPosition()
end
return nil
end
function SideBarBaseCell:getCellPath()
return self.cellPath
end
-- 额外设置的部分 ***********************************************************
function SideBarBaseCell:setAnchoredPositionY(y)
self.baseObject:setAnchoredPositionY(y)
end
function SideBarBaseCell:setAnchoredPositionX(x)
self.baseObject:setAnchoredPositionX(x)
end
function SideBarBaseCell:getIsVisible()
return self.isVisible
end
function SideBarBaseCell:setVisible(visible)
self.isVisible = visible
self.baseObject:setActive(visible)
if not visible then
self:stopShake()
end
if self.isInitSpine and self:getSpineName() and not self.spineIcon:getIsLoadingAsset() then
self.spineIcon:getSkeletonGraphic().enabled = visible
end
end
function SideBarBaseCell:getIsActive()
return self.isActive
end
function SideBarBaseCell:setActive(isActive)
if self.isActive == isActive then
return
end
self.isActive = isActive
if self.isInitSpine and self:getSpineName() and not self.spineIcon:getIsLoadingAsset() then
self.spineIcon:setActive(isActive)
end
end
function SideBarBaseCell:initWithParentUI(parentUI, cellPath, isLeftSide)
self.parentUI = parentUI
self.cellPath = cellPath
self.isLeftSide = isLeftSide
end
function SideBarBaseCell:closeBtn()
if self.parentUI then
self.parentUI:closeSideBarBtn(self.isLeftSide)
end
end
function SideBarBaseCell:onDestroy()
if self.shakeSeq then
self.shakeSeq:Kill()
self.shakeSeq = nil
end
end
return SideBarBaseCellComp
return SideBarBaseCell

View File

@ -1,46 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarBeginnerGiftCell = class("SideBarBeginnerGiftCell", SideBarBaseCellComp)
function SideBarBeginnerGiftCell:getModuleKey()
return ModuleManager.MODULE_KEY.BEGINNER_GIFT
end
function SideBarBeginnerGiftCell:getIsOpen()
return DataManager.ShopData:getBeginnerGiftShowSideBar()
end
function SideBarBeginnerGiftCell:getSpineName()
return "main_btn_gift_new"
end
function SideBarBeginnerGiftCell:onClick()
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.BEGINNER_GIFT_ID, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
function SideBarBeginnerGiftCell:getIsShowRedPoint()
return false
end
function SideBarBeginnerGiftCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarBeginnerGiftCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarBeginnerGiftCell:_refreshTime()
local remainTime = DataManager.ShopData:getBeginnerGiftSideBarRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarBeginnerGiftCell

View File

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

View File

@ -1,50 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarBossRushCell = class("SideBarBossRushCell", SideBarBaseCellComp)
function SideBarBossRushCell:getModuleKey()
return nil
end
function SideBarBossRushCell:getHasPurchase()
return true
end
function SideBarBossRushCell:getIsOpen()
return DataManager.ActBossRushData:getIsOpen()
end
function SideBarBossRushCell:getSpineName()
return "ui_act_bossrush_mainbtn"
end
function SideBarBossRushCell:onClick()
ModuleManager.ActBossRushManager:showMainUI()
end
function SideBarBossRushCell:getIsShowRedPoint()
return DataManager.ActBossRushData:getRp()
end
function SideBarBossRushCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarBossRushCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarBossRushCell:_refreshTime()
local remainTime = DataManager.ActBossRushData:getRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarBossRushCell

View File

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

View File

@ -1,64 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarDiscountCell = class("SideBarDiscountCell", SideBarBaseCellComp)
function SideBarDiscountCell:getModuleKey()
return nil
end
function SideBarDiscountCell:getHasPurchase()
return true
end
function SideBarDiscountCell:getIsOpen()
-- 同ShopComp:refreshDiscountPage() 一起修改
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, true) then
return false
end
-- 章节礼包
if #DataManager.ShopData:getActChapterStoreCanBuyActIds() > 0 then
return true
end
-- 新手礼包
if not DataManager.ShopData:getBeginnerGiftHasBuy() then
return true
end
-- 竞技场
if DataManager.ArenaData:getGiftId() ~= nil then
return true
end
-- 助力礼包
if #DataManager.ShopData:getLevelUpGiftActIds() > 0 then
return true
end
-- 成长礼包
if DataManager.ShopData:hasGrowUpGift() then
return true
end
-- 金币
if DataManager.ShopData:getValidCoinGiftId() ~= nil then
return true
end
return false
end
function SideBarDiscountCell:getSpineName()
return "ui_main_btn_indulgencegift"
end
function SideBarDiscountCell:onClick()
DataManager.ShopData:markEntranceDiscountRedPoint()
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_SHOP, {page = GConst.ShopConst.PAGE_TYPE.DISCOUNT})
end
function SideBarDiscountCell:getIsShowRedPoint()
return DataManager.ShopData:getEntranceDiscountRedPoint()
end
return SideBarDiscountCell

View File

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

View File

@ -1,24 +1,32 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarFirstRechargeCell = class("SideBarFirstRechargeCell", SideBarBaseCellComp)
local SideBarFirstRechargeCell = class("SideBarFirstRechargeCell", SideBarBaseCell)
function SideBarFirstRechargeCell:getModuleKey()
return ModuleManager.MODULE_KEY.FIRST_RECHARGE
return ModuleManager.MODULE_KEY.FIRST_CHARGE
end
function SideBarFirstRechargeCell:getIsOpen()
return DataManager.ShopData:getShowFirstRechargeSideBar()
return DataManager.ShopData:isFirstRechargeOpen()
end
function SideBarFirstRechargeCell:getSpineName()
return "ui_main_btn_gift_first"
end
function SideBarFirstRechargeCell:getIsShowRedPoint()
return DataManager.ShopData:showFirstRechargeRp()
-- if DataManager.ShopData:isNewFirstRechargeGift(GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1) then
-- return "ui_mainbtn_first"
-- else
-- return "ui_mainbtn_first"
-- end
return "ui_main_btn_shop"
end
function SideBarFirstRechargeCell:onClick()
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.FIRST_RECHARGE_ID, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
ModuleManager.ShopManager:showFirstRechargeUI()
end
function SideBarFirstRechargeCell:getIsShowRedPoint()
return DataManager.ShopData:hasFirstRechargeRedPoint()
end
function SideBarFirstRechargeCell:getCellName()
return I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_4)
end
return SideBarFirstRechargeCell

View File

@ -1,43 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarFourteenDayCell = class("SideBarFourteenDayCell", SideBarBaseCellComp)
function SideBarFourteenDayCell:getIsOpen()
return DataManager.FourteenDayData:isOpen() and DataManager.FourteenDayData:isActiveTime()
end
function SideBarFourteenDayCell:getSpineName()
return "ui_act_fourteen_mainbtn"
end
function SideBarFourteenDayCell:onClick()
ModuleManager.FourteenDayManager:showFourteenDayUI()
end
function SideBarFourteenDayCell:getIsShowRedPoint()
return DataManager.FourteenDayData:hasRedPoint()
end
function SideBarFourteenDayCell:onRefresh()
self:_refreshTime()
end
function SideBarFourteenDayCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarFourteenDayCell:_refreshTime()
local remainTime = DataManager.FourteenDayData:getEndRemainTime()
if remainTime >= 0 then
self.timeBg:setVisible(true)
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeBg:setVisible(false)
self.timeTx:setText("00:00:00")
end
end
return SideBarFourteenDayCell

View File

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

View File

@ -1,46 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarFullMoonCell = class("SideBarFullMoonCell", SideBarBaseCellComp)
function SideBarFullMoonCell:getModuleKey()
return ModuleManager.MODULE_KEY.ACTIVITY
end
function SideBarFullMoonCell:getIsOpen()
return DataManager.FullMoonData:isOpen() and DataManager.FullMoonData:isOpenTime()
end
function SideBarFullMoonCell:getSpineName()
return "ui_main_btn_act_fullmoon"
end
function SideBarFullMoonCell:onClick()
ModuleManager.FullMoonManager:showActMainUI()
end
function SideBarFullMoonCell:getIsShowRedPoint()
return DataManager.FullMoonData:hasEntryRedPoint()
end
function SideBarFullMoonCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarFullMoonCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarFullMoonCell:_refreshTime()
local remainTime = DataManager.FullMoonData:getEndRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarFullMoonCell

View File

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

View File

@ -0,0 +1,34 @@
local SideBarFundCell = class("SideBarFundCell", SideBarBaseCell)
function SideBarFundCell:getModuleKey()
-- return ModuleManager.MODULE_KEY.TASK
end
function SideBarFundCell:getIsOpen()
local isOpenFundLevel = DataManager.FundLevelData:getIsOpen() and not DataManager.FundLevelData:getIsAllClaimed()
local isOpenFundChapter = DataManager.ChapterFundData:getIsOpen()
-- local isOpenBounty = DataManager.BountyData:isOpen()
-- local isOpenBountyCollertion = DataManager.BountyCollectionData:isOpen()
-- local isOpenBounryTower = DataManager.TowerData:isOpen()
return isOpenFundLevel or isOpenFundChapter-- or isOpenBounty or isOpenBountyCollertion or isOpenBounryTower
end
function SideBarFundCell:getSpineName()
return "ui_main_btn_shop"
end
function SideBarFundCell:onClick()
ModuleManager.ShopManager:showFundUI()
end
function SideBarFundCell:getIsShowRedPoint()
return DataManager.FundLevelData:getRedPoint() or
DataManager.ChapterFundData:getRedPoint()
end
function SideBarFundCell:getCellName()
return I18N:getGlobalText(I18N.GlobalConst.DUNGEON_ARMOR_DESC_12)
end
return SideBarFundCell

View File

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

View File

@ -1,16 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarGMCell = class("SideBarGMCell", SideBarBaseCellComp)
function SideBarGMCell:getIsOpen()
return Platform:getIsDevChannel()
end
function SideBarGMCell:getIconRes()
return "maincity_gm"
end
function SideBarGMCell:onClick()
ModuleManager.DevToolManager:showOrHideDevListUI()
end
return SideBarGMCell

View File

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

View File

@ -1,78 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarGoldPigCell = class("SideBarGoldPigCell", SideBarBaseCellComp)
function SideBarGoldPigCell:getModuleKey()
return ModuleManager.MODULE_KEY.GOLD_PIG
end
function SideBarGoldPigCell:getIsOpen()
return DataManager.GoldPigData:getIsOpen()
end
function SideBarGoldPigCell:getSpineName()
return "ui_main_btn_pig"
end
function SideBarGoldPigCell:onClick()
ModuleManager.ActivityManager:showGoldPigUI(BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
function SideBarGoldPigCell:onRefresh()
local isFull = DataManager.GoldPigData:getIsFull()
if isFull then
self:showGoldPigDesc()
else
self:hideGoldPigDesc()
end
end
function SideBarGoldPigCell:showGoldPigDesc()
if self.descBgVisible then
return
end
self.descBgVisible = true
self.descBg:setVisible(true)
self.timeBg:setVisible(true)
local gemEntity = DataManager.BagData.ItemData:getItemById(GConst.ItemConst.ITEM_ID_GEM)
self.descIcon:setSprite(gemEntity:getIconRes())
self.descTx:setText(I18N:getGlobalText(I18N.GlobalConst.SIDE_BAR_FULL))
GFunc.centerImgAndTx(self.descIcon, self.descTx, 0, -3)
local endTime = DataManager.GoldPigData:getEndTime()
local remainTime = endTime - Time:getServerTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStrWithHMS(remainTime))
else
self.timeTx:setText(GConst.EMPTY_STRING)
end
end
function SideBarGoldPigCell:hideGoldPigDesc()
if self.descBgVisible == false then
return
end
self.descBgVisible = false
self.descBg:setVisible(false)
self.timeBg:setVisible(false)
end
function SideBarGoldPigCell:updateTime()
if self:getIsOpen() then
local isFull = DataManager.GoldPigData:getIsFull()
if isFull then
self:showGoldPigDesc()
local endTime = DataManager.GoldPigData:getEndTime()
local remainTime = endTime - Time:getServerTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStrWithHMS(remainTime))
end
else
self:hideGoldPigDesc()
end
else
self:closeBtn()
end
end
return SideBarGoldPigCell

View File

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

View File

@ -1,55 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarGrowUpGiftCell = class("SideBarGrowUpGiftCell", SideBarBaseCellComp)
function SideBarGrowUpGiftCell:getIsOpen()
return DataManager.ShopData:hasGrowUpGift()
end
function SideBarGrowUpGiftCell:getSpineName()
return "ui_main_btn_gift_grow"
end
function SideBarGrowUpGiftCell:onClick()
local gift = DataManager.ShopData:getGrowUpGift()
if gift then
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.GROW_UP_GIFT_NEW, gift.current_grow_up_id, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
end
function SideBarGrowUpGiftCell:getIsShowRedPoint()
return false
end
function SideBarGrowUpGiftCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarGrowUpGiftCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarGrowUpGiftCell:_refreshTime()
local gift = DataManager.ShopData:getGrowUpGift()
if gift then
local cfgInfo = DataManager.ShopData:getActGrowUpGiftConfig()[gift.current_grow_up_id]
if cfgInfo then
local remainTime = DataManager.ShopData:getGrowUpGiftRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
else
self.timeTx:setText("00:00:00")
end
else
self.timeTx:setText("00:00:00")
end
end
return SideBarGrowUpGiftCell

View File

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

View File

@ -1,28 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarGrowthFundCell = class("SideBarGrowthFundCell", SideBarBaseCellComp)
function SideBarGrowthFundCell:getModuleKey()
return ModuleManager.MODULE_KEY.FUND
end
function SideBarGrowthFundCell:getIsOpen()
return DataManager.GrowthFundData:getIsOpen()
end
function SideBarGrowthFundCell:getSpineName()
return "ui_main_btn_fund"
end
function SideBarGrowthFundCell:onClick()
ModuleManager.FundManager:showLevelFundUI()
end
function SideBarGrowthFundCell:getIsShowRedPoint()
return DataManager.GrowthFundData:getIfCanClaimReward()
end
function SideBarGrowthFundCell:getHasShake()
return true
end
return SideBarGrowthFundCell

View File

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

View File

@ -1,50 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarHeroFundCell = class("SideBarHeroFundCell", SideBarBaseCellComp)
function SideBarHeroFundCell:getModuleKey()
return ModuleManager.MODULE_KEY.SEVEN_DAY
end
function SideBarHeroFundCell:getHasPurchase()
return true
end
function SideBarHeroFundCell:getIsOpen()
return DataManager.HeroFundData:getIsOpen()
end
function SideBarHeroFundCell:getSpineName()
return "ui_main_herofund"
end
function SideBarHeroFundCell:onClick()
ModuleManager.HeroFundManager:showMainUI()
end
function SideBarHeroFundCell:getIsShowRedPoint()
return DataManager.HeroFundData:getHaveReward()
end
function SideBarHeroFundCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarHeroFundCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarHeroFundCell:_refreshTime()
local remainTime = DataManager.HeroFundData:getRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarHeroFundCell

View File

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

View File

@ -1,33 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarIdleCell = class("SideBarIdleCell", SideBarBaseCellComp)
function SideBarIdleCell:getModuleKey()
return ModuleManager.MODULE_KEY.IDLE_DROP
end
function SideBarIdleCell:getHasPurchase()
return false
end
function SideBarIdleCell:getIsOpen()
return DataManager.IdleData:getIsOpen()
end
function SideBarIdleCell:getSpineName()
return "ui_main_btn_hang"
end
function SideBarIdleCell:onClick()
ModuleManager.IdleManager:showIdleDropUI()
end
function SideBarIdleCell:getIsShowRedPoint()
local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime()
local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
if time >= idleMaxTime then
return true
end
return DataManager.IdleData:getQuickIdleRemainTimes() > 0
end
return SideBarIdleCell

View File

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

View File

@ -1,46 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarIntroductGiftCell = class("SideBarIntroductGiftCell", SideBarBaseCellComp)
function SideBarIntroductGiftCell:getModuleKey()
return ModuleManager.MODULE_KEY.INTRODUCT_GIFT
end
function SideBarIntroductGiftCell:getIsOpen()
return DataManager.ShopData:getIntroductGiftShowSideBar()
end
function SideBarIntroductGiftCell:getSpineName()
return "ui_main_btn_gift_first"
end
function SideBarIntroductGiftCell:onClick()
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, GConst.ShopConst.INTRODUCT_GIFT_ID, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
function SideBarIntroductGiftCell:getIsShowRedPoint()
return false
end
function SideBarIntroductGiftCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarIntroductGiftCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarIntroductGiftCell:_refreshTime()
local remainTime = DataManager.ShopData:getIntroductGiftRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarIntroductGiftCell

View File

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

View File

@ -1,50 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarSevenDaysCell = class("SideBarSevenDaysCell", SideBarBaseCellComp)
function SideBarSevenDaysCell:getModuleKey()
return ModuleManager.MODULE_KEY.SEVEN_DAY
end
function SideBarSevenDaysCell:getHasPurchase()
return false
end
function SideBarSevenDaysCell:getIsOpen()
return DataManager.SevenDayData:getIsOpen()
end
function SideBarSevenDaysCell:getSpineName()
return "ui_main_btn_sevenday"
end
function SideBarSevenDaysCell:onClick()
ModuleManager.SevenDayManager:showUI()
end
function SideBarSevenDaysCell:getIsShowRedPoint()
return DataManager.SevenDayData:showRedPoint()
end
function SideBarSevenDaysCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarSevenDaysCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarSevenDaysCell:_refreshTime()
local remainTime = DataManager.SevenDayData:getEndTime() - Time:getServerTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarSevenDaysCell

View File

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

View File

@ -0,0 +1,28 @@
local SideBarSignCell = class("SideBarSignCell", SideBarBaseCell)
function SideBarSignCell:getModuleKey()
-- return ModuleManager.MODULE_KEY.TASK
end
function SideBarSignCell:getIsOpen()
return DataManager.SignWeekData:isOpen()-- or DataManager.SignMonthData:isOpen()
end
function SideBarSignCell:getSpineName()
-- return "ui_mainbtn_signin"
return "ui_main_btn_shop"
end
function SideBarSignCell:onClick()
ModuleManager.SignManager:showSignUI()
end
function SideBarSignCell:getIsShowRedPoint()
return DataManager.SignMonthData:showRedPoint()-- or DataManager.SignWeekData:showRedPoint()
end
function SideBarSignCell:getCellName()
return I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_8)
end
return SideBarSignCell

View File

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

View File

@ -1,46 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarTournArenaCell = class("SideBarTournArenaCell", SideBarBaseCellComp)
function SideBarTournArenaCell:getModuleKey()
return ModuleManager.MODULE_KEY.ACTIVITY
end
function SideBarTournArenaCell:getIsOpen()
return DataManager.TournArenaData:isOpen() and DataManager.TournArenaData:isActiveTime()
end
function SideBarTournArenaCell:getSpineName()
return "ui_act_tournarena_main_btn"
end
function SideBarTournArenaCell:onClick()
ModuleManager.TournArenaManager:showActMainUI()
end
function SideBarTournArenaCell:getIsShowRedPoint()
return DataManager.TournArenaData:hasEntryRedPoint()
end
function SideBarTournArenaCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarTournArenaCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarTournArenaCell:_refreshTime()
local remainTime = DataManager.TournArenaData:getEndRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarTournArenaCell

View File

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

View File

@ -1,46 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarTournWaveCell = class("SideBarTournWaveCell", SideBarBaseCellComp)
function SideBarTournWaveCell:getModuleKey()
return ModuleManager.MODULE_KEY.ACTIVITY
end
function SideBarTournWaveCell:getIsOpen()
return DataManager.TournWaveData:isOpen() and DataManager.TournWaveData:isActiveTime()
end
function SideBarTournWaveCell:getSpineName()
return "ui_act_tournwave_main_btn"
end
function SideBarTournWaveCell:onClick()
ModuleManager.TournWaveManager:showActMainUI()
end
function SideBarTournWaveCell:getIsShowRedPoint()
return DataManager.TournWaveData:hasEntryRedPoint()
end
function SideBarTournWaveCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarTournWaveCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarTournWaveCell:_refreshTime()
local remainTime = DataManager.TournWaveData:getEndRemainTime()
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarTournWaveCell

View File

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

View File

@ -1,69 +0,0 @@
local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell"
local SideBarWeaponGiftCell = class("SideBarWeaponGiftCell", SideBarBaseCellComp)
local GIFT_TYPE = PayManager.PURCHARSE_ACT_TYPE.WEAPON_UPGRADE_GIFT
function SideBarWeaponGiftCell:getIsOpen()
-- return DataManager.ShopData:hasGift(GIFT_TYPE)
return #DataManager.EquipData:getGiftIdsByType(GIFT_TYPE) > 0
end
function SideBarWeaponGiftCell:getSpineName()
return "ui_main_weapon"
end
function SideBarWeaponGiftCell:onClick()
-- local gift = DataManager.ShopData:getGift(GIFT_TYPE)
-- if gift then
-- ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, gift.id, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
-- end
local ids = DataManager.EquipData:getGiftIdsByType(GIFT_TYPE)
if #ids > 0 then
ModuleManager.ShopManager:showGiftPopUI(PayManager.PURCHARSE_TYPE.ACT_GIFT, ids, true, BIReport.PAY_UI_SHOW_TYPE.CLICK_SHOW)
end
end
function SideBarWeaponGiftCell:getIsShowRedPoint()
return false
end
function SideBarWeaponGiftCell:onRefresh()
self.timeBg:setVisible(true)
self:_refreshTime()
end
function SideBarWeaponGiftCell:updateTime()
if self:getIsOpen() then
self:_refreshTime()
else
self:closeBtn()
end
end
function SideBarWeaponGiftCell:_refreshTime()
-- local gift = DataManager.ShopData:getGift(GIFT_TYPE)
-- if gift then
-- local cfgInfo = DataManager.ShopData:getActGiftConfig()[gift.id]
-- if cfgInfo then
-- local remainTime = DataManager.ShopData:getGiftRemainTime(GIFT_TYPE)
-- if remainTime >= 0 then
-- self.timeTx:setText(GFunc.getTimeStr(remainTime))
-- else
-- self.timeTx:setText("00:00:00")
-- end
-- else
-- self.timeTx:setText("00:00:00")
-- end
-- else
-- self.timeTx:setText("00:00:00")
-- end
local remainTime = DataManager.EquipData:getGiftNearestRemainTime(GIFT_TYPE)
if remainTime >= 0 then
self.timeTx:setText(GFunc.getTimeStr(remainTime))
else
self.timeTx:setText("00:00:00")
end
end
return SideBarWeaponGiftCell

View File

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

View File

@ -190,6 +190,9 @@ function MainCityUI:_addListeners()
self:addEventListener(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_SIDE_BAR, function(module)
self:checkSideBarOpenStatus()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_POP, function()
self:checkMainPop()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, function(params)
params = params or {}
local page = params.page or self.selectedInedx
@ -433,7 +436,7 @@ function MainCityUI:initLeftRightBtns()
end)
self.rightArrowImg = self.uiMap["main_ui.right_node.arrow_node.arrow"]
self.sideBarCellObject = self.uiMap["main_ui.cache_node.side_bar_cell"]
self.sideBarCellObject = self.uiMap["main_ui.cache_node.side_bar_base_cell"]
local w, h = self.sideBarCellObject:fastGetSizeDelta()
self.sideBarHeight = h
self.sideBarMaxCount = 4
@ -786,38 +789,38 @@ function MainCityUI:refreshTopNode()
end
function MainCityUI:refreshBounty()
local isOpen = DataManager.BountyData:getIsOpen()
if not isOpen or GFunc.isShenhe() then
self.bountyNode:setVisible(false)
self.bountyRewardSpine:getSkeletonGraphic().enabled = false
return
end
self.bountyNode:setVisible(true)
if DataManager.BountyData:getIfCanClaimReward() then
self.bountyRewardSpine:setVisible(true)
self.bountyRewardSpine:playAnim("idle", true)
self.bountyRewardSpine:getSkeletonGraphic().enabled = true
self.bountyBannerInfo:setVisible(false)
self.bountyBannerDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.COLLET_REWARDS))
else
self.bountyRewardSpine:setVisible(false)
self.bountyRewardSpine:getSkeletonGraphic().enabled = false
local bannerName = DataManager.BountyData:getBannerName()
self.bountyBanner:setSprite(GConst.ATLAS_PATH.BOUNTY, bannerName)
self.bountyBannerInfo:setVisible(true)
self.bountyBannerDescTx:setText(GConst.EMPTY_STRING)
local exp = DataManager.BountyData:getExp()
local lvUpExp = DataManager.BountyData:getLvUpExp()
local level = DataManager.BountyData:getLevel()
local maxLevel = DataManager.BountyData:getMaxLevel()
self.bountyBannerSliderTx:setText(exp .. "/" .. lvUpExp)
self.bountyBannerSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = exp / lvUpExp
if level >= maxLevel then
self.bountyBannerLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
else
self.bountyBannerLvTx:setText(tostring(level))
end
end
-- local isOpen = DataManager.BountyData:isOpen()
-- if not isOpen or GFunc.isShenhe() then
-- self.bountyNode:setVisible(false)
-- self.bountyRewardSpine:getSkeletonGraphic().enabled = false
-- return
-- end
-- self.bountyNode:setVisible(true)
-- if DataManager.BountyData:getIfCanClaimReward() then
-- self.bountyRewardSpine:setVisible(true)
-- self.bountyRewardSpine:playAnim("idle", true)
-- self.bountyRewardSpine:getSkeletonGraphic().enabled = true
-- self.bountyBannerInfo:setVisible(false)
-- self.bountyBannerDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.COLLET_REWARDS))
-- else
-- self.bountyRewardSpine:setVisible(false)
-- self.bountyRewardSpine:getSkeletonGraphic().enabled = false
-- local bannerName = DataManager.BountyData:getBannerName()
-- self.bountyBanner:setSprite(GConst.ATLAS_PATH.BOUNTY, bannerName)
-- self.bountyBannerInfo:setVisible(true)
-- self.bountyBannerDescTx:setText(GConst.EMPTY_STRING)
-- local exp = DataManager.BountyData:getExp()
-- local lvUpExp = DataManager.BountyData:getLvUpExp()
-- local level = DataManager.BountyData:getLevel()
-- local maxLevel = DataManager.BountyData:getMaxLevel()
-- self.bountyBannerSliderTx:setText(exp .. "/" .. lvUpExp)
-- self.bountyBannerSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = exp / lvUpExp
-- if level >= maxLevel then
-- self.bountyBannerLvTx:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
-- else
-- self.bountyBannerLvTx:setText(tostring(level))
-- end
-- end
end
function MainCityUI:refreshArenaBounty()

View File

@ -1,11 +1,11 @@
local FirstRechargeUI = class("FirstRechargeUI", BaseUI)
function FirstRechargeUI:isFullScreen()
return false
return false
end
function FirstRechargeUI:getPrefabPath()
return "assets/prefabs/ui/shop/first_recharge_ui.prefab"
return "assets/prefabs/ui/shop/first_recharge_ui.prefab"
end
function FirstRechargeUI:onPressBackspace()
@ -13,208 +13,196 @@ function FirstRechargeUI:onPressBackspace()
end
function FirstRechargeUI:onClose()
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_POP)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_POP)
end
function FirstRechargeUI:ctor(params)
self:initData()
self:initData()
end
function FirstRechargeUI:initData()
if DataManager.ShopData:isFirstRechargeOpen(GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1) then
self.curGear = GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1
elseif DataManager.ShopData:isFirstRechargeOpen(GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_2) then
self.curGear = GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_2
else
self.curGear = GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_3
end
if DataManager.ShopData:isFirstRechargeOpen(GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1) then
self.curGear = GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1
elseif DataManager.ShopData:isFirstRechargeOpen(GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_2) then
self.curGear = GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_2
else
self.curGear = GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_3
end
end
function FirstRechargeUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
self.mask = uiMap["first_recharge_ui.mask"]
self.btnClose = uiMap["first_recharge_ui.btn_close"]
self.txTitle = uiMap["first_recharge_ui.tx_title"]
self.spineBanner = uiMap["first_recharge_ui.spine_banner"]
self.txTips = uiMap["first_recharge_ui.tips.tx_tips"]
self.btnGet = uiMap["first_recharge_ui.btn_get"]
self.txGet = uiMap["first_recharge_ui.btn_get.tx_desc"]
self.daysBg = {}
self.daysTitle = {}
self.daysRewardCells = {}
for i = 1, 3 do
table.insert(self.daysBg, uiMap["first_recharge_ui.rewards.day_" .. i])
table.insert(self.daysTitle, uiMap["first_recharge_ui.rewards.day_" .. i .. ".tx_day"])
local rewardCells = {}
for j = 1, 3 do
table.insert(rewardCells, uiMap["first_recharge_ui.rewards.day_" .. i .. ".reward_cell_" .. j]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.daysRewardCells[i] = rewardCells
end
self.tagNode = uiMap["first_recharge_ui.tag"]
self.btnTags = {}
self.imgTags = {}
self.txTags = {}
for k, key in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do
self.btnTags[key] = uiMap["first_recharge_ui.tag.btn_" .. key]
self.txTags[key] = uiMap["first_recharge_ui.tag.btn_" .. key .. ".tx_desc"]
self.imgTags[key] = uiMap["first_recharge_ui.tag.btn_" .. key .. ".img_icon"]
end
local uiMap = self.root:genAllChildren()
self.mask = uiMap["first_recharge_ui.mask"]
self.btnClose = uiMap["first_recharge_ui.btn_close"]
self.txTitle = uiMap["first_recharge_ui.tx_title"]
self.spineBanner = uiMap["first_recharge_ui.spine_banner"]
self.txTips = uiMap["first_recharge_ui.tips.tx_tips"]
self.btnGet = uiMap["first_recharge_ui.btn_get"]
self.txGet = uiMap["first_recharge_ui.btn_get.tx_desc"]
self.daysBg = {}
self.daysTitle = {}
self.daysRewardCells = {}
for i = 1, 3 do
table.insert(self.daysBg, uiMap["first_recharge_ui.rewards.day_" .. i])
table.insert(self.daysTitle, uiMap["first_recharge_ui.rewards.day_" .. i .. ".tx_day"])
local rewardCells = {}
for j = 1, 3 do
table.insert(rewardCells, uiMap["first_recharge_ui.rewards.day_" .. i .. ".reward_cell_" .. j]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL))
end
self.daysRewardCells[i] = rewardCells
end
self.tagNode = uiMap["first_recharge_ui.tag"]
self.btnTags = {}
self.imgTags = {}
self.txTags = {}
for k, key in pairs(GConst.ShopConst.FIRST_RECHARGE_GEARS) do
self.btnTags[key] = uiMap["first_recharge_ui.tag.btn_" .. key]
self.txTags[key] = uiMap["first_recharge_ui.tag.btn_" .. key .. ".tx_desc"]
self.imgTags[key] = uiMap["first_recharge_ui.tag.btn_" .. key .. ".img_icon"]
end
DataManager.ShopData:setFirstrechargePoped()
-- 上报
BIReport:postPayUIShow(BIReport.GIFT_TYPE.FIRST_RECHARGE, DataManager.ShopData:getFirstRechargeGiftId(self.curGear))
self:postChangePage()
DataManager.ShopData:setFirstrechargePoped()
-- 上报
BIReport:postPayUIShow(BIReport.GIFT_TYPE.FIRST_RECHARGE, DataManager.ShopData:getFirstRechargeGiftId(self.curGear))
self:postChangePage()
for gear, btn in pairs(self.btnTags) do
btn:addClickListener(function()
self.curGear = gear
self:onRefresh()
-- 上报
BIReport:postPayUIShow(BIReport.GIFT_TYPE.FIRST_RECHARGE, DataManager.ShopData:getFirstRechargeGiftId(self.curGear))
self:postChangePage()
end)
end
self.mask:addClickListener(function()
self:closeUI()
end)
self.btnClose:addClickListener(function()
self:closeUI()
for gear, btn in pairs(self.btnTags) do
btn:addClickListener(function()
self.curGear = gear
self:onRefresh()
-- 上报
BIReport:postPayUIShow(BIReport.GIFT_TYPE.FIRST_RECHARGE, DataManager.ShopData:getFirstRechargeGiftId(self.curGear))
self:postChangePage()
end)
end
self.mask:addClickListener(function()
self:closeUI()
end)
self.btnClose:addClickListener(function()
self:closeUI()
end)
self.btnGet:addClickListener(function()
local boughtDay = DataManager.ShopData:getFirstRechargeBoughtDays(self.curGear)
local rewardDay = DataManager.ShopData:getFirstRechargeRewardDays(self.curGear)
if boughtDay > 0 then
-- 已购买
if boughtDay > rewardDay then
ModuleManager.ShopManager:onBuyFirstRecharge(self.curGear, rewardDay + 1)
end
else
-- 未购买
ModuleManager.ShopManager:onBuyFirstRecharge(self.curGear, rewardDay + 1)
end
local boughtDay = DataManager.ShopData:getFirstRechargeBoughtDays(self.curGear)
local rewardDay = DataManager.ShopData:getFirstRechargeRewardDays(self.curGear)
if boughtDay > 0 then
-- 已购买
if boughtDay > rewardDay then
ModuleManager.ShopManager:onBuyFirstRecharge(self.curGear, rewardDay + 1)
end
else
-- 未购买
ModuleManager.ShopManager:onBuyFirstRecharge(self.curGear, rewardDay + 1)
end
end)
self:bind(DataManager.PaymentData, "isDirty", function()
if not DataManager.ShopData:isFirstRechargeOpen(self.curGear) then
self:initData()
end
self:onRefresh()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.CROSS_DAY, function()
self:bind(DataManager.PaymentData, "isDirty", function()
if not DataManager.ShopData:isFirstRechargeOpen(self.curGear) then
self:initData()
end
self:onRefresh()
end)
end)
self:addEventListener(EventManager.CUSTOM_EVENT.CROSS_DAY, function()
self:onRefresh()
end)
end
function FirstRechargeUI:postChangePage()
if self.curGear then
BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME["FIRST_RECHARGE_PAGE_" .. self.curGear])
end
-- if self.curGear then
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME["FIRST_RECHARGE_PAGE_" .. self.curGear])
-- end
end
function FirstRechargeUI:onRefresh()
if not DataManager.ShopData:isFirstRechargeOpen() then
self:closeUI()
end
if not DataManager.ShopData:isFirstRechargeOpen() then
self:closeUI()
end
local cfg = DataManager.ShopData:getActGiftConfig(DataManager.ShopData:getFirstRechargeGiftId(self.curGear))
local price = GFunc.getFormatPrice(cfg.recharge_id)
local cfg = DataManager.ShopData:getActGiftConfig(DataManager.ShopData:getFirstRechargeGiftId(self.curGear))
local price = GFunc.getFormatPrice(cfg.recharge_id)
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst["FIRST_CHARGE_TITLE_" .. self.curGear]))
self.txTitle:setText(I18N:getGlobalText(I18N.GlobalConst["FIRST_CHARGE_TITLE_" .. self.curGear]))
local tips
local spineName
-- if DataManager.ShopData:isNewFirstRechargeGift(self.curGear) and self.curGear == GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1 then
-- tips = I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_TIPS_1_NEW, price)
-- spineName = "ui_first_dec_4"
-- else
-- tips = I18N:getGlobalText(I18N.GlobalConst["FIRST_CHARGE_TIPS_" .. self.curGear], price)
-- spineName = "ui_first_dec_" .. self.curGear
-- end
tips = I18N:getGlobalText(I18N.GlobalConst["FIRST_CHARGE_TIPS_" .. self.curGear], price)
spineName = "ui_first_dec_" .. self.curGear
self.txTips:setText(tips)
local tips
local spineName
tips = I18N:getGlobalText(I18N.GlobalConst["FIRST_CHARGE_TIPS_" .. self.curGear], price)
spineName = "ui_first_dec_" .. self.curGear
spineName = "ui_first_dec_1"
self.txTips:setText(tips)
self.spineBanner:setActive(false)
self.spineBanner:loadAssetAsync(spineName, function()
self.spineBanner:setActive(true)
self.spineBanner:setLocalScale(1, 1)
self.spineBanner:playAnim("idle", true, true, true)
end)
self.spineBanner:setActive(false)
self.spineBanner:loadAssetAsync(spineName, function()
self.spineBanner:setActive(true)
self.spineBanner:setLocalScale(1, 1)
self.spineBanner:playAnim("idle", true, true, true)
end)
-- 档位标签
local openCount = DataManager.ShopData:getFirstRechargeOpenCount()
for gear, btn in pairs(self.btnTags) do
if openCount > 1 and DataManager.ShopData:isFirstRechargeOpen(gear) then
btn:setActive(true)
local cfg = DataManager.ShopData:getActGiftConfig(DataManager.ShopData:getFirstRechargeGiftId(gear))
self.imgTags[gear]:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, "act_firstcharge_icon_".. gear)
-- if DataManager.ShopData:isNewFirstRechargeGift(gear) and gear == GConst.ShopConst.FIRST_RECHARGE_GEARS.GEAR_1 then
-- btn:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, gear == self.curGear and "act_firstcharge_btn_4" or "act_firstcharge_btn_4_1")
-- else
-- btn:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, gear == self.curGear and ("act_firstcharge_btn_" .. gear) or ("act_firstcharge_btn_" .. gear .. "_1"))
-- end
btn:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, gear == self.curGear and ("act_firstcharge_bg_2") or ("act_firstcharge_bg_3"))
self.txTags[gear]:setText("<color=" .. (gear == self.curGear and "#A1591A" or "#C5EAFF") .. ">" .. I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_2, GFunc.getFormatPrice(cfg.recharge_id)) .. "</color>")
local boughtDay = DataManager.ShopData:getFirstRechargeBoughtDays(gear)
local rewardDay = DataManager.ShopData:getFirstRechargeRewardDays(gear)
if boughtDay > 0 and boughtDay > rewardDay then
btn:addRedPoint(90, 30, 0.9)
else
btn:removeRedPoint()
end
else
btn:setActive(false)
end
end
-- 档位标签
local openCount = DataManager.ShopData:getFirstRechargeOpenCount()
for gear, btn in pairs(self.btnTags) do
if openCount > 1 and DataManager.ShopData:isFirstRechargeOpen(gear) then
btn:setActive(true)
local cfg = DataManager.ShopData:getActGiftConfig(DataManager.ShopData:getFirstRechargeGiftId(gear))
self.imgTags[gear]:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, "act_firstcharge_icon_".. gear)
btn:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, gear == self.curGear and ("act_firstcharge_bg_2") or ("act_firstcharge_bg_3"))
self.txTags[gear]:setText("<color=" .. (gear == self.curGear and "#A1591A" or "#C5EAFF") .. ">" .. I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_2, GFunc.getFormatPrice(cfg.recharge_id)) .. "</color>")
local boughtDay = DataManager.ShopData:getFirstRechargeBoughtDays(gear)
local rewardDay = DataManager.ShopData:getFirstRechargeRewardDays(gear)
if boughtDay > 0 and boughtDay > rewardDay then
btn:addRedPoint(90, 30, 0.9)
else
btn:removeRedPoint()
end
else
btn:setActive(false)
end
end
local boughtDay = DataManager.ShopData:getFirstRechargeBoughtDays(self.curGear)
local rewardDay = DataManager.ShopData:getFirstRechargeRewardDays(self.curGear)
local boughtDay = DataManager.ShopData:getFirstRechargeBoughtDays(self.curGear)
local rewardDay = DataManager.ShopData:getFirstRechargeRewardDays(self.curGear)
-- 奖励相关
for day, bg in ipairs(self.daysBg) do
local giftId = DataManager.ShopData:getFirstRechargeGiftId(self.curGear, day)
local cfg = DataManager.ShopData:getActGiftConfig(giftId)
local rewards = cfg.reward
local received = DataManager.ShopData:isBoughtFirstRecharge(self.curGear, day)
local canGet = DataManager.ShopData:canGetFirstRechargeReward(self.curGear, day)
for i, cell in ipairs(self.daysRewardCells[day]) do
if rewards and rewards[i] then
cell:showCell()
cell:refreshByConfig(rewards[i], received, received)
if canGet then
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:hideCell()
end
end
-- bg:setSprite(GConst.ATLAS_PATH.UI_FIRST_CHARGE, canGet and "act_firstcharge_bg_1" or "act_firstcharge_bg_2")
self.daysTitle[day]:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_1, day))
end
-- 奖励相关
for day, bg in ipairs(self.daysBg) do
local giftId = DataManager.ShopData:getFirstRechargeGiftId(self.curGear, day)
local cfg = DataManager.ShopData:getActGiftConfig(giftId)
local rewards = cfg.reward
local received = DataManager.ShopData:isBoughtFirstRecharge(self.curGear, day)
local canGet = DataManager.ShopData:canGetFirstRechargeReward(self.curGear, day)
for i, cell in ipairs(self.daysRewardCells[day]) do
if rewards and rewards[i] then
cell:setActive(true)
cell:refreshByConfig(rewards[i], received, received)
if canGet then
cell:showFrameAnimation()
else
cell:hideFrameAnimation()
end
else
cell:setActive(false)
end
end
self.daysTitle[day]:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_1, day))
end
-- 购买领取按钮
if boughtDay > 0 then
-- 已购买
if boughtDay > rewardDay then
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CLAIM))
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_2")
self.btnGet:setTouchEnable(true)
self.btnGet:addRedPoint(114, 38, 1)
else
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_3))
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_5")
self.btnGet:setTouchEnable(false)
self.btnGet:removeRedPoint()
end
else
-- 未购买
self.txGet:setText(price)
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_2")
self.btnGet:setTouchEnable(true)
self.btnGet:removeRedPoint()
end
-- 购买领取按钮
if boughtDay > 0 then
-- 已购买
if boughtDay > rewardDay then
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_CLAIM))
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_2")
self.btnGet:setTouchEnable(true)
self.btnGet:addRedPoint(114, 38, 1)
else
self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_3))
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_5")
self.btnGet:setTouchEnable(false)
self.btnGet:removeRedPoint()
end
else
-- 未购买
self.txGet:setText(price)
self.btnGet:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_2")
self.btnGet:setTouchEnable(true)
self.btnGet:removeRedPoint()
end
end
return FirstRechargeUI

8
lua/app/ui/sign.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c8f91806e05cd44d4907a367efbcda77
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1cd78dd2f30e04a44960e1db5295842d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,89 @@
local SignMonthCell = class("sign_month_cell", BaseCell)
function SignMonthCell:init()
local uiMap = self:getUIMap()
self.txDay = uiMap["sign_month_cell.tx_day"]
self.bg = uiMap["sign_month_cell.bg"]
self.imgAd = uiMap["sign_month_cell.btn_ad.check"]
if DataManager.PaymentData:getIsSkipAd() then
self.imgAd:setSprite(GConst.ATLAS_PATH.COMMON, "common_ad_2")
else
self.imgAd:setSprite(GConst.ATLAS_PATH.COMMON, "common_ad_1")
end
self.rewardCell = uiMap["sign_month_cell.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.btn_ad = uiMap["sign_month_cell.reward_cell.btn_ad"]
self.btn_ad:addClickListener(function()
local signState = DataManager.SignMonthData:getSignState(self.day)
if signState == GConst.SignConst.SIGN_STATE.CAN_SIGN_AD then
self:OnClickSignAgain()
end
end)
self:addClickListener(function()
local signState = DataManager.SignMonthData:getSignState(self.day)
if signState == GConst.SignConst.SIGN_STATE.CAN_SIGN then
self:OnClickSign()
end
end)
end
function SignMonthCell:OnClickSignAgain()
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.AD_SIGN_MONTH_AGAIN, function ()
ModuleManager.SignManager:reqMonthSignAgain()
end)
end
function SignMonthCell:OnClickSign()
ModuleManager.SignManager:reqMonthSign(self.day)
end
function SignMonthCell:refresh(day)
self.day = day
local showCheck = false
local showFrame = false
local reward = DataManager.SignMonthData:getReward(GConst.SignConst.MONTH_REWARD_TYPE.SIGN, day)
local signState = DataManager.SignMonthData:getSignState(day)
self.rewardCell:refreshByConfig(reward, showCheck, showCheck)
self.txDay:setText(I18N:getGlobalText(I18N.GlobalConst.FIRST_CHARGE_1,day))
if signState == GConst.SignConst.SIGN_STATE.CAN_SIGN then
--可以领取状态
self.btn_ad:setActive(false)
self.rewardCell:addClickListener(function()
local signState = DataManager.SignMonthData:getSignState(self.day)
if signState == GConst.SignConst.SIGN_STATE.CAN_SIGN then
self:OnClickSign()
end
end)
showFrame = true
self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_MONTH_SIGNIN, "act_month_signin_bg_4")
elseif signState == GConst.SignConst.SIGN_STATE.CAN_SIGN_AD then
--可以领取广告
self.btn_ad:setActive(true)
self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_MONTH_SIGNIN, "act_month_signin_bg_4")
self.rewardCell:addClickListener(function()
local signState = DataManager.SignMonthData:getSignState(self.day)
if signState == GConst.SignConst.SIGN_STATE.CAN_SIGN_AD then
self:OnClickSignAgain()
end
end)
elseif signState == GConst.SignConst.SIGN_STATE.UNABLE_SIGN then
--不可领取
self.btn_ad:setActive(false)
self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_MONTH_SIGNIN, "act_month_signin_bg_3")
-- self.rewardCell:setClickShowTips(true)
elseif signState == GConst.SignConst.SIGN_STATE.SIGNEDIN then
--已签到
showCheck = true
self.btn_ad:setActive(false)
self.bg:setSprite(GConst.ATLAS_PATH.UI_ACT_MONTH_SIGNIN, "act_month_signin_bg_5")
-- self.rewardCell:setClickShowTips(true)
end
if showFrame then
self.rewardCell:showFrameAnimation()
else
self.rewardCell:hideFrameAnimation()
end
self.rewardCell:showMask(showCheck, showCheck)
end
return SignMonthCell

View File

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

View File

@ -0,0 +1,137 @@
local SignWeekCell = class("SignWeekCell", BaseCell)
function SignWeekCell:init()
local uiMap = self:getUIMap()
self.upSlider = uiMap["bounty_cell.up_slider"]
self.upIcon = uiMap["bounty_cell.up_slider.icon"]
self.downSlider = uiMap["bounty_cell.down_slider"]
self.downIcon = uiMap["bounty_cell.down_slider.icon"]
self.downSliderCanvas = self.downSlider:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS)
self.dayIconCanvas = uiMap["bounty_cell.day_icon"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS)
self.dayTx = uiMap["bounty_cell.day_icon.day_tx"]
self.freeRewardCell = uiMap["bounty_cell.reward_free.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.proRewardCells = {}
for i = 1, 2 do
self.proRewardCells[i] = uiMap["bounty_cell.reward_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
self.resignFlagTx = uiMap["bounty_cell.resign_tx"]
self.funcBtn = uiMap["bounty_cell.func_btn"]
self.funcBtnCostIcon = uiMap["bounty_cell.func_btn.icon"]
self.funcBtnCostTx = uiMap["bounty_cell.func_btn.resign_tx"]
self.funcBtnCenterTx = uiMap["bounty_cell.func_btn.center_tx"]
self.rp = uiMap["bounty_cell.func_btn.rp"]
self.signFlag = uiMap["bounty_cell.has_sign_flag"]
self.signFlagTx = uiMap["bounty_cell.has_sign_flag.desc_tx"]
end
function SignWeekCell:refresh(day)
local curDay = DataManager.SignWeekData:calculateDay()
local freeGot = DataManager.SignWeekData:getHasGotReward(GConst.SignConst.REWARD_TYPE.FREE, day)
local proGot = DataManager.SignWeekData:getHasGotReward(GConst.SignConst.REWARD_TYPE.PRO, day)
local freeCanGet = DataManager.SignWeekData:getCanGetReward(GConst.SignConst.REWARD_TYPE.FREE, day)
local rewardFree = DataManager.SignWeekData:getReward(GConst.SignConst.REWARD_TYPE.FREE, day)
local rewardPro1, rewardPro2 = DataManager.SignWeekData:getReward(GConst.SignConst.REWARD_TYPE.PRO, day)
local cost = DataManager.SignWeekData:getReSignCost()
local isUnlockPro = DataManager.SignWeekData:isUnlockPro()
self.dayTx:setText(day)
self.resignFlagTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_9))
self.signFlagTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_10))
self.funcBtnCostTx:setText(cost.num)
if curDay >= day then -- 处于可领取天数
if freeGot then -- 已经领过了
self.funcBtn:setActive(false)
self.resignFlagTx:setVisible(false)
self.signFlag:setVisible(true)
elseif freeCanGet then -- 可领取
self.funcBtn:setActive(true)
self.funcBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_5")
self.funcBtnCostIcon:setVisible(false)
self.funcBtnCostTx:setVisible(false)
self.funcBtnCenterTx:setVisible(true)
self.funcBtnCenterTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_8))
self.resignFlagTx:setVisible(false)
self.signFlag:setVisible(false)
self.rp:setVisible(true)
else
self.funcBtn:setActive(true)
self.funcBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
self.funcBtnCostIcon:setVisible(true)
self.funcBtnCostTx:setVisible(true)
GFunc.centerImgAndTx(self.funcBtnCostIcon, self.funcBtnCostTx, 0, nil, -6)
self.funcBtnCenterTx:setVisible(false)
self.resignFlagTx:setVisible(true)
self.signFlag:setVisible(false)
self.rp:setVisible(false)
end
else -- 还未到达可领取天数
self.funcBtn:setActive(true)
self.funcBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_5")
self.funcBtnCostIcon:setVisible(false)
self.funcBtnCostTx:setVisible(false)
self.funcBtnCenterTx:setVisible(true)
self.funcBtnCenterTx:setText(I18N:getGlobalText(I18N.GlobalConst.GIFT_ROUTINE_DESC_11))
self.resignFlagTx:setVisible(false)
self.signFlag:setVisible(false)
self.rp:setVisible(false)
end
-- 刷新slider部分
self.upSlider:setVisible(day ~= 1)
self.downSlider:setVisible(day ~= 7)
self.upIcon:setVisible(day <= curDay)
self.downIcon:setVisible(day < curDay)
-- 奖励
self.freeRewardCell:refreshByConfig(rewardFree, freeGot, freeGot)
self.proRewardCells[1]:refreshByConfig(rewardPro1, proGot, proGot)
if rewardPro2 then
self.proRewardCells[2]:setActive(true)
self.proRewardCells[2]:refreshByConfig(rewardPro2, proGot, proGot)
else
self.proRewardCells[2]:setActive(false)
end
self.proRewardCells[1]:showLock(not isUnlockPro)
self.proRewardCells[2]:showLock(not isUnlockPro)
if freeGot and isUnlockPro and not proGot then
self.proRewardCells[1]:showFrameAnimation()
self.proRewardCells[2]:showFrameAnimation()
self.proRewardCells[1]:addClickListener(function()
ModuleManager.SignManager:reqSignClaimed(day, true)
end)
self.proRewardCells[2]:addClickListener(function()
ModuleManager.SignManager:reqSignClaimed(day, true)
end)
else
self.proRewardCells[1]:hideFrameAnimation()
self.proRewardCells[2]:hideFrameAnimation()
-- self.proRewardCells[1]:setClickShowTips()
-- self.proRewardCells[2]:setClickShowTips()
end
self.funcBtn:addClickListener(function()
local curDay = DataManager.SignWeekData:calculateDay()
local freeGot = DataManager.SignWeekData:getHasGotReward(GConst.SignConst.REWARD_TYPE.FREE, day)
local proGot = DataManager.SignWeekData:getHasGotReward(GConst.SignConst.REWARD_TYPE.PRO, day)
local freeCanGet = DataManager.SignWeekData:getCanGetReward(GConst.SignConst.REWARD_TYPE.FREE, day)
if curDay >= day then -- 处于可领取天数
if freeGot then -- 已经领过了
-- 不作处理
elseif freeCanGet then -- 可领取
ModuleManager.SignManager:reqSignClaimed(day, false)
else -- 补签
local cost = DataManager.SignWeekData:getReSignCost()
if GFunc.checkCost(cost.id, cost.num, true) then
ModuleManager.SignManager:reqSignReCheckin(day)
end
end
else -- 还未到达可领取天数
-- 不作处理
end
end)
end
return SignWeekCell

View File

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

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3cc0d987e63c54a0dafc4bf844d1942a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,144 @@
local SignMonthComp = class("SignMonthComp", LuaComponent)
function SignMonthComp:init()
local uiMap = self:getBaseObject():genAllChildren()
if not self.boxObjs then
self.boxObjs = {}
for i = 1, 4 do
self.boxObjs[i] = {
box = uiMap["sign_month_comp.top_node.bg_2.progress_bg.box_" .. i],
btnGet = uiMap["sign_month_comp.top_node.bg_2.progress_bg.box_" .. i .. ".btn_get"],
desc = uiMap["sign_month_comp.top_node.bg_2.progress_bg.box_" .. i .. ".bg.box_desc"],
rewardCell = uiMap["sign_month_comp.top_node.bg_2.progress_bg.box_" .. i .. ".reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL),
}
self.boxObjs[i].btnGet:addClickListener(function()
ModuleManager.SignManager:reqMonthAccumClaim(DataManager.SignMonthData:getAccumClaimID(i))
end)
end
end
self.boxObjs[1].desc:setText(7)
self.boxObjs[2].desc:setText(14)
self.boxObjs[3].desc:setText(21)
self.boxObjs[4].desc:setText(30)
self.slider = uiMap["sign_month_comp.top_node.bg_2.progress_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
self.scrollRectPrefab = uiMap["sign_month_comp.bg_2.scroll_rect"]
self.txAccum = uiMap["sign_month_comp.top_node.bg_2.progress_bg.bg.tx_accum"]
self.btnSign = uiMap["sign_month_comp.btn_sign"]
self.btnAdSign = uiMap["sign_month_comp.btn_ad_sign"]
self.btnNo = uiMap["sign_month_comp.btn_no"]
self.imgAd = uiMap["sign_month_comp.bg_2.img_bg.btn_ad_sign.img_ad"]
self.timeBg = uiMap["sign_month_comp.top_node.time_bg"]
self.titleTx = uiMap["sign_month_comp.top_node.title_tx"]
self.txTips = uiMap["sign_month_comp.top_node.time_bg.tx_tips"]
self.txSign = uiMap["sign_month_comp.btn_sign.tx_sign"]
self.txAdSign = uiMap["sign_month_comp.btn_ad_sign.tx_ad_sign"]
self.txNo = uiMap["sign_month_comp.btn_no.tx_no"]
self.txTips2 = uiMap["sign_month_comp.bg_2.scroll_rect.view_port.content.sign_month_cell.btn_ad.tx_tips"]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_30SIGNIN_1))
self.txTips:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_30SIGNIN_3))
self.txSign:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_8))
self.txAdSign:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_30SIGNIN_5))
self.txNo:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_10))
self.txTips2:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_30SIGNIN_5))
local meshProComp = self.txTips:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
self.timeBg:setSizeDeltaX(meshProComp + 55)
self.count = DataManager.SignMonthData:getConfigCount()
self.btnAdSign:addClickListener(function()
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.AD_SIGN_MONTH_AGAIN, function ()
ModuleManager.SignManager:reqMonthSignAgain()
end)
end)
self.btnSign:addClickListener(function()
ModuleManager.SignManager:reqMonthSign(1)
end)
self:bind(DataManager.SignMonthData, "isDirty", function()
self:refresh()
end)
end
function SignMonthComp:refresh()
self:refreshTop()
self:refreshScrollRect()
self:refreshBtn()
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.SIGN_MONTH)
end
function SignMonthComp:refreshTop()
for i = 1, 4 do
local reward = DataManager.SignMonthData:getReward(GConst.SignConst.MONTH_REWARD_TYPE.BOX, DataManager.SignMonthData:getAccumClaimID(i))
self.boxObjs[i].rewardCell:refreshByConfig(reward, false, false)
local state = DataManager.SignMonthData:getBoxState(i)
if state == GConst.SignConst.BOX_STATE.UNABLE_CLAIM then
self.boxObjs[i].rewardCell:showMask(false, false)
self.boxObjs[i].rewardCell:hideFrameAnimation()
self.boxObjs[i].btnGet:setVisible(false)
elseif state == GConst.SignConst.BOX_STATE.CAN_CLAIM then
self.boxObjs[i].rewardCell:showMask(false, false)
self.boxObjs[i].rewardCell:showFrameAnimation()
self.boxObjs[i].btnGet:setVisible(true)
elseif state == GConst.SignConst.BOX_STATE.CLAIMED then
self.boxObjs[i].rewardCell:showMask(true, true)
self.boxObjs[i].rewardCell:hideFrameAnimation()
self.boxObjs[i].btnGet:setVisible(false)
else
self.boxObjs[i].btnGet:setVisible(false)
end
end
self.curDay = DataManager.SignMonthData:getCurDay()
self.txAccum:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_30SIGNIN_4, self.curDay))
if self.curDay == 0 then
self.slider.value = 0
else
self.slider.value = DataManager.SignMonthData:getSliderValue()
end
end
function SignMonthComp:refreshBtn()
if DataManager.PaymentData:getIsSkipAd() then
self.imgAd:setSprite(GConst.ATLAS_PATH.COMMON, "common_ad_2")
else
self.imgAd:setSprite(GConst.ATLAS_PATH.COMMON, "common_ad_1")
end
if DataManager.SignMonthData:getCanSign() then
self.btnSign:addRedPoint(89, 42, 1)
self.btnSign:setActive(true)
self.btnAdSign:setActive(false)
self.btnNo:setActive(false)
elseif not DataManager.SignMonthData:getCanSignAgain() then
self.btnSign:setActive(false)
self.btnAdSign:setActive(true)
self.btnNo:setActive(false)
else
self.btnSign:setActive(false)
self.btnAdSign:setActive(false)
self.btnNo:setActive(true)
end
end
function SignMonthComp:refreshScrollRect()
if self.scrollRect then
self.scrollRect:updateAllCell()
else
self.scrollRect = self.scrollRectPrefab:getLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRect:addInitCallback(function()
return "app/ui/sign/cell/sign_month_cell"
end)
self.scrollRect:addRefreshCallback(function(index, cell)
cell:refresh(index)
end)
self.scrollRect:refillCells(self.count)
end
if self.curDay > 0 then
self.scrollRect:moveToIndex(self.curDay)
end
end
return SignMonthComp

View File

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

View File

@ -0,0 +1,84 @@
local SignWeekComp = class("SignWeekComp", LuaComponent)
function SignWeekComp:init()
local uiMap = self:getBaseObject():genAllChildren()
self.timeTx = uiMap["sign_bounty_node.top_node.time_bg.text"]
self.titleTx = uiMap["sign_bounty_node.top_node.title_tx"]
self.desc1Tx = uiMap["sign_bounty_node.top_node.desc_bg.tx_1"]
self.desc2Tx = uiMap["sign_bounty_node.top_node.desc_bg.tx_2"]
self.lockFlag = uiMap["sign_bounty_node.top_node.bg_2.lock_flag"]
self.gotFlag = uiMap["sign_bounty_node.top_node.bg_2.got_flag"]
self.signTx = uiMap["sign_bounty_node.top_node.bg_2.sign_day_tx"]
self.cardDescTx = uiMap["sign_bounty_node.top_node.bg_2.desc_tx"]
self.buyBtn = uiMap["sign_bounty_node.top_node.bg_2.buy_btn"]
self.buyTx = uiMap["sign_bounty_node.top_node.bg_2.buy_btn.text"]
self.bg = uiMap["sign_bounty_node.bg"]
self.scrollRectPrefab = uiMap["sign_bounty_node.bg.scroll_rect"]
self.buyBtn:addClickListener(function()
self:buyCard()
end)
self:bind(DataManager.SignWeekData, "isDirty", function()
self:refresh()
end)
end
function SignWeekComp:refresh()
local giftCfg = ConfigManager:getConfig("act_gift")[DataManager.SignWeekData:getProRewardGiftId()]
self.titleTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_1))
self.desc1Tx:setText(I18N:getGlobalText(I18N.GlobalConst.FUND_DESC_3, giftCfg.value))
self.desc2Tx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_2))
self.buyTx:setText(GFunc.getFormatPrice(giftCfg.recharge_id))
self:refreshTop()
self:refreshScrollRect()
-- 尝试请求一次未领取奖励
ModuleManager.SignManager:reqSignAutoRewardsClaimed()
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.SING_WEEK)
end
function SignWeekComp:refreshTop()
self.signTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_4, DataManager.SignWeekData:getSignDay()))
self.lockFlag:setActive(not DataManager.SignWeekData:isUnlockPro())
self.buyBtn:setActive(not DataManager.SignWeekData:isUnlockPro())
self.gotFlag:setActive(DataManager.SignWeekData:isUnlockPro())
self.cardDescTx:setText(DataManager.SignWeekData:isUnlockPro() and I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_6) or I18N:getGlobalText(I18N.GlobalConst.ACT_BOUNTY_SIGNIN_DESC_5))
end
function SignWeekComp:refreshScrollRect()
self.list = DataManager.SignWeekData:getConfigList()
if self.scrollRect then
self.scrollRect:updateAllCell()
else
self.scrollRect = self.scrollRectPrefab:getLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRect:addInitCallback(function()
return "app/ui/sign/cell/sign_week_cell"
end)
self.scrollRect:addRefreshCallback(function(index, cell)
cell:refresh(index)
end)
self.scrollRect:refillCells(#self.list)
end
local curDay = DataManager.SignWeekData:getMinCanGetRewardDay()
self.scrollRect:moveToIndex(curDay)
end
function SignWeekComp:updateTime()
local remainTime = DataManager.SignWeekData:getRemainTime()
if remainTime < 0 then
return
end
self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.NEXT_REFRESH_DESC, Time:formatNumTimeStr(remainTime)))
end
function SignWeekComp:buyCard()
local id = DataManager.SignWeekData:getProRewardGiftId()
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
return SignWeekComp

View File

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

216
lua/app/ui/sign/sign_main_ui.lua Executable file
View File

@ -0,0 +1,216 @@
local SignMainUI = class("SignMainUI", BaseUI)
local BTN_WIDTH = 82
local BTN_RIGHT = 20
local BTN_SPACING = 26
function SignMainUI:showCommonBG()
return false
end
function SignMainUI:onPressBackspace()
self:closeUI()
end
function SignMainUI:getPrefabPath()
return "assets/prefabs/ui/sign/sign_main_ui.prefab"
end
function SignMainUI:onClose()
if self.subComps then
for _, comp in pairs(self.subComps) do
if comp.onClose then
comp:onClose()
end
end
end
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_POP)
local callback = self.callback
self.callback = nil
if callback then
callback()
end
end
function SignMainUI:ctor(param)
if param and param.showPage then
self.curPage = param.showPage
self.onlyShowPage = param.onlyShowPage
self.callback = param.callback
else
self:switchOtherPage()
end
end
function SignMainUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
self.btnClose = uiMap["sign_main_ui.bottom.btn_close"]
self.btnNode = uiMap["sign_main_ui.bottom.btns"]
self.btnContent = uiMap["sign_main_ui.bottom.btns.viewport.content"]
self.btns = {}
self.txBtns = {}
for i = 1, table.nums(GConst.SignConst.SIGN_SHOW_PAGE) do
table.insert(self.btns, uiMap["sign_main_ui.bottom.btns.viewport.content.btn_" .. i])
table.insert(self.txBtns, uiMap["sign_main_ui.bottom.btns.viewport.content.btn_" .. i .. ".tx_desc"])
end
self.compsRoot = uiMap["sign_main_ui.comps"]
for i, btn in ipairs(self.btns) do
self.txBtns[i]:setText(I18N:getGlobalText(I18N.GlobalConst[GConst.SignConst.SIGN_PAGE_BTN_DESC[i]]))
btn:addClickListener(function()
self:onChangePage(i)
end)
end
self:initComps()
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
self.btnClose:addClickListener(function()
self:closeUI()
end)
self:bind(DataManager.SignWeekData, "isDirty", function()
self:refreshRedPoint()
end)
self:bind(DataManager.SignMonthData, "isDirty", function()
self:refreshRedPoint()
end)
end
function SignMainUI:initComps()
if self.subComps then
return
end
local uiMap = self.root:genAllChildren()
self.subComps = {}
for k, id in pairs(GConst.SignConst.SIGN_SHOW_PAGE) do
if GConst.SignConst.SIGN_COMP_NAME[id] then
-- 预制体挂载
local obj = uiMap[GConst.SignConst.SIGN_COMP_NAME[id]]
obj:initPrefabHelper()
obj:genAllChildren()
local comp = obj:addLuaComponent(GConst.SignConst.SIGN_COMP[id])
self.subComps[id] = comp
elseif GConst.SignConst.SIGN_COMP_PATH[id] then
-- 动态加载
self:loadModule(GConst.SignConst.SIGN_COMP_PATH[id], self.compsRoot, GConst.SignConst.SIGN_COMP[id], function(comp)
comp:getBaseObject():setActive(false)
self.subComps[id] = comp
-- 判断当前需要展示界面是否是刚加载完的界面,是的话刷新一下界面
if self.curPage == id then
self:onRefresh()
end
end)
end
end
end
function SignMainUI:updateTime()
if self.subComps then
for _, comp in pairs(self.subComps) do
if comp.updateTime then
comp:updateTime()
end
end
end
end
function SignMainUI:onChangePage(page)
if self.curPage == page then
return
end
for i, comp in pairs(self.subComps) do
if page ~= i and self.curPage == i and comp.onClose then
comp:onClose()
end
end
self.curPage = page
self:onRefresh()
end
function SignMainUI:switchOtherPage()
if DataManager.SignWeekData:showRedPoint() then
self.curPage = GConst.SignConst.SIGN_SHOW_PAGE.WEEK
elseif DataManager.SignMonthData:showRedPoint() then
self.curPage = GConst.SignConst.SIGN_SHOW_PAGE.MONTH
end
if self.curPage ~= nil then
return
end
for page = 1, table.nums(GConst.SignConst.SIGN_SHOW_PAGE) do
if self:isOpen(page) then
self.curPage = page
break
end
end
end
function SignMainUI:onRefresh()
local openCount = 0
for i, btn in ipairs(self.btns) do
if self:isOpen(i) then
btn:setActive(true)
openCount = openCount + 1
if self.curPage == i then
btn:setSprite(GConst.SignConst.SIGN_PAGE_BTN_ICON_ATLAS[i], GConst.SignConst.SIGN_PAGE_BTN_ICON_1[i])
else
btn:setSprite(GConst.SignConst.SIGN_PAGE_BTN_ICON_ATLAS[i], GConst.SignConst.SIGN_PAGE_BTN_ICON_2[i])
end
else
btn:setActive(false)
end
end
local width = BTN_RIGHT + BTN_WIDTH * openCount + BTN_SPACING * (openCount - 1)
self.btnContent:setSizeDeltaX(width)
self.btnContent:setAnchoredPositionX(math.max(width - self.btnNode:getSizeDeltaX(), 0))
for i, comp in pairs(self.subComps) do
if self.curPage == i then
comp:getBaseObject():setActive(true)
comp:refresh()
else
comp:getBaseObject():setActive(false)
end
end
-- 红点
self:refreshRedPoint()
self.btnNode:setActive(not self.onlyShowPage)
end
function SignMainUI:refreshRedPoint()
for i, btn in ipairs(self.btns) do
if self:hasRedPoint(i) then
btn:addRedPoint(30, 30, 0.9)
else
btn:removeRedPoint()
end
end
end
function SignMainUI:isOpen(type)
if type == GConst.SignConst.SIGN_SHOW_PAGE.WEEK then
return DataManager.SignWeekData:isOpen()
elseif type == GConst.SignConst.SIGN_SHOW_PAGE.MONTH then
return DataManager.SignMonthData:isOpen()
end
end
function SignMainUI:hasRedPoint(type)
if type == GConst.SignConst.SIGN_SHOW_PAGE.WEEK then
return DataManager.SignWeekData:showRedPoint()
elseif type == GConst.SignConst.SIGN_SHOW_PAGE.MONTH then
return DataManager.SignMonthData:showRedPoint()
end
end
return SignMainUI

View File

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

Some files were not shown because too many files have changed in this diff Show More