This commit is contained in:
puxuan 2025-09-25 16:04:15 +08:00
parent 35059a2f70
commit a20f3f0dd1
251 changed files with 8344 additions and 16081 deletions

View File

@ -23,23 +23,14 @@ function DataManager:init()
self:initManager("TutorialData", "app/userdata/tutorial/tutorial_data") self:initManager("TutorialData", "app/userdata/tutorial/tutorial_data")
self:initManager("MailData", "app/userdata/mail/mail_data") self:initManager("MailData", "app/userdata/mail/mail_data")
self:initManager("ActivityData", "app/userdata/activity/activity_data") self:initManager("ActivityData", "app/userdata/activity/activity_data")
self:initManager("GoldPigData", "app/userdata/activity/gold_pig/gold_pig_data")
self:initManager("BountyData", "app/userdata/bounty/bounty_data") self:initManager("BountyData", "app/userdata/bounty/bounty_data")
self:initManager("ArenaBountyData", "app/userdata/arena/arena_bounty_data") self:initManager("ArenaBountyData", "app/userdata/arena/arena_bounty_data")
self:initManager("TaskData", "app/userdata/task/task_data") self:initManager("TaskData", "app/userdata/task/task_data")
self:initManager("DailyTaskData", "app/userdata/task/daily_task_data") self:initManager("DailyTaskData", "app/userdata/task/daily_task_data")
self:initManager("IdleData", "app/userdata/idle/idle_data") self:initManager("IdleData", "app/userdata/idle/idle_data")
self:initManager("SevenDayData", "app/userdata/activity/seven_day/seven_day_data")
self:initManager("ShopData", "app/userdata/shop/shop_data") self:initManager("ShopData", "app/userdata/shop/shop_data")
self:initManager("SummonData", "app/userdata/summon/summon_data") self:initManager("SummonData", "app/userdata/summon/summon_data")
self:initManager("FullMoonData", "app/userdata/activity/full_moon/full_moon_data")
self:initManager("TournWaveData", "app/userdata/activity/tourn_wave/tourn_wave_data")
self:initManager("TournArenaData", "app/userdata/activity/tourn_arena/tourn_arena_data")
self:initManager("AIHelperData", "app/userdata/game_setting/ai_helper_data") self:initManager("AIHelperData", "app/userdata/game_setting/ai_helper_data")
self:initManager("HeroFundData", "app/userdata/activity/hero_fund/hero_fund_data")
self:initManager("ActBossRushData", "app/userdata/activity/act_boss_rush/act_boss_rush_data")
self:initManager("FourteenDayData", "app/userdata/activity/fourteen_day/fourteen_day_data")
self:initManager("ActPvpData", "app/userdata/activity/act_pvp/act_pvp_data")
self:initManager("TalentData", "app/userdata/talent/talent_data") self:initManager("TalentData", "app/userdata/talent/talent_data")
self:initManager("GiftPopData", "app/userdata/gift_pop/gift_pop_data") self:initManager("GiftPopData", "app/userdata/gift_pop/gift_pop_data")
self:initManager("PaymentData", "app/userdata/payment/payment_data") self:initManager("PaymentData", "app/userdata/payment/payment_data")
@ -48,6 +39,7 @@ function DataManager:init()
self:initManager("SignWeekData", "app/userdata/sign/sign_week_data") self:initManager("SignWeekData", "app/userdata/sign/sign_week_data")
self:initManager("SignMonthData", "app/userdata/sign/sign_month_data") self:initManager("SignMonthData", "app/userdata/sign/sign_month_data")
self:initManager("ChapterFundData", "app/userdata/chapter_fund/chapter_fund_data") self:initManager("ChapterFundData", "app/userdata/chapter_fund/chapter_fund_data")
self:initManager("ActSevenDayData", "app/userdata/activity/act_seven_day/act_seven_day_data")
end end
function DataManager:initManager(name, path) function DataManager:initManager(name, path)
@ -147,7 +139,6 @@ function DataManager:initWithServerData(data)
self.CollectionData:init(data.collection) self.CollectionData:init(data.collection)
self.TutorialData:init(data.guide) self.TutorialData:init(data.guide)
self.MailData:init(data.mail_info) self.MailData:init(data.mail_info)
self.GoldPigData:init(data.pig, true)
self.BountyData:init(data.bounty) self.BountyData:init(data.bounty)
self.ArenaBountyData:init(data.arena_bounty) self.ArenaBountyData:init(data.arena_bounty)
self.ArenaData:initGiftInfo(data.act_arena_gift, true) self.ArenaData:initGiftInfo(data.act_arena_gift, true)
@ -177,12 +168,12 @@ function DataManager:initWithServerData(data)
self.SignMonthData:initData(data.sign_30) self.SignMonthData:initData(data.sign_30)
-- 活动要在礼包后初始化 -- 活动要在礼包后初始化
self.ActivityData:init() self.ActivityData:init()
self.ActSevenDayData:initData(data.seven_days, true)
-- 商店礼包都初始化完了后检查一下每日红点 -- 商店礼包都初始化完了后检查一下每日红点
-- self.ShopData:checkShopDiscountRedPoint() -- self.ShopData:checkShopDiscountRedPoint()
-- self.ShopData:checkLoginPopInfo() -- 需要写在shopdata所有初始化之后 -- self.ShopData:checkLoginPopInfo() -- 需要写在shopdata所有初始化之后
self.SummonData:init(data.summon_data.summons) self.SummonData:init(data.summon_data.summons)
self.AIHelperData:init(nil, true) self.AIHelperData:init(nil, true)
self.FourteenDayData:init(data.fourteen_bounty)
-- 任务数据最后初始化,依赖其他模块的数据 -- 任务数据最后初始化,依赖其他模块的数据
self.TaskData:init() self.TaskData:init()
@ -292,7 +283,7 @@ function DataManager:scheduleGlobal()
return return
end end
self.crossDayTS = Time:getOverOfServerToday() self.crossDayTS = Time:getDayOverTimeStamp()
self.cacheTimer = SchedulerManager:scheduleGlobal(function (inter) self.cacheTimer = SchedulerManager:scheduleGlobal(function (inter)
for k, v in ipairs(self.cdCallBack) do for k, v in ipairs(self.cdCallBack) do
if self[v] and self[v].updateCd then if self[v] and self[v].updateCd then
@ -301,7 +292,7 @@ function DataManager:scheduleGlobal()
end end
if Time:getServerTime() > self.crossDayTS then if Time:getServerTime() > self.crossDayTS then
self.crossDayTS = Time:getOverOfServerToday() self.crossDayTS = Time:getDayOverTimeStamp()
if self.crossDayCallbacks then if self.crossDayCallbacks then
for i, info in ipairs(self.crossDayCallbacks) do for i, info in ipairs(self.crossDayCallbacks) do
if info.func and info.open then if info.func and info.open then

View File

@ -27,8 +27,6 @@ local MODULE_PATHS = {
DailyChallengeManager = "app/module/daily_challenge/daily_challenge_manager", DailyChallengeManager = "app/module/daily_challenge/daily_challenge_manager",
-- 挂机 -- 挂机
IdleManager = "app/module/idle/idle_manager", IdleManager = "app/module/idle/idle_manager",
-- 七天乐
SevenDayManager = "app/module/activity/seven_day/seven_day_manager",
-- 基金 -- 基金
FundManager = "app/module/fund/fund_manager", FundManager = "app/module/fund/fund_manager",
-- 设置 -- 设置
@ -71,22 +69,8 @@ local MODULE_PATHS = {
SkinManager = "app/module/skin/skin_manager", SkinManager = "app/module/skin/skin_manager",
-- 皮肤 -- 皮肤
RunesManager = "app/module/runes/runes_manager", RunesManager = "app/module/runes/runes_manager",
-- 英雄基金
HeroFundManager = "app/module/activity/hero_fund/hero_fund_manager",
-- 世界首领活动
ActBossRushManager = "app/module/activity/act_boss_rush/act_boss_rush_manager",
-- 新手14天乐
FourteenDayManager = "app/module/activity/fourteen_day/fourteen_day_manager",
-- 圆月活动
FullMoonManager = "app/module/activity/full_moon/full_moon_manager",
-- 波次锦标赛活动
TournWaveManager = "app/module/activity/tourn_wave/tourn_wave_manager",
-- 竞技场锦标赛活动
TournArenaManager = "app/module/activity/tourn_arena/tourn_arena_manager",
-- 符文副本 -- 符文副本
DungeonRuneManager = "app/module/dungeon_rune/dungeon_rune_manager", DungeonRuneManager = "app/module/dungeon_rune/dungeon_rune_manager",
-- 梦魇酒馆
ActPvpManager = "app/module/activity/act_pvp/act_pvp_manager",
-- 天赋 -- 天赋
TalentManager = "app/module/talent/talent_manager", TalentManager = "app/module/talent/talent_manager",
BagManager = "app/module/bag/bag_manager", BagManager = "app/module/bag/bag_manager",
@ -98,6 +82,8 @@ local MODULE_PATHS = {
FundChapterManager = "app/module/fund_chapter/fund_chapter_manager", FundChapterManager = "app/module/fund_chapter/fund_chapter_manager",
-- 签到 -- 签到
SignManager = "app/module/sign/sign_manager", SignManager = "app/module/sign/sign_manager",
-- 活动七天乐
ActSevenDayManager = "app/module/activity/act_seven_day/act_seven_day_manager",
} }
-- 这里的key对应func_open里的id -- 这里的key对应func_open里的id
@ -140,6 +126,9 @@ ModuleManager.MODULE_KEY = {
-- 签到 -- 签到
SIGN_BOUNTY = "signin_bounty", SIGN_BOUNTY = "signin_bounty",
SIGN_MONTH = "signin_30", SIGN_MONTH = "signin_30",
-- 七天乐
ACT_SEVENDAY = "act_sevenday",
ACT_SEVENDAY_2 = "act_sevenday_2",
} }
local _moduleMgrs = {} local _moduleMgrs = {}
@ -164,7 +153,6 @@ function ModuleManager:init()
ModuleManager.DailyChallengeManager:init() ModuleManager.DailyChallengeManager:init()
ModuleManager.PlayerManager:init() ModuleManager.PlayerManager:init()
ModuleManager.SkinManager:init() ModuleManager.SkinManager:init()
ModuleManager.TournArenaManager:init()
end end
-- 功能是否开启 -- 功能是否开启
@ -226,6 +214,14 @@ function ModuleManager:getOpenStageId(key)
return cfg.stage return cfg.stage
end end
function ModuleManager:getOpenDay(key)
local cfg = ConfigManager:getConfig("func_open")[key]
if not cfg or cfg.time == nil then
return
end
return cfg.time
end
function ModuleManager:clear() function ModuleManager:clear()
for k, v in ipairs(_moduleMgrs) do for k, v in ipairs(_moduleMgrs) do
v:_clear() v:_clear()

View File

@ -32,7 +32,8 @@ PayManager.PURCHARSE_ACT_TYPE = {
-- RUNES_GIFT = 21, -- RUNES_GIFT = 21,
-- TOURN_WAVE_GIFT = 23, -- TOURN_WAVE_GIFT = 23,
-- TOURN_ARENA_GIFT = 24, -- TOURN_ARENA_GIFT = 24,
GIFT_POP_CHAPTER = 10, GIFT_POP_CHAPTER = 10, -- 章节礼包
ACT_SEVEN_DAY = 15, -- 七天乐
} }
PayManager.PURCHARSE_TYPE_CONFIG = { PayManager.PURCHARSE_TYPE_CONFIG = {

View File

@ -16,13 +16,13 @@ function ServerPushManager:initWhenLogin()
self:addServerPushListener(ProtoMsgType.FromMsgEnum.BountyBoughtNtf, ModuleManager.BountyManager, ModuleManager.BountyManager.onBoughtBountyFinish) self:addServerPushListener(ProtoMsgType.FromMsgEnum.BountyBoughtNtf, ModuleManager.BountyManager, ModuleManager.BountyManager.onBoughtBountyFinish)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.ArenaBountyBoughtNtf, ModuleManager.ArenaBountyManager, ModuleManager.ArenaBountyManager.onBoughtBountyFinish) self:addServerPushListener(ProtoMsgType.FromMsgEnum.ArenaBountyBoughtNtf, ModuleManager.ArenaBountyManager, ModuleManager.ArenaBountyManager.onBoughtBountyFinish)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.NewMailNtf, ModuleManager.MailManager, ModuleManager.MailManager.needUpdateMail) self:addServerPushListener(ProtoMsgType.FromMsgEnum.NewMailNtf, ModuleManager.MailManager, ModuleManager.MailManager.needUpdateMail)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.PigLevelUpNtf, ModuleManager.ActivityManager, ModuleManager.ActivityManager.onBoughtGoldPigFinish) -- self:addServerPushListener(ProtoMsgType.FromMsgEnum.PigLevelUpNtf, ModuleManager.ActivityManager, ModuleManager.ActivityManager.onBoughtGoldPigFinish)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerLevelUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerLevelUpGift) self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerLevelUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerLevelUpGift)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerGrowUpGift2Ntf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerGrowUpGift) self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerGrowUpGift2Ntf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerGrowUpGift)
-- self:addServerPushListener(ProtoMsgType.FromMsgEnum.MallDailyResetNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onMallDailyReset) -- self:addServerPushListener(ProtoMsgType.FromMsgEnum.MallDailyResetNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onMallDailyReset)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.AIHelpUnreadNtf, ModuleManager.GameSettingManager, ModuleManager.GameSettingManager.rspAiHelperNtf) self:addServerPushListener(ProtoMsgType.FromMsgEnum.AIHelpUnreadNtf, ModuleManager.GameSettingManager, ModuleManager.GameSettingManager.rspAiHelperNtf)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.RecoveryNtf, ModuleManager.ItemManager, ModuleManager.ItemManager.rspRecoveryNtf) self:addServerPushListener(ProtoMsgType.FromMsgEnum.RecoveryNtf, ModuleManager.ItemManager, ModuleManager.ItemManager.rspRecoveryNtf)
self:addServerPushListener(ProtoMsgType.FromMsgEnum.BossRushBoughtNtf, ModuleManager.ActBossRushManager, ModuleManager.ActBossRushManager.rspBossRushBoughtNtf) -- self:addServerPushListener(ProtoMsgType.FromMsgEnum.BossRushBoughtNtf, ModuleManager.ActBossRushManager, ModuleManager.ActBossRushManager.rspBossRushBoughtNtf)
-- self:addServerPushListener(ProtoMsgType.FromMsgEnum.RuneUpdateNtf, ModuleManager.RunesManager, ModuleManager.RunesManager.rspUpdate) -- self:addServerPushListener(ProtoMsgType.FromMsgEnum.RuneUpdateNtf, ModuleManager.RunesManager, ModuleManager.RunesManager.rspUpdate)
end end

View File

@ -8,13 +8,24 @@ local SECONDS_PRE_DAY = 86400
local SECONDS_PRE_HOUR = 3600 local SECONDS_PRE_HOUR = 3600
local SECONDS_PRE_MINUTE = 60 local SECONDS_PRE_MINUTE = 60
local DAY_PER_HOUR = 24 local DAY_PER_HOUR = 24
local DAY_PRE_WEEK = 7
local ZERO_TIME_STR = "00:00:00" local ZERO_TIME_STR = "00:00:00"
local ZERO_TIME_STR_2 = "00:00" local ZERO_TIME_STR_2 = "00:00"
local UnityTime = CS.UnityEngine.Time local UnityTime = CS.UnityEngine.Time
-- 获取服务器的当前时间戳 -- 获取时间格式(时间戳转本地时间格式)
function Time:getTimeFormat(timestamp)
return os.date('*t', timestamp)
end
-- 获取时间格式(时间戳转世界时间格式)
function Time:getTimeFormatUTC(timestamp)
return os.date('!*t', timestamp)
end
-- 获取服务器的当前时间戳当前服务器是UTC-0
function Time:getServerTime() function Time:getServerTime()
if not self.serverTime then if not self.serverTime then
return os.time() return os.time()
@ -22,6 +33,19 @@ function Time:getServerTime()
return self.serverTime + self.differenceTime + GFunc.getTickCount() return self.serverTime + self.differenceTime + GFunc.getTickCount()
end end
-- 获取服务器的转本地时区的当前时间戳
function Time:getServerTimeLocal()
return self:getServerTime() + self:getTimeZoneOffset() * SECONDS_PRE_HOUR
end
-- 获取服务器的当前时间戳(毫秒级)
function Time:getServerTime2()
if not self.serverTime2 then
return os.time() * 1000
end
return self.serverTime2 + self.differenceTime2 + GFunc.getTickCount2()
end
function Time:getRealtimeSinceStartup() function Time:getRealtimeSinceStartup()
return UnityTime.realtimeSinceStartup return UnityTime.realtimeSinceStartup
end end
@ -60,39 +84,27 @@ function Time:getCertainTimeByStr(timeStr)
local hour = timeTab[4] local hour = timeTab[4]
local minute = timeTab[5] local minute = timeTab[5]
local second = timeTab[6] local second = timeTab[6]
local time = os.time({day = day, month = month, year = year, hour = hour, min = minute, sec = second}) + Time:getClientTimeZone()*3600 local timeStr = { day = day, month = month, year = year, hour = hour, min = minute, sec = second }
local time = Time:getCertainTime(timeStr) + Time:getTimeZoneOffset() * SECONDS_PRE_HOUR
return math.floor(time) return math.floor(time)
end end
-- 格式化时间返回os.data(finalTime) -- 格式化时间返回os.data(finalTime)
function Time:formatTimeExact(time) function Time:formatTimeExact(time)
local endTime = self:getServerTime() + time local endTime = self:getServerTime() + time
return os.date("*t", endTime) return self:getTimeFormat(endTime)
end end
-- 格式化y/m/d时间返回os.data(finalTime)
function Time:formatTimeYMD(time)
time = time or Time:getServerTime()
local date = os.date("!*t", time)
return date.year .. "/" .. date.month .. "/" .. date.day
end
-- 格式化y/m/d/h/m/s时间返回os.data(finalTime)
function Time:formatTimeYMDHMS(time)
time = time or Time:getServerTime()
local date = os.date("!*t", time)
return date.year .. "/" .. date.month .. "/" .. date.day .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec
end
function Time:updateServerTimeToday(todayTime) function Time:updateServerTimeToday(todayTime)
todayTime = todayTime or 0 todayTime = todayTime or 0
self.todayTime = GFunc.formatTimeStep(todayTime) self.todayTime = todayTime // 1000
end end
function Time:updateServerTime(serverTime) function Time:updateServerTime(serverTime)
self.serverTime = (serverTime or 0) // 1000 self.serverTime = (serverTime or 0) // 1000
self.serverTime2 = serverTime or 0 -- 毫秒级
self.differenceTime = -GFunc.getTickCount() self.differenceTime = -GFunc.getTickCount()
self.differenceTime2 = -GFunc.getTickCount2()
if EDITOR_MODE then if EDITOR_MODE then
Logger.log("updateServerTime:%s", self.differenceTime) Logger.log("updateServerTime:%s", self.differenceTime)
end end
@ -104,7 +116,8 @@ function Time:updateByServer(serverTime, todayTime)
end end
function Time:setServerTimeZone(timeZone) function Time:setServerTimeZone(timeZone)
self.timeZoneOffset = timeZone - self:getClientTimeZone() self.timeZoneOffset = math.floor(timeZone - self:getClientTimeZone())
self.serverTimeZone = timeZone
end end
function Time:getClientTimeZone() function Time:getClientTimeZone()
@ -120,50 +133,12 @@ function Time:getTimeZoneOffset()
end end
function Time:getBeginningOfServerToday() function Time:getBeginningOfServerToday()
if Time:getServerTime() > self.todayTime + 86400 then if self:getServerTime() > self.todayTime + 86400 then
self.todayTime = self.todayTime + 86400 self.todayTime = self.todayTime + 86400
end end
return self.todayTime return self.todayTime
end end
function Time:getOverOfServerToday(time)
if time then
local passS = time % SECONDS_PRE_DAY
if passS > 0 then
return time + SECONDS_PRE_DAY - passS
end
return time + SECONDS_PRE_DAY
end
return self:getBeginningOfServerToday() + SECONDS_PRE_DAY
end
-- 获取今日剩余时间
function Time:getTodaySurplusTime()
local result = self:getOverOfServerToday() - self:getServerTime()
if result < 0 then
result = 0
end
return result
end
function Time:getBeginningOfToday()
local now = os.date('*t', self:getServerTime() + self:getTimeZoneOffset()*SECONDS_PRE_HOUR)
local beginDay = os.time{year = now.year, month = now.month, day = now.day, hour = 0}
return beginDay - self:getTimeZoneOffset()*SECONDS_PRE_HOUR
end
function Time:getBeginningOfOneDay(t)
local now = os.date('*t', t + self:getTimeZoneOffset()*SECONDS_PRE_HOUR)
local beginDay = os.time{year = now.year, month = now.month, day = now.day, hour = 0}
return beginDay - self:getTimeZoneOffset()*SECONDS_PRE_HOUR
end
-- 判断时间是否是大于等于今天
function Time:getTimeIsToday(time)
local todayBegin = self:getBeginningOfToday()
return time >= todayBegin
end
function Time:splitTime(time) function Time:splitTime(time)
time = math.floor(time) time = math.floor(time)
local reduceD = time % SECONDS_PRE_DAY local reduceD = time % SECONDS_PRE_DAY
@ -177,8 +152,8 @@ end
-- 根据秒换算成向上取整hour的时间 -- 根据秒换算成向上取整hour的时间
function Time:getCeilHourTime(time) function Time:getCeilHourTime(time)
local count = time // 3600 local count = time // SECONDS_PRE_HOUR
if time % 3600 > 0 then if time % SECONDS_PRE_HOUR > 0 then
count = count + 1 count = count + 1
end end
return count return count
@ -193,19 +168,7 @@ function Time:getCeilPerSecend(time, per)
return count return count
end end
function Time:getDayofWeek(time) -- 格式化文案 ----------------------------------------------------------------------------------------------------------------------------------------
local curTime = time or self:getServerTime()
local day = tonumber(os.date("%w", curTime))
day = day == 0 and 7 or day
return day
end
function Time:getDayofWeekUTC(time)
local curTime = time or self:getServerTime()
local day = tonumber(os.date("!%w", curTime))
day = day == 0 and 7 or day
return day
end
-- 00:00:00 -- 00:00:00
function Time:formatNumTime(time) function Time:formatNumTime(time)
@ -265,61 +228,165 @@ function Time:formatBeforeTimeStr(time)
end end
end end
---- 得到time周开始时的时间戳 -- 格式化y/m/d时间返回os.data(finalTime)
function Time:formatTimeYMD(time)
time = time or self:getServerTime()
local date = self:getTimeFormat(time)
return date.year .. "/" .. date.month .. "/" .. date.day
end
-- 格式化y/m/d/h/m/s时间返回os.data(finalTime)
function Time:formatTimeYMDHMS(time)
time = time or Time:getServerTime()
local date = self:getTimeFormat(time)
return date.year .. "/" .. date.month .. "/" .. date.day .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec
end
-- 格式化y-m-d h:m:s时间返回os.data(finalTime)
function Time:formatTimeYMDHMS2(time)
time = time or Time:getServerTime()
local date = self:getTimeFormat(time)
return date.year .. "-" .. date.month .. "-" .. date.day .. " " .. date.hour .. ":" .. date.min .. ":" .. date.sec
end
-- 日相关时间接口 ------------------------------------------------------------------------------------------------------------------------
-- time日开始时的时间戳
function Time:getDayBeginTimeStamp(time)
time = time or self:getServerTime()
local now = self:getTimeFormatUTC(time)
local beginDay = os.time { year = now.year, month = now.month, day = now.day, hour = 0 }
return math.floor(beginDay - self:getTimeZoneOffset() * SECONDS_PRE_HOUR)
end
-- time日结束时的时间戳
function Time:getDayOverTimeStamp(time)
time = time or self:getServerTime()
local dateTable = self:getTimeFormatUTC(time)
local nextDay = os.time { year = dateTable.year, month = dateTable.month, day = dateTable.day + 1, hour = 0, min = 0, sec = 0 }
return math.floor(nextDay - self:getTimeZoneOffset() * SECONDS_PRE_HOUR)
end
-- 获取今日剩余时间
function Time:getTodaySurplusTime()
local result = self:getDayOverTimeStamp() - self:getServerTime()
if result < 0 then
result = 0
end
return result
end
-- 判断时间是否是大于等于今天
function Time:getTimeIsToday(time)
local todayBegin = self:getDayBeginTimeStamp()
return time >= todayBegin
end
-- 获取今天距目标日期的天数
function Time:getDistanceDays(time)
local nowNum = self:getDayBeginTimeStamp(self:getServerTime())
local targetNum = self:getDayBeginTimeStamp(time)
return (nowNum - targetNum) / 24 / 60 / 60
end
-- 周相关时间接口 ------------------------------------------------------------------------------------------------------------------------
-- time周开始时的时间戳
function Time:getWeekBeginTimeStamp(time) function Time:getWeekBeginTimeStamp(time)
time = time or self:getServerTime() time = time or self:getServerTime()
local remainDay = -self:getDayofWeek(time) local remainDay = -self:getDayofWeek(time)
return self:getOverOfServerToday(time) + remainDay * SECONDS_PRE_DAY return math.floor(self:getDayOverTimeStamp(time) + remainDay * SECONDS_PRE_DAY)
end end
---- 得到time周结束时的时间戳 -- time周结束时的时间戳
function Time:getWeekOverTimeStamp(time) function Time:getWeekOverTimeStamp(time)
time = time or self:getServerTime() time = time or self:getServerTime()
local remainDay = 7 - self:getDayofWeek(time) local remainDay = 7 - self:getDayofWeek(time)
return self:getOverOfServerToday(time) + remainDay * SECONDS_PRE_DAY return math.floor(self:getDayOverTimeStamp(time) + remainDay * SECONDS_PRE_DAY)
end end
---- 得到time月结束的时间戳 -- 获取本周剩余时间
function Time:getWeekSurplusTime()
local result = self:getWeekOverTimeStamp() - self:getServerTime()
if result < 0 then
result = 0
end
return result
end
-- time时间在周第几天
function Time:getDayofWeek(time)
local curTime = time or self:getServerTime()
local day = tonumber(os.date("!%w", curTime))
day = day == 0 and 7 or day
return day
end
-- 月相关时间接口 ------------------------------------------------------------------------------------------------------------------------
-- time月开始的时间戳
function Time:getMonthBeginTimeStamp(time)
time = time or self:getServerTime()
local day = self:getDayofMonth(time) - 1
return math.floor(self:getDayBeginTimeStamp(time) - day * SECONDS_PRE_DAY)
end
-- time月结束的时间戳
function Time:getMonthOverTimeStamp(time) function Time:getMonthOverTimeStamp(time)
time = time or self:getServerTime() time = time or self:getServerTime()
local now = os.date('!*t', time) local now = self:getTimeFormatUTC(time)
now.month = now.month + 1 now.month = now.month + 1
if now.month > 12 then if now.month > 12 then
now.year = now.year + now.month // 12 now.year = now.year + now.month // 12
now.month = now.month % 12 now.month = now.month % 12
end end
local remainDay = os.date("%d", os.time({ year = now.year, month = now.month, day = 0 })) - now.day local remainDay = os.date("%d", os.time({ year = now.year, month = now.month, day = 0 })) - now.day
return self:getOverOfServerToday(time) + remainDay * SECONDS_PRE_DAY return math.floor(self:getDayOverTimeStamp(time) + remainDay * SECONDS_PRE_DAY)
end end
---- 得到当前处于本月的第几天 -- time时间在月第几天
function Time:getDayByTimeStamp(time) function Time:getDayofMonth(time)
time = time or self:getServerTime() time = time or self:getServerTime()
local now = os.date('!*t', time) local now = self:getTimeFormatUTC(time)
return now.day return now.day
end end
-- 获取当前处于星期几 -- 其他接口 ------------------------------------------------------------------------------------------------------------------------
function Time:getWeekByTimeStamp(time)
time = time or self:getServerTime()
local now = os.date('!*t', time)
local weekTab = {7, 1, 2, 3, 4, 5, 6} function Time:getXDaySecond(day)
return weekTab[now.wday] return day * SECONDS_PRE_DAY
end end
-- 获取今天距目标日期的天数 function Time:getAWeekSecond()
function Time:getDistanceDays(time) return self:getXDaySecond(DAY_PRE_WEEK)
local nowNum = self:getBeginningOfOneDay(self:getServerTime())
local targetNum = self:getBeginningOfOneDay(time)
return (nowNum - targetNum)/24/60/60
end end
-- 转换服务器时间字符串(ISO 8601)的对应的时间戳,例如2022-09-10T18:10:00.000Z --以秒为单位 计算时间差 返回 是否达到时间剩余时间00:00:00
function Time:convertServerTimeStringToTimestamp(str) function Time:checkTimeByMinutes(lastTriggerTime, minutes)
local dateTime = CS.System.DateTime.Parse(str) -- 计算从上次触发到现在经过的秒数
local dateTimeOffset = CS.System.DateTimeOffset(dateTime) local currentTime = Time:getServerTime()
return dateTimeOffset:ToUnixTimeSeconds() local elapsedSeconds = currentTime - lastTriggerTime
Logger.logHighlight(elapsedSeconds)
local freeSeconds = minutes * 60
-- 计算是否达到时间
if elapsedSeconds >= freeSeconds then
Logger.logHighlight(freeSeconds)
return true, nil
else
-- 计算剩余的秒数
local remainingSeconds = freeSeconds - elapsedSeconds
Logger.logHighlight(remainingSeconds)
-- 计算小时数
local hours = math.floor(remainingSeconds / 3600)
-- 计算剩余的分钟数
local minutes = math.floor((remainingSeconds % 3600) / 60)
-- 计算剩余的秒数
local seconds = remainingSeconds % 60
-- 格式化时间为 00:00:00 的形式
local formattedTime = string.format("%02d:%02d:%02d", hours, minutes, seconds)
return false, formattedTime
end
end end
return Time return Time

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +1,496 @@
local act_sevenday_quest_reward = { local act_sevenday_quest_reward = {
[1]={ [1]={
["num"]=10, ["period"]=1,
["num"]=100,
["reward"]={ ["reward"]={
{
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=2,
["id_for_nothing"]="VA==", ["id_for_nothing"]="VA==",
["num"]=100, ["num"]=500,
["num_for_nothing"]="Vwhc" ["num_for_nothing"]="Uwhc"
}
} }
}, },
[2]={ [2]={
["num"]=20, ["period"]=1,
["num"]=200,
["reward"]={ ["reward"]={
{
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=1, ["id"]=5,
["id_for_nothing"]="Vw==", ["id_for_nothing"]="Uw==",
["num"]=2000, ["num"]=10,
["num_for_nothing"]="VAhcAw==" ["num_for_nothing"]="Vwg="
}
} }
}, },
[3]={ [3]={
["num"]=30, ["period"]=1,
["num"]=300,
["reward"]={ ["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=12,
["id_for_nothing"]="Vwo=",
["num"]=500,
["num_for_nothing"]="Uwhc"
}
}
},
[4]={
["period"]=1,
["num"]=400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[5]={
["period"]=1,
["num"]=500,
["reward"]={
{
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=2,
["id_for_nothing"]="VA==", ["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
}
},
[6]={
["period"]=1,
["num"]=600,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
}
}
},
[7]={
["period"]=1,
["num"]=700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=19,
["id_for_nothing"]="VwE=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[8]={
["period"]=2,
["num"]=100,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=500,
["num_for_nothing"]="Uwhc"
}
}
},
[9]={
["period"]=2,
["num"]=200,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=5,
["num_for_nothing"]="Uw=="
}
}
},
[10]={
["period"]=2,
["num"]=300,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=12,
["id_for_nothing"]="Vwo=",
["num"]=500,
["num_for_nothing"]="Uwhc"
}
}
},
[11]={
["period"]=2,
["num"]=400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[12]={
["period"]=2,
["num"]=500,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
}
},
[13]={
["period"]=2,
["num"]=600,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=40,
["id_for_nothing"]="Ugg=",
["num"]=10,
["num_for_nothing"]="Vwg="
}
}
},
[14]={
["period"]=2,
["num"]=700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=19,
["id_for_nothing"]="VwE=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
}
},
[15]={
["num"]=100,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=500,
["num_for_nothing"]="Uwhc"
}
},
["activity"]=12201
},
[16]={
["num"]=200,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=5,
["id_for_nothing"]="Uw==",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
["activity"]=12201
},
[17]={
["num"]=300,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
},
["activity"]=12201
},
[18]={
["num"]=400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=37,
["id_for_nothing"]="VQ8=",
["num"]=150, ["num"]=150,
["num_for_nothing"]="Vw1c" ["num_for_nothing"]="Vw1c"
} }
}, },
[4]={ ["activity"]=12201
["num"]=40,
["reward"]={
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=13,
["id_for_nothing"]="Vws=",
["num"]=3,
["num_for_nothing"]="VQ=="
}
}, },
[5]={ [19]={
["num"]=50, ["num"]=500,
["reward"]={ ["reward"]={
{
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=2, ["id"]=2,
["id_for_nothing"]="VA==", ["id_for_nothing"]="VA==",
["num"]=200, ["num"]=1500,
["num_for_nothing"]="VAhc" ["num_for_nothing"]="Vw1cAw=="
} }
}, },
[6]={ ["activity"]=12201
["num"]=60, },
[20]={
["num"]=600,
["reward"]={ ["reward"]={
{
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=14, ["id"]=5,
["id_for_nothing"]="Vww=", ["id_for_nothing"]="Uw==",
["num"]=20,
["num_for_nothing"]="VAg="
}
},
["activity"]=12201
},
[21]={
["num"]=700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=231,
["id_for_nothing"]="VAtd",
["num"]=1, ["num"]=1,
["num_for_nothing"]="Vw==" ["num_for_nothing"]="Vw=="
} }
}, },
[7]={ ["activity"]=12201
["num"]=70, },
[22]={
["num"]=100,
["reward"]={ ["reward"]={
{
["type"]=1, ["type"]=1,
["type_for_nothing"]="Vw==", ["type_for_nothing"]="Vw==",
["id"]=34001, ["id"]=2,
["id_for_nothing"]="VQxcA2Q=", ["id_for_nothing"]="VA==",
["num"]=3, ["num"]=500,
["num_for_nothing"]="VQ==" ["num_for_nothing"]="Uwhc"
} }
},
["activity"]=12401
},
[23]={
["num"]=200,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
["activity"]=12401
},
[24]={
["num"]=300,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
},
["activity"]=12401
},
[25]={
["num"]=400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=222,
["id_for_nothing"]="VApe",
["num"]=2,
["num_for_nothing"]="VA=="
}
},
["activity"]=12401
},
[26]={
["num"]=500,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1500,
["num_for_nothing"]="Vw1cAw=="
}
},
["activity"]=12401
},
[27]={
["num"]=600,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=68,
["id_for_nothing"]="UAA=",
["num"]=20,
["num_for_nothing"]="VAg="
}
},
["activity"]=12401
},
[28]={
["num"]=700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=228,
["id_for_nothing"]="VApU",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["activity"]=12401
},
[29]={
["num"]=100,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=500,
["num_for_nothing"]="Uwhc"
}
},
["activity"]=12501
},
[30]={
["num"]=200,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=262,
["id_for_nothing"]="VA5e",
["num"]=5,
["num_for_nothing"]="Uw=="
}
},
["activity"]=12501
},
[31]={
["num"]=300,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1000,
["num_for_nothing"]="VwhcAw=="
}
},
["activity"]=12501
},
[32]={
["num"]=400,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=18,
["id_for_nothing"]="VwA=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["activity"]=12501
},
[33]={
["num"]=500,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=2,
["id_for_nothing"]="VA==",
["num"]=1500,
["num_for_nothing"]="Vw1cAw=="
}
},
["activity"]=12501
},
[34]={
["num"]=600,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=262,
["id_for_nothing"]="VA5e",
["num"]=10,
["num_for_nothing"]="Vwg="
}
},
["activity"]=12501
},
[35]={
["num"]=700,
["reward"]={
{
["type"]=1,
["type_for_nothing"]="Vw==",
["id"]=19,
["id_for_nothing"]="VwE=",
["num"]=1,
["num_for_nothing"]="Vw=="
}
},
["activity"]=12501
} }
} }
local config = { local config = {
data=act_sevenday_quest_reward,count=7 data=act_sevenday_quest_reward,count=35
} }
return config return config

View File

@ -506,6 +506,9 @@ local const = {
["dungeon_rune_buylimit"]={ ["dungeon_rune_buylimit"]={
["value"]=5 ["value"]=5
}, },
["act_sevenday_duration"]={
["value"]=14.0
},
["activity_pvp_time"]={ ["activity_pvp_time"]={
["value"]=1 ["value"]=1
}, },

View File

@ -31,10 +31,6 @@ local func_open = {
["stage"]=2, ["stage"]=2,
["icon"]="module_unlock_idle" ["icon"]="module_unlock_idle"
}, },
["act_sevenday"]={
["stage"]=999,
["icon"]="module_unlock_sevenday"
},
["mall"]={ ["mall"]={
["stage"]=2, ["stage"]=2,
["pop_ups"]=1 ["pop_ups"]=1
@ -103,6 +99,13 @@ local func_open = {
["stage"]=8, ["stage"]=8,
["pop_ups"]=1 ["pop_ups"]=1
}, },
["act_sevenday"]={
["stage"]=2
},
["act_sevenday_2"]={
["stage"]=2,
["time"]=8
},
["dungeon_armor_open"]={ ["dungeon_armor_open"]={
["stage"]=10, ["stage"]=10,
["pop_ups"]=1 ["pop_ups"]=1

View File

@ -807,6 +807,32 @@ local LocalizationGlobalConst =
ACT_30SIGNIN_3 = "ACT_30SIGNIN_3", ACT_30SIGNIN_3 = "ACT_30SIGNIN_3",
ACT_30SIGNIN_4 = "ACT_30SIGNIN_4", ACT_30SIGNIN_4 = "ACT_30SIGNIN_4",
ACT_30SIGNIN_5 = "ACT_30SIGNIN_5", ACT_30SIGNIN_5 = "ACT_30SIGNIN_5",
ACT_SEVENDAY = "ACT_SEVENDAY",
ACT_SEVENDAY_2 = "ACT_SEVENDAY_2",
ACT_SEVENDAY_HELP = "ACT_SEVENDAY_HELP",
GIFT_DESC_4 = "GIFT_DESC_4",
ADVENTURE_CLOSED = "ADVENTURE_CLOSED",
TIME_END_DESC_1 = "TIME_END_DESC_1",
GIFT_ROUTINE_DESC_1 = "GIFT_ROUTINE_DESC_1",
GIFT_ROUTINE_DESC_2 = "GIFT_ROUTINE_DESC_2",
GIFT_ROUTINE_DESC_3 = "GIFT_ROUTINE_DESC_3",
GIFT_ROUTINE_DESC_4 = "GIFT_ROUTINE_DESC_4",
GIFT_ROUTINE_DESC_5 = "GIFT_ROUTINE_DESC_5",
GIFT_ROUTINE_DESC_6 = "GIFT_ROUTINE_DESC_6",
GIFT_ROUTINE_DESC_7 = "GIFT_ROUTINE_DESC_7",
GIFT_ROUTINE_DESC_8 = "GIFT_ROUTINE_DESC_8",
GIFT_ROUTINE_DESC_9 = "GIFT_ROUTINE_DESC_9",
GIFT_ROUTINE_DESC_10 = "GIFT_ROUTINE_DESC_10",
GIFT_ROUTINE_DESC_11 = "GIFT_ROUTINE_DESC_11",
GIFT_ROUTINE_DESC_12 = "GIFT_ROUTINE_DESC_12",
GIFT_ROUTINE_DESC_13 = "GIFT_ROUTINE_DESC_13",
GIFT_ROUTINE_DESC_14 = "GIFT_ROUTINE_DESC_14",
GIFT_ROUTINE_DESC_15 = "GIFT_ROUTINE_DESC_15",
GIFT_ROUTINE_DESC_16 = "GIFT_ROUTINE_DESC_16",
GIFT_ROUTINE_DESC_17 = "GIFT_ROUTINE_DESC_17",
GIFT_ROUTINE_DESC_18 = "GIFT_ROUTINE_DESC_18",
GIFT_ROUTINE_DESC_19 = "GIFT_ROUTINE_DESC_19",
FREE_DESC = "FREE_DESC",
} }
return LocalizationGlobalConst return LocalizationGlobalConst

View File

@ -0,0 +1,342 @@
local act_gift = {
[10102]={
["value"]="首充"
},
[10202]={
["value"]="首充"
},
[10302]={
["value"]="首充"
},
[10402]={
["value"]="首充"
},
[10502]={
["value"]="首充"
},
[10602]={
["value"]="首充"
},
[10702]={
["value"]="首充"
},
[10802]={
["value"]="首充"
},
[10902]={
["value"]="首充"
},
[20102]={
["value"]="超值月卡"
},
[20202]={
["value"]="特权月卡"
},
[30102]={
["value"]="高级战令"
},
[30202]={
["value"]="豪华战令"
},
[40102]={
["value"]="成长基金"
},
[40202]={
["value"]="成长基金"
},
[40302]={
["value"]="成长基金"
},
[40402]={
["value"]="成长基金"
},
[40502]={
["value"]="成长基金"
},
[40602]={
["value"]="成长基金"
},
[40702]={
["value"]="关卡基金"
},
[40802]={
["value"]="关卡基金"
},
[40902]={
["value"]="关卡基金"
},
[41002]={
["value"]="关卡基金"
},
[41102]={
["value"]="关卡基金"
},
[41202]={
["value"]="关卡基金"
},
[41302]={
["value"]="关卡基金"
},
[41402]={
["value"]="关卡基金"
},
[41502]={
["value"]="关卡基金"
},
[50102]={
["value"]="林间巡逻"
},
[50202]={
["value"]="林间巡逻"
},
[110102]={
["value"]="广告礼包"
},
[110202]={
["value"]="半价黄金魔法石"
},
[110302]={
["value"]="黄金魔法石"
},
[110402]={
["value"]="特惠黄金魔法石"
},
[110502]={
["value"]="入门黄金魔法石"
},
[110602]={
["value"]="闪耀黄金魔法石"
},
[110702]={
["value"]="豪华黄金魔法石"
},
[110802]={
["value"]="至尊黄金魔法石"
},
[110902]={
["value"]="超值英雄礼包"
},
[111002]={
["value"]="超值英雄礼包"
},
[111102]={
["value"]="超值升级礼包"
},
[111202]={
["value"]="超值升星礼包"
},
[114302]={
["value"]="广告礼包"
},
[114402]={
["value"]="半价黄金魔法石"
},
[114502]={
["value"]="黄金魔法石"
},
[114602]={
["value"]="特惠黄金魔法石"
},
[114702]={
["value"]="入门黄金魔法石"
},
[114802]={
["value"]="闪耀黄金魔法石"
},
[114902]={
["value"]="豪华黄金魔法石"
},
[115002]={
["value"]="至尊黄金魔法石"
},
[115102]={
["value"]="超值英雄礼包"
},
[115202]={
["value"]="超值英雄礼包"
},
[115302]={
["value"]="超值升级礼包"
},
[115402]={
["value"]="超值升星礼包"
},
[100102]={
["value"]="关卡礼包1-2"
},
[100202]={
["value"]="关卡礼包2-1"
},
[100302]={
["value"]="关卡礼包2-4"
},
[100402]={
["value"]="关卡礼包3-2"
},
[100502]={
["value"]="关卡礼包3-5"
},
[100602]={
["value"]="关卡礼包4-2"
},
[100702]={
["value"]="关卡礼包4-5"
},
[100802]={
["value"]="关卡礼包5-2"
},
[100902]={
["value"]="关卡礼包5-5"
},
[101002]={
["value"]="关卡礼包6-4"
},
[101102]={
["value"]="关卡礼包7-4"
},
[101202]={
["value"]="关卡礼包8-4"
},
[101302]={
["value"]="关卡礼包9-4"
},
[101402]={
["value"]="关卡礼包10-4"
},
[101502]={
["value"]="关卡礼包11-4"
},
[101602]={
["value"]="关卡礼包12-4"
},
[101702]={
["value"]="关卡礼包13-4"
},
[101802]={
["value"]="关卡礼包14-4"
},
[101902]={
["value"]="关卡礼包15-4"
},
[118502]={
["value"]="免费礼包"
},
[118602]={
["value"]="冲刺礼包1"
},
[118702]={
["value"]="冲刺礼包2"
},
[118802]={
["value"]="冲刺礼包3"
},
[118902]={
["value"]="冲刺礼包4"
},
[119002]={
["value"]="冲刺礼包5"
},
[119102]={
["value"]="冲刺礼包6"
},
[119202]={
["value"]="冲刺礼包7"
},
[119302]={
["value"]="冲刺礼包8"
},
[119402]={
["value"]="免费礼包"
},
[119502]={
["value"]="冲刺礼包1"
},
[119602]={
["value"]="冲刺礼包2"
},
[119702]={
["value"]="冲刺礼包3"
},
[119802]={
["value"]="冲刺礼包4"
},
[119902]={
["value"]="冲刺礼包5"
},
[120002]={
["value"]="冲刺礼包6"
},
[120102]={
["value"]="冲刺礼包7"
},
[120202]={
["value"]="冲刺礼包8"
},
[1100102]={
["value"]="免费礼包"
},
[1100202]={
["value"]="冲刺礼包1"
},
[1100302]={
["value"]="冲刺礼包2"
},
[1100402]={
["value"]="冲刺礼包3"
},
[1100502]={
["value"]="冲刺礼包4"
},
[1100602]={
["value"]="冲刺礼包5"
},
[1100702]={
["value"]="冲刺礼包6"
},
[1100802]={
["value"]="冲刺礼包7"
},
[1100902]={
["value"]="冲刺礼包8"
},
[1101002]={
["value"]="免费礼包"
},
[1101102]={
["value"]="冲刺礼包1"
},
[1101202]={
["value"]="冲刺礼包2"
},
[1101302]={
["value"]="冲刺礼包3"
},
[1101402]={
["value"]="冲刺礼包4"
},
[1101502]={
["value"]="冲刺礼包5"
},
[1101602]={
["value"]="冲刺礼包6"
},
[1101702]={
["value"]="冲刺礼包7"
},
[1101802]={
["value"]="冲刺礼包8"
},
[1800102]={
["value"]="扫荡礼包"
},
[1900102]={
},
[1900202]={
}
}
local config = {
data=act_gift,count=112
}
return config

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 0598bbbceeebf3444bc6ac70ab44861a guid: 3563d3ea57d28419e850dfc5a342bd98
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -806,6 +806,32 @@ local localization_global =
["ACT_30SIGNIN_3"] = "领取完所有奖励后重置", ["ACT_30SIGNIN_3"] = "领取完所有奖励后重置",
["ACT_30SIGNIN_4"] = "{0}天累计", ["ACT_30SIGNIN_4"] = "{0}天累计",
["ACT_30SIGNIN_5"] = "再领一次", ["ACT_30SIGNIN_5"] = "再领一次",
["ACT_SEVENDAY"] = "七日狂欢",
["ACT_SEVENDAY_2"] = "七日狂欢2期",
["ACT_SEVENDAY_HELP"] = "[活动介绍]\n完成全部任务,获得海量奖励。\n\n[活动规则]\n1.活动前7日每日解锁新的任务和礼包。\n2.14日内可完成所有任务,赢得最终大奖。\n3.未完成和领取的任务奖励将在活动结束后失效,请及时领取。",
["GIFT_DESC_4"] = "礼包",
["ADVENTURE_CLOSED"] = "活动已结束",
["TIME_END_DESC_1"] = "结束时间:{0}",
["GIFT_ROUTINE_DESC_1"] = "新手礼包",
["GIFT_ROUTINE_DESC_2"] = "日礼包",
["GIFT_ROUTINE_DESC_3"] = "周礼包",
["GIFT_ROUTINE_DESC_4"] = "月礼包",
["GIFT_ROUTINE_DESC_5"] = "每日充值",
["GIFT_ROUTINE_DESC_6"] = "循环累充",
["GIFT_ROUTINE_DESC_7"] = "特惠礼包",
["GIFT_ROUTINE_DESC_8"] = "限购",
["GIFT_ROUTINE_DESC_9"] = "{0}后重置",
["GIFT_ROUTINE_DESC_10"] = "已售罄",
["GIFT_ROUTINE_DESC_11"] = "未开启",
["GIFT_ROUTINE_DESC_12"] = "累计{0}天",
["GIFT_ROUTINE_DESC_13"] = "{0}积分档",
["GIFT_ROUTINE_DESC_14"] = "累充{0}积分",
["GIFT_ROUTINE_DESC_15"] = "第{0}日充值获得{1}积分",
["GIFT_ROUTINE_DESC_16"] = "推荐",
["GIFT_ROUTINE_DESC_17"] = "累充豪礼",
["GIFT_ROUTINE_DESC_18"] = "精彩活动",
["GIFT_ROUTINE_DESC_19"] = "必买",
["FREE_DESC"] = "免费",
} }
return localization_global return localization_global

View File

@ -956,6 +956,10 @@ function GFunc.getTickCount()
return math.floor(UnityTime.realtimeSinceStartup) return math.floor(UnityTime.realtimeSinceStartup)
end end
function GFunc.getTickCount2()
return math.floor(UnityTime.realtimeSinceStartup * 1000)
end
---得到展示奖励的图集名称,图片资源id ---得到展示奖励的图集名称,图片资源id
function GFunc.getFrameRes(type, id) function GFunc.getFrameRes(type, id)
if type == GConst.REWARD_TYPE.REWARD_NONE then if type == GConst.REWARD_TYPE.REWARD_NONE then
@ -1352,19 +1356,16 @@ function GFunc.getAdSprite()
return skip and "common_ad_4" or "common_ad_3" return skip and "common_ad_4" or "common_ad_3"
end end
function GFunc.centerImgAndTx(imgObj, txObj, spacing, offset, txMaxWidth) function GFunc.centerImgAndTx(imgObj, txObj, spacing, iconOffectY, addX)
spacing = spacing or 0 spacing = spacing or 0
offset = offset or 0 addX = addX or 0
local imgW = imgObj:getSizeDelta().x local imgW = imgObj:getSizeDelta().x
local posx, posy = imgObj:fastGetAnchoredPosition()
local txW = txObj:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth local txW = txObj:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
-- 文字最大宽度处理
if txMaxWidth and txW > txMaxWidth then
txW = txMaxWidth
end
txObj:setSizeDeltaX(txW) txObj:setSizeDeltaX(txW)
local w = (imgW + txW + spacing) / 2 local w = (imgW + txW + spacing) / 2
imgObj:setAnchoredPositionX(imgW / 2 - w + offset) imgObj:setAnchoredPosition(imgW / 2 - w + addX, iconOffectY or posy)
txObj:setAnchoredPositionX(w - txW / 2 + offset) txObj:setAnchoredPositionX(w - txW / 2 + addX)
end end
-- centerImgAndTx的位置反向版本 -- centerImgAndTx的位置反向版本

View File

@ -1,319 +0,0 @@
local ActBossRushManager = class("ActBossRushManager", BaseModule)
function ActBossRushManager:showMainUI()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
self:reqTopRank()
UIManager:showUI("app/ui/activity/act_boss_rush/act_boss_rush_ui")
end
function ActBossRushManager:showFundUI()
UIManager:showUI("app/ui/activity/act_boss_rush/act_boss_rush_fund_ui")
end
function ActBossRushManager:showRankUI()
self:reqRankList()
UIManager:showUI("app/ui/activity/act_boss_rush/act_boss_rush_rank_ui")
end
function ActBossRushManager:showShopUI()
UIManager:showUI("app/ui/activity/act_boss_rush/act_boss_rush_shop_ui")
end
function ActBossRushManager:showPopUI()
UIManager:showUI("app/ui/activity/act_boss_rush/act_boss_rush_pop_ui")
return true
end
function ActBossRushManager:reqFight()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if not DataManager.ActBossRushData:getFightFree() then
local cost = DataManager.ActBossRushData:getFightCost()
if not GFunc.checkCost(GConst.ItemConst.ITEM_ID_GEM, cost, true) then -- 消耗不足
return
else
local params ={
content = I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_1, cost),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
costId = GConst.ItemConst.ITEM_ID_GEM,
costNum = cost,
okFunc = function()
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushStartReq, {}, {}, self.rspFight, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_FIGHT_START)
end,
}
GFunc.showMessageBox(params)
return
end
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushStartReq, {}, {}, self.rspFight, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_FIGHT_START)
end
function ActBossRushManager:rspFight(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActBossRushData:updateStageSeed(result.seed)
local params = {
atkFormation = {}
}
local formation = DataManager.FormationData:getBossRushFormation()
for elementType, heroId in pairs(formation) do
local heroEntity = DataManager.HeroData:getHeroById(heroId)
if heroEntity then
params.atkFormation[elementType] = heroEntity
end
end
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, params, function()
UIManager:closeAllUI()
ModuleManager.MaincityManager:showMainCityUI()
ModuleManager.ActBossRushManager:showMainUI()
end)
end
end
function ActBossRushManager:reqEndBattle(chapterId, combatReport, taskProgress)
local params = {
chapterId = chapterId,
combatReport = combatReport,
task_stat = taskProgress
}
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushSettlementReq, params, {}, self.rspEndBattle, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_FIGHT)
end
function ActBossRushManager:rspEndBattle(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.reqData then
ModuleManager.TaskManager:addFightTaskProgress(result.reqData.task_stat)
DataManager.ActBossRushData:addWaveCount(result.reqData.task_stat[GConst.BattleConst.BATTLE_TASK_FIELD.PASS_WAVE] or 0)
end
local wave = result.max_wave or 0
local round = result.min_round or 0
DataManager.ActBossRushData:updateWaveAndRound(wave, round)
ModuleManager.BattleManager:showBossRushBattleResultUI(GConst.BattleConst.BATTLE_TYPE.ACT_BOSS_RUSH, result.reqData and result.reqData.combatReport, result.reqData and result.reqData.task_stat)
end
end
function ActBossRushManager:purcharse(id)
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
function ActBossRushManager:reqFundAward(level, rewardType)
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
-- -- 直接一键领取
-- local curLevel = DataManager.ActBossRushData:getWaveLevel()
-- local idWithLv = {}
-- for id = 1, curLevel do
-- if DataManager.ActBossRushData:getFreeCanGet(id) then
-- table.insert(idWithLv, {id = id, grade = 0})
-- end
-- if DataManager.ActBossRushData:getProCanGet(id) then
-- table.insert(idWithLv, {id = id, grade = 1})
-- end
-- if DataManager.ActBossRushData:getUtralCanGet(id) then
-- table.insert(idWithLv, {id = id, grade = 2})
-- end
-- end
-- if not idWithLv[1] then
-- return
-- end
local params = {
id = level,
grade = rewardType
}
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushBountyClaimReq, params, {}, self.rspFundAward, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_FUND)
end
function ActBossRushManager:rspFundAward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.reqData then
if result.reqData.id ~= 0 then
DataManager.ActBossRushData:gotSingleFundReward(result.reqData.id, result.reqData.grade)
end
end
GFunc.showRewardBox(result.rewards)
end
end
function ActBossRushManager:reqBuyFundLevel()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
local cost = DataManager.ActBossRushData:getBuyBountyLevelCost()
if not GFunc.checkCost(cost.id, cost.num, true) then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushBountyUnlockReq, {}, {}, self.rspBuyFundLevel, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_BUY_FUND)
end
function ActBossRushManager:rspBuyFundLevel(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local addCount = result.accum_wave - DataManager.ActBossRushData:getWaveCount()
if addCount > 0 then
DataManager.ActBossRushData:addWaveCount(addCount)
end
end
end
function ActBossRushManager:reqExchange(id, count)
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if DataManager.ActBossRushData:getExchangeRemainCount(id) < count then
return
end
local params = {
id = id,
count = count
}
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushExchangeReq, params, {}, self.rspExchange, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_SHOP)
end
function ActBossRushManager:rspExchange(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.reqData then
DataManager.ActBossRushData:setShopInfo(result.reqData.id, result.reqData.count)
end
GFunc.showRewardBox(result.rewards)
end
end
function ActBossRushManager:reqRankReward()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushRankRewardReq, {}, {}, self.rspRankReward, BIReport.ITEM_GET_TYPE.ACT_BOSS_RUSH_RANK)
end
function ActBossRushManager:rspRankReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActBossRushData:setGotRankReward()
GFunc.showRewardBox(result.rewards)
end
end
function ActBossRushManager:reqActData()
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushInfoReq, {}, {}, self.rspActData)
end
function ActBossRushManager:rspActData(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActBossRushData:init(result.boss_rush)
end
end
function ActBossRushManager:reqRankList()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if not DataManager.ActBossRushData:getNeedUpdateRank() then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushRankReq, {}, {}, self.rspRankList)
end
function ActBossRushManager:rspRankList(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActBossRushData:updateRankInfo(result)
end
end
function ActBossRushManager:reqTopRank()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if not DataManager.ActBossRushData:getIsOpen() then
return false
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushTopReq, {}, {}, self.rspTopRank)
end
function ActBossRushManager:rspTopRank(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActBossRushData:updateTopRankInfo(result.top3)
end
end
function ActBossRushManager:reqFormation(formation)
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
local heroes = {}
for matchType, heroId in pairs(formation) do
if heroId and heroId > 0 then
table.insert(heroes, heroId)
end
end
local params = {
heroes = heroes
}
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushFormationReq, params, {}, self.rspFormation)
end
function ActBossRushManager:rspFormation(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.FORMATION_CHANGE, {type = GConst.BattleConst.FORMATION_TYPE.BOSS_RUSH})
end
end
function ActBossRushManager:rspBossRushBoughtNtf(result)
if result.bought then
DataManager.ActBossRushData:setProBought()
end
if result.bought_max then
DataManager.ActBossRushData:setUtralBought()
end
end
---- 特殊callback, 引用的话需要注意callback中如果有baseobj需要判定null或销毁状态
function ActBossRushManager:reqOtherPlayerInfo(playerId, callback)
self.reqOtherPlayerInfoCallback = callback
local params = {
id = playerId
}
self:sendMessage(ProtoMsgType.FromMsgEnum.BossRushPlayerInfoReq, params, {}, self.rspOtherPlayerInfo)
end
function ActBossRushManager:rspOtherPlayerInfo(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local callback = self.reqOtherPlayerInfoCallback
self.reqOtherPlayerInfoCallback = nil
local formation = GFunc.formatPlayerFormationInfo(result)
if callback then
callback(formation)
end
end
self.reqOtherPlayerInfoCallback = nil
end
return ActBossRushManager

View File

@ -1,446 +0,0 @@
local ActPvpManager = class("ActPvpManager", BaseModule)
function ActPvpManager:showMainUI()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if DataManager.ActPvpData:getNeedUpdateData() then
self:reqActData()
end
if DataManager.ActPvpData:isPlaying() then
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_playing_ui")
else
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_main_ui")
end
end
function ActPvpManager:showMatchUI(forceShowMatchUI)
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if DataManager.ActPvpData:getNeedReMatch() or forceShowMatchUI then
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_match_ui")
self:reqMatch()
else
self:showMatchResultUI()
end
end
function ActPvpManager:showMatchResultUI()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_match_result_ui")
end
function ActPvpManager:showHelpUI()
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_help_ui")
end
function ActPvpManager:showSelectUI()
local curPairIds = DataManager.ActPvpData:getCurSelectPairId()
if not curPairIds or not curPairIds[1] then
return
end
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_select_ui")
end
function ActPvpManager:showBountyUI()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_bounty_ui")
end
function ActPvpManager:showRankUI()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if DataManager.ActPvpData:getNeedUpdateRank() then
self:reqRank()
end
UIManager:showUI("app/ui/activity/act_pvp/act_pvp_rank_ui")
end
function ActPvpManager:reqActData()
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPDataReq, {}, {}, self.rspActData)
end
function ActPvpManager:rspActData(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:updateData(result.activity_pvp)
end
end
function ActPvpManager:reqEnter()
if DataManager.ActPvpData:isFinalDay() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_24))
end
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if DataManager.ActPvpData:isPlaying() then
return
end
if DataManager.ActPvpData:getFreeEnterCount() <= 0 then
local cost = DataManager.ActPvpData:getEnterCost()
if not GFunc.checkCost(cost.id, cost.num, true) then
return
end
local params ={
content = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_1, cost.num),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
costId = cost.id,
costNum = cost.num,
okFunc = function()
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPBeginReq, {}, {}, self.rspEnter, BIReport.ITEM_GET_TYPE.ACT_PVP_ENTER)
end,
}
GFunc.showMessageBox(params)
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPBeginReq, {}, {}, self.rspEnter, BIReport.ITEM_GET_TYPE.ACT_PVP_ENTER)
end
function ActPvpManager:rspEnter(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:updateData(result.activity_pvp)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {closeMainUI = true})
self:showMainUI()
end
end
function ActPvpManager:reqDecideHero(index)
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
--int32 index = 1; // 0. 左边的、1.右边的
local params = {
index = index
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPDecideHeroReq, params, {}, self.rspDecideHero)
end
function ActPvpManager:rspDecideHero(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:updateHerosInfo(result.heroes, result.pair_id, result.next_select_four_id)
if not result.reqData then
result.reqData = {index = 0}
end
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {selectIndex = result.reqData.index})
end
end
function ActPvpManager:reqRefreshHero()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if not DataManager.ActPvpData:getCanAdFlush() then
local cost = DataManager.ActPvpData:getFlushCost()
if not GFunc.checkCost(cost.id, cost.num, true) then
return
end
local params ={
content = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_13, cost.num),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
costId = cost.id,
costNum = cost.num,
okFunc = function()
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPFlushHeroesReq, {}, {}, self.rspRefreshHero, BIReport.ITEM_GET_TYPE.ACT_PVP_REFRESH_HERO)
end,
}
GFunc.showMessageBox(params)
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPFlushHeroesReq, {}, {}, self.rspRefreshHero, BIReport.ITEM_GET_TYPE.ACT_PVP_REFRESH_HERO)
end
function ActPvpManager:rspRefreshHero(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:addFlushCount()
DataManager.ActPvpData:updateSelectInfo(result.pair_id, result.next_select_four_id)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {refreshHero = true})
end
end
function ActPvpManager:reqMatch()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPMatchReq, {}, {}, self.rspMatch)
end
function ActPvpManager:rspMatch(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:updateRivalInfo(result.rival, result.match_cd_end_at)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {matchOver = true})
end
end
function ActPvpManager:reqOverCD(isAd)
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
if not isAd then
local cost = DataManager.ActPvpData:getRematchConstGem()
if not GFunc.checkCost(GConst.ItemConst.ITEM_ID_GEM, cost, true) then
return
end
local params ={
content = I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_25, cost),
boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL,
costId = GConst.ItemConst.ITEM_ID_GEM,
costNum = cost,
okFunc = function()
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPOverCDReq, {ad = isAd}, {}, self.rspOverCD, BIReport.ITEM_GET_TYPE.ACT_PVP_OVER_CD)
end,
}
GFunc.showMessageBox(params)
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPOverCDReq, {ad = isAd}, {}, self.rspOverCD, BIReport.ITEM_GET_TYPE.ACT_PVP_OVER_CD)
end
function ActPvpManager:rspOverCD(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {reqCDOver = true})
local isAd = false
if result.reqData and result.reqData.ad then
isAd = true
end
DataManager.ActPvpData:setMatchCdEndAt(isAd)
self:showMatchUI(true)
end
end
function ActPvpManager:reqFight()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPStartReq, {}, {}, self.rspFight)
end
function ActPvpManager:rspFight(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local atkFormation = {}
local defFormation = {}
local heroes = DataManager.ActPvpData:getRivalInfoHeroes()
if not heroes then
Logger.logHighlight("1")
return
end
local count = 0
for matchType, heroEntity in pairs(heroes) do
local id = heroEntity:getCfgId()
if DataManager.HeroData:isExistHeroById(id) then
defFormation[matchType] = heroEntity
count = count + 1
end
end
if count <= 0 then
Logger.logHighlight("2")
return
end
count = 0
heroes = DataManager.ActPvpData:getHeros()
for matchType, heroEntity in pairs(heroes) do
local id = heroEntity:getCfgId()
if DataManager.HeroData:isExistHeroById(id) then
atkFormation[matchType] = heroEntity
count = count + 1
end
end
if count <= 0 then
Logger.logHighlight("3")
return
end
local defInfo = DataManager.ActPvpData:getRivalInfo()
local params = {
defInfo = defInfo,
atkFormation = atkFormation,
defFormation = defFormation
}
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.ACT_PVP, params, function()
UIManager:closeAllUI()
ModuleManager.MaincityManager:showMainCityUI()
ModuleManager.ActPvpManager:showMainUI()
end)
end
end
function ActPvpManager:reqFightEnd(win, battleReport, taskProgress)
local parmas = {
win = win,
task_stat = taskProgress,
battleReport = battleReport,
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPSettlementReq, parmas, {}, self.rspFightEnd, BIReport.ITEM_GET_TYPE.ACT_PVP_FIGHT_END)
end
function ActPvpManager:rspFightEnd(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
local herolv = DataManager.ActPvpData:getHeroLv()
DataManager.ActPvpData:recordLastBountyLevel()
DataManager.ActPvpData:updateData(result.activity_pvp)
DataManager.ActPvpData:setLastTurnWin(nil) -- 默认不给状态
DataManager.ActPvpData:setHeroLevelUp(false)
-- 展示结算界面
if result.reqData then
local taskStat = result.reqData.task_stat
if taskStat then
taskStat[GConst.BattleConst.BATTLE_TASK_FIELD.KILL_BOSS] = 0 -- boss不算
taskStat[GConst.BattleConst.BATTLE_TASK_FIELD.KILL_NORMAL_MONSTER] = 0 -- 击杀小怪数量不算
taskStat[GConst.BattleConst.BATTLE_TASK_FIELD.PASS_WAVE] = 0 -- 通关波数不算
ModuleManager.TaskManager:addFightTaskProgress(taskStat)
end
ModuleManager.BattleManager:showActPvpResultUI(GConst.BattleConst.BATTLE_TYPE.ACT_PVP, result.rewards, result.reqData.battleReport)
if not DataManager.ActPvpData:isPlaying() then -- 进入下一轮
DataManager.ActPvpData:setLastTurnWin(result.reqData.win)
else
local newHerolv = DataManager.ActPvpData:getHeroLv()
if newHerolv > herolv then
DataManager.ActPvpData:setHeroLevelUp(true)
end
end
end
end
end
function ActPvpManager:reqDailyReward(index)
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
local params = {
id = index
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPDailyRewardsReq, params, {}, self.rspDailyReward, BIReport.ITEM_GET_TYPE.ACT_PVP_DAILY_REWARD)
end
function ActPvpManager:rspDailyReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.reqData then
DataManager.ActPvpData:setDailyReward(result.reqData.id)
end
GFunc.showRewardBox(result.rewards)
end
end
function ActPvpManager:reqRank()
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPRankReq, {}, {}, self.rspRank)
end
function ActPvpManager:rspRank(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:updateRankInfo(result.ranks, result.own_rank)
end
end
function ActPvpManager:reqRankReward()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPRankRewardsReq, {}, {}, self.rspRankReward, BIReport.ITEM_GET_TYPE.ACT_PVP_RANK_REWARD)
end
function ActPvpManager:rspRankReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:setGotRankReward()
GFunc.showRewardBox(result.rewards)
end
end
function ActPvpManager:reqBountyReward(id, bountyType)
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
local typeNum = DataManager.ActPvpData.BOUNTY_TYPE_TO_NUM[bountyType]
if not typeNum then
return
end
local params = {
id = id,
grade = typeNum
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPBountyClaimReq, params, {}, self.rspBountyReward, BIReport.ITEM_GET_TYPE.ACT_PVP_BOUNTY)
end
function ActPvpManager:rspBountyReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:setBountyCollected(result.success_id_grade)
GFunc.showRewardBox(result.rewards)
end
end
function ActPvpManager:reqBuyBountyLevel()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
local level = DataManager.ActPvpData:getBountyLevel()
if level + 1 > DataManager.ActPvpData:getMaxBountyLevel() then
return
end
local cost = DataManager.ActPvpData:getBuyBountyLevelCost()
if not GFunc.checkCost(cost.id, cost.num, 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.ACT_PVP_BUY_BOUNTY_LEVEL,
costId = cost.id,
costNum = cost.num,
okFunc = function()
local params = {
id = DataManager.ActPvpData:getBountyLevelId(level + 1)
}
self:sendMessage(ProtoMsgType.FromMsgEnum.ActivityPVPBountyClaimByDiamondReq, params, {}, self.rspBuyBountyLevel, BIReport.ITEM_GET_TYPE.ACT_PVP_BUY_BOUNTY_LEVEL)
end,
}
GFunc.showMessageBox(params)
end
function ActPvpManager:rspBuyBountyLevel(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.ActPvpData:setBountyLevel(result.reqData.id)
end
end
return ActPvpManager

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 4bc67b0cb6448474b89b7a92613c0fba guid: 201070154efdf4d09aa56d9e1fc458a4
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@ -0,0 +1,75 @@
local ActSevenDayManager = class("ActSevenDayManager", BaseModule)
function ActSevenDayManager:showMainUI()
UIManager:showUI("app/ui/activity/act_seven_day/act_seven_day_ui")
end
function ActSevenDayManager:showMainS2UI()
UIManager:showUI("app/ui/activity/act_seven_day/act_seven_day_s2_ui")
end
function ActSevenDayManager:onGetRewardTask(id, period)
period = period or 1
if not DataManager.ActSevenDayData:isOpen(period) then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ADVENTURE_CLOSED))
return
end
-- 一键领取处理
id = nil
local itemGetType = period == 1 and BIReport.ITEM_GET_TYPE.SEVEN_DAY_TASK or BIReport.ITEM_GET_TYPE.SEVEN_DAY_TASK_2
self:sendMessage(ProtoMsgType.FromMsgEnum.SevenDaysTaskReq, {id = id, period = period}, self.onGetRewardTaskSuccess, itemGetType)
end
function ActSevenDayManager:onGetRewardTaskSuccess(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
local ids = DataManager.ActSevenDayData:getAllCanClaimTaskIds(result.reqData.period)
DataManager.ActSevenDayData:setTaskClaimed(result.reqData.id, ids)
if result.reqData.id then
BIReport:postSevenDayTask(BIReport.SEVEN_DAY_OPT.TASK_REWARD, {result.reqData.id}, result.rewards, result.reqData.period)
else
BIReport:postSevenDayTask(BIReport.SEVEN_DAY_OPT.TASK_REWARD, ids, result.rewards, result.reqData.period)
end
end
function ActSevenDayManager:onGetRewardScore(id, period)
period = period or 1
if not DataManager.ActSevenDayData:isOpen(period) then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ADVENTURE_CLOSED))
return
end
-- 一键领取处理
id = nil
local itemGetType = period == 1 and BIReport.ITEM_GET_TYPE.SEVEN_DAY_SCORE or BIReport.ITEM_GET_TYPE.SEVEN_DAY_SCORE_2
self:sendMessage(ProtoMsgType.FromMsgEnum.SevenDaysScoreRewardReq, {id = id, period = period}, self.onGetRewardScoreSuccess, itemGetType)
end
function ActSevenDayManager:onGetRewardScoreSuccess(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
local ids = DataManager.ActSevenDayData:getAllCanClaimScoreIds(result.reqData.period)
DataManager.ActSevenDayData:setScoreReceived(result.reqData.id, ids)
if result.reqData.id then
BIReport:postSevenDayTask(BIReport.SEVEN_DAY_OPT.SCORE_REWARD, {result.reqData.id}, result.rewards, result.reqData.period)
else
BIReport:postSevenDayTask(BIReport.SEVEN_DAY_OPT.SCORE_REWARD, ids, result.rewards, result.reqData.period)
end
end
function ActSevenDayManager:onGiftBuy(giftId)
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT, true)
end
return ActSevenDayManager

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: d97c1d93669059f4990f3ff1b17f7b58 guid: f88003187528b4303b0803f5e40179b4
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,19 +1,5 @@
local ActivityManager = class("ActivityManager", BaseModule) local ActivityManager = class("ActivityManager", BaseModule)
function ActivityManager:showGoldPigUI(showType)
UIManager:showUI("app/ui/activity/gold_pig/gold_pig_ui", {showType = showType})
end
function ActivityManager:buyGoldPig(id)
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG)
end
function ActivityManager:onBoughtGoldPigFinish(result)
if result.status == 0 then
DataManager.GoldPigData:onBought(result.pig)
end
end
-- 夏日活动分界线----------------------------------------------------------------------------------------------------- -- 夏日活动分界线-----------------------------------------------------------------------------------------------------
function ActivityManager:showActivityUI(panelType) function ActivityManager:showActivityUI(panelType)

View File

@ -1,12 +0,0 @@
local FourteenDayConst = {}
-- 战令档位
FourteenDayConst.BOUNTY_GRADE_TYPE = {
FREE = 0,
PAY = 1,
}
-- 战令礼包id
FourteenDayConst.BOUNTY_GIFT_ID = 140405
return FourteenDayConst

View File

@ -1,75 +0,0 @@
local FourteenDayManager = class("FourteenDayManager", BaseModule)
function FourteenDayManager:showFourteenDayUI()
if DataManager.FourteenDayData:getNeedSyncData() then
self:reqSyncData()
end
local time = DataManager.FourteenDayData:getEndRemainTime()
if time > 0 then
UIManager:showUI("app/ui/activity/fourteen_day/fourteen_day_entrance_ui")
else
UIManager:showUI("app/ui/activity/fourteen_day/fourteen_day_task_ui")
end
end
-- 购买活动战令
function FourteenDayManager:buyBounty()
PayManager:purchasePackage(GConst.FourteenDayConst.BOUNTY_GIFT_ID, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
-- 请求任务奖励
function FourteenDayManager:reqTaskReward(id)
self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyTaskAwardReq, {id = id}, {}, self.rspTaskReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_TASK)
end
function FourteenDayManager:rspTaskReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FourteenDayData:onReceivedTaskReward(result.reqData.id)
GFunc.showRewardBox(result.rewards)
end
end
-- 请求战令奖励
function FourteenDayManager:reqBountyReward(id, grade)
local list = {}
table.insert(list, {id = id, grade = grade})
self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyAwardReq, {id_with_lv = list}, {}, self.rspBountyReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_BOUNTY)
end
function FourteenDayManager:rspBountyReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FourteenDayData:onReceivedBountyReward(result.id_with_lv)
GFunc.showRewardBox(result.rewards)
end
end
-- 请求兑换奖励
function FourteenDayManager:reqExchangeReward(id, count)
self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenBountyExchangeAwardReq, {id = id, count = count or 0}, {}, self.rspExchangeReward, BIReport.ITEM_GET_TYPE.ACT_FOURTEEN_DAY_EXCHANGE)
end
function FourteenDayManager:rspExchangeReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
if result.reqData.count then
DataManager.FourteenDayData:onReceivedExchangeReward(result.reqData.id, result.reqData.count)
end
GFunc.showRewardBox(result.rewards)
end
end
function FourteenDayManager:reqSyncData()
self:sendMessage(ProtoMsgType.FromMsgEnum.FourteenDayInfoReq, {}, {}, self.rspSyncData)
end
function FourteenDayManager:rspSyncData(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FourteenDayData:setSyncData()
DataManager.FourteenDayData:initData(result.info)
DataManager.FourteenDayData:setDirty()
end
end
return FourteenDayManager

View File

@ -1,28 +0,0 @@
local FullMoonConst = {}
-- 活动id
FullMoonConst.ACT_ID = 406
FullMoonConst.ACT_DAYS = 10
-- 英雄自选礼包分页显示个数
FullMoonConst.HERO_GIFT_SHOW_STEP = {
4,4,5
}
-- 界面
FullMoonConst.PANEL_TYPE = {
TASK = 1,
CHOOSE_HERO = 2,
NEW_HERO = 3,
SKIN = 4,
}
FullMoonConst.SKIN_CHALLENGE_ID_1 = 1
FullMoonConst.SKIN_CHALLENGE_ID_2 = 2
FullMoonConst.SKIN_GIFT_ID_1 = 200102
FullMoonConst.SKIN_GIFT_ID_2 = 200202
return FullMoonConst

View File

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

View File

@ -1,112 +0,0 @@
local FullMoonManager = class("FullMoonManager", BaseModule)
function FullMoonManager:showActMainUI(panelType)
UIManager:showUI("app/ui/activity/full_moon/full_moon_ui", panelType)
end
-- 初始化计时器
function FullMoonManager:initTimer()
self:unscheduleGlobal(self.actSid)
if DataManager.FullMoonData:isOpenTime() then
Logger.logHighlight("圆月活动结束倒计时:"..DataManager.FullMoonData:getEndRemainTime())
self.actSid = self:performWithDelayGlobal(function()
Logger.logHighlight("圆月活动结束")
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACTIVITY_FULL_MOON_END)
end, DataManager.FullMoonData:getEndRemainTime())
elseif DataManager.FullMoonData:getStartRemainTime() > 0 then
Logger.logHighlight("圆月活动开始倒计时:"..DataManager.FullMoonData:getStartRemainTime())
self.actSid = self:performWithDelayGlobal(function()
Logger.logHighlight("圆月活动开始")
self:reqActData()
end, DataManager.FullMoonData:getStartRemainTime())
end
end
-- 请求活动数据
function FullMoonManager:reqActData()
if not DataManager.FullMoonData:isOpen() then
return
end
if not DataManager.FullMoonData:isOpenTime() then
return
end
if self.isReqActData then
return
end
self.isReqActData = true
self:sendMessage(ProtoMsgType.FromMsgEnum.FullMoonInfoReq, {}, {}, self.rspActData, nil)
end
function FullMoonManager:rspActData(result)
self.isReqActData = false
DataManager.FullMoonData:setInReset(false)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FullMoonData:onGetActData(result.full_moon)
end
end
-- 请求任务奖励
function FullMoonManager:reqTaskReward(id)
self:sendMessage(ProtoMsgType.FromMsgEnum.FullMoonTaskClaimReq, {id = id}, {}, self.rspTaskReward, BIReport.ITEM_GET_TYPE.FULL_MOON_TASK)
end
function FullMoonManager:rspTaskReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FullMoonData:onReceivedTaskReward(result.reqData.id, result.finished)
GFunc.showRewardBox(result.rewards)
end
end
-- 请求任务进度奖励
function FullMoonManager:reqTaskProgressReward(id)
self:sendMessage(ProtoMsgType.FromMsgEnum.FullMoonRewardClaimReq, {id = id}, {}, self.rspTaskProgressReward, BIReport.ITEM_GET_TYPE.FULL_MOON_TASK_PROG_REWARD)
end
function FullMoonManager:rspTaskProgressReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FullMoonData:onReceivedTaskProgressReward(result.reqData.id)
GFunc.showRewardBox(result.rewards)
end
end
-- 自选礼包选择
function FullMoonManager:reqGiftChooseHero(index)
self:sendMessage(ProtoMsgType.FromMsgEnum.FullMoonCustomGiftChooseReq, {index = index}, {}, self.rspGiftChooseHero, nil)
end
function FullMoonManager:rspGiftChooseHero(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FullMoonData:onChooseHeroSuccess(result.reqData.index)
end
end
-- 皮肤挑战
function FullMoonManager:skinChallenge(id)
DataManager.FullMoonData:setCurSkinChallengeId(id)
ModuleManager.BattleManager:playBattle(GConst.BattleConst.BATTLE_TYPE.FULL_MOON_SKIN, nil, function()
UIManager:closeAllUI()
ModuleManager.MaincityManager:showMainCityUI()
self:showActMainUI(GConst.FullMoonConst.PANEL_TYPE.SKIN)
end)
end
-- 请求皮肤关卡挑战奖励
function FullMoonManager:reqChapterSkinClaim(id, combatReport)
if not combatReport.victory or DataManager.FullMoonData:isReceivedSkinFirstChallengeReward(id) then
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.FULL_MOON_SKIN, {}, combatReport or {}, nil, nil, true)
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.FullMoonChapterSkinClaimReq, {id = id, combatReport = combatReport}, {}, self.rspChapterSkinClaim, BIReport.ITEM_GET_TYPE.FULL_MOON_SKIN_CHALLENGE_REWARD)
end
function FullMoonManager:rspChapterSkinClaim(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.FullMoonData:onReceivedSkinChallengeReward(result.reqData.id)
ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.FULL_MOON_SKIN, result.rewards, result.reqData and result.reqData.combatReport or {}, nil, nil, true)
end
end
return FullMoonManager

View File

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

View File

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

View File

@ -1,51 +0,0 @@
local HeroFundManager = class("HeroFundManager", BaseModule)
function HeroFundManager:showMainUI()
UIManager:showUI("app/ui/activity/hero_fund/hero_fund_ui")
end
function HeroFundManager:reqHeroFundAward(level, rewardType)
if not DataManager.HeroFundData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
-- 直接一键领取
local curLevel = DataManager.HeroFundData:getWaveLevel()
local heroIdWithLv = {}
for id = 1, curLevel do
if DataManager.HeroFundData:getFreeCanGet(id) then
table.insert(heroIdWithLv, {id = id, grade = 0})
end
if DataManager.HeroFundData:getProCanGet(id) then
table.insert(heroIdWithLv, {id = id, grade = 1})
end
if DataManager.HeroFundData:getUtralCanGet(id) then
table.insert(heroIdWithLv, {id = id, grade = 2})
end
end
if not heroIdWithLv[1] then
return
end
local params = {
id_with_lv = heroIdWithLv
}
self:sendMessage(ProtoMsgType.FromMsgEnum.HeroFundAwardReq, params, {}, self.rspHeroFundAward, BIReport.ITEM_GET_TYPE.ACT_HERO_FUND)
end
function HeroFundManager:rspHeroFundAward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.HeroFundData:gotReward(result.id_with_lv)
GFunc.showRewardBox(result.rewards)
end
end
function HeroFundManager:purcharse(id)
PayManager:purchasePackage(id, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
return HeroFundManager

View File

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

View File

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

View File

@ -1,43 +0,0 @@
local SevenDayManager = class("SevenDayManager", BaseModule)
function SevenDayManager:showUI()
UIManager:showUI("app/ui/activity/seven_day/seven_day_ui")
end
function SevenDayManager:claimTaskReward(id)
local args = {
ids = {id}
}
self:sendMessage(ProtoMsgType.FromMsgEnum.SevenDayTaskRewardReq, args, {}, self.onClaimTaskRewardFinish, BIReport.ITEM_GET_TYPE.SEVEN_DAY_TASK)
end
function SevenDayManager:onClaimTaskRewardFinish(result)
if result.status == 0 then
GFunc.showRewardBox(result.rewards)
DataManager.SevenDayData:refreshTasks(result.tasks)
DataManager.SevenDayData:setDirty()
end
end
function SevenDayManager:claimStepReward(id)
if DataManager.SevenDayData:getStepCollected(id) then
return
end
if not DataManager.SevenDayData:canClaimStepTask(id) then
return
end
local params = {
id = id
}
self:sendMessage(ProtoMsgType.FromMsgEnum.SevenDayRewardReq, params, {}, self.onClaimStepRewardFinish, BIReport.ITEM_GET_TYPE.SEVEN_DAY_STEP_REWARD)
end
function SevenDayManager:onClaimStepRewardFinish(result)
if result.status == 0 then
GFunc.showRewardBox(result.rewards)
DataManager.SevenDayData:refreshClaimed(result.Claimed)
DataManager.SevenDayData:setDirty()
end
end
return SevenDayManager

View File

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

View File

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

View File

@ -1,33 +0,0 @@
local TournArenaConst = {}
-- 界面
TournArenaConst.PANEL_TYPE = {
BOUNTY = 1,
RANK = 2,
GIFT = 3,
}
-- 战令档位
TournArenaConst.BOUNTY_GRADE_TYPE = {
FREE = 0,
PAY1 = 1,
PAY2 = 2,
}
-- 战令礼包id
TournArenaConst.BOUNTY_GIFT_ID_1 = 240102
TournArenaConst.BOUNTY_GIFT_ID_2 = 240202
TournArenaConst.GIFT_IDS = {
240302,
240402,
240502,
240602,
240702,
240802,
}
-- 轮次周期
TournArenaConst.PRESENT_TURN_DAY = 2
return TournArenaConst

View File

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

View File

@ -1,123 +0,0 @@
local TournArenaManager = class("TournArenaManager", BaseModule)
function TournArenaManager:init()
self:addEventListener(EventManager.CUSTOM_EVENT.ARENA_BATTLE_SETTLEMENT, function(isWin)
self:reqActData()
end)
end
function TournArenaManager:showActMainUI()
UIManager:showUI("app/ui/activity/tourn_arena/tourn_arena_ui")
end
-- 初始化计时器
function TournArenaManager:initTimer()
self:unscheduleGlobal(self.actSid)
if DataManager.TournArenaData:isActiveTime() then
Logger.logHighlight("竞技场锦标赛活动结束倒计时:"..DataManager.TournArenaData:getEndRemainTime())
self.actSid = self:performWithDelayGlobal(function()
Logger.logHighlight("竞技场锦标赛活动结束")
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACTIVITY_TOURN_ARENA_END)
end, DataManager.TournArenaData:getEndRemainTime())
elseif DataManager.TournArenaData:getStartRemainTime() > 0 then
Logger.logHighlight("竞技场锦标赛活动开始倒计时:"..DataManager.TournArenaData:getStartRemainTime())
self.actSid = self:performWithDelayGlobal(function()
Logger.logHighlight("竞技场锦标赛活动开始")
DataManager.ShopData:resetTournArenaGift()
self:reqActData()
end, DataManager.TournArenaData:getStartRemainTime())
end
end
-- 购买活动战令
function TournArenaManager:buyBounty(giftId)
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
-- 请求活动数据
function TournArenaManager:reqActData()
if not DataManager.TournArenaData:isOpen() then
return
end
if not DataManager.TournArenaData:isActiveTime() then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.TournArenaDataReq, {}, {}, self.rspActData, nil)
end
function TournArenaManager:rspActData(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournArenaData:onGetActData(result.tourn_arena)
end
end
-- 请求战令奖励
function TournArenaManager:reqBountyReward(id, grade)
id = 0-- 默认领所有可领奖励
self:sendMessage(ProtoMsgType.FromMsgEnum.TournArenaBountyClaimReq, {id = id, grade = grade}, {}, self.rspBountyReward, BIReport.ITEM_GET_TYPE.TOURN_ARENA_BOUNTY_REWARD)
end
function TournArenaManager:rspBountyReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournArenaData:onReceivedBountyReward(result.success_id_grade)
GFunc.showRewardBox(result.rewards)
end
end
-- 购买战令等级
function TournArenaManager:reqBuyBountyLevel()
local cost = DataManager.TournArenaData: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.ACTIVITY_BUY_LEVEL,
costId = costId,
costNum = costNum,
okFunc = function()
local id = DataManager.TournArenaData:getBountyIdList()[DataManager.TournArenaData:getBountyLevel() + 1]
-- Logger.logHighlight("购买战令等级:"..id)
self:sendMessage(ProtoMsgType.FromMsgEnum.TournArenaBountyClaimByDiamondReq, {id = id}, {}, self.rspBuyBountyLevel, BIReport.ITEM_GET_TYPE.TOURN_ARENA_BOUNTY_LEVEL)
end,
}
GFunc.showMessageBox(params)
end
function TournArenaManager:rspBuyBountyLevel(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournArenaData:onBoughtBountyLevel()
end
end
-- 获取排行榜数据
function TournArenaManager:reqRankList(turn)
self:sendMessage(ProtoMsgType.FromMsgEnum.TournArenaRankReq, {turn = turn}, {}, self.rspRankList, nil)
end
function TournArenaManager:rspRankList(result)
DataManager.TournArenaData:setInReset(false)
if result.err_code == GConst.ERROR_STR.SUCCESS and result.reqData then
DataManager.TournArenaData:onGetRankData(result.reqData.turn, result.ranks, result.score, result.own_rank)
end
end
-- 领取排行榜奖励
function TournArenaManager:reqRankReward()
self:sendMessage(ProtoMsgType.FromMsgEnum.TournArenaRankClaimRewardReq, {}, {}, self.rspRankReward, BIReport.ITEM_GET_TYPE.TOURN_ARENA_RANK_REWARD)
end
function TournArenaManager:rspRankReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournArenaData:onReceivedRankReward()
GFunc.showRewardBox(result.rewards)
end
end
return TournArenaManager

View File

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

View File

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

View File

@ -1,33 +0,0 @@
local TournWaveConst = {}
-- 界面
TournWaveConst.PANEL_TYPE = {
BOUNTY = 1,
RANK = 2,
GIFT = 3,
}
-- 战令档位
TournWaveConst.BOUNTY_GRADE_TYPE = {
FREE = 0,
PAY1 = 1,
PAY2 = 2,
}
-- 战令礼包id
TournWaveConst.BOUNTY_GIFT_ID_1 = 230102
TournWaveConst.BOUNTY_GIFT_ID_2 = 230202
TournWaveConst.GIFT_IDS = {
230302,
230402,
230502,
230602,
230702,
230802,
}
-- 轮次周期
TournWaveConst.PRESENT_TURN_DAY = 2
return TournWaveConst

View File

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

View File

@ -1,117 +0,0 @@
local TournWaveManager = class("TournWaveManager", BaseModule)
function TournWaveManager:showActMainUI()
UIManager:showUI("app/ui/activity/tourn_wave/tourn_wave_ui")
end
-- 初始化计时器
function TournWaveManager:initTimer()
self:unscheduleGlobal(self.actSid)
if DataManager.TournWaveData:isActiveTime() then
Logger.logHighlight("波次锦标赛活动结束倒计时:"..DataManager.TournWaveData:getEndRemainTime())
self.actSid = self:performWithDelayGlobal(function()
Logger.logHighlight("波次锦标赛活动结束")
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACTIVITY_TOURN_WAVE_END)
end, DataManager.TournWaveData:getEndRemainTime())
elseif DataManager.TournWaveData:getStartRemainTime() > 0 then
Logger.logHighlight("波次锦标赛活动开始倒计时:"..DataManager.TournWaveData:getStartRemainTime())
self.actSid = self:performWithDelayGlobal(function()
Logger.logHighlight("波次锦标赛活动开始")
DataManager.ShopData:resetTournWaveGift()
self:reqActData()
end, DataManager.TournWaveData:getStartRemainTime())
end
end
-- 购买活动战令
function TournWaveManager:buyBounty(giftId)
PayManager:purchasePackage(giftId, PayManager.PURCHARSE_TYPE.ACT_GIFT)
end
-- 请求活动数据
function TournWaveManager:reqActData()
if not DataManager.TournWaveData:isOpen() then
return
end
if not DataManager.TournWaveData:isActiveTime() then
return
end
self:sendMessage(ProtoMsgType.FromMsgEnum.TournWaveDataReq, {}, {}, self.rspActData, nil)
end
function TournWaveManager:rspActData(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournWaveData:onGetActData(result.tourn_wave)
end
end
-- 请求战令奖励
function TournWaveManager:reqBountyReward(id, grade)
id = 0-- 默认领所有可领奖励
self:sendMessage(ProtoMsgType.FromMsgEnum.TournWaveBountyClaimReq, {id = id, grade = grade}, {}, self.rspBountyReward, BIReport.ITEM_GET_TYPE.TOURN_WAVE_BOUNTY_REWARD)
end
function TournWaveManager:rspBountyReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournWaveData:onReceivedBountyReward(result.success_id_grade)
GFunc.showRewardBox(result.rewards)
end
end
-- 购买战令等级
function TournWaveManager:reqBuyBountyLevel()
local cost = DataManager.TournWaveData: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.ACTIVITY_BUY_LEVEL,
costId = costId,
costNum = costNum,
okFunc = function()
local id = DataManager.TournWaveData:getBountyIdList()[DataManager.TournWaveData:getBountyLevel() + 1]
-- Logger.logHighlight("购买战令等级:"..id)
self:sendMessage(ProtoMsgType.FromMsgEnum.TournWaveBountyClaimByDiamondReq, {id = id}, {}, self.rspBuyBountyLevel, BIReport.ITEM_GET_TYPE.TOURN_WAVE_BOUNTY_LEVEL)
end,
}
GFunc.showMessageBox(params)
end
function TournWaveManager:rspBuyBountyLevel(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournWaveData:onBoughtBountyLevel()
end
end
-- 获取排行榜数据
function TournWaveManager:reqRankList(turn)
self:sendMessage(ProtoMsgType.FromMsgEnum.TournWaveRankReq, {turn = turn}, {}, self.rspRankList, nil)
end
function TournWaveManager:rspRankList(result)
DataManager.TournWaveData:setInReset(false)
if result.err_code == GConst.ERROR_STR.SUCCESS and result.reqData then
DataManager.TournWaveData:onGetRankData(result.reqData.turn, result.ranks, result.score, result.own_rank)
end
end
-- 领取排行榜奖励
function TournWaveManager:reqRankReward()
self:sendMessage(ProtoMsgType.FromMsgEnum.TournWaveRankClaimRewardReq, {}, {}, self.rspRankReward, BIReport.ITEM_GET_TYPE.TOURN_WAVE_RANK_REWARD)
end
function TournWaveManager:rspRankReward(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.TournWaveData:onReceivedRankReward()
GFunc.showRewardBox(result.rewards)
end
end
return TournWaveManager

View File

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

View File

@ -25,6 +25,8 @@ MainCityConst.LEFT_SIDE_BARS = {
MainCityConst.RIGHT_SIDE_BARS = { MainCityConst.RIGHT_SIDE_BARS = {
"app/ui/main_city/cell/side_bar_sign_cell", -- 签到 "app/ui/main_city/cell/side_bar_sign_cell", -- 签到
"app/ui/main_city/cell/side_bar_seven_day_cell", -- 七天乐第一期
"app/ui/main_city/cell/side_bar_seven_day_cell_2", -- 七天乐第二期
} }
return MainCityConst return MainCityConst

View File

@ -81,7 +81,7 @@ function MaincityManager:getModuleEntrancePos(moduleKey)
elseif moduleKey == ModuleManager.MODULE_KEY.SUMMON_OPEN then elseif moduleKey == ModuleManager.MODULE_KEY.SUMMON_OPEN then
return mainUI:getSummonIconPos() return mainUI:getSummonIconPos()
elseif moduleKey == ModuleManager.MODULE_KEY.FUND or elseif moduleKey == ModuleManager.MODULE_KEY.FUND or
moduleKey == ModuleManager.MODULE_KEY.SEVEN_DAY then moduleKey == ModuleManager.MODULE_KEY.ACT_SEVENDAY then
return mainUI:getSideBarActIconPos(moduleKey) return mainUI:getSideBarActIconPos(moduleKey)
end end
end end

View File

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

View File

@ -1,172 +0,0 @@
local ActBossRushFundUI = class("ActBossRushFundUI", BaseUI)
local FUND_CELL = "app/ui/activity/act_boss_rush/cell/fund_cell"
local BTN_ICON = {"common_btn_green_3", "act_bossrush_board_1"}
function ActBossRushFundUI:onPressBackspace()
self:closeUI()
end
function ActBossRushFundUI:isFullScreen()
return false
end
function ActBossRushFundUI:ctor()
self.rewardList = {}
for _, id in pairs(DataManager.ActBossRushData:getBountyList()) do
table.insert(self.rewardList, id)
end
table.sort(self.rewardList, function(a, b)
return a < b
end)
end
function ActBossRushFundUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_boss_rush/act_boss_rush_fund_ui.prefab"
end
function ActBossRushFundUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActBossRushFundUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_fund_ui.bg.bg.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_15))
uiMap["act_boss_rush_fund_ui.bg.level.tx_level"]:setText(DataManager.ActBossRushData:getWaveCount())
uiMap["act_boss_rush_fund_ui.bg.scrollrect.viewport.content.mask_img.line.btn_buy_level.tx_num"]:setText(GFunc.getRewardNum(DataManager.ActBossRushData:getBuyBountyLevelCost()))
self.downDesc = uiMap["act_boss_rush_fund_ui.bg.bg.desc"]
self.downDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_16))
self:refreshBtns()
self:_refreshScrollrect()
end
function ActBossRushFundUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_fund_ui.bg.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_boss_rush_fund_ui.bg.scrollrect.viewport.content.mask_img.line.btn_buy_level"]:addClickListener(function()
ModuleManager.ActBossRushManager:reqBuyFundLevel()
end)
end
function ActBossRushFundUI:_bind()
self:bind(DataManager.ActBossRushData, "isDirty", function()
self:_display()
end)
end
function ActBossRushFundUI:refreshBtns()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_fund_ui.bg.free.tx_free"]:setText(I18N:getGlobalText(I18N.GlobalConst.STR_FREE))
local probtn = uiMap["act_boss_rush_fund_ui.bg.buy1"]
local proBtntx = uiMap["act_boss_rush_fund_ui.bg.buy1.tx_buyed"]
local proBuy = uiMap["act_boss_rush_fund_ui.bg.buy1.tx_buy"]
proBtntx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_ACTIVE))
proBuy:setText(DataManager.ActBossRushData:getProPrice())
if DataManager.ActBossRushData:getProBought() then
probtn:setSprite(GConst.ATLAS_PATH.ACT_BOSS_RUSH, BTN_ICON[2])
probtn:setTouchEnable(false)
proBtntx:setVisible(true)
proBuy:setVisible(false)
else
probtn:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
probtn:setTouchEnable(true)
probtn:addClickListener(function()
ModuleManager.ActBossRushManager:purcharse(DataManager.ActBossRushData:getProActId())
end)
proBtntx:setVisible(false)
proBuy:setVisible(true)
end
local utralbtn = uiMap["act_boss_rush_fund_ui.bg.buy2"]
local utralBtntx = uiMap["act_boss_rush_fund_ui.bg.buy2.tx_buyed"]
local utralBuy = uiMap["act_boss_rush_fund_ui.bg.buy2.tx_buy"]
utralBtntx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_ACTIVE))
utralBuy:setText(DataManager.ActBossRushData:gettUtralPrice())
if DataManager.ActBossRushData:getUtralBought() then
utralbtn:setSprite(GConst.ATLAS_PATH.ACT_BOSS_RUSH, BTN_ICON[2])
utralbtn:setTouchEnable(false)
utralBtntx:setVisible(true)
utralBuy:setVisible(false)
else
utralbtn:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
utralbtn:setTouchEnable(true)
utralbtn:addClickListener(function()
ModuleManager.ActBossRushManager:purcharse(DataManager.ActBossRushData:getUtralActId())
end)
utralBtntx:setVisible(false)
utralBuy:setVisible(true)
end
end
function ActBossRushFundUI:_refreshScrollrect()
local uiMap = self.root:genAllChildren()
local mask = uiMap["act_boss_rush_fund_ui.bg.scrollrect.viewport.content.mask_img"]
local level = DataManager.ActBossRushData:getWaveLevel() - DataManager.ActBossRushData:getStartWaveLevel()
local totalCount = #self.rewardList
local maskCount = math.max(0, totalCount - level)
mask:setAnchoredPositionY(-10 - level * 120)
mask:setSizeDeltaY(maskCount * 120 + 20)
local progSlider = uiMap["act_boss_rush_fund_ui.bg.scrollrect.viewport.content.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
local y = (totalCount - 1) * 120
if (level - 1) >= 0 then
progSlider.value = (level - 1) / (totalCount - 1)
else
progSlider.value = 0
end
mask:setVisible(level < totalCount)
if self.scrollRectComp then
self.scrollRectComp:updateAllCell()
return
end
local prog = uiMap["act_boss_rush_fund_ui.bg.scrollrect.viewport.content.prog"]
prog:setSizeDeltaY(y)
self.scrollRectComp = uiMap["act_boss_rush_fund_ui.bg.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRectComp:addInitCallback(function()
return FUND_CELL
end)
self.scrollRectComp:addRefreshCallback(function(index, cell)
cell:refresh(self.rewardList[index])
mask:getTransform():SetAsLastSibling()
end)
self.scrollRectComp:clearCells()
self.scrollRectComp:setTotalCount(0)
if level < 1 then
level = 1
end
self.scrollRectComp:refillCells(totalCount, nil, level)
end
function ActBossRushFundUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActBossRushData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
uiMap["act_boss_rush_fund_ui.bg.countdown.tx_countdown"]:setText(str)
uiMap["act_boss_rush_fund_ui.bg.scrollrect.viewport.content.mask_img.line.btn_buy_level"]:setActive(remainTime < 86400)
end
return ActBossRushFundUI

View File

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

View File

@ -1,75 +0,0 @@
local ActBossRushPopUI = class("ActBossRushPopUI", BaseUI)
function ActBossRushPopUI:onPressBackspace()
self:closeUI()
end
function ActBossRushPopUI:isFullScreen()
return false
end
function ActBossRushPopUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_boss_rush/act_boss_rush_pop_ui.prefab"
end
function ActBossRushPopUI:onClose()
if self.popCheckBar then
self.popCheckBar:saveCheckStatus()
end
end
function ActBossRushPopUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
DataManager.ActBossRushData:markPoped()
end
function ActBossRushPopUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_pop_ui.ui_spine_obj"]:playAnim("idle", true, false)
uiMap["act_boss_rush_pop_ui.ui_spine_obj.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_2))
uiMap["act_boss_rush_pop_ui.ui_spine_obj.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_13))
uiMap["act_boss_rush_pop_ui.btn_goto.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_14))
self.popCheckBar = uiMap["act_boss_rush_pop_ui.pop_check_bar"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.POP_CHECK_BAR)
self.popCheckBar:refresh(false, "ActBossRushData")
end
function ActBossRushPopUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_pop_ui.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_boss_rush_pop_ui.btn_goto"]:addClickListener(function()
if not DataManager.ActBossRushData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
ModuleManager.ActBossRushManager:showMainUI()
self:closeUI()
end)
end
function ActBossRushPopUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActBossRushData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
uiMap["act_boss_rush_pop_ui.ui_spine_obj.countdown.tx_countdown"]:setText(str)
end
return ActBossRushPopUI

View File

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

View File

@ -1,330 +0,0 @@
local ActBossRushRankUI = class("ActBossRushRankUI", BaseUI)
local RANK_REWARD_CELL = "app/ui/activity/act_boss_rush/cell/rank_reward_cell"
local RANK_CELL = "app/ui/activity/act_boss_rush/cell/rank_cell"
local TOP_RANK_CELL = "app/ui/activity/act_boss_rush/cell/top_rank_cell"
local PAGE_ICON = {"common_menu_1", "common_menu_2"}
local PAGE_TYPE = {
LAST_DAY = 1,
TODAY = 2,
REWARD = 3,
}
local PAGE_TX = {
[PAGE_TYPE.LAST_DAY] = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_20,
[PAGE_TYPE.TODAY] = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_21,
[PAGE_TYPE.REWARD] = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_22,
}
function ActBossRushRankUI:onPressBackspace()
self:closeUI()
end
function ActBossRushRankUI:isFullScreen()
return false
end
function ActBossRushRankUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_boss_rush/act_boss_rush_rank_ui.prefab"
end
function ActBossRushRankUI:ctor()
self.rankRewardList = {}
self.rankRewardListCount = 0
local cfg = DataManager.ActBossRushData:getRankConfig()
local list = DataManager.ActBossRushData:getRankRewardList()
for index, id in ipairs(list) do
local info = cfg[id]
table.insert(self.rankRewardList, {id = id, ranking1 = info.ranking[1], ranking2 = info.ranking[2], rewards = info.reward})
self.rankRewardListCount = self.rankRewardListCount + 1
end
end
function ActBossRushRankUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
end
function ActBossRushRankUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_rank_ui.bg.rank_node.rank_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_24))
uiMap["act_boss_rush_rank_ui.bg.rank_node.player_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_25))
uiMap["act_boss_rush_rank_ui.bg.rank_node.record_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_26))
if not DataManager.ActBossRushData:getIsFinalDay() then
self:switchPage(PAGE_TYPE.TODAY)
else
self:switchPage(PAGE_TYPE.LAST_DAY)
end
end
function ActBossRushRankUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_rank_ui.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_boss_rush_rank_ui.bg.rank_bg.btn_help"]:addClickListener(function()
local params = {
type = GConst.TipsConst.HELP_TIPS_TYPE.NORMAL,
title = I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_11),
desc = I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_27),
}
ModuleManager.TipsManager:showHelpTips(params)
end)
end
function ActBossRushRankUI:_bind()
self:bind(DataManager.ActBossRushData, "isDirty", function()
if self.curPage ~= PAGE_TYPE.REWARD then
self:refreshRankNode()
else
self:refreshRewardNode()
end
self:refreshMyRankInfo()
self:refreshPages()
end)
end
function ActBossRushRankUI:refreshRankNode()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_rank_ui.bg.rank_node"]:setActive(true)
uiMap["act_boss_rush_rank_ui.bg.reward_node"]:setActive(false)
local text = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_20
if self.curPage == PAGE_TYPE.LAST_DAY then
self.rankList = DataManager.ActBossRushData:getLastRankInfo()
else
self.rankList = DataManager.ActBossRushData:getCurRankInfo()
text = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_21
end
uiMap["act_boss_rush_rank_ui.bg.title"]:setText(I18N:getGlobalText(text))
if not self.topRankCells then
self.topRankCells = {}
for i = 1, 3 do
self.topRankCells[i] = CellManager:addCellComp(uiMap["act_boss_rush_rank_ui.bg.rank_node.top_rank_cell_" .. i], TOP_RANK_CELL)
end
end
for index, cell in ipairs(self.topRankCells) do
cell:refresh(self.rankList[index])
end
local count = #self.rankList - 3
if count < 0 then
count = 0
end
if self.rankScrollRectComp then
self.rankScrollRectComp:refillCells(count)
return
end
self.rankScrollRectComp = uiMap["act_boss_rush_rank_ui.bg.rank_node.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.rankScrollRectComp:addInitCallback(function()
return RANK_CELL
end)
self.rankScrollRectComp:addRefreshCallback(function(index, cell)
local info = self.rankList[index + 3]
cell:refresh(index + 3, info)
end)
self.rankScrollRectComp:clearCells()
self.rankScrollRectComp:setTotalCount(0)
self.rankScrollRectComp:refillCells(count)
end
function ActBossRushRankUI:refreshRewardNode()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_rank_ui.bg.rank_node"]:setActive(false)
uiMap["act_boss_rush_rank_ui.bg.reward_node"]:setActive(true)
uiMap["act_boss_rush_rank_ui.bg.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_22))
if self.rewardScrollRectComp then
self.rewardScrollRectComp:updateAllCell()
return
end
self.rewardScrollRectComp = uiMap["act_boss_rush_rank_ui.bg.reward_node.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.rewardScrollRectComp:addInitCallback(function()
return RANK_REWARD_CELL
end)
self.rewardScrollRectComp:addRefreshCallback(function(index, cell)
local info = self.rankRewardList[index]
cell:refresh(info.ranking1, info.ranking2, info.rewards, self.rankRewardListCount)
end)
self.rewardScrollRectComp:clearCells()
self.rewardScrollRectComp:setTotalCount(0)
self.rewardScrollRectComp:refillCells(#self.rankRewardList)
end
function ActBossRushRankUI:refreshPages()
if not self.pageObjs then
local uiMap = self.root:genAllChildren()
self.pageObjs = {}
for i = 1, 3 do
self.pageObjs[i] = {
page = uiMap["act_boss_rush_rank_ui.bg.page_" .. i],
tx1 = uiMap["act_boss_rush_rank_ui.bg.page_" .. i .. ".tx"],
tx2 = uiMap["act_boss_rush_rank_ui.bg.page_" .. i .. ".tx_hl"],
}
self.pageObjs[i].page:addClickListener(function()
self:switchPage(i)
end)
end
end
for index, objs in ipairs(self.pageObjs) do
if index == self.curPage then
objs.page:setSprite(GConst.ATLAS_PATH.COMMON, PAGE_ICON[1])
objs.page:setAnchoredPositionY(-516.5)
objs.tx1:setText(GConst.EMPTY_STRING)
objs.tx2:setText(I18N:getGlobalText(PAGE_TX[index]))
else
objs.page:setSprite(GConst.ATLAS_PATH.COMMON, PAGE_ICON[2])
objs.page:setAnchoredPositionY(-505.5)
objs.tx1:setText(I18N:getGlobalText(PAGE_TX[index]))
objs.tx2:setText(GConst.EMPTY_STRING)
end
end
if DataManager.ActBossRushData:getIsFinalDay() then
self.pageObjs[2].page:setActive(false)
self.pageObjs[1].page:setActive(true)
self.pageObjs[3].page:setActive(true)
self.pageObjs[1].page:setAnchoredPositionX(-90)
self.pageObjs[3].page:setAnchoredPositionX(90)
elseif DataManager.ActBossRushData:getIsFirstDay() then
self.pageObjs[1].page:setActive(false)
self.pageObjs[2].page:setActive(true)
self.pageObjs[3].page:setActive(true)
self.pageObjs[2].page:setAnchoredPositionX(-90)
self.pageObjs[3].page:setAnchoredPositionX(90)
else
local x = -186
for index, objs in ipairs(self.pageObjs) do
objs.page:setAnchoredPositionX(x)
x = x + 186
objs.page:setActive(true)
end
end
if DataManager.ActBossRushData:canGetRankReward() then
self.pageObjs[3].page:addRedPoint(77, -6.5, 1)
else
self.pageObjs[3].page:removeRedPoint()
end
end
function ActBossRushRankUI:switchPage(page)
if self.curPage == page then
return
end
self.curPage = page
if self.curPage ~= PAGE_TYPE.REWARD then
self:refreshRankNode()
else
self:refreshRewardNode()
end
self:refreshPages()
self:refreshMyRankInfo()
end
function ActBossRushRankUI:refreshMyRankInfo()
local info = DataManager.ActBossRushData:getLastSelfInfo()
local canGot = DataManager.ActBossRushData:canGetRankReward()
if self.curPage == PAGE_TYPE.TODAY then
info = DataManager.ActBossRushData:getCurRankSelfInfo()
end
if self.curPage == PAGE_TYPE.REWARD and not canGot then
info = DataManager.ActBossRushData:getCurRankSelfInfo()
end
local rank = info and info.rank or 0
local wave = info and info.wave or 0
local round = info and info.round or 0
local uiMap = self.root:genAllChildren()
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["act_boss_rush_rank_ui.bg.rank_bg.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
self.selfRewardCells = {}
for i = 1, 2 do
self.selfRewardCells[i] = CellManager:addCellComp(uiMap["act_boss_rush_rank_ui.bg.rank_bg.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
end
self.playerHeadCell:refresh()
uiMap["act_boss_rush_rank_ui.bg.rank_bg.name"]:setText(DataManager.PlayerData:getNickname())
local descObj = uiMap["act_boss_rush_rank_ui.bg.rank_bg.tx_last_day"]
local rankObj = uiMap["act_boss_rush_rank_ui.bg.rank_bg.tx_rank"]
if not rank or rank <= 0 then
rankObj:setText("--")
else
rankObj:setText(rank)
end
local waveObj = uiMap["act_boss_rush_rank_ui.bg.rank_bg.tx_wave"]
if not wave then
waveObj:setText("--")
else
waveObj:setText(wave)
end
local roundObj = uiMap["act_boss_rush_rank_ui.bg.rank_bg.tx_round"]
if not round then
roundObj:setText("--")
else
roundObj:setText(round)
end
local imgWave = uiMap["act_boss_rush_rank_ui.bg.rank_bg.wave_icon"]
local imgRound = uiMap["act_boss_rush_rank_ui.bg.rank_bg.round_icon"]
if self.curPage ~= PAGE_TYPE.REWARD then
imgWave:setVisible(true)
imgRound:setVisible(true)
waveObj:setVisible(true)
roundObj:setVisible(true)
for index, cell in ipairs(self.selfRewardCells) do
cell:getBaseObject():setActive(false)
end
if self.curPage == PAGE_TYPE.LAST_DAY then
descObj:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_20))
else
descObj:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_21))
end
else
imgWave:setVisible(false)
imgRound:setVisible(false)
waveObj:setVisible(false)
roundObj:setVisible(false)
local got = DataManager.ActBossRushData:isGotRankReward()
local rewards
if canGot then
rewards = DataManager.ActBossRushData:getRankRewards(rank)
descObj:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_20))
else
info = DataManager.ActBossRushData:getCurRankSelfInfo()
rewards = DataManager.ActBossRushData:getRankRewards(info.rank or 0)
got = false
descObj:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_21))
end
for index, cell in ipairs(self.selfRewardCells) do
if rewards and rewards[index] then
cell:refreshByConfig(rewards[index], got, got)
cell:getBaseObject():setActive(true)
if canGot then
cell:showFrameAnimation()
cell:addClickListener(function()
ModuleManager.ActBossRushManager:reqRankReward()
end)
else
cell:hideFrameAnimation()
cell:addClickListener(nil)
end
else
cell:getBaseObject():setActive(false)
end
end
end
end
return ActBossRushRankUI

View File

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

View File

@ -1,116 +0,0 @@
local ActBossRushShopUI = class("ActBossRushShopUI", BaseUI)
local SHOP_CELL = "app/ui/activity/act_boss_rush/cell/shop_cell"
function ActBossRushShopUI:onPressBackspace()
self:closeUI()
end
function ActBossRushShopUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_boss_rush/act_boss_rush_shop_ui.prefab"
end
function ActBossRushShopUI:isFullScreen()
return false
end
function ActBossRushShopUI:ctor()
self:dealList()
end
function ActBossRushShopUI:dealList()
self.shopList = {}
self.costId = 1
for _, id in ipairs(DataManager.ActBossRushData:getExchangeList()) do
local canExchange = DataManager.ActBossRushData:getExchangeRemainCount(id) > 0
table.insert(self.shopList, {id = id, canExchange = canExchange})
if self.costId == 1 then
local cost = DataManager.ActBossRushData:getShopCost(id)
self.costId = GFunc.getRewardId(cost)
end
end
table.sort(self.shopList, function(a, b)
if a.canExchange == b.canExchange then
return a.id < b.id
else
return a.canExchange
end
end)
end
function ActBossRushShopUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
DataManager.ActBossRushData:setTodayExchangeCheck()
end
function ActBossRushShopUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_shop_ui.bg.desc_bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_17))
uiMap["act_boss_rush_shop_ui.bg.score.tx_score"]:setText(DataManager.BagData.ItemData:getItemNumById(self.costId))
uiMap["act_boss_rush_shop_ui.bg.score.img"]:setSprite(ModuleManager.ItemManager:getItemIcon(self.costId))
self:_refreshScrollrect()
end
function ActBossRushShopUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_shop_ui.bg.score"]:addClickListener(function()
ModuleManager.ActBossRushManager:showFundUI()
self:closeUI()
end)
uiMap["act_boss_rush_shop_ui.bg.close_btn"]:addClickListener(function()
self:closeUI()
end)
end
function ActBossRushShopUI:_bind()
self:bind(DataManager.ActBossRushData, "isDirty", function()
self:dealList()
self:_display()
end)
end
function ActBossRushShopUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActBossRushData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
uiMap["act_boss_rush_shop_ui.bg.countdown.tx_countdown"]:setText(str)
end
function ActBossRushShopUI:_refreshScrollrect()
if self.scrollRectComp then
self.scrollRectComp:updateAllCell()
return
end
local uiMap = self.root:genAllChildren()
self.scrollRectComp = uiMap["act_boss_rush_shop_ui.bg.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRectComp:addInitCallback(function()
return SHOP_CELL
end)
self.scrollRectComp:addRefreshCallback(function(index, cell)
cell:refresh(self.shopList[index].id)
end)
self.scrollRectComp:clearCells()
self.scrollRectComp:refillCells(#self.shopList)
end
return ActBossRushShopUI

View File

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

View File

@ -1,205 +0,0 @@
local ActBossRushUI = class("ActBossRushUI", BaseUI)
local RANK_CELL = "app/ui/activity/act_boss_rush/cell/rank_cell"
function ActBossRushUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_boss_rush/act_boss_rush_ui.prefab"
end
function ActBossRushUI:onPressBackspace()
self:closeUI()
end
function ActBossRushUI:getCurrencyParams()
if self.currencyParams == nil then
self.currencyParams = {
itemIds = {
GConst.ItemConst.ITEM_ID_GEM,
},
showType = GConst.CURRENCY_TYPE.HORIZONTAL
}
end
return self.currencyParams
end
function ActBossRushUI:ctor()
end
function ActBossRushUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActBossRushUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_ui.bg.title_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_2))
uiMap["act_boss_rush_ui.bg.tx_today_rank"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_3))
uiMap["act_boss_rush_ui.down.formation_btn.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.DUNGEON_WEAPON_DESC_4))
uiMap["act_boss_rush_ui.bg.btn_rank.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_10))
uiMap["act_boss_rush_ui.bg.btn_bounty.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_11))
uiMap["act_boss_rush_ui.bg.btn_shop.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_12))
uiMap["act_boss_rush_ui.bg.fight_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
local todayMaxWaveDesc = uiMap["act_boss_rush_ui.bg.tx_today_max_wave_desc"]
local todayMaxWave = uiMap["act_boss_rush_ui.bg.tx_today_max_wave"]
local todayMaxWaveImg = uiMap["act_boss_rush_ui.bg.img_today_max_wave"]
todayMaxWaveDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_4))
todayMaxWave:setText(DataManager.ActBossRushData:getTodayMaxWave())
GFunc.centerTxAndImgAndTx(todayMaxWaveDesc, 5, todayMaxWaveImg, 5, todayMaxWave)
uiMap["act_boss_rush_ui.bg.tx_today_fight_count"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_5, DataManager.ActBossRushData:getTodayFightCount()))
local cost = uiMap["act_boss_rush_ui.bg.fight_btn.cost"]
local costIcon = uiMap["act_boss_rush_ui.bg.cost.icon"]
local costDesc = uiMap["act_boss_rush_ui.bg.cost.tx_cost_desc"]
local costNum = uiMap["act_boss_rush_ui.bg.cost.tx_cost"]
local todayFreeFightCount = uiMap["act_boss_rush_ui.bg.tx_count"]
local count = DataManager.ActBossRushData:getFreeFightCount()
if count > 0 then
todayFreeFightCount:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_6, count))
cost:setVisible(false)
else
todayFreeFightCount:setText(GConst.EMPTY_STRING)
cost:setVisible(true)
costDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_7))
costNum:setText(DataManager.ActBossRushData:getFightCost())
GFunc.centerTxAndImgAndTx(costDesc, 5, costIcon, 5, costNum)
end
local rankBtn = uiMap["act_boss_rush_ui.bg.btn_rank"]
if DataManager.ActBossRushData:canGetRankReward() then
rankBtn:addRedPoint(20, 40, 0.8)
else
rankBtn:removeRedPoint()
end
local bountyBtn = uiMap["act_boss_rush_ui.bg.btn_bounty"]
if DataManager.ActBossRushData:getHaveReward() then
bountyBtn:addRedPoint(20, 40, 0.8)
else
bountyBtn:removeRedPoint()
end
local shopBtn = uiMap["act_boss_rush_ui.bg.btn_shop"]
if not DataManager.ActBossRushData:getTodayExchangeCheck() then
shopBtn:addRedPoint(20, 40, 0.8)
else
shopBtn:removeRedPoint()
end
self:refreshRankList()
self:refreshFormation()
end
function ActBossRushUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_boss_rush_ui.bg.fight_btn"]:addClickListener(function()
ModuleManager.ActBossRushManager:reqFight()
end)
uiMap["act_boss_rush_ui.down.formation_btn"]:addClickListener(function()
if not DataManager.ActBossRushData:getIsOpen() then
return
end
ModuleManager.CommonManager:showFormationUI(GConst.BattleConst.FORMATION_TYPE.BOSS_RUSH)
end)
uiMap["act_boss_rush_ui.down.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_boss_rush_ui.bg.btn_rank"]:addClickListener(function()
ModuleManager.ActBossRushManager:showRankUI()
end)
uiMap["act_boss_rush_ui.bg.btn_bounty"]:addClickListener(function()
ModuleManager.ActBossRushManager:showFundUI()
end)
uiMap["act_boss_rush_ui.bg.btn_shop"]:addClickListener(function()
ModuleManager.ActBossRushManager:showShopUI()
end)
uiMap["act_boss_rush_ui.bg.time_bg.btn_help"]:addClickListener(function()
local params = {
type = GConst.TipsConst.HELP_TIPS_TYPE.NORMAL,
title = I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_11),
desc = I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_31),
}
ModuleManager.TipsManager:showHelpTips(params)
end)
self:addEventListener(EventManager.CUSTOM_EVENT.GO_SHOP, function()
self:closeUI()
end)
end
function ActBossRushUI:_bind()
self:bind(DataManager.ActBossRushData, "isDirty", function()
self:_display()
end)
self:bind(DataManager.FormationData, "dirty", function()
self:refreshFormation()
end)
self:bind(DataManager.HeroData, "isDirty", function()
self:refreshFormation()
end)
end
function ActBossRushUI:refreshRankList()
if not self.rankCells then
self.rankCells = {}
local uiMap = self.root:genAllChildren()
for i = 1, 3 do
self.rankCells[i] = CellManager:addCellComp(uiMap["act_boss_rush_ui.bg.act_rank_cell_" .. i], RANK_CELL)
end
end
local list = DataManager.ActBossRushData:getTopRankInfo()
for index, cell in ipairs(self.rankCells) do
cell:refresh(index, list[index])
end
end
function ActBossRushUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActBossRushData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
uiMap["act_boss_rush_ui.bg.time_bg.time"]:setText(str)
local canFight = remainTime > 86400
if self.canFight ~= canFight then
self.canFight = canFight
uiMap["act_boss_rush_ui.bg.fight_btn"]:setActive(canFight)
uiMap["act_boss_rush_ui.bg.fight_btn.cost"]:setActive(canFight)
uiMap["act_boss_rush_ui.bg.tx_count"]:setActive(canFight)
end
end
function ActBossRushUI:refreshFormation()
if not self.formationComp then
local uiMap = self.root:genAllChildren()
self.formationComp = uiMap["act_boss_rush_ui.bg.hero_formation_comp"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.HERO_FORMATION_COMP)
end
self.formationComp:refreshByFormation(DataManager.FormationData:getBossRushFormation())
end
return ActBossRushUI

View File

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

View File

@ -1,76 +0,0 @@
local FundCell = class("FundCell", BaseCell)
function FundCell:init()
local uiMap = self:getUIMap()
self.txLevel = uiMap["fund_cell.level.tx_level"]
self.rewardCell1 = uiMap["fund_cell.reward_cell_1"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewardCell2 = uiMap["fund_cell.reward_cell_2"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewardCell3 = uiMap["fund_cell.reward_cell_3"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
function FundCell:refresh(level)
self.txLevel:setText(DataManager.ActBossRushData:getLevelWave(level))
local isGet
isGet = DataManager.ActBossRushData:getFreeGot(level)
local reward = DataManager.ActBossRushData:getReward(level, DataManager.ActBossRushData.REWARD_TYPE.FREE)
if reward then
self.rewardCell1:refreshByConfig(reward, isGet, isGet)
end
self.rewardCell1:showLock(false)
if DataManager.ActBossRushData:getFreeCanGet(level) then
self.rewardCell1:showFrameAnimation()
self.rewardCell1.baseObject:addRedPoint(50, 50, 0.6)
self.rewardCell1:addClickListener(function()
self:onClickReward(level, DataManager.ActBossRushData.REWARD_TYPE.FREE)
end)
else
self.rewardCell1:hideFrameAnimation()
self.rewardCell1.baseObject:removeRedPoint()
self.rewardCell1:addClickListener(nil)
end
isGet = DataManager.ActBossRushData:getProGot(level)
local reward = DataManager.ActBossRushData:getReward(level, DataManager.ActBossRushData.REWARD_TYPE.PRO)
if reward then
self.rewardCell2:refreshByConfig(reward, isGet, isGet)
end
self.rewardCell2:showLock(not DataManager.ActBossRushData:getProBought())
if DataManager.ActBossRushData:getProCanGet(level) then
self.rewardCell2:showFrameAnimation()
self.rewardCell2.baseObject:addRedPoint(50, 50, 0.6)
self.rewardCell2:addClickListener(function()
self:onClickReward(level, DataManager.ActBossRushData.REWARD_TYPE.PRO)
end)
else
self.rewardCell2:hideFrameAnimation()
self.rewardCell2.baseObject:removeRedPoint()
self.rewardCell2:addClickListener(nil)
end
isGet = DataManager.ActBossRushData:getUtralGot(level)
local reward = DataManager.ActBossRushData:getReward(level, DataManager.ActBossRushData.REWARD_TYPE.UTRAL)
if reward then
self.rewardCell3:refreshByConfig(reward, isGet, isGet)
end
self.rewardCell3:showLock(not DataManager.ActBossRushData:getUtralBought())
if DataManager.ActBossRushData:getUtralCanGet(level) then
self.rewardCell3:showFrameAnimation()
self.rewardCell3.baseObject:addRedPoint(50, 50, 0.6)
self.rewardCell3:addClickListener(function()
self:onClickReward(level, DataManager.ActBossRushData.REWARD_TYPE.UTRAL)
end)
else
self.rewardCell3:hideFrameAnimation()
self.rewardCell3.baseObject:removeRedPoint()
self.rewardCell3:addClickListener(nil)
end
end
-- 领取奖励
function FundCell:onClickReward(level, rewardType)
ModuleManager.ActBossRushManager:reqFundAward(level, rewardType)
end
return FundCell

View File

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

View File

@ -1,65 +0,0 @@
local RankCell = class("RankCell", BaseCell)
local RANK_ICON = {
"act_ranking_1",
"act_ranking_2",
"act_ranking_3"
}
local RANK_BG = {
"act_ranking_bg_1",
"act_ranking_bg_2",
"act_ranking_bg_3",
"act_ranking_bg_4"
}
function RankCell:refresh(index, info)
local uiMap = self:getUIMap()
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["act_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end
uiMap["act_rank_cell.tx_rank"]:setText(index)
local imgRank = uiMap["act_rank_cell.img_rank"]
if RANK_ICON[index] then
imgRank:setVisible(true)
imgRank:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_ICON[index])
uiMap["act_rank_cell.tx_rank"]:setText(GConst.EMPTY_STRING)
else
imgRank:setVisible(false)
end
local imgBg = uiMap["act_rank_cell.bg"]
if RANK_BG[index] then
imgBg:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_BG[index])
else
imgBg:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_BG[4])
end
local txName = uiMap["act_rank_cell.tx_name"]
local txWave = uiMap["act_rank_cell.tx_wave"]
local txRound = uiMap["act_rank_cell.tx_round"]
if info then
txName:setText(info.name)
txWave:setText(info.wave)
txRound:setText(info.round)
self.playerHeadCell:getBaseObject():addClickListener(function()
ModuleManager.ActBossRushManager:reqOtherPlayerInfo(info.id, function(formation)
if not self.playerHeadCell or not self.playerHeadCell:getBaseObject() or self.playerHeadCell:getBaseObject():isDestroyed() then
return
end
ModuleManager.TipsManager:showHeroFormation(self.playerHeadCell:getBaseObject(), formation)
end)
end)
self.playerHeadCell:refresh(info.avatar, info.avatar_frame, false)
else
txName:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_8))
txWave:setText("--")
txRound:setText("--")
self.playerHeadCell:getBaseObject():addClickListener(nil)
self.playerHeadCell:refresh(3001, 1000, false) -- 默认
end
end
return RankCell

View File

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

View File

@ -1,35 +0,0 @@
local RankRewardcell = class("RankRewardcell", BaseCell)
function RankRewardcell:refresh(ranking1, ranking2, rewards, totalIndex)
local uiMap = self:getUIMap()
local rankStr = ranking1 .. "-"
if ranking2 then
rankStr = rankStr .. ranking2
else
rankStr = rankStr .. "-"
end
if ranking1 == ranking2 then
rankStr = ranking1
end
if self:getIndex() == totalIndex then
rankStr = ranking1 .. "+"
end
uiMap["rank_reward_cell.bg.tx_rank"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_23, rankStr))
if not self.rewardCells then
self.rewardCells = {}
for i = 1, 2 do
self.rewardCells[i] = uiMap["rank_reward_cell.bg.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
end
for index, cell in ipairs(self.rewardCells) do
if rewards and rewards[index] then
cell:refreshByConfig(rewards[index])
cell:getBaseObject():setActive(true)
else
cell:getBaseObject():setActive(false)
end
end
end
return RankRewardcell

View File

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

View File

@ -1,66 +0,0 @@
local ShopCell = class("ShopCell", BaseCell)
local BTN_ICON = {"common_btn_green_2", "common_btn_grey_2"}
function ShopCell:init()
local uiMap = self:getUIMap()
self.scoreIcon = uiMap["shop_cell.bg.score"]
self.txScore = uiMap["shop_cell.score.tx_score"]
self.rewardCell = uiMap["shop_cell.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.txBtn = uiMap["shop_cell.ok_btn.text"]
self.txLimit = uiMap["shop_cell.tx_limit"]
self.btn = uiMap["shop_cell.ok_btn"]
end
function ShopCell:refresh(id)
self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_18))
local cost = DataManager.ActBossRushData:getShopCost(id)
local costId = GFunc.getRewardId(cost)
local costNum = GFunc.getRewardNum(cost)
self.scoreIcon:setSprite(ModuleManager.ItemManager:getItemIcon(costId))
local color = "#FFFFFF"
local itemEnough = GFunc.checkCost(costId, costNum, false)
if not itemEnough then
-- color = "#FF4F38"
end
local str = string.format("<color=%s>%s</color>", color, costNum)
self.txScore:setText(str)
local remainCount = DataManager.ActBossRushData:getExchangeRemainCount(id)
local reward = DataManager.ActBossRushData:getShopReward(id)
if reward then
self.rewardCell:refreshByConfig(reward)
end
local canExchange = remainCount > 0
local color = "#FFFFFF"
if not canExchange then
-- color = "#FF4F38"
end
local str = string.format("<color=%s>%s</color>", color, I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_19, remainCount))
self.txLimit:setText(str)
self.btn:addClickListener(function()
self:onClickReward(id)
end)
if not itemEnough then
canExchange = false
end
local icon = canExchange and BTN_ICON[1] or BTN_ICON[2]
self.btn:setSprite(GConst.ATLAS_PATH.COMMON, icon)
self.btn:setTouchEnable(canExchange)
end
-- 领取奖励
function ShopCell:onClickReward(id)
local cost = DataManager.ActBossRushData:getShopCost(id)
local remainCount = DataManager.ActBossRushData:getExchangeRemainCount(id)
local reward = DataManager.ActBossRushData:getShopReward(id)
ModuleManager.CommonManager:showExchangeUI(1, remainCount, reward, cost, function(count)
ModuleManager.ActBossRushManager:reqExchange(id, count)
end)
end
return ShopCell

View File

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

View File

@ -1,43 +0,0 @@
local TopRankCell = class("TopRankCell", BaseCell)
function TopRankCell:refresh(info)
local uiMap = self:getUIMap()
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["top_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end
local txName = uiMap["top_rank_cell.name"]
local txWave = uiMap["top_rank_cell.wave"]
local txRound = uiMap["top_rank_cell.round"]
local imgWave = uiMap["top_rank_cell.img_wave"]
local imgRound = uiMap["top_rank_cell.img_round"]
if info then
txName:setText(info.name)
txWave:setText(info.wave)
txRound:setText(info.round)
imgWave:setVisible(true)
imgRound:setVisible(true)
self.playerHeadCell:getBaseObject():addClickListener(function()
ModuleManager.ActBossRushManager:reqOtherPlayerInfo(info.id, function(formation)
if not self.playerHeadCell or not self.playerHeadCell:getBaseObject() or self.playerHeadCell:getBaseObject():isDestroyed() then
return
end
ModuleManager.TipsManager:showHeroFormation(self.playerHeadCell:getBaseObject(), formation)
end)
end)
self.playerHeadCell:refresh(info.avatar, info.avatar_frame, false)
GFunc.centerImgAndTx(imgWave, txWave, 5)
GFunc.centerImgAndTx(imgRound, txRound, 5)
else
txName:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_8))
txWave:setText(GConst.EMPTY_STRING)
txRound:setText(GConst.EMPTY_STRING)
imgWave:setVisible(false)
imgRound:setVisible(false)
self.playerHeadCell:getBaseObject():addClickListener(nil)
self.playerHeadCell:refresh(3001, 1000, false) -- 默认
end
end
return TopRankCell

View File

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

View File

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

View File

@ -1,198 +0,0 @@
local ActPvpBountyUI = class("ActPvpBountyUI", BaseUI)
local BOUNTY_CELL = "app/ui/activity/act_pvp/cell/bounty_cell"
local BTN_ICON = {"common_btn_green_3", "act_common_board_6"}
function ActPvpBountyUI:onPressBackspace()
self:closeUI()
end
function ActPvpBountyUI:isFullScreen()
return false
end
function ActPvpBountyUI:ctor()
self.rewardList = DataManager.ActPvpData:getBountyList()
end
function ActPvpBountyUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_bounty_ui.prefab"
end
function ActPvpBountyUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActPvpBountyUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_bounty_ui.bg.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_4))
uiMap["act_pvp_bounty_ui.bg.scrollrect.viewport.content.mask_img.line.btn_buy_level.tx_num"]:setText(GFunc.getRewardNum(DataManager.ActPvpData:getBuyBountyLevelCost()))
self.downDesc = uiMap["act_pvp_bounty_ui.bg.bg.desc"]
self.downDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_16))
self:refreshBtns()
self:_refreshScrollrect()
self:refreshLevelInfo()
end
function ActPvpBountyUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_bounty_ui.bg.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_pvp_bounty_ui.bg.scrollrect.viewport.content.mask_img.line.btn_buy_level"]:addClickListener(function()
ModuleManager.ActPvpManager:reqBuyBountyLevel()
end)
end
function ActPvpBountyUI:_bind()
self:bind(DataManager.ActPvpData, "isDirty", function()
self:_display()
end)
self:bind(DataManager.ShopData, "isDirty", function()
self:_display()
end)
end
function ActPvpBountyUI:refreshBtns()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_bounty_ui.bg.free.tx_free"]:setText(I18N:getGlobalText(I18N.GlobalConst.STR_FREE))
local probtn = uiMap["act_pvp_bounty_ui.bg.buy1"]
local proBtntx = uiMap["act_pvp_bounty_ui.bg.buy1.tx_buyed"]
local proBuy = uiMap["act_pvp_bounty_ui.bg.buy1.tx_buy"]
proBtntx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_ACTIVE))
proBuy:setText(DataManager.ActPvpData:getProPrice())
if DataManager.ActPvpData:getProBought() then
probtn:setSprite(GConst.ATLAS_PATH.ACT_COMMON, BTN_ICON[2])
probtn:setTouchEnable(false)
proBtntx:setVisible(true)
proBuy:setVisible(false)
else
probtn:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
probtn:setTouchEnable(true)
probtn:addClickListener(function()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
PayManager:purchasePackage(DataManager.ActPvpData:getProActId(), PayManager.PURCHARSE_TYPE.ACT_GIFT)
end)
proBtntx:setVisible(false)
proBuy:setVisible(true)
end
local utralbtn = uiMap["act_pvp_bounty_ui.bg.buy2"]
local utralBtntx = uiMap["act_pvp_bounty_ui.bg.buy2.tx_buyed"]
local utralBuy = uiMap["act_pvp_bounty_ui.bg.buy2.tx_buy"]
utralBtntx:setText(I18N:getGlobalText(I18N.GlobalConst.ALREADY_ACTIVE))
utralBuy:setText(DataManager.ActPvpData:gettUtralPrice())
if DataManager.ActPvpData:getUtralBought() then
utralbtn:setSprite(GConst.ATLAS_PATH.ACT_COMMON, BTN_ICON[2])
utralbtn:setTouchEnable(false)
utralBtntx:setVisible(true)
utralBuy:setVisible(false)
else
utralbtn:setSprite(GConst.ATLAS_PATH.COMMON, BTN_ICON[1])
utralbtn:setTouchEnable(true)
utralbtn:addClickListener(function()
if not DataManager.ActPvpData:getIsOpen() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC))
return
end
PayManager:purchasePackage(DataManager.ActPvpData:getUtralActId(), PayManager.PURCHARSE_TYPE.ACT_GIFT)
end)
utralBtntx:setVisible(false)
utralBuy:setVisible(true)
end
end
function ActPvpBountyUI:_refreshScrollrect()
local uiMap = self.root:genAllChildren()
local mask = uiMap["act_pvp_bounty_ui.bg.scrollrect.viewport.content.mask_img"]
local level = DataManager.ActPvpData:getBountyLevel()
local totalCount = #self.rewardList
local maskCount = math.max(0, totalCount - level)
mask:setAnchoredPositionY(-10 - level * 120)
mask:setSizeDeltaY(maskCount * 120 + 20)
local progSlider = uiMap["act_pvp_bounty_ui.bg.scrollrect.viewport.content.prog.img_prog"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
local y = (totalCount - 1) * 120
if (level - 1) >= 0 then
progSlider.value = (level - 1) / (totalCount - 1)
else
progSlider.value = 0
end
mask:setVisible(level < totalCount)
if self.scrollRectComp then
self.scrollRectComp:updateAllCell()
return
end
local prog = uiMap["act_pvp_bounty_ui.bg.scrollrect.viewport.content.prog"]
prog:setSizeDeltaY(y)
self.scrollRectComp = uiMap["act_pvp_bounty_ui.bg.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.scrollRectComp:addInitCallback(function()
return BOUNTY_CELL
end)
self.scrollRectComp:addRefreshCallback(function(index, cell)
cell:refresh(self.rewardList[index])
mask:getTransform():SetAsLastSibling()
end)
self.scrollRectComp:clearCells()
self.scrollRectComp:setTotalCount(0)
if level < 1 then
level = 1
end
self.scrollRectComp:refillCells(totalCount, nil, level)
end
function ActPvpBountyUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActPvpData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
uiMap["act_pvp_bounty_ui.bg.countdown.tx_countdown"]:setText(str)
uiMap["act_pvp_bounty_ui.bg.scrollrect.viewport.content.mask_img.line.btn_buy_level"]:setActive(remainTime < 86400)
end
function ActPvpBountyUI:refreshLevelInfo()
local uiMap = self.root:genAllChildren()
local lv = DataManager.ActPvpData:getBountyLevel()
uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_lv_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_DESC_12))
uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_lv"]:setText(lv)
uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_15))
local needExp = DataManager.ActPvpData:getBountyLevelExp(lv)
local txSlider = uiMap["act_pvp_bounty_ui.bg.bg.point_bg.desc_slider"]
local slider = uiMap["act_pvp_bounty_ui.bg.bg.point_bg.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER)
if needExp <= 0 then -- 满级了
txSlider:setText(I18N:getGlobalText(I18N.GlobalConst.STR_MAX))
slider.value = 1
else
local exp = DataManager.ActPvpData:getBountyExp()
txSlider:setText(exp .. "/" .. needExp)
slider.value = exp / needExp
end
end
return ActPvpBountyUI

View File

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

View File

@ -1,93 +0,0 @@
local ActPvpHelpUI = class("ActPvpHelpUI", BaseUI)
-- 响应安卓后退事件
function ActPvpHelpUI:onPressBackspace()
self:closeUI()
end
function ActPvpHelpUI:isFullScreen()
return false
end
function ActPvpHelpUI:showCommonBG()
return false
end
function ActPvpHelpUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_help_ui.prefab"
end
function ActPvpHelpUI:ctor()
end
function ActPvpHelpUI:onClose()
end
function ActPvpHelpUI:onLoadRootComplete()
self:_display()
self:_addListeners()
end
function ActPvpHelpUI:_display()
local uiMap = self.root:genAllChildren()
self.videoNode = uiMap["act_pvp_help_ui.skill_node.video_node"]
uiMap["act_pvp_help_ui.skill_node.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_11))
uiMap["act_pvp_help_ui.skill_node.last_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLE_DESC_9))
uiMap["act_pvp_help_ui.skill_node.next_btn.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_BATTLE_DESC_10))
self.curIndex = 1
self:showTips()
end
function ActPvpHelpUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_help_ui.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_pvp_help_ui.skill_node.last_btn"]:addClickListener(function()
self.curIndex = math.max(1, self.curIndex - 1)
self:showTips()
end)
uiMap["act_pvp_help_ui.skill_node.next_btn"]:addClickListener(function()
self.curIndex = math.min(3, self.curIndex + 1)
self:showTips()
end)
end
function ActPvpHelpUI:showTips()
local uiMap = self.root:genAllChildren()
for i = 1, 3 do
local obj = uiMap["act_pvp_help_ui.skill_node.video_node.pause_video_0" .. i]
obj:setVisible(i == self.curIndex)
end
local lastBtn = uiMap["act_pvp_help_ui.skill_node.last_btn"]
local nextBtn = uiMap["act_pvp_help_ui.skill_node.next_btn"]
local str
if self.curIndex == 1 then
str = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_21)
lastBtn:setActive(false)
nextBtn:setActive(true)
nextBtn:setAnchoredPositionX(0)
elseif self.curIndex == 2 then
str = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_22)
lastBtn:setActive(true)
nextBtn:setActive(true)
lastBtn:setAnchoredPositionX(-137.5)
nextBtn:setAnchoredPositionX(137.5)
else
str = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_23)
lastBtn:setActive(true)
nextBtn:setActive(false)
lastBtn:setAnchoredPositionX(0)
end
local descObj = uiMap["act_pvp_help_ui.skill_node.scrollrect.viewport.desc"]
descObj:setText(str)
descObj:setSizeDeltaY(descObj:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredHeight)
descObj:setAnchoredPositionY(0)
end
return ActPvpHelpUI

View File

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

View File

@ -1,297 +0,0 @@
local ActPvpMainUI = class("ActPvpMainUI", BaseUI)
local ENTER_BTN_BG = {"common_btn_green_1", "common_btn_grey_1"}
local TASK_DESC =
{
"ACT_PVP_TALK_DESC_1",
"ACT_PVP_TALK_DESC_2",
"ACT_PVP_TALK_DESC_3",
"ACT_PVP_TALK_DESC_4",
"ACT_PVP_TALK_DESC_5"
}
local WIN_TASK_DESC =
{
"ACT_PVP_TALK_DESC_6",
"ACT_PVP_TALK_DESC_7",
}
local FAIL_TASK_DESC =
{
"ACT_PVP_TALK_DESC_8",
"ACT_PVP_TALK_DESC_9",
}
function ActPvpMainUI:ctor()
end
function ActPvpMainUI:getBGMId()
return AudioManager.BGM_ID.ACT_PVP_MAINBGM
end
function ActPvpMainUI:getCurrencyParams()
if self.currencyParams == nil then
self.currencyParams = {
itemIds = {
GConst.ItemConst.ITEM_ID_GEM,
},
showType = GConst.CURRENCY_TYPE.HORIZONTAL
}
end
return self.currencyParams
end
function ActPvpMainUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_main_ui.prefab"
end
function ActPvpMainUI:onLoadRootComplete()
if not DataManager.ActPvpData:getActPvpShowHelpTag() then
DataManager.ActPvpData:recordActPvpShowHelpTag()
ModuleManager.ActPvpManager:showHelpUI()
end
self:_display()
self:_addListeners()
self:_bind()
self:showTalk()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActPvpMainUI:onPressBackspace()
self:closeUI()
end
function ActPvpMainUI:onClose()
if self.showTalkSeq then
self.showTalkSeq:Kill()
self.showTalkSeq = nil
end
if self.countdownSid then
self:unscheduleGlobal(self.countdownSid)
self.countdownSid = nil
end
end
function ActPvpMainUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_main_ui.bg.ui_spine_obj"]:playAnim("idle", true, false, false)
uiMap["act_pvp_main_ui.down.btn_rank.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_10))
uiMap["act_pvp_main_ui.down.btn_bounty.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_4))
if DataManager.ActPvpData:isFinalDay() then
uiMap["act_pvp_main_ui.bg.desc"]:setText(GConst.EMPTY_STRING)
uiMap["act_pvp_main_ui.down.enter_node.enter_btn"]:setSprite(GConst.ATLAS_PATH.COMMON, ENTER_BTN_BG[2])
uiMap["act_pvp_main_ui.down.enter_node.enter_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_24))
else
uiMap["act_pvp_main_ui.bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_5))
uiMap["act_pvp_main_ui.down.enter_node.enter_btn"]:setSprite(GConst.ATLAS_PATH.COMMON, ENTER_BTN_BG[1])
uiMap["act_pvp_main_ui.down.enter_node.enter_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_2))
end
local titleBg = uiMap["act_pvp_main_ui.bg.title_img"]
local title = uiMap["act_pvp_main_ui.bg.title_tx"]
title:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_6))
GFunc.centerImgAndTx(titleBg, title, 5)
self:refreshEnterNode()
self:refreshDialyRewardNode()
self:refreshBtns()
end
function ActPvpMainUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_main_ui.down.enter_node.enter_btn"]:addClickListener(function()
ModuleManager.ActPvpManager:reqEnter()
end)
uiMap["act_pvp_main_ui.bg.time_bg.btn_help"]:addClickListener(function()
ModuleManager.ActPvpManager:showHelpUI()
end)
uiMap["act_pvp_main_ui.down.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_pvp_main_ui.down.btn_rank"]:addClickListener(function()
ModuleManager.ActPvpManager:showRankUI()
end)
uiMap["act_pvp_main_ui.down.btn_bounty"]:addClickListener(function()
ModuleManager.ActPvpManager:showBountyUI()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, function(params)
if params and params.closeMainUI then
self:closeUI()
end
end)
self:addEventListener(EventManager.CUSTOM_EVENT.GO_SHOP, function()
self:closeUI()
end)
end
function ActPvpMainUI:_bind()
self:bind(DataManager.ActPvpData, "isDirty", function()
self:_display()
end)
end
function ActPvpMainUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActPvpData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
local icon = uiMap["act_pvp_main_ui.bg.time_bg.time_icon"]
local tx = uiMap["act_pvp_main_ui.bg.time_bg.time"]
tx:setText(str)
GFunc.centerImgAndTx(icon, tx, 5)
local canFight = remainTime > 86400
if self.canFight ~= canFight then
self.canFight = canFight
if not self.canFight then
uiMap["act_pvp_main_ui.down.enter_node.enter_btn"]:setSprite(GConst.ATLAS_PATH.COMMON, ENTER_BTN_BG[2])
uiMap["act_pvp_main_ui.down.enter_node.enter_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_24))
end
end
end
function ActPvpMainUI:refreshEnterNode()
local uiMap = self.root:genAllChildren()
local freeCount = DataManager.ActPvpData:getFreeEnterCount()
local txFree = uiMap["act_pvp_main_ui.down.enter_node.tx_count"]
local costNode = uiMap["act_pvp_main_ui.down.enter_node.cost"]
local costDesc = uiMap["act_pvp_main_ui.down.enter_node.cost.tx_cost_desc"]
local costNum = uiMap["act_pvp_main_ui.down.enter_node.cost.tx_cost"]
local costIcon = uiMap["act_pvp_main_ui.down.enter_node.cost.icon"]
local btnHelp = uiMap["act_pvp_main_ui.bg.time_bg.btn_help"]
if freeCount > 0 then
if DataManager.ActPvpData:isFinalDay() then
freeCount = 0
end
txFree:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_6, freeCount))
costNode:setVisible(false)
btnHelp:setAnchoredPositionX(txFree:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth / 2 + 30)
else
txFree:setText(GConst.EMPTY_STRING)
costNode:setVisible(true)
costDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_7))
costNum:setText(DataManager.ActPvpData:getEnterCost().num)
GFunc.centerTxAndImgAndTx(costDesc, 5, costIcon, 5, costNum)
local x = costNum:fastGetAnchoredPositionX()
btnHelp:setAnchoredPositionX(x + costNum:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth / 2 + 30)
end
end
function ActPvpMainUI:refreshBtns()
local uiMap = self.root:genAllChildren()
local btnRank = uiMap["act_pvp_main_ui.down.btn_rank"]
if DataManager.ActPvpData:canGetRankReward() then
btnRank:addRedPoint(30, 36, 0.6)
else
btnRank:removeRedPoint()
end
local btnBounty = uiMap["act_pvp_main_ui.down.btn_bounty"]
if DataManager.ActPvpData:getBountyRp() then
btnBounty:addRedPoint(30, 36, 0.6)
else
btnBounty:removeRedPoint()
end
end
function ActPvpMainUI:refreshDialyRewardNode()
local uiMap = self.root:genAllChildren()
local boxIndex = 0
for i = 1, 10 do
local obj = uiMap["act_pvp_main_ui.bg.win_point_" .. i]
local color = "#ffffff"
local countEnough = false
if DataManager.ActPvpData:winCountEnough(i) then
color = "#FFF667"
countEnough = true
end
if DataManager.ActPvpData:getWinCountMap()[i] then
boxIndex = boxIndex + 1
local boxIcon = "act_pvp_chest_" .. boxIndex
local tx = uiMap["act_pvp_main_ui.bg.win_desc_" .. i]
if tx then
local str = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_7, i)
str = string.format("<color=%s>%s</color>", color, str)
tx:setText(str)
end
if DataManager.ActPvpData:canGetDailyReward(i) then
GFunc.getShakeSeq(obj, false, 1)
obj:addClickListener(function()
ModuleManager.ActPvpManager:reqDailyReward(DataManager.ActPvpData:getWinCountMap()[i])
end)
else
GFunc.getShakeSeq(obj, true, 1)
obj:addClickListener(function()
ModuleManager.TipsManager:showRewardsTips(DataManager.ActPvpData:getDailyRewards(i), nil, obj)
end)
end
if DataManager.ActPvpData:gotDailyReward(i) then
boxIcon = "act_pvp_chest_" .. boxIndex .. "_1"
end
obj:setSprite(GConst.ATLAS_PATH.UI_ACT_PVP, boxIcon)
else
local icon = "act_pvp_point_2"
if countEnough then
icon = "act_pvp_point_1"
end
obj:setSprite(GConst.ATLAS_PATH.UI_ACT_PVP, icon)
end
end
uiMap["act_pvp_main_ui.bg.mask_img"]:setVisible(DataManager.ActPvpData:isFinalDay())
end
function ActPvpMainUI:showTalk()
local uiMap = self.root:genAllChildren()
local popBg = uiMap["act_pvp_main_ui.bg.pop_bg"]
local popDesc = uiMap["act_pvp_main_ui.bg.pop_desc"]
self.curTaskDescList = TASK_DESC
if DataManager.ActPvpData:getLastTurnWin() ~= nil then
if DataManager.ActPvpData:getLastTurnWin() then
self.curTaskDescList = WIN_TASK_DESC
else
self.curTaskDescList = FAIL_TASK_DESC
end
DataManager.ActPvpData:setLastTurnWin(nil)
end
if self.showTalkSeq then
self.showTalkSeq:Kill()
self.showTalkSeq = nil
end
self.showTalkSeq = self.root:createBindTweenSequence()
self.showTalkSeq:AppendCallback(function()
local index = math.random(1, #self.curTaskDescList - 1)
local desc = table.remove(self.curTaskDescList, index)
table.insert(self.curTaskDescList, desc)
popDesc:setText(I18N:getGlobalText(I18N.GlobalConst[desc]))
popBg:setVisible(false)
end)
self.showTalkSeq:Append(popBg:getTransform():DOScale(1, 1))
self.showTalkSeq:AppendInterval(5)
self.showTalkSeq:Append(popBg:getTransform():DOScale(0, 1))
self.showTalkSeq:SetLoops(-1)
end
return ActPvpMainUI

View File

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

View File

@ -1,157 +0,0 @@
local ActPvpMatchResultUI = class("ActPvpMatchResultUI", BaseUI)
local SIMPLE_HERO_CELL = "app/ui/activity/act_pvp/cell/simple_hero_cell"
function ActPvpMatchResultUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_match_result_ui.prefab"
end
function ActPvpMatchResultUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActPvpMatchResultUI:_display()
local uiMap = self.root:genAllChildren()
local vsSpineObj = uiMap["act_pvp_match_result_ui.match_result.spine_vs"]
vsSpineObj:playAnimComplete("born", false, true, function()
vsSpineObj:playAnim("idle", true, true)
end)
uiMap["act_pvp_match_result_ui.match_result.btn_start.tx_start"]:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_CHALLENGE))
uiMap["act_pvp_match_result_ui.match_result.btn_rematch.tx_rematch"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_23))
local matchAnimator = uiMap["act_pvp_match_result_ui.match_result"]:getComponent(GConst.TYPEOF_UNITY_CLASS.ANIMATOR)
matchAnimator:Play(1396761479, -1, 0)
self:refreshPlayerInfos()
end
function ActPvpMatchResultUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_match_result_ui.match_result.btn_close"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_pvp_match_result_ui.match_result.btn_rematch"]:addClickListener(function()
self:onClickRefresh()
end)
uiMap["act_pvp_match_result_ui.match_result.btn_start"]:addClickListener(function()
ModuleManager.ActPvpManager:reqFight()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, function(params)
if params and params.reqCDOver then
self:closeUI()
end
end)
end
function ActPvpMatchResultUI:onClickRefresh()
local remainTime = DataManager.ActPvpData:getMatchCdEndTime()
if remainTime <= 0 then
self:closeUI()
ModuleManager.ActPvpManager:showMatchUI(true)
else
if DataManager.ActPvpData:getCanAdRefreshHero() then
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.ACT_PVP_AD_REMATCH, function()
ModuleManager.ActPvpManager:reqOverCD(true)
end)
else
ModuleManager.ActPvpManager:reqOverCD(false)
end
end
end
function ActPvpMatchResultUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActPvpData:getMatchCdEndTime()
local adImg = uiMap["act_pvp_match_result_ui.match_result.btn_rematch.img_ad"]
local str
if remainTime <= 0 then
str = GConst.EMPTY_STRING
adImg:setVisible(false)
else
str = Time:formatNumTime(remainTime)
if DataManager.ActPvpData:getCanAdRefreshHero() then
adImg:setVisible(true)
else
adImg:setVisible(false)
end
end
uiMap["act_pvp_match_result_ui.match_result.btn_rematch.tx_free_countdown"]:setText(str)
end
function ActPvpMatchResultUI:refreshPlayerInfos()
local uiMap = self.root:genAllChildren()
local rivalInfo = DataManager.ActPvpData:getRivalInfo()
if rivalInfo then
if not self.otherPlayerHeadCell then
self.otherPlayerHeadCell = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end
self.otherPlayerHeadCell:refresh(rivalInfo.avatar, rivalInfo.avatar_frame)
uiMap["act_pvp_match_result_ui.match_result.match.info.tx_name"]:setText(rivalInfo.name)
uiMap["act_pvp_match_result_ui.match_result.match.info.tx_level"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, rivalInfo.level))
uiMap["act_pvp_match_result_ui.match_result.match.info.tx_win_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_14))
uiMap["act_pvp_match_result_ui.match_result.match.info.tx_win_count"]:setText(rivalInfo.total_win)
if not self.otherSimpleHeroCells then
self.otherSimpleHeroCells = {}
for i = 1, 5 do
self.otherSimpleHeroCells[i] = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.match.formation.simple_hero_cell_" .. i], SIMPLE_HERO_CELL)
end
end
local heroes = DataManager.ActPvpData:getRivalInfoHeroes()
if heroes then
for matchType, cell in ipairs(self.otherSimpleHeroCells) do
local entity = heroes[matchType]
if entity then
cell:getBaseObject():setVisible(true)
cell:refresh(entity)
else
cell:getBaseObject():setVisible(false)
end
end
end
end
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end
self.playerHeadCell:refresh(DataManager.PlayerData:getUsingAvatarId(), DataManager.PlayerData:getUsingFrameId())
uiMap["act_pvp_match_result_ui.match_result.self.info.tx_name"]:setText(DataManager.PlayerData:getNickname())
uiMap["act_pvp_match_result_ui.match_result.self.info.tx_level"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, DataManager.PlayerData:getLv()))
uiMap["act_pvp_match_result_ui.match_result.self.info.tx_win_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_14))
uiMap["act_pvp_match_result_ui.match_result.self.info.tx_win_count"]:setText(DataManager.ActPvpData:getTotalWinCount())
if not self.simpleHeroCells then
self.simpleHeroCells = {}
for i = 1, 5 do
self.simpleHeroCells[i] = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.self.formation.simple_hero_cell_" .. i], SIMPLE_HERO_CELL)
end
end
local heroes = DataManager.ActPvpData:getHeros()
if heroes then
for matchType, cell in ipairs(self.simpleHeroCells) do
local entity = heroes[matchType]
if entity then
cell:getBaseObject():setVisible(true)
cell:refresh(entity)
else
cell:getBaseObject():setVisible(false)
end
end
end
end
return ActPvpMatchResultUI

View File

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

View File

@ -1,40 +0,0 @@
local ActPvpMatchUI = class("ActPvpMatchUI", BaseUI)
function ActPvpMatchUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_match_ui.prefab"
end
function ActPvpMatchUI:ctor()
self:addEventListener(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, function(parmas)
if self.dealySid then
return
end
if parmas and parmas.matchOver then
self.dealySid = self:performWithDelayGlobal(function()
self:closeUI()
ModuleManager.ActPvpManager:showMatchResultUI()
end, 1.5)
end
end)
end
function ActPvpMatchUI:onLoadRootComplete()
self:_display()
end
function ActPvpMatchUI:_display()
local uiMap = self.root:genAllChildren()
-- uiMap["act_pvp_match_ui.match_loading.tx_title"]:setText()
local tx = uiMap["act_pvp_match_ui.match_loading.tx_loading"]
tx:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_22))
tx:setSizeDeltaX(tx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth)
uiMap["act_pvp_match_ui.match_loading.spine_battle"]:playAnim("idle", true, false, false)
uiMap["act_pvp_match_ui.match_loading.tx_loading.ui_spine_obj"]:playAnim("idle", true, false, false)
uiMap["act_pvp_match_ui.match_loading.btn_cancel.tx_cancel"]:setText(I18N:getGlobalText(I18N.GlobalConst.BTN_TEXT_CANCEL))
uiMap["act_pvp_match_ui.match_loading.btn_cancel"]:addClickListener(function()
self:closeUI()
end)
end
return ActPvpMatchUI

View File

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

View File

@ -1,315 +0,0 @@
local ActPvpPlayingUI = class("ActPvpPlayingUI", BaseUI)
local SIMPLE_HERO_CELL = "app/ui/activity/act_pvp/cell/simple_hero_cell"
local TASK_DESC =
{
"ACT_PVP_TALK_DESC_1",
"ACT_PVP_TALK_DESC_2",
"ACT_PVP_TALK_DESC_3",
"ACT_PVP_TALK_DESC_4",
"ACT_PVP_TALK_DESC_5"
}
function ActPvpPlayingUI:ctor()
end
function ActPvpPlayingUI:getBGMId()
return AudioManager.BGM_ID.ACT_PVP_MAINBGM
end
function ActPvpPlayingUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_playing_ui.prefab"
end
function ActPvpPlayingUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
self:showTalk()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActPvpPlayingUI:onPressBackspace()
self:closeUI()
end
function ActPvpPlayingUI:onClose()
if self.showTalkSeq then
self.showTalkSeq:Kill()
self.showTalkSeq = nil
end
if self.countdownSid then
self:unscheduleGlobal(self.countdownSid)
self.countdownSid = nil
end
if self.showLevelUpSid then
self:unscheduleGlobal(self.showLevelUpSid)
self.showLevelUpSid = nil
end
end
function ActPvpPlayingUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_playing_ui.bg.ui_spine_obj"]:playAnim("idle", true, false, false)
uiMap["act_pvp_main_ui.down.playing_node.macth_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ARENA_DESC_2))
uiMap["act_pvp_main_ui.down.btn_rank.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_10))
uiMap["act_pvp_main_ui.down.btn_bounty.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_4))
local title = uiMap["act_pvp_main_ui.bg.title_tx"]
title:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_6))
title:setSizeDeltaX(title:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth)
self:refreshPlayingNode()
self:refreshDialyRewardNode()
self:refreshBtns()
end
function ActPvpPlayingUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_main_ui.down.playing_node.macth_btn"]:addClickListener(function()
if DataManager.ActPvpData:isFinalDay() then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_24))
return
end
ModuleManager.ActPvpManager:showMatchUI()
end)
uiMap["act_pvp_main_ui.bg.time_bg.btn_help"]:addClickListener(function()
ModuleManager.ActPvpManager:showHelpUI()
end)
uiMap["act_pvp_main_ui.down.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_pvp_main_ui.down.btn_rank"]:addClickListener(function()
ModuleManager.ActPvpManager:showRankUI()
end)
uiMap["act_pvp_main_ui.down.btn_bounty"]:addClickListener(function()
ModuleManager.ActPvpManager:showBountyUI()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, function(params)
if params and params.closeMainUI then
self:closeUI()
end
end)
end
function ActPvpPlayingUI:_bind()
self:bind(DataManager.ActPvpData, "isDirty", function()
self:_display()
end)
end
function ActPvpPlayingUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActPvpData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
local icon = uiMap["act_pvp_main_ui.bg.time_bg.time_icon"]
local tx = uiMap["act_pvp_main_ui.bg.time_bg.time"]
tx:setText(str)
GFunc.centerImgAndTx(icon, tx, 5)
local canFight = remainTime > 86400
if self.canFight ~= canFight then
self.canFight = canFight
if not self.canFight then
uiMap["act_pvp_main_ui.down.playing_node"]:setVisible(false)
end
end
end
function ActPvpPlayingUI:refreshPlayingNode()
local curPairIds = DataManager.ActPvpData:getCurSelectPairId()
if curPairIds and curPairIds[1] then
ModuleManager.ActPvpManager:showSelectUI() -- 还有可选择的英雄
end
local uiMap = self.root:genAllChildren()
if not self.simpleHeroCells then
self.simpleHeroCells = {}
for i = 1, 5 do
self.simpleHeroCells[i] = CellManager:addCellComp(uiMap["act_pvp_main_ui.down.playing_node.hero_formation_comp.simple_hero_cell_" .. i], SIMPLE_HERO_CELL)
end
end
if not self.skillObjs then
self.skillObjs = {}
for i = 1, 5 do
self.skillObjs[i] = {}
self.skillObjs[i].bg = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_" .. i]
self.skillObjs[i].icon = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_" .. i .. ".icon"]
self.skillObjs[i].spine = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_node.ui_spine_obj_" .. i]
end
end
local heroes = DataManager.ActPvpData:getHeros()
local skillUpNode = uiMap["act_pvp_playing_ui.bg.playing_node.skill_up_node"]
skillUpNode:setVisible(false)
if DataManager.ActPvpData:getHeroLevelUp() then
DataManager.ActPvpData:setHeroLevelUp(false)
local heroLv = DataManager.ActPvpData:getHeroLv()
local info = ConfigManager:getConfig("hero_level")[heroLv]
local infoLast = ConfigManager:getConfig("hero_level")[heroLv - 1]
if info and infoLast and info.unlock_skill > infoLast.unlock_skill then
skillUpNode:setVisible(true)
for matchType, objs in ipairs(self.skillObjs) do
local entity = heroes[matchType]
local skillId = entity:getRogueSkillList()[info.unlock_skill]
if entity and skillId then
objs.bg:addClickListener(function()
local cfg = ConfigManager:getConfig("skill_rogue")[skillId]
ModuleManager.TipsManager:showSkillTips(objs.icon, cfg.buff_id, skillId)
end)
objs.icon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId))
objs.bg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId, true))
objs.spine:playAnim("idle", false, false, false)
objs.bg:setVisible(true)
else
objs.bg:setVisible(false)
end
end
if self.showLevelUpSid then
self:unscheduleGlobal(self.showLevelUpSid)
self.showLevelUpSid = nil
end
self.showLevelUpSid = self:performWithDelayGlobal(function()
skillUpNode:setVisible(false)
end, 5)
else -- 只升级,没有升级技能
for matchType, objs in ipairs(self.skillObjs) do
objs.bg:setVisible(false)
objs.spine:playAnim("idle", false, false, false)
end
skillUpNode:setVisible(true)
if self.showLevelUpSid then
self:unscheduleGlobal(self.showLevelUpSid)
self.showLevelUpSid = nil
end
self.showLevelUpSid = self:performWithDelayGlobal(function()
skillUpNode:setVisible(false)
end, 2)
end
end
local actData = DataManager.ActPvpData
local txObj = uiMap["act_pvp_main_ui.down.playing_node.tx_fight"]
local txLose = uiMap["act_pvp_playing_ui.bg.playing_node.tx_fight_lose"]
txObj:setText(actData:getWinCount() .. "/" .. actData:getWinLimit())
txLose:setText(actData:getLoseCount() .. "/" .. actData:getLoseLimit())
for matchType, cell in ipairs(self.simpleHeroCells) do
local entity = heroes[matchType]
if entity then
cell:getBaseObject():setVisible(true)
cell:refresh(entity)
else
cell:getBaseObject():setVisible(false)
end
end
end
function ActPvpPlayingUI:refreshBtns()
local uiMap = self.root:genAllChildren()
local btnRank = uiMap["act_pvp_main_ui.down.btn_rank"]
if DataManager.ActPvpData:canGetRankReward() then
btnRank:addRedPoint(30, 36, 0.6)
else
btnRank:removeRedPoint()
end
local btnBounty = uiMap["act_pvp_main_ui.down.btn_bounty"]
if DataManager.ActPvpData:getBountyRp() then
btnBounty:addRedPoint(30, 36, 0.6)
else
btnBounty:removeRedPoint()
end
end
function ActPvpPlayingUI:refreshDialyRewardNode()
local uiMap = self.root:genAllChildren()
local boxIndex = 0
for i = 1, 10 do
local obj = uiMap["act_pvp_main_ui.bg.win_point_" .. i]
local color = "#ffffff"
local countEnough = false
if DataManager.ActPvpData:winCountEnough(i) then
color = "#FFF667"
countEnough = true
end
if DataManager.ActPvpData:getWinCountMap()[i] then
boxIndex = boxIndex + 1
local boxIcon = "act_pvp_chest_" .. boxIndex
local tx = uiMap["act_pvp_main_ui.bg.win_desc_" .. i]
if tx then
local str = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_7, i)
str = string.format("<color=%s>%s</color>", color, str)
tx:setText(str)
end
if DataManager.ActPvpData:canGetDailyReward(i) then
GFunc.getShakeSeq(obj, false, 1)
obj:addClickListener(function()
ModuleManager.ActPvpManager:reqDailyReward(DataManager.ActPvpData:getWinCountMap()[i])
end)
else
GFunc.getShakeSeq(obj, true, 1)
obj:addClickListener(function()
ModuleManager.TipsManager:showRewardsTips(DataManager.ActPvpData:getDailyRewards(i), nil, obj)
end)
end
if DataManager.ActPvpData:gotDailyReward(i) then
boxIcon = "act_pvp_chest_" .. boxIndex .. "_1"
end
obj:setSprite(GConst.ATLAS_PATH.UI_ACT_PVP, boxIcon)
else
local icon = "act_pvp_point_2"
if countEnough then
icon = "act_pvp_point_1"
end
obj:setSprite(GConst.ATLAS_PATH.UI_ACT_PVP, icon)
end
end
end
function ActPvpPlayingUI:showTalk()
local uiMap = self.root:genAllChildren()
local popBg = uiMap["act_pvp_playing_ui.bg.pop_bg"]
local popDesc = uiMap["act_pvp_main_ui.bg.pop_desc"]
if self.showTalkSeq then
self.showTalkSeq:Kill()
self.showTalkSeq = nil
end
self.showTalkSeq = self.root:createBindTweenSequence()
self.showTalkSeq:AppendCallback(function()
local index = math.random(1, #TASK_DESC - 1)
local desc = table.remove(TASK_DESC, index)
table.insert(TASK_DESC, desc)
popDesc:setText(I18N:getGlobalText(I18N.GlobalConst[desc]))
popBg:setVisible(false)
end)
self.showTalkSeq:Append(popBg:getTransform():DOScale(1, 1))
self.showTalkSeq:AppendInterval(5)
self.showTalkSeq:Append(popBg:getTransform():DOScale(0, 1))
self.showTalkSeq:SetLoops(-1)
end
return ActPvpPlayingUI

View File

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

View File

@ -1,289 +0,0 @@
local ActPvpRankUI = class("ActPvpRankUI", BaseUI)
local RANK_REWARD_CELL = "app/ui/activity/act_pvp/cell/rank_reward_cell"
local RANK_CELL = "app/ui/activity/act_pvp/cell/rank_cell"
local TOP_RANK_CELL = "app/ui/activity/act_pvp/cell/top_rank_cell"
local PAGE_ICON = {"common_menu_1", "common_menu_2"}
local PAGE_TYPE = {
RANK = 1,
REWARD = 2,
}
local PAGE_TX = {
[PAGE_TYPE.RANK] = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_24,
[PAGE_TYPE.REWARD] = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_22,
}
function ActPvpRankUI:onPressBackspace()
self:closeUI()
end
function ActPvpRankUI:isFullScreen()
return false
end
function ActPvpRankUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_rank_ui.prefab"
end
function ActPvpRankUI:ctor()
self.rankRewardList = {}
self.rankRewardListCount = 0
local cfg = DataManager.ActPvpData:getRankConfig()
Logger.printTable(DataManager.ActPvpData:getRankRewardList())
for index, id in ipairs(DataManager.ActPvpData:getRankRewardList()) do
local info = cfg[id]
table.insert(self.rankRewardList, {id = id, ranking1 = info.ranking[1], ranking2 = info.ranking[2], rewards = info.reward})
self.rankRewardListCount = self.rankRewardListCount + 1
end
end
function ActPvpRankUI:onLoadRootComplete()
self:_display()
self:_addListeners()
self:_bind()
self:refreshTime()
if self.actCountdownSid then
self:unscheduleGlobal(self.actCountdownSid)
end
self.actCountdownSid = self:scheduleGlobal(function()
self:refreshTime()
end, 1)
end
function ActPvpRankUI:_display()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_rank_ui.bg.rank_node.rank_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_24))
uiMap["act_pvp_rank_ui.bg.rank_node.player_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_25))
uiMap["act_pvp_rank_ui.bg.rank_node.record_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_26))
if not DataManager.ActPvpData:isFinalDay() then
self:switchPage(PAGE_TYPE.RANK)
else
self:switchPage(PAGE_TYPE.REWARD)
end
end
function ActPvpRankUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_rank_ui.close_btn"]:addClickListener(function()
self:closeUI()
end)
uiMap["act_pvp_rank_ui.bg.rank_bg.btn_help"]:addClickListener(function()
local params = {
type = GConst.TipsConst.HELP_TIPS_TYPE.NORMAL,
title = I18N:getGlobalText(I18N.GlobalConst.COLLECTION_DESC_11),
desc = I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_18),
}
ModuleManager.TipsManager:showHelpTips(params)
end)
end
function ActPvpRankUI:_bind()
self:bind(DataManager.ActPvpData, "isDirty", function()
if self.curPage ~= PAGE_TYPE.REWARD then
self:refreshRankNode()
else
self:refreshRewardNode()
end
self:refreshMyRankInfo()
self:refreshPages()
end)
end
function ActPvpRankUI:refreshRankNode()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_rank_ui.bg.rank_node"]:setActive(true)
uiMap["act_pvp_rank_ui.bg.reward_node"]:setActive(false)
local text = I18N.GlobalConst.ACT_BOSS_RUSH_DESC_10
self.rankList = DataManager.ActPvpData:getRankList()
uiMap["act_pvp_rank_ui.bg.title"]:setText(I18N:getGlobalText(text))
if not self.topRankCells then
self.topRankCells = {}
for i = 1, 3 do
self.topRankCells[i] = CellManager:addCellComp(uiMap["act_pvp_rank_ui.bg.rank_node.top_rank_cell_" .. i], TOP_RANK_CELL)
end
end
for index, cell in ipairs(self.topRankCells) do
cell:refresh(self.rankList[index])
end
local count = #self.rankList - 3
if count < 0 then
count = 0
end
if self.rankScrollRectComp then
self.rankScrollRectComp:refillCells(count)
return
end
self.rankScrollRectComp = uiMap["act_pvp_rank_ui.bg.rank_node.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.rankScrollRectComp:addInitCallback(function()
return RANK_CELL
end)
self.rankScrollRectComp:addRefreshCallback(function(index, cell)
local info = self.rankList[index + 3]
cell:refresh(index + 3, info)
end)
self.rankScrollRectComp:clearCells()
self.rankScrollRectComp:setTotalCount(0)
self.rankScrollRectComp:refillCells(count)
end
function ActPvpRankUI:refreshRewardNode()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_rank_ui.bg.rank_node"]:setActive(false)
uiMap["act_pvp_rank_ui.bg.reward_node"]:setActive(true)
uiMap["act_pvp_rank_ui.bg.title"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_22))
if self.rewardScrollRectComp then
self.rewardScrollRectComp:updateAllCell()
return
end
self.rewardScrollRectComp = uiMap["act_pvp_rank_ui.bg.reward_node.scrollrect"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE)
self.rewardScrollRectComp:addInitCallback(function()
return RANK_REWARD_CELL
end)
self.rewardScrollRectComp:addRefreshCallback(function(index, cell)
local info = self.rankRewardList[index]
cell:refresh(info.ranking1, info.ranking2, info.rewards, self.rankRewardListCount)
end)
self.rewardScrollRectComp:clearCells()
self.rewardScrollRectComp:setTotalCount(0)
self.rewardScrollRectComp:refillCells(#self.rankRewardList)
end
function ActPvpRankUI:refreshPages()
if not self.pageObjs then
local uiMap = self.root:genAllChildren()
self.pageObjs = {}
for i = 1, 2 do
self.pageObjs[i] = {
page = uiMap["act_pvp_rank_ui.bg.page_" .. i],
tx1 = uiMap["act_pvp_rank_ui.bg.page_" .. i .. ".tx"],
tx2 = uiMap["act_pvp_rank_ui.bg.page_" .. i .. ".tx_hl"],
}
self.pageObjs[i].page:addClickListener(function()
self:switchPage(i)
end)
end
end
for index, objs in ipairs(self.pageObjs) do
if index == self.curPage then
objs.page:setSprite(GConst.ATLAS_PATH.COMMON, PAGE_ICON[1])
objs.page:setAnchoredPositionY(-451.5)
objs.tx1:setText(GConst.EMPTY_STRING)
objs.tx2:setText(I18N:getGlobalText(PAGE_TX[index]))
else
objs.page:setSprite(GConst.ATLAS_PATH.COMMON, PAGE_ICON[2])
objs.page:setAnchoredPositionY(-442.5)
objs.tx1:setText(I18N:getGlobalText(PAGE_TX[index]))
objs.tx2:setText(GConst.EMPTY_STRING)
end
end
if DataManager.ActPvpData:canGetRankReward() then
self.pageObjs[2].page:addRedPoint(77, -6.5, 1)
else
self.pageObjs[2].page:removeRedPoint()
end
end
function ActPvpRankUI:switchPage(page)
if self.curPage == page then
return
end
self.curPage = page
if self.curPage ~= PAGE_TYPE.REWARD then
self:refreshRankNode()
else
self:refreshRewardNode()
end
self:refreshPages()
self:refreshMyRankInfo()
end
function ActPvpRankUI:refreshMyRankInfo()
local myRank = DataManager.ActPvpData:getSelfRank()
local totalWin = DataManager.ActPvpData:getTotalWinCount()
local canGot = DataManager.ActPvpData:canGetRankReward()
local uiMap = self.root:genAllChildren()
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["act_pvp_rank_ui.bg.rank_bg.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
self.selfRewardCells = {}
for i = 1, 2 do
self.selfRewardCells[i] = CellManager:addCellComp(uiMap["act_pvp_rank_ui.bg.rank_bg.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
end
self.playerHeadCell:refresh()
uiMap["act_pvp_rank_ui.bg.rank_bg.name"]:setText(DataManager.PlayerData:getNickname())
local rankObj = uiMap["act_pvp_rank_ui.bg.rank_bg.tx_rank"]
if not myRank or myRank <= 0 then
rankObj:setText("--")
else
rankObj:setText(myRank)
end
local winObj = uiMap["act_pvp_rank_ui.bg.rank_bg.tx_win"]
winObj:setText(GConst.EMPTY_STRING)
local winDesc = uiMap["act_pvp_rank_ui.bg.rank_bg.tx_win_desc"]
winDesc:setText(GConst.EMPTY_STRING)
if self.curPage ~= PAGE_TYPE.REWARD then
for index, cell in ipairs(self.selfRewardCells) do
cell:getBaseObject():setActive(false)
end
if totalWin and totalWin > 0 then
winObj:setText(totalWin)
else
winObj:setText("--")
end
winDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_17))
else
local got = DataManager.ActPvpData:getGotRankReward()
local rewards = DataManager.ActPvpData:getRankRewards(myRank)
for index, cell in ipairs(self.selfRewardCells) do
if rewards and rewards[index] then
cell:refreshByConfig(rewards[index], got, got)
cell:getBaseObject():setActive(true)
if canGot then
cell:showFrameAnimation()
cell:addClickListener(function()
ModuleManager.ActPvpManager:reqRankReward()
end)
else
cell:hideFrameAnimation()
cell:addClickListener(nil)
end
else
cell:getBaseObject():setActive(false)
end
end
end
end
function ActPvpRankUI:refreshTime()
local uiMap = self.root:genAllChildren()
local remainTime = DataManager.ActPvpData:getRemainTime()
local str
if remainTime <= 0 then
str = I18N:getGlobalText(I18N.GlobalConst.ACTIVITY_OVER_EDSC)
else
str = Time:formatNumTimeStr(remainTime)
end
local icon = uiMap["act_pvp_rank_ui.bg.time_node.icon"]
local tx = uiMap["act_pvp_rank_ui.bg.time_node.tx_time"]
tx:setText(str)
GFunc.centerImgAndTx(icon, tx, 5)
end
return ActPvpRankUI

View File

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

View File

@ -1,307 +0,0 @@
local ActPvpSelectUI = class("ActPvpSelectUI", BaseUI)
local INFO_BG = {
[1] = "common_board_quality_2",
[2] = "common_board_quality_2",
[3] = "common_board_quality_3",
[4] = "common_board_quality_4",
}
local BG_SPINE = {
[GConst.BattleConst.ELEMENT_TYPE.RED] = "ui_hero_red",
[GConst.BattleConst.ELEMENT_TYPE.YELLOW] = "ui_hero_yellow",
[GConst.BattleConst.ELEMENT_TYPE.GREEN] = "ui_hero_green",
[GConst.BattleConst.ELEMENT_TYPE.BLUE] = "ui_hero_blue",
[GConst.BattleConst.ELEMENT_TYPE.PURPLE] = "ui_hero_purple",
}
local SIMPLE_HERO_CELL = "app/ui/activity/act_pvp/cell/simple_hero_cell"
function ActPvpSelectUI:getBGMId()
return AudioManager.BGM_ID.ACT_PVP_CHOOSEBGM
end
function ActPvpSelectUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_pvp/act_pvp_select_ui.prefab"
end
function ActPvpSelectUI:onClose()
if self.aniSeq then
self.aniSeq:Kill()
self.aniSeq = nil
end
end
function ActPvpSelectUI:onLoadRootComplete()
self:_display()
self:_addListeners()
end
function ActPvpSelectUI:_display()
local curPairIds = DataManager.ActPvpData:getCurSelectPairId()
if not curPairIds or not curPairIds[1] then
AudioManager:playEffect(AudioManager.EFFECT_ID.ACT_PVP_FINISH)
self:closeUI()
return
end
local uiMap = self.root:genAllChildren()
local heroId = DataManager.ActPvpData:getSelectHeroId(curPairIds[1])
local heroCfg = ConfigManager:getConfig("hero")[heroId]
local matchType = heroCfg and heroCfg.position or GConst.BattleConst.ELEMENT_TYPE.RED
local matchStr = ModuleManager.HeroManager:getMatchTypeName(matchType, true)
local txTitle = uiMap["act_pvp_select_ui.bg.title_tx"]
txTitle:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_8, matchStr))
txTitle:setSizeDeltaX(txTitle:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth)
uiMap["act_pvp_select_ui.bg.desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_9))
uiMap["act_pvp_select_ui.bg.hero_cell_1.select_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_12))
uiMap["act_pvp_select_ui.bg.hero_cell_2.select_btn.tx_desc"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_12))
if not self.bigHeroInfos then
self.bigHeroInfos = {}
for i = 1, 2 do
local unit = {}
local prefix = "act_pvp_select_ui.bg.hero_cell_" .. i
unit.node = uiMap[prefix]
unit.spineBg = uiMap[prefix .. ".ui_spine_obj_bg"]
unit.spineHero = uiMap[prefix .. ".ui_spine_obj_hero"]
unit.simpleHeroCell = CellManager:addCellComp(uiMap[prefix .. ".simple_hero_cell"], SIMPLE_HERO_CELL)
unit.info = uiMap[prefix .. ".info"]
unit.matchIcon = uiMap[prefix .. ".info.icon"]
unit.name = uiMap[prefix .. ".info.name"]
unit.nextNode = uiMap[prefix .. ".next_node"]
unit.nextDesc = uiMap[prefix .. ".next_node.desc"]
unit.nextBg1 = uiMap[prefix .. ".next_node.bg_1"]
unit.nextBg1Icon = uiMap[prefix .. ".next_node.bg_1.icon"]
unit.nextBg1Dec = uiMap[prefix .. ".next_node.bg_1.dec"]
unit.nextBg1Match = uiMap[prefix .. ".next_node.bg_1.match_img"]
unit.nextBg2 = uiMap[prefix .. ".next_node.bg_2"]
unit.nextBg2Icon = uiMap[prefix .. ".next_node.bg_2.icon"]
unit.nextBg2Dec = uiMap[prefix .. ".next_node.bg_2.dec"]
unit.nextBg2Match = uiMap[prefix .. ".next_node.bg_2.match_img"]
unit.selectBtn = uiMap[prefix .. ".select_btn"]
unit.selectDesc = uiMap[prefix .. ".select_btn.tx_desc"]
unit.clickMask = uiMap[prefix .. ".info.click_mask"]
self.bigHeroInfos[i] = unit
end
end
self:rfreshRefreshBtns()
self:refreshSelectInfo()
self:refreshFormation()
end
function ActPvpSelectUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_pvp_select_ui.down.close_btn"]:addClickListener(function()
local heroes = DataManager.ActPvpData:getHeros()
if #heroes < GConst.BattleConst.ELEMENT_TYPE_COUNT then
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, {closeMainUI = true})
end
self:closeUI()
end)
uiMap["act_pvp_select_ui.bg.refresh_btn"]:addClickListener(function()
if DataManager.ActPvpData:getCanAdFlush() then
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.ACT_PVP_AD_REFRESH_HERO, function()
ModuleManager.ActPvpManager:reqRefreshHero()
end)
else
ModuleManager.ActPvpManager:reqRefreshHero()
end
end)
uiMap["act_pvp_select_ui.bg.hero_cell_1.select_btn"]:addClickListener(function()
ModuleManager.ActPvpManager:reqDecideHero(0)
end)
uiMap["act_pvp_select_ui.bg.hero_cell_2.select_btn"]:addClickListener(function()
ModuleManager.ActPvpManager:reqDecideHero(1)
end)
self:addEventListener(EventManager.CUSTOM_EVENT.ACT_PVP_EVENT, function(params)
if params and params.selectIndex then
if not self.heroEntities or not self.bigHeroInfos or not self.simpleHeroCells then
self:_display()
return
end
local heroEntity
local cell
local node
if params.selectIndex == 0 then -- 左边的
heroEntity = self.heroEntities[1]
cell = self.bigHeroInfos[1] and self.bigHeroInfos[1].simpleHeroCell
node = self.bigHeroInfos[1] and self.bigHeroInfos[1].node
if cell then
cell:getBaseObject():setAnchoredPosition(-170, 190)
end
else
heroEntity = self.heroEntities[2]
cell = self.bigHeroInfos[2] and self.bigHeroInfos[2].simpleHeroCell
node = self.bigHeroInfos[2] and self.bigHeroInfos[2].node
if cell then
cell:getBaseObject():setAnchoredPosition(170, 190)
end
end
if not heroEntity or not cell then
self:_display()
return
end
local target = self.simpleHeroCells[heroEntity:getMatchType()]
if not target then
self:_display()
return
end
self:disableUITouch()
local targetPos = target:getBaseObject():getTransform().position
local sPoint = UIManager:getUICameraComponent():WorldToScreenPoint(targetPos)
targetPos = CS.BF.Utils.RectTransformScreenPointToLocalPointInRectangle(node:getTransform(), sPoint.x, sPoint.y, UIManager:getUICameraComponent())
if self.aniSeq then
self.aniSeq:Kill()
self.aniSeq = nil
end
self.aniSeq = self.root:createBindTweenSequence()
self.aniSeq:AppendCallback(function()
cell:getBaseObject():setActive(true)
end)
self.aniSeq:Append(cell:getBaseObject():getTransform():DOAnchorPos(targetPos, 0.3))
self.aniSeq:AppendCallback(function()
self:_display()
self:enableUITouch()
end)
elseif params and params.refreshHero then
self:_display()
end
end)
end
function ActPvpSelectUI:refreshSelectInfo()
if not self.bigHeroInfos then
return
end
local curPairIds = DataManager.ActPvpData:getCurSelectPairId()
local nextPairIds = DataManager.ActPvpData:getNextSelectFourId()
local list = {}
table.insert(list, {curPairIds[1], nextPairIds[1], nextPairIds[2]})
table.insert(list, {curPairIds[2], nextPairIds[3], nextPairIds[4]})
self.heroEntities = {}
for inedx, ids in pairs(list) do
local curId = ids[1]
local nextId1 = ids[2]
local nextId2 = ids[3]
local unit = self.bigHeroInfos[inedx]
if curId then
local heroId = DataManager.ActPvpData:getSelectHeroId(curId)
if heroId then
local heroEntity = DataManager.HeroData:getEntity({id = heroId, level = DataManager.ActPvpData:getHeroLv()})
self.heroEntities[inedx] = heroEntity
unit.node:setVisible(true)
unit.clickMask:addClickListener(function()
ModuleManager.HeroManager:showHeroDetailUI(nil, true, heroEntity)
end)
unit.simpleHeroCell:refresh(heroEntity)
unit.simpleHeroCell:getBaseObject():setActive(false)
unit.info:setSprite(GConst.ATLAS_PATH.COMMON, INFO_BG[heroEntity:getQlt()])
local heroInfo = heroEntity:getConfig()
unit.matchIcon:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
unit.name:setText(heroEntity:getName())
unit.spineBg:setVisible(false)
unit.spineBg:loadAssetAsync(BG_SPINE[heroEntity:getMatchType()], function()
unit.spineBg:setVisible(true, 1.8)
unit.spineBg:playAnim("idle", true, true, true)
end)
unit.spineHero:setVisible(false)
unit.spineHero:loadAssetAsync(heroEntity:getModelId(), function()
unit.spineHero:setVisible(true)
unit.spineHero:playAnim("idle", true, true, true)
end, true)
if nextId1 and nextId2 then
unit.nextNode:setVisible(true)
unit.nextDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_11))
local heroId = DataManager.ActPvpData:getSelectHeroId(nextId1)
local heroInfo = ConfigManager:getConfig("hero")[heroId]
if heroInfo then
unit.nextBg1:addClickListener(function()
ModuleManager.HeroManager:showHeroDetailUI(nil, true, heroEntity)
end)
local itemInfo = ConfigManager:getConfig("item")[heroInfo.item_id]
if itemInfo then
unit.nextBg1:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[itemInfo.qlt])
end
unit.nextBg1Icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, heroInfo.icon)
unit.nextBg1Dec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
unit.nextBg1Match:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
end
heroId = DataManager.ActPvpData:getSelectHeroId(nextId2)
heroInfo = ConfigManager:getConfig("hero")[heroId]
if heroInfo then
unit.nextBg2:addClickListener(function()
ModuleManager.HeroManager:showHeroDetailUI(nil, true, heroEntity)
end)
local itemInfo = ConfigManager:getConfig("item")[heroInfo.item_id]
if itemInfo then
unit.nextBg2:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[itemInfo.qlt])
end
unit.nextBg2Icon:setSprite(GConst.ATLAS_PATH.ICON_HERO, heroInfo.icon)
unit.nextBg2Dec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
unit.nextBg2Match:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
end
else
unit.nextNode:setVisible(false)
end
else
unit.node:setVisible(false)
end
else
unit.node:setVisible(false)
end
end
end
function ActPvpSelectUI:rfreshRefreshBtns()
local uiMap = self.root:genAllChildren()
local tx = uiMap["act_pvp_select_ui.bg.refresh_btn.tx_desc"]
local txCost = uiMap["act_pvp_select_ui.bg.refresh_btn.tx_cost"]
local imgCost = uiMap["act_pvp_select_ui.bg.refresh_btn.img_cost"]
local ad = uiMap["act_pvp_select_ui.bg.refresh_btn.img_ad"]
if DataManager.ActPvpData:getCanAdFlush() then
tx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_10))
txCost:setVisible(false)
imgCost:setVisible(false)
ad:setVisible(true)
else
tx:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3))
txCost:setVisible(true)
imgCost:setVisible(true)
txCost:setText(DataManager.ActPvpData:getFlushCost().num)
GFunc.centerImgAndTx(imgCost, txCost, 0)
ad:setVisible(false)
end
end
function ActPvpSelectUI:refreshFormation()
local uiMap = self.root:genAllChildren()
if not self.simpleHeroCells then
self.simpleHeroCells = {}
for i = 1, 5 do
self.simpleHeroCells[i] = CellManager:addCellComp(uiMap["act_pvp_select_ui.down.simple_hero_cell_" .. i], SIMPLE_HERO_CELL)
end
end
local heroes = DataManager.ActPvpData:getHeros()
for matchType, cell in ipairs(self.simpleHeroCells) do
local entity = heroes[matchType]
if entity then
cell:getBaseObject():setVisible(true)
cell:refresh(entity)
else
cell:getBaseObject():setVisible(false)
end
end
end
return ActPvpSelectUI

View File

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

View File

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

View File

@ -1,85 +0,0 @@
local BountyCell = class("BountyCell", BaseCell)
local LEVEL_ICON = {"act_common_bg_14", "act_common_bg_15"}
function BountyCell:init()
local uiMap = self:getUIMap()
self.imgLevel = uiMap["fund_cell.level"]
self.txLevel = uiMap["fund_cell.level.tx_level"]
self.rewardCell1 = uiMap["fund_cell.reward_cell_1"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewardCell2 = uiMap["fund_cell.reward_cell_2"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
self.rewardCell3 = uiMap["fund_cell.reward_cell_3"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
function BountyCell:refresh(level)
self.txLevel:setText(self:getIndex())
local bountyType = DataManager.ActPvpData.BOUNTY_TYPE
local isGet
isGet = DataManager.ActPvpData:getBountyCollected(level, bountyType.NORMAL)
local reward = DataManager.ActPvpData:getBountyReward(level, bountyType.NORMAL)
if reward then
self.rewardCell1:refreshByConfig(reward, isGet, isGet)
end
self.rewardCell1:showLock(false)
if DataManager.ActPvpData:getBountyCanGet(level, bountyType.NORMAL) then
self.rewardCell1:showFrameAnimation()
self.rewardCell1.baseObject:addRedPoint(50, 50, 0.6)
self.rewardCell1:addClickListener(function()
self:onClickReward(level, bountyType.NORMAL)
end)
else
self.rewardCell1:hideFrameAnimation()
self.rewardCell1.baseObject:removeRedPoint()
self.rewardCell1:addClickListener(nil)
end
isGet = DataManager.ActPvpData:getBountyCollected(level, bountyType.SUPERIOR)
local reward = DataManager.ActPvpData:getBountyReward(level, bountyType.SUPERIOR)
if reward then
self.rewardCell2:refreshByConfig(reward, isGet, isGet)
end
self.rewardCell2:showLock(not DataManager.ActPvpData:getProBought())
if DataManager.ActPvpData:getBountyCanGet(level, bountyType.SUPERIOR) then
self.rewardCell2:showFrameAnimation()
self.rewardCell2.baseObject:addRedPoint(50, 50, 0.6)
self.rewardCell2:addClickListener(function()
self:onClickReward(level, bountyType.SUPERIOR)
end)
else
self.rewardCell2:hideFrameAnimation()
self.rewardCell2.baseObject:removeRedPoint()
self.rewardCell2:addClickListener(nil)
end
isGet = DataManager.ActPvpData:getBountyCollected(level, bountyType.SUPERIOR_MAX)
local reward = DataManager.ActPvpData:getBountyReward(level, bountyType.SUPERIOR_MAX)
if reward then
self.rewardCell3:refreshByConfig(reward, isGet, isGet)
end
self.rewardCell3:showLock(not DataManager.ActPvpData:getUtralBought())
if DataManager.ActPvpData:getBountyCanGet(level, bountyType.SUPERIOR_MAX) then
self.rewardCell3:showFrameAnimation()
self.rewardCell3.baseObject:addRedPoint(50, 50, 0.6)
self.rewardCell3:addClickListener(function()
self:onClickReward(level, bountyType.SUPERIOR_MAX)
end)
else
self.rewardCell3:hideFrameAnimation()
self.rewardCell3.baseObject:removeRedPoint()
self.rewardCell3:addClickListener(nil)
end
if DataManager.ActPvpData:getBountyLevelEnough(level) then
self.imgLevel:setSprite(GConst.ATLAS_PATH.ACT_COMMON, LEVEL_ICON[1])
else
self.imgLevel:setSprite(GConst.ATLAS_PATH.ACT_COMMON, LEVEL_ICON[2])
end
end
-- 领取奖励
function BountyCell:onClickReward(level, rewardType)
ModuleManager.ActPvpManager:reqBountyReward(level, rewardType)
end
return BountyCell

View File

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

View File

@ -1,58 +0,0 @@
local RankCell = class("RankCell", BaseCell)
local RANK_ICON = {
"act_ranking_1",
"act_ranking_2",
"act_ranking_3"
}
local RANK_BG = {"common_bg_8", "common_bg_9", "common_bg_10", "common_bg_11"}
function RankCell:refresh(index, info)
local uiMap = self:getUIMap()
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["act_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end
uiMap["act_rank_cell.tx_rank"]:setText(index)
local imgRank = uiMap["act_rank_cell.img_rank"]
if RANK_ICON[index] then
imgRank:setVisible(true)
imgRank:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_ICON[index])
uiMap["act_rank_cell.tx_rank"]:setText(GConst.EMPTY_STRING)
else
imgRank:setVisible(false)
end
local imgBg = uiMap["act_rank_cell.bg"]
if RANK_BG[index] then
imgBg:setSprite(GConst.ATLAS_PATH.COMMON, RANK_BG[index])
else
imgBg:setSprite(GConst.ATLAS_PATH.COMMON, RANK_BG[4])
end
local txName = uiMap["act_rank_cell.tx_name"]
local txWin = uiMap["act_rank_cell.tx_win"]
local txWinDesc = uiMap["act_rank_cell.bg.tx_win_desc"]
txWinDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_17))
if info then
txName:setText(info.name)
txWin:setText(info.total_win)
self.playerHeadCell:getBaseObject():addClickListener(function()
-- ModuleManager.ActBossRushManager:reqOtherPlayerInfo(info.id, function(formation)
-- if not self.playerHeadCell or not self.playerHeadCell:getBaseObject() or self.playerHeadCell:getBaseObject():isDestroyed() then
-- return
-- end
-- ModuleManager.TipsManager:showHeroFormation(self.playerHeadCell:getBaseObject(), formation)
-- end)
end)
self.playerHeadCell:refresh(info.avatar, info.avatar_frame, false)
else
txName:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_8))
txWin:setText("--")
self.playerHeadCell:getBaseObject():addClickListener(nil)
self.playerHeadCell:refresh(3001, 1000, false) -- 默认
end
end
return RankCell

View File

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

View File

@ -1,54 +0,0 @@
local RankRewardcell = class("RankRewardcell", BaseCell)
local RANK_IMG = {"act_ranking_1", "act_ranking_2", "act_ranking_3"}
local BG = {"common_bg_8", "common_bg_9", "common_bg_10", "common_bg_11"}
function RankRewardcell:refresh(ranking1, ranking2, rewards, totalIndex)
local uiMap = self:getUIMap()
local rankStr = ranking1 .. "-"
if ranking2 then
rankStr = rankStr .. ranking2
else
rankStr = rankStr .. "-"
end
if ranking1 == ranking2 then
rankStr = ranking1
end
if self:getIndex() == totalIndex then
rankStr = ranking1 .. "+"
end
uiMap["rank_reward_cell.bg.tx_rank"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_23, rankStr))
if not self.rewardCells then
self.rewardCells = {}
for i = 1, 2 do
self.rewardCells[i] = uiMap["rank_reward_cell.bg.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
end
for index, cell in ipairs(self.rewardCells) do
if rewards and rewards[index] then
cell:refreshByConfig(rewards[index])
cell:getBaseObject():setActive(true)
else
cell:getBaseObject():setActive(false)
end
end
local bg = uiMap["rank_reward_cell.bg"]
if BG[ranking1] then
bg:setSprite(GConst.ATLAS_PATH.COMMON, BG[ranking1])
else
bg:setSprite(GConst.ATLAS_PATH.COMMON, BG[4])
end
local imgRank = uiMap["rank_reward_cell.bg.rank_img"]
if RANK_IMG[ranking1] then
imgRank:setSprite(GConst.ATLAS_PATH.ACT_COMMON, RANK_IMG[ranking1])
imgRank:setVisible(true)
uiMap["rank_reward_cell.bg.tx_rank"]:setText(GConst.EMPTY_STRING)
else
imgRank:setVisible(false)
end
end
return RankRewardcell

View File

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

View File

@ -1,27 +0,0 @@
local SimpleHeroCell = class("SimpleHeroCell", BaseCell)
function SimpleHeroCell:refresh(heroEntity)
local uiMap = self:getUIMap()
local bg = uiMap["simple_hero_cell.bg"]
local icon = uiMap["simple_hero_cell.icon"]
local heroDec = uiMap["simple_hero_cell.dec"]
local matchImg = uiMap["simple_hero_cell.match_img"]
local lvTx = uiMap["simple_hero_cell.lv_tx"]
local sImg = uiMap["simple_hero_cell.s"]
local txName = uiMap["simple_hero_cell.tx_name"]
local heroInfo = heroEntity:getConfig()
bg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.FRAME_QLT[heroInfo.qlt])
heroDec:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HERO_DEC_QLT[heroInfo.qlt])
matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
sImg:setVisible(heroInfo.qlt >= 4)
lvTx:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, heroEntity:getLv()))
txName:setText(heroEntity:getName())
icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, DataManager.SkinData:getIcon(heroEntity:getSkinId()))
self:getBaseObject():addClickListener(function()
ModuleManager.HeroManager:showHeroDetailUI(nil, true, heroEntity)
end)
end
return SimpleHeroCell

View File

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

View File

@ -1,34 +0,0 @@
local TopRankCell = class("TopRankCell", BaseCell)
function TopRankCell:refresh(info)
local uiMap = self:getUIMap()
if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["top_rank_cell.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end
local txName = uiMap["top_rank_cell.name"]
local txWin = uiMap["top_rank_cell.win"]
local txWinDesc = uiMap["top_rank_cell.win_desc"]
txWinDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_PVP_DESC_17))
if info then
txName:setText(info.name)
txWin:setText(info.total_win)
self.playerHeadCell:getBaseObject():addClickListener(function()
-- ModuleManager.ActBossRushManager:reqOtherPlayerInfo(info.id, function(formation)
-- if not self.playerHeadCell or not self.playerHeadCell:getBaseObject() or self.playerHeadCell:getBaseObject():isDestroyed() then
-- return
-- end
-- ModuleManager.TipsManager:showHeroFormation(self.playerHeadCell:getBaseObject(), formation)
-- end)
end)
self.playerHeadCell:refresh(info.avatar, info.avatar_frame, false)
else
txName:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_BOSS_RUSH_DESC_8))
txWin:setText("--")
self.playerHeadCell:getBaseObject():addClickListener(nil)
self.playerHeadCell:refresh(3001, 1000, false) -- 默认
end
end
return TopRankCell

View File

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

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: a8cccd7f512852a408f6f2ced012eb95 guid: a32b1e414f6554416b0a2c127efdfece
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@ -0,0 +1,8 @@
local ActSevenDayUI = require("app/ui/activity/act_seven_day/act_seven_day_ui")
local ActSevenDayS2UI = class("ActSevenDayS2UI", ActSevenDayUI)
function ActSevenDayS2UI:getPeriod()
return 2
end
return ActSevenDayS2UI

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 72435753c4dcd0e419a2685ad64955d6 guid: 6401e41b61e344172a4199d92d5b8961
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -0,0 +1,293 @@
local ActSevenDayUI = class("ActSevenDayUI", BaseUI)
local TASK_COMP = "app/ui/activity/act_seven_day/component/task_comp"
local GIFT_COMP = "app/ui/activity/act_seven_day/component/gift_comp"
local DAY_COMP = "app/ui/activity/act_seven_day/component/day_comp"
function ActSevenDayUI:getPeriod()
return 1
end
function ActSevenDayUI:isFullScreen()
return false
end
function ActSevenDayUI:onPressBackspace()
self:onClickClose()
end
function ActSevenDayUI:ctor()
end
function ActSevenDayUI:getPrefabPath()
return "assets/prefabs/ui/activity/act_sevenday/act_sevenday_ui.prefab"
end
function ActSevenDayUI:onLoadRootComplete()
local uiMap = self.root:genAllChildren()
uiMap["act_sevenday_ui.d_menu.d_menu_1.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_DESC_1))
uiMap["act_sevenday_ui.d_menu.d_menu_1.desc_tx_choose"]:setText(I18N:getGlobalText(I18N.GlobalConst.TASK_DESC_1))
uiMap["act_sevenday_ui.d_menu.d_menu_2.desc_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.GIFT_DESC_4))
uiMap["act_sevenday_ui.d_menu.d_menu_2.desc_tx_choose"]:setText(I18N:getGlobalText(I18N.GlobalConst.GIFT_DESC_4))
if self:getPeriod() == 1 then
uiMap["act_sevenday_ui.bg.title_img.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_SEVENDAY))
else
uiMap["act_sevenday_ui.bg.title_img.text"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_SEVENDAY_2))
end
self.timeTx = uiMap["act_sevenday_ui.bg.time_bg.time_tx"]
self.timeBg = uiMap["act_sevenday_ui.bg.time_bg"]
uiMap["act_sevenday_ui.bg.time_bg.help"]:addClickListener(function()
local params = {
desc = I18N:getGlobalText(I18N.GlobalConst.ACT_SEVENDAY_HELP)
}
ModuleManager.TipsManager:showHelpTips(params)
end)
self:initComps()
self:_display()
self:_addListeners()
self:_bind()
self:scheduleGlobal(function()
self:updateTime()
end, 1)
self:updateTime()
end
function ActSevenDayUI:_display()
local page = 1
if DataManager.ActSevenDayData:hasTaskRp(self:getPeriod()) then
page = 1
end
self:switchComp(page)
self:refreshTitle()
end
function ActSevenDayUI:_addListeners()
local uiMap = self.root:genAllChildren()
uiMap["act_sevenday_ui.mask"]:addClickListener(function()
self:onClickClose()
end)
uiMap["act_sevenday_ui.close_btn"]:addClickListener(function()
self:onClickClose()
end)
self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, function()
self:closeUI()
end)
end
function ActSevenDayUI:onClickClose()
self:closeUI()
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.MAIN_UI_CHECK_POP)
end
function ActSevenDayUI:_bind()
self:bind(DataManager.ActSevenDayData, "isDirty", function()
if not self.day or not self.page then
return
end
if self:getMaxShowDay() < self.day then
self.day = self:getMaxShowDay()
end
self:refreshTitle()
self:refreshBottoms()
self:refreshDayComp(self.day)
self.subComps[self.page]:refresh(self, self.day, self:getPeriod())
end)
self:bind(DataManager.PlayerData, "isDirty", function()
if not self.day or not self.page then
return
end
if self:getMaxShowDay() < self.day then
self.day = self:getMaxShowDay()
end
self:refreshTitle()
self:refreshBottoms()
self:refreshDayComp(self.day)
self.subComps[self.page]:refresh(self, self.day, self:getPeriod())
end)
self:bind(DataManager.PaymentData, "isDirty", function()
if not self.day or not self.page then
return
end
if self:getMaxShowDay() < self.day then
self.day = self:getMaxShowDay()
end
self:refreshTitle()
self:refreshBottoms()
self:refreshDayComp(self.day)
self.subComps[self.page]:refresh(self, self.day, self:getPeriod())
end)
end
function ActSevenDayUI:initComps()
if self.subComps then
return
end
local uiMap = self.root:genAllChildren()
self.subComps = {}
local taskComp = uiMap["act_sevenday_ui.task_comp"]
taskComp:initPrefabHelper()
taskComp:genAllChildren()
self.subComps[1] = taskComp:addLuaComponent(TASK_COMP)
local giftComp = uiMap["act_sevenday_ui.gift_comp"]
giftComp:initPrefabHelper()
giftComp:genAllChildren()
self.subComps[2] = giftComp:addLuaComponent(GIFT_COMP)
local dayComp = uiMap["act_sevenday_ui.r_menu"]
dayComp:initPrefabHelper()
dayComp:genAllChildren()
self.dayComp = dayComp:addLuaComponent(DAY_COMP)
end
function ActSevenDayUI:refreshTitle()
end
function ActSevenDayUI:refreshBottoms()
if not self.bottomBtns then
local uiMap = self.root:genAllChildren()
self.bottomBtns = {}
self.bgs = {}
self.hlBgs = {}
self.txs = {}
self.hlTxs = {}
self.rps = {}
for i = 1, 2 do
local prefix = "act_sevenday_ui.d_menu.d_menu_" .. i
self.bottomBtns[i] = uiMap[prefix]
self.bottomBtns[i]:addClickListener(function()
AudioManager:playEffect(AudioManager.EFFECT_ID.UI_BTN_SWITCH_2)
self:switchComp(i)
end)
self.bgs[i] = uiMap[prefix .. ".d_menu"]
self.hlBgs[i] = uiMap[prefix .. ".d_menu_choose"]
self.txs[i] = uiMap[prefix .. ".desc_tx"]
self.hlTxs[i] = uiMap[prefix .. ".desc_tx_choose"]
self.rps[i] = uiMap[prefix .. ".point_img"]
end
end
for index = 1, 2 do
local select = index == self.page
self.hlBgs[index]:setVisible(select)
self.txs[index]:setVisible(not select)
self.bgs[index]:setVisible(not select)
self.hlTxs[index]:setVisible(select)
if index == 1 then
self.rps[index]:setVisible(DataManager.ActSevenDayData:hasTaskRp(self:getPeriod()))
elseif index == 2 then
self.rps[index]:setVisible(DataManager.ActSevenDayData:hasGiftRp(self:getPeriod()))
end
end
end
function ActSevenDayUI:switchComp(page, force)
if self.page == page and not force then
return
end
self.page = page
local day = self:getMaxShowDay()
day = self:refreshDayComp() or day
self.day = day
for index, comp in ipairs(self.subComps) do
comp:getBaseObject():setActive(index == page)
comp:refresh(self, day, self:getPeriod())
end
self:refreshBottoms()
-- if self:getPeriod() == 1 then -- 第一期
-- if self.page == 1 then
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.ACT_SEVENDAY_TASK)
-- else
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.ACT_SEVENDAY_GIFT)
-- end
-- else
-- if self.page == 1 then
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.ACT_SEVENDAY_TASK_2)
-- else
-- BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.ACT_SEVENDAY_GIFT_2)
-- end
-- end
end
function ActSevenDayUI:refreshDayComp(targetDay)
local maxShowDay = self:getMaxShowDay()
local dataInfo = {}
local minRpDay = maxShowDay
for day = 1, 7 do
local over = false
local rp = false
if day <= maxShowDay then
over = true
if self.page == 1 then
local tasks = DataManager.ActSevenDayData:getTaskIdsByDay(day, self:getPeriod())
if tasks then
for _, id in ipairs(tasks) do
if not DataManager.ActSevenDayData:isTaskReceived(id) then
over = false
end
if DataManager.ActSevenDayData:canClaimTask(id) then
rp = true
if minRpDay > day then
minRpDay = day
end
break
end
end
end
elseif self.page == 2 then
rp = DataManager.ActSevenDayData:hasGiftDayRp(day, self:getPeriod())
over = DataManager.ActSevenDayData:getIsGiftAllOverDay(day, self:getPeriod())
if rp and minRpDay > day then
minRpDay = day
end
end
end
table.insert(dataInfo, {
over = over,
rp = rp,
func = function(selectDay)
self.day = selectDay
self.subComps[self.page]:refresh(self, selectDay, self:getPeriod())
end
})
end
targetDay = targetDay or minRpDay
self.dayComp:refresh(self, dataInfo, targetDay, maxShowDay, self:getPeriod())
return minRpDay
end
function ActSevenDayUI:getMaxShowDay()
local day = DataManager.ActSevenDayData:getActDay(self:getPeriod())
if day <= 0 or day >= 7 then
day = 7
end
return day
end
function ActSevenDayUI:updateTime()
local cd = DataManager.ActSevenDayData:getRemainTime(self:getPeriod())
local timeStr = GConst.EMPTY_STRING
local remainDay = -1
if cd <= 0 then
timeStr = I18N:getGlobalText(I18N.GlobalConst.ADVENTURE_CLOSED)
else
remainDay = cd // 86400
timeStr = I18N:getGlobalText(I18N.GlobalConst.TIME_END_DESC_1, GFunc.getTimeStr(cd))
end
self.timeTx:setText(timeStr)
if remainDay >= 0 and self.remainDay ~= remainDay then
self.remainDay = remainDay
local width = self.timeTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO).preferredWidth
self.timeBg:setSizeDeltaX(width + 74)
end
end
return ActSevenDayUI

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3f6a2e3ef3d3e3045b4c3cc0fda335bc guid: 10bf3aa8d477d4cd6a75b5569c6c3704
ScriptedImporter: ScriptedImporter:
internalIDToNameTable: [] internalIDToNameTable: []
externalObjects: {} externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: e3ad55d83f2f7554b9c8c21a442f894f guid: 8481132a6d14a4f498ff848b8e7d1c70
folderAsset: yes folderAsset: yes
DefaultImporter: DefaultImporter:
externalObjects: {} externalObjects: {}

View File

@ -0,0 +1,165 @@
local GiftCell = class("GiftCell", BaseCell)
function GiftCell:init()
local uiMap = self:getUIMap()
self.tagBg = uiMap["gift_cell.tag_bg"]
self.tagTx = uiMap["gift_cell.tag_bg.tag_tx"]
self.claimBtn = uiMap["gift_cell.claim_btn"]
self.claimBtnAdImg = uiMap["gift_cell.claim_btn.ad_img"]
self.claimBtnTx = uiMap["gift_cell.claim_btn.text"]
self.claimBtnTxBlue = uiMap["gift_cell.claim_btn.text_blue"]
self.claimBtnTxGray = uiMap["gift_cell.claim_btn.text_gray"]
self.limitTx = uiMap["gift_cell.limit_tx"]
self.claimBtnIcon = uiMap["gift_cell.claim_btn.icon"]
self.claimBtnNumTx = uiMap["gift_cell.claim_btn.num_tx"]
self.titleTx = uiMap["gift_cell.title_tx"]
self.discountBg = uiMap["gift_cell.discount_bg"]
self.discountBgTx = uiMap["gift_cell.discount_bg.desc_tx"]
self.rewardCells = {}
for i = 1, 4 do
self.rewardCells[i] = uiMap["gift_cell.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL)
end
self.claimBtn:addClickListener(function()
if self.info == nil then
return
end
if self.info.cfg.parameter_pro and self.info.cfg.parameter_pro[1] == 1 then -- 免费
ModuleManager.ActSevenDayManager:onGiftBuy(self.info.id)
elseif self.info.cfg.item_cost then -- 道具购买
if not GFunc.checkCost(self.info.cfg.item_cost[1].id, self.info.cfg.item_cost[1].num, true) then
return
end
local params = {}
params.content = I18N:getGlobalText(I18N.GlobalConst.MALL_DESC_13)
params.boxType = GConst.MESSAGE_BOX_TYPE.MB_OK_CANCEL
params.showToday = GConst.MESSAGE_BOX_SHOW_TODAY.ACT_SEVEN_DAY_GIFT
params.okFunc = function()
ModuleManager.ActSevenDayManager:onGiftBuy(self.info.id)
end
GFunc.showMessageBox(params)
elseif self.info.cfg.recharge_id == nil then -- 广告
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.AD_ACT_SEVEN_DAY_GIFT, function ()
ModuleManager.ActSevenDayManager:onGiftBuy(self.info.id)
end)
elseif self.info.cfg.recharge_id then -- 正常购买
ModuleManager.ActSevenDayManager:onGiftBuy(self.info.id)
end
end)
end
function GiftCell:refresh(info, period)
self.info = info
local giftRemainNum = DataManager.ActSevenDayData:getGiftRemainNum(info.id, period)
self.titleTx:setText(I18N:getText("act_gift", info.id, "value"))
self.limitTx:setText(I18N:getGlobalText(I18N.GlobalConst.GIFT_ROUTINE_DESC_8) .. giftRemainNum .. "/" .. info.cfg.limit)
if info.cfg.recharge_id then
self.baseObject:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_bg_11")
else
self.baseObject:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_bg_10")
end
if info.cfg.recommend then
self.tagBg:setActive(true)
self.titleTx:setAnchoredPositionX(88)
if info.cfg.recommend == 1 then
self.tagTx:setText(I18N:getGlobalText(I18N.GlobalConst.GIFT_ROUTINE_DESC_16))
else
self.tagTx:setText("<color=#FFEB11>" .. I18N:getGlobalText(I18N.GlobalConst.GIFT_ROUTINE_DESC_19) .. "</color>")
end
else
self.tagBg:setActive(false)
self.titleTx:setAnchoredPositionX(24)
end
GFunc.setAdsSprite(self.claimBtnAdImg)
local isClaimAll = giftRemainNum <= 0
if isClaimAll then
self.claimBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_3")
self.claimBtn:setTouchEnable(false)
self.claimBtnTxGray:setVisible(true)
self.claimBtnTxGray:setText(I18N:getGlobalText(I18N.GlobalConst.GIFT_ROUTINE_DESC_10))
self.claimBtnTxGray:setSizeDeltaX(120)
self.claimBtnTxGray:setAnchoredPositionX(0)
self.claimBtnTxBlue:setVisible(false)
self.claimBtnTx:setVisible(false)
self.claimBtnAdImg:setActive(false)
self.claimBtnIcon:setActive(false)
self.claimBtnNumTx:setActive(false)
else
self.claimBtn:setTouchEnable(true)
if info.cfg.parameter_pro and info.cfg.parameter_pro[1] == 1 then -- 免费
self.claimBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_3")
self.claimBtnAdImg:setActive(false)
self.claimBtnIcon:setActive(false)
self.claimBtnNumTx:setActive(false)
self.claimBtnTxBlue:setVisible(true)
self.claimBtnTxBlue:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_DESC))
self.claimBtnTxBlue:setSizeDeltaX(120)
self.claimBtnTxBlue:setAnchoredPositionX(0)
self.claimBtnTx:setVisible(false)
self.claimBtnTxGray:setVisible(false)
elseif info.cfg.item_cost then -- 道具购买
self.claimBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3")
self.claimBtnIcon:setSprite(GFunc.getIconRes(info.cfg.item_cost[1].id))
self.claimBtnAdImg:setActive(false)
self.claimBtnIcon:setActive(true)
self.claimBtnNumTx:setActive(true)
self.claimBtnTx:setVisible(false)
self.claimBtnTxGray:setVisible(false)
self.claimBtnTxBlue:setVisible(false)
self.claimBtnNumTx:setText(info.cfg.item_cost[1].num)
GFunc.centerImgAndTx(self.claimBtnIcon, self.claimBtnNumTx, 0, nil, -6)
elseif info.cfg.recharge_id == nil then -- 广告
self.claimBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_3")
self.claimBtnAdImg:setActive(true)
self.claimBtnIcon:setActive(false)
self.claimBtnNumTx:setActive(false)
self.claimBtnTxBlue:setText(I18N:getGlobalText(I18N.GlobalConst.FREE_DESC))
self.claimBtnTxBlue:setSizeDeltaX(80)
self.claimBtnTxBlue:setAnchoredPositionX(18)
self.claimBtnTxBlue:setVisible(true)
self.claimBtnTx:setVisible(false)
self.claimBtnTxGray:setVisible(false)
elseif info.cfg.recharge_id then -- 付费购买
self.claimBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_yellow_3")
self.claimBtnAdImg:setActive(false)
self.claimBtnIcon:setActive(false)
self.claimBtnNumTx:setActive(false)
self.claimBtnTx:setText(GFunc.getFormatPrice(info.cfg.recharge_id))
self.claimBtnTx:setSizeDeltaX(120)
self.claimBtnTx:setAnchoredPositionX(0)
self.claimBtnTx:setVisible(true)
self.claimBtnTxGray:setVisible(false)
self.claimBtnTxBlue:setVisible(false)
end
end
-- -- 红点
-- if not isClaimAll and not self.cfg.free and not self.cfg.item_cost and not self.cfg.recharge_id then
-- self.claimBtn:addRedPoint(67, 28, 0.9)
-- else
-- self.claimBtn:removeRedPoint()
-- end
for i = 1, 4 do
if info.cfg.reward and info.cfg.reward[i] then
self.rewardCells[i]:setVisible(true)
self.rewardCells[i]:refreshByConfig(info.cfg.reward[i], isClaimAll, isClaimAll)
else
self.rewardCells[i]:setVisible(false)
end
end
if info.cfg.value then
self.discountBg:setActive(true)
self.discountBgTx:setText(info.cfg.value .. "%")
else
self.discountBg:setActive(false)
end
end
return GiftCell

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