diff --git a/lua/app/common/bi_report.lua b/lua/app/common/bi_report.lua index 9168650e..8e51fa5f 100644 --- a/lua/app/common/bi_report.lua +++ b/lua/app/common/bi_report.lua @@ -93,7 +93,6 @@ BIReport.ITEM_GET_TYPE = { ACT_CHAPTER_STORE = "ActChapterStore", -- 章节礼包 SUMMON = "Summon", PLAYER_LV_UP = "PlayerLvUp", - GOLD_PIG = "GoldPig", BATTLE_SKILL_REFRESH = "BattleSkillRefresh", GROWTH_FUND = "GrowthFund", GROW_UP_GIFT_NEW = "GrowUpGiftNew", -- 新成长礼包 @@ -273,7 +272,6 @@ BIReport.GIFT_TYPE = { BEGINNER_GIFT = "BeginnerGift", LEVEL_UP_GIFT = "LevelUpGift", BOUNTY = "Bounty", - GOLD_PIG = "GoldPig", MALL_TREASURE = "MallTreasure", ACT_CHAPTER_STORE = "ActChapterStore", GROWTH_FUND = "GrowthFund", diff --git a/lua/app/common/event_manager.lua b/lua/app/common/event_manager.lua index f00a138c..444333cb 100644 --- a/lua/app/common/event_manager.lua +++ b/lua/app/common/event_manager.lua @@ -81,6 +81,9 @@ EventManager.CUSTOM_EVENT = { FORCE_SUMMON_CHECK_PATH_GM = "FORCE_SUMMON_CHECK_PATH_GM", UPDATE_SIDE_BAR = "UPDATE_SIDE_BAR", + -- 活动 + CHANGE_ACTIVITY_PAGE = "CHANGE_ACTIVITY_PAGE", + CROSS_DAY = "CROSS_DAY",-- 跨天 } diff --git a/lua/app/common/module_manager.lua b/lua/app/common/module_manager.lua index e49e7c8f..160d4545 100644 --- a/lua/app/common/module_manager.lua +++ b/lua/app/common/module_manager.lua @@ -90,7 +90,6 @@ local MODULE_PATHS = { -- 这里的key对应func_open里的id ModuleManager.MODULE_KEY = { - GOLD_PIG = "act_gold_pig", SEVEN_DAY = "act_sevenday", TASK = "task", STORE_BOX_OPEN = "store_box_open", diff --git a/lua/app/common/server_push_manager.lua b/lua/app/common/server_push_manager.lua index 8c2a1435..091496af 100644 --- a/lua/app/common/server_push_manager.lua +++ b/lua/app/common/server_push_manager.lua @@ -16,7 +16,6 @@ function ServerPushManager:initWhenLogin() self:addServerPushListener(ProtoMsgType.FromMsgEnum.BountyBoughtNtf, ModuleManager.BountyManager, ModuleManager.BountyManager.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.PigLevelUpNtf, ModuleManager.ActivityManager, ModuleManager.ActivityManager.onBoughtGoldPigFinish) self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerLevelUpGiftNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerLevelUpGift) self:addServerPushListener(ProtoMsgType.FromMsgEnum.TriggerGrowUpGift2Ntf, ModuleManager.ShopManager, ModuleManager.ShopManager.onTriggerGrowUpGift) -- self:addServerPushListener(ProtoMsgType.FromMsgEnum.MallDailyResetNtf, ModuleManager.ShopManager, ModuleManager.ShopManager.onMallDailyReset) diff --git a/lua/app/module/activity/act_sprint/act_sprint_const.lua b/lua/app/module/activity/act_sprint/act_sprint_const.lua index d50a3d90..3a5b2350 100644 --- a/lua/app/module/activity/act_sprint/act_sprint_const.lua +++ b/lua/app/module/activity/act_sprint/act_sprint_const.lua @@ -1,100 +1,33 @@ local ActSprintConst = {} ActSprintConst.ACT_ID = { - -- SUMMON = 11301, - -- CORE_SOUL_BOX = 11401, - -- SUMMON_V2 = 11501, - -- CORE_SOUL_BOX_V2 = 11601, -- 新版新手 SUMMON_ALL = 10001, - -- CORE_SOUL_BOX_ALL = 11801, - -- -- Loop - -- SUMMON_LOOP = 11901, - -- CORE_SOUL_BOX_LOOP = 12001, - -- TREE_LOOP = 12101, } ActSprintConst.ACT_ID_NOT_SHOP = { - -- [ActSprintConst.ACT_ID.SUMMON] = true, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = true, - -- [ActSprintConst.ACT_ID.SUMMON_V2] = true, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = true, } ActSprintConst.ACT_ID_MAP = { - -- [ActSprintConst.ACT_ID.SUMMON] = true, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = true, - -- [ActSprintConst.ACT_ID.SUMMON_V2] = true, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = true, - [ActSprintConst.ACT_ID.SUMMON_ALL] = true, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = true, - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = true, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = true, - -- [ActSprintConst.ACT_ID.TREE_LOOP] = true, } ActSprintConst.ACT_LIST_BANNER = { - -- [ActSprintConst.ACT_ID.SUMMON] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_2.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_5.png", - -- [ActSprintConst.ACT_ID.SUMMON_V2] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_2.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_5.png", - [ActSprintConst.ACT_ID.SUMMON_ALL] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_2.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_5.png", - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_2.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_5.png", - -- [ActSprintConst.ACT_ID.TREE_LOOP] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_7.png", } ActSprintConst.ACT_LIST_NAME = { - -- [ActSprintConst.ACT_ID.SUMMON] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.SUMMON_V2] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - [ActSprintConst.ACT_ID.SUMMON_ALL] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, - -- [ActSprintConst.ACT_ID.TREE_LOOP] = I18N.GlobalConst.ACT_GOGOGO_DESC_1, } ActSprintConst.ACT_MAIN_BANNER = { - -- [ActSprintConst.ACT_ID.SUMMON] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_1.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_4.png", - -- [ActSprintConst.ACT_ID.SUMMON_V2] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_1.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_4.png", - [ActSprintConst.ACT_ID.SUMMON_ALL] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_1.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_4.png", - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_1.png", - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_4.png", - -- [ActSprintConst.ACT_ID.TREE_LOOP] = "assets/arts/textures/background/act_gogogo/act_gogogo_bg_6.png", } ActSprintConst.ACT_ROUND_LIMIT = { - -- [ActSprintConst.ACT_ID.SUMMON] = GFunc.getConstIntValue("act_gogogo_round_limit_1"), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = GFunc.getConstIntValue("act_gogogo_round_limit_2"), - -- [ActSprintConst.ACT_ID.SUMMON_V2] = GFunc.getConstIntValue("act_gogogo_round_limit_3"), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = GFunc.getConstIntValue("act_gogogo_round_limit_4"), - [ActSprintConst.ACT_ID.SUMMON_ALL] = GFunc.getConstIntValue("act_gogogo_round_limit_1"), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = GFunc.getConstIntValue("act_gogogo_round_limit_6"), - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = GFunc.getConstIntValue("act_gogogo_round_limit_7"), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = GFunc.getConstIntValue("act_gogogo_round_limit_8"), - -- [ActSprintConst.ACT_ID.TREE_LOOP] = GFunc.getConstIntValue("act_gogogo_round_limit_9"), } ActSprintConst.ACT_ROUND_REWARD = { - -- [ActSprintConst.ACT_ID.SUMMON] = GFunc.getConstCost("act_gogogo_round_reward_1", true), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = GFunc.getConstCost("act_gogogo_round_reward_2", true), - -- [ActSprintConst.ACT_ID.SUMMON_V2] = GFunc.getConstCost("act_gogogo_round_reward_3", true), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = GFunc.getConstCost("act_gogogo_round_reward_4", true), - - [ActSprintConst.ACT_ID.SUMMON_ALL] = GFunc.getConstReward2("act_gogogo_round_reward_1", true), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = GFunc.getConstCost("act_gogogo_round_reward_6", true), - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = GFunc.getConstCost("act_gogogo_round_reward_7", true), - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = GFunc.getConstCost("act_gogogo_round_reward_8", true), - -- [ActSprintConst.ACT_ID.TREE_LOOP] = GFunc.getConstCost("act_gogogo_round_reward_9", true), + [ActSprintConst.ACT_ID.SUMMON_ALL] = GFunc.getConstReward2("act_gogogo_round_reward_1"), } ActSprintConst.REFRESH_TYPE = { @@ -111,103 +44,21 @@ ActSprintConst.MAIN_PAGE_TYPE = { } ActSprintConst.MAIN_PAGE_BTN_ICON_1 = { - -- [ActSprintConst.ACT_ID.SUMMON] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_28_1", - -- [3] = "act_common_btn_29_1", - -- }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_28_1", - -- [3] = "act_common_btn_29_1", - -- }, - -- [ActSprintConst.ACT_ID.SUMMON_V2] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_34_1", - -- [3] = "act_common_btn_28_1", - -- }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_34_1", - -- [3] = "act_common_btn_28_1", - -- }, [ActSprintConst.ACT_ID.SUMMON_ALL] = { [1] = "act_common_btn_27_1", [2] = "act_common_btn_34_1", [3] = "act_common_btn_29_1", [4] = "act_common_btn_28_1", }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_34_1", - -- [3] = "act_common_btn_29_1", - -- [4] = "act_common_btn_28_1", - -- }, - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_34_1", - -- [3] = "act_common_btn_28_1", - -- }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_34_1", - -- [3] = "act_common_btn_28_1", - -- }, - -- [ActSprintConst.ACT_ID.TREE_LOOP] = { - -- [1] = "act_common_btn_27_1", - -- [2] = "act_common_btn_34_1", - -- [3] = "act_common_btn_28_1", - -- }, } ActSprintConst.MAIN_PAGE_BTN_ICON_2 = { - -- [ActSprintConst.ACT_ID.SUMMON] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_28_2", - -- [3] = "act_common_btn_29_2", - -- }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_28_2", - -- [3] = "act_common_btn_29_2", - -- }, - -- [ActSprintConst.ACT_ID.SUMMON_V2] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_34_2", - -- [3] = "act_common_btn_28_2", - -- }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_V2] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_34_2", - -- [3] = "act_common_btn_28_2", - -- }, [ActSprintConst.ACT_ID.SUMMON_ALL] = { [1] = "act_common_btn_27_2", [2] = "act_common_btn_34_2", [3] = "act_common_btn_29_2", [4] = "act_common_btn_28_2", }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_ALL] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_34_2", - -- [3] = "act_common_btn_29_2", - -- [4] = "act_common_btn_28_2", - -- }, - -- [ActSprintConst.ACT_ID.SUMMON_LOOP] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_34_2", - -- [3] = "act_common_btn_28_2", - -- }, - -- [ActSprintConst.ACT_ID.CORE_SOUL_BOX_LOOP] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_34_2", - -- [3] = "act_common_btn_28_2", - -- }, - -- [ActSprintConst.ACT_ID.TREE_LOOP] = { - -- [1] = "act_common_btn_27_2", - -- [2] = "act_common_btn_34_2", - -- [3] = "act_common_btn_28_2", - -- }, } ActSprintConst.MAIN_PAGE_BTN_DESC = { @@ -217,5 +68,32 @@ ActSprintConst.MAIN_PAGE_BTN_DESC = { [ActSprintConst.MAIN_PAGE_TYPE.LOGIN] = "ACT_GOGOGO_DESC_20", } +ActSprintConst.BOTTOM_PAGE = { + SCORE_TASK = 1, + BOUNTY = 2, + GIFT = 3, + TASK = 4, +} + +ActSprintConst.COMP = { + [ActSprintConst.BOTTOM_PAGE.SCORE_TASK] = "app/ui/activity/common/comp/act_score_task_comp_v1", + [ActSprintConst.BOTTOM_PAGE.BOUNTY] = "app/ui/activity/common/comp/act_bounty_comp_v1", + [ActSprintConst.BOTTOM_PAGE.GIFT] = "app/ui/activity/common/comp/act_gift_comp_v1", + [ActSprintConst.BOTTOM_PAGE.TASK] = "app/ui/activity/common/comp/act_task_comp_v1", +} + +ActSprintConst.COMP_NAME = { + [ActSprintConst.BOTTOM_PAGE.SCORE_TASK] = "act_main_ui.sub_comps.act_score_task_comp_v1", + [ActSprintConst.BOTTOM_PAGE.BOUNTY] = "act_main_ui.sub_comps.act_bounty_comp_v1", + [ActSprintConst.BOTTOM_PAGE.GIFT] = "act_main_ui.sub_comps.act_gift_comp_v1", + [ActSprintConst.BOTTOM_PAGE.TASK] = "act_main_ui.sub_comps.act_task_comp_v1", +} + +-- 动态加载的组件 +ActSprintConst.COMP_PATH = { + -- [ActSprintConst.BOTTOM_PAGE.BOUNTY] = "assets/prefabs/ui/activity/common/comp/act_bounty_comp.prefab", + -- [ActSprintConst.BOTTOM_PAGE.EXCHANGE] = "assets/prefabs/ui/activity/common/comp/act_exchange_comp.prefab", + -- [ActSprintConst.BOTTOM_PAGE.GIFT] = "assets/prefabs/ui/activity/common/comp/act_gift_comp.prefab", +} return ActSprintConst \ No newline at end of file diff --git a/lua/app/module/activity/act_sprint/act_sprint_manager.lua b/lua/app/module/activity/act_sprint/act_sprint_manager.lua index 175042f9..b8b39c01 100644 --- a/lua/app/module/activity/act_sprint/act_sprint_manager.lua +++ b/lua/app/module/activity/act_sprint/act_sprint_manager.lua @@ -13,7 +13,7 @@ end function ActSprintManager:showActSprintMainUI(params) local actId = params.actId if actId == GConst.ActSprintConst.ACT_ID.SUMMON_ALL then - UIManager:showUI("app/ui/activity/act_sprint_summon_all/act_sprint_main_ui", params) + UIManager:showUI("app/ui/activity/act_sprint_summon_all/act_main_ui", params) end -- if actId == GConst.ActSprintConst.ACT_ID.SUMMON then -- UIManager:showUI("app/ui/activity/act_sprint_summon/act_sprint_main_ui", params) diff --git a/lua/app/module/chapter/chapter_manager.lua b/lua/app/module/chapter/chapter_manager.lua index 8791a0ff..0fe7af59 100644 --- a/lua/app/module/chapter/chapter_manager.lua +++ b/lua/app/module/chapter/chapter_manager.lua @@ -129,8 +129,6 @@ function ChapterManager:endFightFinish(result) ModuleManager.BattleManager:showBattleResultUI(GConst.BattleConst.BATTLE_TYPE.STAGE, newRewards, reqData.combatReport, mysteryBoxIdx, nil, true) DataManager.ChapterData:fightChapter(reqData.chapter_id, result.max_chapter_id, result.max_wave, reqData.mystery_box_idx) DataManager.ChapterData:clearChapterBoxState() - -- 处理金猪,要在章节更新之后 - DataManager.GoldPigData:addGoldPigCount() local newMaxChapter = DataManager.ChapterData:getNewChapterId() if maxChapter ~= newMaxChapter then diff --git a/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua new file mode 100644 index 00000000..f2439b8b --- /dev/null +++ b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua @@ -0,0 +1,143 @@ +local ActBaseUI = require "app/ui/activity/common/act_base_ui" +local ActMainUI = class("ActMainUI", ActBaseUI) + +local PAGE_BTN_NORMAL = { + "act_common_btn_27_2", + "act_common_btn_34_2", + "act_common_btn_29_2", + "act_common_btn_28_2", +} +local PAGE_BTN_LIGHT = { + "act_common_btn_27_1", + "act_common_btn_34_1", + "act_common_btn_29_1", + "act_common_btn_28_1", +} +local PAGE_BTN_DESC = { + "ACT_GOGOGO_DESC_1", + "ACT_GOGOGO_DESC_10", + "ACT_GOGOGO_DESC_11", + "ACT_GOGOGO_DESC_20", +} + +function ActMainUI:showCommonBG() + return false +end + +function ActMainUI:onPressBackspace() + self:closeUI() +end + +function ActMainUI:currencyParams() + self.params = {} + self.params.showType = GConst.CURRENCY_TYPE.HORIZONTAL + if self.curPage == 3 then + self.params.itemIds = { + GConst.ItemConst.ITEM_ID_GEM, + } + else + self.params.itemIds = {} + end + return self.params, true +end + +function ActMainUI:ctor(params) + self.params = params or {} + self.actId = params.actId + self.curPage = params.page or self:getRpPage() +end + +function ActMainUI:getPrefabPath() + return "assets/prefabs/ui/activity/act_sprint/act_main_ui.prefab" +end + +function ActMainUI:getRpPage() + for i = 1, 4 do + if DataManager[self:getActDataType()]:getRpByPage(i) then + return i + end + end + return 1 +end + +-- region 活动功能接口 +function ActMainUI:getActConst() + return GConst.ActSprintConst +end + +function ActMainUI:getActDataType() + return "ActSprintSummonDataAll" +end + +function ActMainUI:getGiftAdType() + return BIReport.ADS_CLICK_TYPE.AD_NEW_NEW_GIFT +end + +function ActMainUI:getBountyLvRes(active) + if active then + return GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_dec_4" + else + return GConst.ATLAS_PATH.UI_ACT_COMMON, "act_common_dec_3" + end +end + +function ActMainUI:getCellName(page) + page = page or self.page + return I18N:getGlobalText(PAGE_BTN_DESC[page]) +end + +function ActMainUI:showGamePreviewUI() + local params = {} + params.dataKey = self:getActDataType() + params.parentUI = self + ModuleManager.ActivityManager:showFishPreviewUI(params) +end + +function ActMainUI:getPageBtnName(index, light) + if light then + return PAGE_BTN_LIGHT[index] + else + return PAGE_BTN_NORMAL[index] + end +end + +function ActMainUI:getShowBountyBg() + return false +end + +function ActMainUI:isShowBannerLine1() + return false +end + +function ActMainUI:getBountyBanner() + return "assets/arts/textures/background/act_newnew/act_newnew_bg_2.png" +end + +--@endregion + +-- region 活动消息 +function ActMainUI:reqActivityGameDo(score) + ModuleManager.ActNewNewManager:reqActivityGameDo(score) +end + +function ActMainUI:reqActivityGameTarget(id) + ModuleManager.ActNewNewManager:reqActivityGameTarget(0) +end + +function ActMainUI:reqActivityTarget(id) + ModuleManager.ActNewNewManager:reqActivityTarget(id) +end + +function ActMainUI:reqActivityPlay(count, isFree) + ModuleManager.ActNewNewManager:reqActivityPlay(count, isFree) +end + +function ActMainUI:onClaimAllRewards() + ModuleManager.ActNewNewManager:onClaimAllRewards() +end + +function ActMainUI:onUnlockProReward(gear) + ModuleManager.ActNewNewManager:onUnlockProReward(gear) +end +--@endregion +return ActMainUI \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/login_cell.lua.meta b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua.meta similarity index 86% rename from lua/app/ui/activity/act_sprint_summon_all/cell/login_cell.lua.meta rename to lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua.meta index b0c03f1e..fd825c61 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/login_cell.lua.meta +++ b/lua/app/ui/activity/act_sprint_summon_all/act_main_ui.lua.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a8b0bda5edab9ab44a9d8cd117347310 +guid: 4f6b3b4dd840749b189863949799ece6 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/lua/app/ui/activity/act_sprint_summon_all/act_sprint_main_ui.lua b/lua/app/ui/activity/act_sprint_summon_all/act_sprint_main_ui.lua deleted file mode 100644 index c0075b0d..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/act_sprint_main_ui.lua +++ /dev/null @@ -1,244 +0,0 @@ -local ActSprintMainUI = class("ActSprintMainUI", BaseUI) - -local BTN_WIDTH = 82 -local BTN_RIGHT = 20 -local BTN_SPACING = 26 - -function ActSprintMainUI:showCommonBG() - return false -end - -function ActSprintMainUI:onPressBackspace() - self:closeUI() -end - -function ActSprintMainUI:getPrefabPath() - return "assets/prefabs/ui/activity/act_sprint/act_sprint_main_ui_1_all.prefab" -end - -function ActSprintMainUI:onClose() - if self.subComps then - for _, comp in pairs(self.subComps) do - if comp.onClose then - comp:onClose() - end - end - end - - local callback = self.callback - self.callback = nil - if callback then - callback() - end -end - -function ActSprintMainUI:currencyParams() - self.params = {} - self.params.showType = GConst.CURRENCY_TYPE.HORIZONTAL - if self.curPage == 3 then - self.params.itemIds = { - GConst.ItemConst.ITEM_ID_GEM, - } - else - self.params.itemIds = {} - end - return self.params, true -end - -function ActSprintMainUI:ctor(params) - self.params = params or {} - self.actId = params.actId - self.curPage = params.page or self:getRpPage() - -end - -function ActSprintMainUI:onLoadRootComplete() - if not self.actId then - self:closeUI() - return - end - - local uiMap = self.root:genAllChildren() - self.btnClose = uiMap["act_sprint_main_ui.bottom.btn_close"] - self.btnNode = uiMap["act_sprint_main_ui.bottom.btns"] - self.btnContent = uiMap["act_sprint_main_ui.bottom.btns.viewport.content"] - self.btns = {} - self.txBtns = {} - for i = 1, 4 do - table.insert(self.btns, uiMap["act_sprint_main_ui.bottom.btns.viewport.content.btn_" .. i]) - table.insert(self.txBtns, uiMap["act_sprint_main_ui.bottom.btns.viewport.content.btn_" .. i .. ".tx_desc"]) - end - self.compsRoot = uiMap["act_sprint_main_ui.comps"] - for i, btn in ipairs(self.btns) do - btn:addClickListener(function() - self:onChangePage(i) - end) - end - self.txBtns[1]:setText(I18N:getGlobalText(I18N.GlobalConst[GConst.ActSprintConst.MAIN_PAGE_BTN_DESC[GConst.ActSprintConst.MAIN_PAGE_TYPE.STANDARD]])) - self.txBtns[2]:setText(I18N:getGlobalText(I18N.GlobalConst[GConst.ActSprintConst.MAIN_PAGE_BTN_DESC[GConst.ActSprintConst.MAIN_PAGE_TYPE.LOGIN]])) - self.txBtns[3]:setText(I18N:getGlobalText(I18N.GlobalConst[GConst.ActSprintConst.MAIN_PAGE_BTN_DESC[GConst.ActSprintConst.MAIN_PAGE_TYPE.GIFT]])) - self.txBtns[4]:setText(I18N:getGlobalText(I18N.GlobalConst[GConst.ActSprintConst.MAIN_PAGE_BTN_DESC[GConst.ActSprintConst.MAIN_PAGE_TYPE.TASK]])) - - self:initComps() - self:scheduleGlobal(function() - self:updateTime() - end, 1) - self:updateTime() - - self.btnClose:addClickListener(function() - self:closeUI() - end) - self:bind(DataManager.ActSprintSummonDataAll, "isDirty", function() - self:refreshRedPoint() - self:onRefresh() - end) - self:bind(DataManager.ActivityData, "isDirty", function() - self:refreshRedPoint() - self:onRefresh() - end) - self:bind(DataManager.PaymentData, "isDirty", function() - self:refreshRedPoint() - self:onRefresh() - end) - self:bind(DataManager.ActTaskData, "isDirty", function() - self:refreshRedPoint() - self:onRefresh() - end) - self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, function() - self:closeUI() - end) - - self:refreshRedPoint() - self:onRefresh() - - BIReportV2:postOperation(BIReportV2.OPERATION_UI_NAME.ACT_SPRINT_NEW_SUMMON) -end - -function ActSprintMainUI:initComps() - if self.subComps then - return - end - local uiMap = self.root:genAllChildren() - self.subComps = {} - - -- 预制体挂载 - local obj = uiMap["act_sprint_main_ui.standard_comp"] - obj:initPrefabHelper() - obj:genAllChildren() - local comp = obj:addLuaComponent("app/ui/activity/act_sprint_summon_all/comp/standard_comp") - self.subComps[1] = comp - - local obj2 = uiMap["act_sprint_main_ui.login_comp"] - obj2:initPrefabHelper() - obj2:genAllChildren() - self.subComps[2] = obj2:addLuaComponent("app/ui/activity/act_sprint_summon_all/comp/login_comp") - - local obj3 = uiMap["act_sprint_main_ui.gift_comp"] - obj3:initPrefabHelper() - obj3:genAllChildren() - self.subComps[3] = obj3:addLuaComponent("app/ui/activity/act_sprint_summon_all/comp/gift_comp") - - local obj4 = uiMap["act_sprint_main_ui.task_comp"] - obj4:initPrefabHelper() - obj4:genAllChildren() - self.subComps[4] = obj4:addLuaComponent("app/ui/activity/act_sprint_summon_all/comp/task_comp") -end - -function ActSprintMainUI:updateTime() - if self.subComps then - for _, comp in pairs(self.subComps) do - if comp.updateTime then - comp:updateTime(self.actId) - end - end - end - if not DataManager.ActSprintSummonDataAll:getIsOpen() then - self:closeUI() - end -end - -function ActSprintMainUI:onChangePage(page) - if self.curPage == page then - return - end - - for i, comp in pairs(self.subComps) do - if page ~= i and self.curPage == i and comp.onClose then - comp:onClose() - end - end - - self.curPage = page - self:onRefresh() -end - -function ActSprintMainUI:onRefresh() - local openCount = 0 - for i, btn in ipairs(self.btns) do - if self:isOpen(i) then - btn:setActive(true) - openCount = openCount + 1 - if self.curPage == i then - btn:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, GConst.ActSprintConst.MAIN_PAGE_BTN_ICON_1[self.actId][i]) - else - btn:setSprite(GConst.ATLAS_PATH.UI_ACT_COMMON, GConst.ActSprintConst.MAIN_PAGE_BTN_ICON_2[self.actId][i]) - end - else - btn:setActive(false) - end - end - local width = BTN_RIGHT + BTN_WIDTH * openCount + BTN_SPACING * (openCount - 1) + 20 - self.btnContent:setSizeDeltaX(width) - self.btnContent:setAnchoredPositionX(math.max(width - self.btnNode:getSizeDeltaX(), 0)) - - for i, comp in pairs(self.subComps) do - if self.curPage == i then - comp:getBaseObject():setActive(true) - comp:refresh(self.actId) - else - comp:getBaseObject():setActive(false) - end - end - - self:updateCurrencyBar() - -- 红点 - self:refreshRedPoint() -end - -function ActSprintMainUI:refreshRedPoint() - for i, btn in ipairs(self.btns) do - if self:hasRedPoint(i) then - btn:addRedPoint(30, 30, 0.9) - else - btn:removeRedPoint() - end - end -end - -function ActSprintMainUI:isOpen(type) - return true -end - -function ActSprintMainUI:hasRedPoint(page) - if page == 1 then - return DataManager.ActSprintSummonDataAll:hasStandardRp() - elseif page == 2 then - return DataManager.ActSprintSummonDataAll:hasBountyRp() - elseif page == 3 then - return DataManager.ActSprintSummonDataAll:hasGiftRp() - elseif page == 4 then - return DataManager.ActSprintSummonDataAll:hasTaskRp() - end - return false -end - -function ActSprintMainUI:getRpPage() - for i = 1, 4 do - if self:hasRedPoint(i) then - return i - end - end - return 1 -end - -return ActSprintMainUI \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/task_cell.lua.meta b/lua/app/ui/activity/act_sprint_summon_all/cell/task_cell.lua.meta deleted file mode 100644 index a23267fe..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/task_cell.lua.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 48fc395edac664a4da2ccdaf9696b5a0 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/gift_comp.lua b/lua/app/ui/activity/act_sprint_summon_all/comp/gift_comp.lua deleted file mode 100644 index fc5a9130..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/gift_comp.lua +++ /dev/null @@ -1,40 +0,0 @@ -local GiftComp = class("GiftComp", LuaComponent) -local CELL = "app/ui/activity/act_sprint_summon_all/cell/gift_cell" - -function GiftComp:init() - local uiMap = self:getUIMap() - self.banner = uiMap["gift_comp.bg.banner"] - self.txTitle = uiMap["gift_comp.top.title_tx"] - self.txTime = uiMap["gift_comp.top.time_bg.time_tx"] - self.scrollrect = uiMap["gift_comp.scrollrect"] -end - -function GiftComp:refresh(actId) - self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) - self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) - self.giftList = DataManager.ActGiftData:getGiftIdsSort(actId) - - if self.scrollRect == nil then - self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) - self.scrollRect:addInitCallback(function() - return CELL - end) - self.scrollRect:addRefreshCallback(function(index, cell) - cell:refresh(actId, self.giftList[index]) - end) - end - if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then - self.scrollRect:refillCells(#self.giftList) - elseif self.scrollRect:getTotalCount() ~= #self.giftList then - self.scrollRect:clearCells() - self.scrollRect:refillCells(#self.giftList) - else - self.scrollRect:updateAllCell() - end -end - -function GiftComp:updateTime() - self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) -end - -return GiftComp \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/gift_comp.lua.meta b/lua/app/ui/activity/act_sprint_summon_all/comp/gift_comp.lua.meta deleted file mode 100644 index 5893c136..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/gift_comp.lua.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 179f9ae95bad42a408979f724a68060b -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/login_comp.lua b/lua/app/ui/activity/act_sprint_summon_all/comp/login_comp.lua deleted file mode 100644 index 0f2d9da0..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/login_comp.lua +++ /dev/null @@ -1,81 +0,0 @@ -local SummonActLogin = class("SummonActLogin", LuaComponent) - -local CELL = "app/ui/activity/act_sprint_summon_all/cell/login_cell" - -function SummonActLogin:onClose() -end - -function SummonActLogin:init() - local uiMap = self:getUIMap() - self.txTitle = uiMap["login_comp.top.title_tx"] - self.txTime = uiMap["login_comp.top.time_bg.time_tx"] - self.banner = uiMap["login_comp.top.banner"] - self.scrollrectPrefab = uiMap["login_comp.scrollrect"] - self.scrollrect = self.scrollrectPrefab:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) - - self.getBtn = uiMap["login_comp.get_btn"] - self.getBtn:addClickListener(function() - local actId = DataManager.ActSprintSummonDataAll:getActId() - local actType = DataManager.ActSprintSummonDataAll:getActType(actId) - local grade = DataManager.ActSprintSummonDataAll:isUnlockBountyPro() and 1 or 0 - ModuleManager.ActSprintManager:reqSprintBountySign(actType, actId, grade) - end) - self.getBtnTx = uiMap["login_comp.get_btn.text"] - self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.ONE_KEY_GET_DESC)) - self.payBtn = uiMap["login_comp.pay_btn"] - self.payBtn:addClickListener(function() - if DataManager.ActSprintSummonDataAll:isUnlockBountyPro() then - return - end - local giftId = DataManager.ActSprintSummonDataAll:getBountyProGiftId() - ModuleManager.ActSprintManager:onBuyBountyPro(giftId) - end) - self.payBtnTx = uiMap["login_comp.pay_btn.text"] - - uiMap["login_comp.scrollrect.title.tx_scro_title_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_HERO_SUIT_DESC_4)) - uiMap["login_comp.scrollrect.title.tx_scro_title_2"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_HERO_SUIT_DESC_5)) - uiMap["login_comp.scrollrect.title.tx_scro_title_3"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_HERO_SUIT_DESC_6)) -end ---endregion - ---region基础初始化方法 -function SummonActLogin:updateTime() - self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) -end - -function SummonActLogin:refresh() - local actId = DataManager.ActSprintSummonDataAll:getActId() - self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) - self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) - self.getBtn:setActive(DataManager.ActSprintSummonDataAll:isHaveUnclaimedBountyReward()) - self.payBtn:setActive(not DataManager.ActSprintSummonDataAll:isUnlockBountyPro()) - local rechargeId = DataManager.ActSprintSummonDataAll:getBountyProRechargeId() - self.payBtnTx:setText(GFunc.getFormatPrice(rechargeId)) - self:refreshScrollRect() -end - -function SummonActLogin:refreshScrollRect() - self.cfgList = DataManager.ActSprintSummonDataAll:getBountyCfgList() - if not self.isInitScrollrect then - self.isInitScrollrect = true - self.scrollrect:addInitCallback(function() - return CELL - end) - self.scrollrect:addRefreshCallback(function(index, cell) - cell:refresh(index, #self.cfgList, self.cfgList[index]) - end) - self.scrollrect:clearCells() - self.scrollrect:refillCells(#self.cfgList) - else - if self.scrollrect:getTotalCount() == #self.cfgList then - self.scrollrect:updateAllCell() - else - self.scrollrect:refillCells(#self.cfgList) - end - end - -- local minIndex = self.dataManager:getMinUnclaimedRewardIndex() - -- self.scrollrect:moveToIndex(minIndex) -end ---endregion - -return SummonActLogin \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/login_comp.lua.meta b/lua/app/ui/activity/act_sprint_summon_all/comp/login_comp.lua.meta deleted file mode 100644 index ad3cb3a2..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/login_comp.lua.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: 8c51d0d3dc469e64a9480443efbe5eb4 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/standard_comp.lua b/lua/app/ui/activity/act_sprint_summon_all/comp/standard_comp.lua deleted file mode 100644 index c43696ef..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/standard_comp.lua +++ /dev/null @@ -1,101 +0,0 @@ -local StandardComp = class("StandardComp", LuaComponent) -local REWARD_CELL_COUNT = 3 -local CELL = "app/ui/activity/act_sprint_summon_all/cell/standard_cell" - -function StandardComp:init() - local uiMap = self:getUIMap() - self.banner = uiMap["standard_comp.bg.banner"] - self.txTitle = uiMap["standard_comp.top.title_tx"] - self.txTitle2 = uiMap["standard_comp.top.title_2_tx"] - self.txDesc = uiMap["standard_comp.top.turn_bg.desc_tx"] - self.txTime = uiMap["standard_comp.top.time_bg.time_tx"] - self.goBtn = uiMap["standard_comp.top.go_bg"] - self.goTx = uiMap["standard_comp.top.go_bg.desc_tx"] - self.getBtn = uiMap["standard_comp.top.turn_reward_bg.get_btn"] - self.getTx = uiMap["standard_comp.top.turn_reward_bg.get_btn.tx"] - self.helpBtn = uiMap["standard_comp.top.title_tx.btn_help"] - if not self.rewardList then - self.rewardList = {} - for i = 1, REWARD_CELL_COUNT do - table.insert(self.rewardList, CellManager:addCellComp(uiMap["standard_comp.top.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) - end - end - self.rewardDescTx = uiMap["standard_comp.top.turn_reward_bg.desc_tx"] - self.scrollrect = uiMap["standard_comp.scrollrect"] -end - -function StandardComp:refresh(actId) - local turn = DataManager.ActTaskData:getTurnScore(actId) - local maxTurn = DataManager.ActTaskData:getMaxTurnScore(actId) - local canGetTurnReward = DataManager.ActTaskData:getCanGetTurnRewardScore(actId) - local gotAllTurnReward = DataManager.ActTaskData:getGotAllTurnRewardScore(actId) - - -- 轮次奖励 - local rewards = DataManager.ActTaskData:getRewardsgetMaxTurnScore(actId) - for i = 1, REWARD_CELL_COUNT do - local reward = rewards and rewards[i] - if reward then - self.rewardList[i].baseObject:setActive(true) - if gotAllTurnReward then - self.rewardList[i]:refreshByConfig(reward, true, true) - self.rewardList[i]:hideFrameAnimation() - else - self.rewardList[i]:refreshByConfig(reward) - if canGetTurnReward then - self.rewardList[i]:showFrameAnimation() - self.rewardList[i]:addClickListener(function() - ModuleManager.ActSprintManager:reqStandardReward(actId) - end) - else - self.rewardList[i]:hideFrameAnimation() - end - end - else - self.rewardList[i].baseObject:setActive(false) - end - end - - self.rewardDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_12)) - self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) - self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) - self.txTitle2:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_19)) - self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_9) .. "(" .. (turn >= maxTurn and maxTurn or (turn + 1)) .. "/" .. maxTurn .. ")") - self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) - self.goTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_14)) - self.goBtn:addClickListener(function() - EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, {page = GConst.MainCityConst.BOTTOM_PAGE.MAIN}) - ModuleManager.SummonManager:showSummonMainUI() - end) - self.getBtn:setActive(false) - self.helpBtn:addClickListener(function() - local params = {} - params.desc = I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_17) - ModuleManager.TipsManager:showHelpTips(params) - end) - - -- 滑动窗 - self.standardList = DataManager.ActTaskData:getActTaskListScore(actId) - if self.scrollRect == nil then - self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) - self.scrollRect:addInitCallback(function() - return CELL - end) - self.scrollRect:addRefreshCallback(function(index, cell) - cell:refresh(actId, self.standardList[index]) - end) - end - if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then - self.scrollRect:refillCells(#self.standardList) - elseif self.scrollRect:getTotalCount() ~= #self.standardList then - self.scrollRect:clearCells() - self.scrollRect:refillCells(#self.standardList) - else - self.scrollRect:updateAllCell() - end -end - -function StandardComp:updateTime() - self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) -end - -return StandardComp \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/standard_comp.lua.meta b/lua/app/ui/activity/act_sprint_summon_all/comp/standard_comp.lua.meta deleted file mode 100644 index d3ccf68a..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/standard_comp.lua.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: dfb4b457808240949843517d59105702 -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/task_comp.lua b/lua/app/ui/activity/act_sprint_summon_all/comp/task_comp.lua deleted file mode 100644 index f86ca459..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/task_comp.lua +++ /dev/null @@ -1,41 +0,0 @@ -local TaskComp = class("TaskComp", LuaComponent) -local CELL = "app/ui/activity/act_sprint_summon_all/cell/task_cell" - -function TaskComp:init() - local uiMap = self:getUIMap() - self.banner = uiMap["task_comp.bg.banner"] - self.txTitle = uiMap["task_comp.top.title_tx"] - self.txTime = uiMap["task_comp.top.time_bg.time_tx"] - self.scrollrect = uiMap["task_comp.scrollrect"] -end - -function TaskComp:refresh(actId) - self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) - self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) - self.taskList = DataManager.ActTaskData:getTaskSortList(actId) - if self.scrollRect == nil then - self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) - self.scrollRect:addInitCallback(function() - return CELL - end) - self.scrollRect:addRefreshCallback(function(index, cell) - cell:refresh(actId, self.taskList[index].id) - end) - end - if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then - self.scrollRect:refillCells(#self.taskList) - elseif self.scrollRect:getTotalCount() ~= #self.taskList then - self.scrollRect:clearCells() - self.scrollRect:refillCells(#self.taskList) - else - self.scrollRect:updateAllCell() - end -end - -function TaskComp:updateTime(actId) - self:refresh(actId) - - self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) -end - -return TaskComp \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp/task_comp.lua.meta b/lua/app/ui/activity/act_sprint_summon_all/comp/task_comp.lua.meta deleted file mode 100644 index 1e56f5e5..00000000 --- a/lua/app/ui/activity/act_sprint_summon_all/comp/task_comp.lua.meta +++ /dev/null @@ -1,10 +0,0 @@ -fileFormatVersion: 2 -guid: c132ed2b81e467745ac7ee7bd2e8b83f -ScriptedImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 2 - userData: - assetBundleName: - assetBundleVariant: - script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/common.meta b/lua/app/ui/activity/common.meta new file mode 100644 index 00000000..241cfad0 --- /dev/null +++ b/lua/app/ui/activity/common.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d11c359242fdf42ea8551a54c95e0f94 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/lua/app/ui/activity/common/act_base_ui.lua b/lua/app/ui/activity/common/act_base_ui.lua new file mode 100755 index 00000000..b3219693 --- /dev/null +++ b/lua/app/ui/activity/common/act_base_ui.lua @@ -0,0 +1,313 @@ +local ActBaseUI = class("ActBaseUI", BaseUI) + +function ActBaseUI:ctor(params) + self.page = params.page or 1 + self.ActConst = self:getActConst() +end + +function ActBaseUI:onClose() + if self.subComps then + for _, comp in pairs(self.subComps) do + if comp.onClose then + comp:onClose() + end + end + end + self.subComps = nil +end + +function ActBaseUI:onLoadRootComplete() + self:_display() + self:_addListeners() + self:_bind() + self:initComps() + + self:updateCurrencyBar() + + self:scheduleGlobal(function() + self:updateTime() + end, 0) + self:updateTime() +end + +function ActBaseUI:_display() + local uiMap = self.root:genAllChildren() + self.compsRoot = uiMap["act_main_ui.sub_comps"] + self.closeBtn = uiMap["act_main_ui.bottom.close_btn"] + -- self.titleBg = uiMap["act_main_ui.title_bg"] + self.titleTx = uiMap["act_main_ui.top.title_tx"] + self.helpBtn = uiMap["act_main_ui.title_bg.help_btn"] + self.timeTx = uiMap["act_main_ui.top.time_bg.time_tx"] + self.pageBtnsCompObj = uiMap["act_main_ui.bottom.page_btns_comp"] + self.disableBg = uiMap["act_main_ui.disable_bg"] + self.disableBg:setActive(false) + + self.pageBtns = {} + for k, idx in pairs(self:getActConst().BOTTOM_PAGE) do + self.pageBtns[idx] = uiMap["act_main_ui.bottom.btns.viewport.content.page_btn_" .. idx] + uiMap["act_main_ui.bottom.btns.viewport.content.page_btn_" .. idx .. ".text"]:setText(self:getCellName(idx)) + end +end + +function ActBaseUI:_addListeners() + self.closeBtn:addClickListener(function() + self:closeUI() + end) + + if self.helpBtn then + self.helpBtn:addClickListener(function() + if self.getHelpStr then + local params = {} + params.desc = self:getHelpStr() + ModuleManager.TipsManager:showHelpTips(params) + end + end) + end + + for i, btn in ipairs(self.pageBtns) do + btn:addClickListener(function() + self:refreshPage(i) + end, GConst.CLICK_SOUND.NONE) + end + + self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, function(params) + if not self:isClosed() then + self:closeUI() + end + end) + + -- self:addEventListener(EventManager.CUSTOM_EVENT.ACT_GAME_OPT, function(params) + -- if self.subComps[self:getActConst().BOTTOM_PAGE.GAME] then + -- self.subComps[self:getActConst().BOTTOM_PAGE.GAME]:settlementGame() + -- end + -- self:refreshPageBtns() + -- end) + + -- self:addEventListener(EventManager.CUSTOM_EVENT.ACT_TURNTABLE, function(params) + -- if not self:isClosed() and self.page == self:getActConst().BOTTOM_PAGE.TURNTABLE then + -- self.subComps[self.page]:playAni(params) + -- end + -- end) + -- self:addEventListener(EventManager.CUSTOM_EVENT.ACT_BIG_REWARD_SHOW, function(params) + -- if self:isClosed() then + -- return + -- end + -- if self.page ~= self:getActConst().BOTTOM_PAGE.TURNTABLE then + -- return + -- end + -- local rewards = DataManager[self:getActDataType()]:getBigRewards() + -- if rewards == nil or #rewards == 0 then + -- return + -- end + -- ModuleManager.ActivityManager:showBigRewardUI(self, rewards) + -- end) + -- self:addEventListener(EventManager.CUSTOM_EVENT.ACT_TRIGGER_GIFT, function() + -- if not self:isClosed() and self.page == self:getActConst().BOTTOM_PAGE.TURNTABLE then + -- self.subComps[self.page]:updateTriggerGift() + -- end + -- end) + -- self:addEventListener(EventManager.CUSTOM_EVENT.ACT_TURNTABLE_RESET, function() + -- if not self:isClosed() and self.page == self:getActConst().BOTTOM_PAGE.TURNTABLE then + -- self.subComps[self.page]:updateTurntable() + -- end + -- end) + + self:addEventListener(EventManager.CUSTOM_EVENT.CHANGE_ACTIVITY_PAGE, function(params) + self:refreshPage(params) + end) +end + +function ActBaseUI:_bind() + self:bind(DataManager.PaymentData, "isDirty", function() + self.subComps[self.page]:refresh(self, self:getActDataType()) + self:onRefresh() + end) + self:bind(DataManager.ActivityData, "isDirty", function() + self.subComps[self.page]:refresh(self, self:getActDataType()) + self:onRefresh() + end) + -- self:bind(DataManager.ActBountyData, "isDirty", function() + -- self.subComps[self.page]:refresh(self, self:getActDataType()) + -- self:onRefresh() + -- end) + self:bind(DataManager.ActTaskData, "isDirty", function() + self.subComps[self.page]:refresh(self, self:getActDataType()) + self:onRefresh() + end) + self:bind(DataManager[self:getActDataType()], "isDirty", function() + if self.page == self:getActConst().BOTTOM_PAGE.GAME then + self.subComps[self.page]:refreshStepRewardScrollrect() + else + self.subComps[self.page]:refresh(self, self:getActDataType()) + end + self:refreshPageBtns() + end) + self:bind(DataManager.ActTaskData, "isDirty", function() + self:refreshPageBtns() + end) +end + +function ActBaseUI:refreshPage(page) + -- if self.page == page then + -- return + -- end + self.page = page + self:onRefresh() +end + +function ActBaseUI:initComps() + if self.subComps then + return + end + local uiMap = self.root:genAllChildren() + self.subComps = {} + + for k, id in pairs(self:getActConst().BOTTOM_PAGE) do + if self:getActConst().COMP_NAME[id] then + -- 预制体挂载 + self.subComps[id] = CellManager:addCellComp(uiMap[self:getActConst().COMP_NAME[id]], self:getActConst().COMP[id]) + if self.subComps[id].setParentUI then + self.subComps[id]:setParentUI(self, self:getActDataType()) + end + elseif self:getActConst().COMP_PATH[id] then + -- 动态加载 + self:loadModule(self:getActConst().COMP_PATH[id], self.compsRoot, self:getActConst().COMP[id], function(comp) + if self.subComps == nil then + return + end + comp:getBaseObject():setActive(false) + self.subComps[id] = comp + if self.subComps[id].setParentUI then + self.subComps[id]:setParentUI(self, self:getActDataType()) + end + end) + end + end + + if self:getActConst().BOTTOM_PAGE.GAME then + local order = self._baseRootCanvas.sortingOrder + self.subComps[self:getActConst().BOTTOM_PAGE.GAME]:getBaseObject():setActive(true) + local uiHelper = self.subComps[self:getActConst().BOTTOM_PAGE.GAME]:getGameObject():GetComponent(GConst.TYPEOF_UNITY_CLASS.BF_UI_HELPER) + if uiHelper then + uiHelper:SetSortingOrder(order + 1) + end + end +end + +function ActBaseUI:updateTime() + if DataManager[self:getActDataType()]:getRemainTime() <= 0 then + self:closeUI() + return + end + + local remainTime = DataManager[self:getActDataType()]:getRemainTime() + if self.cacheRemainTime ~= remainTime then + self.cacheRemainTime = remainTime + if remainTime > 0 then + self.timeTx:setText(I18N:getGlobalText(I18N.GlobalConst.TIME_END_DESC_1, Time:formatNumTimeStr(remainTime))) + end + end + + for i,v in ipairs(self.subComps) do + if v.updateTime then + v:updateTime() + end + end + + if self.subComps[self:getActConst().BOTTOM_PAGE.TURNTABLE] and self.subComps[self:getActConst().BOTTOM_PAGE.TURNTABLE].updateAni then + self.subComps[self:getActConst().BOTTOM_PAGE.TURNTABLE]:updateAni() + end +end + +function ActBaseUI:onRefresh() + if not DataManager[self:getActDataType()]:getIsOpen() then + return + end + + self:refreshPanel() + self:refreshPageBtns() + + -- self.titleBg:setActive(self.page == self:getActConst().BOTTOM_PAGE.TURNTABLE) + self.titleTx:setText(self:getCellName(self.page)) + if self.helpBtn then + self.helpBtn:setActive(self.page == self:getActConst().BOTTOM_PAGE.GAME) + end +end + +function ActBaseUI:refreshPanel() + if self.subComps == nil then + return + end + + for i, comp in ipairs(self.subComps) do + comp.baseObject:setActive(i == self.page) + if i == self.page then + comp:refresh(self, self:getActDataType()) + end + end +end + +function ActBaseUI:refreshPageBtns() + if self.pageBtnInfos == nil then + self.pageBtnInfos = {} + for k, idx in pairs(self:getActConst().BOTTOM_PAGE) do + self.pageBtnInfos[idx] = {} + end + end + for k, idx in pairs(self:getActConst().BOTTOM_PAGE) do + local atlas = GConst.ATLAS_PATH.UI_ACT_COMMON + local icon = self:getPageBtnName(idx, self.page == idx) + local desc = self:getCellName(idx) + local redPoint = DataManager[self:getActDataType()]:getRpByPage(idx) + local callback = function() + self:refreshPage(idx) + end + + self.pageBtnInfos[idx].atlas = atlas + self.pageBtnInfos[idx].icon = icon + self.pageBtnInfos[idx].desc = desc + self.pageBtnInfos[idx].redPoint = redPoint + self.pageBtnInfos[idx].callback = callback + end + + if self.pageBtnsCompObj then + self.pageBtnsComp = self.pageBtnsCompObj:addLuaComponent(GConst.TYPEOF_LUA_CLASS.PAGE_BTNS_COMP) + self.pageBtnsComp:refresh(self.pageBtnInfos) + end + + for i, btn in ipairs(self.pageBtns) do + btn:setActive(self.pageBtnsComp == nil) + + local atlas = GConst.ATLAS_PATH.UI_ACT_COMMON + if self.page == i then + btn:setSprite(atlas, self:getPageBtnName(i, true)) + else + btn:setSprite(atlas, self:getPageBtnName(i, false)) + end + + if DataManager[self:getActDataType()]:getRpByPage(i) then + btn:addRedPoint(32, 20, 1) + else + btn:removeRedPoint() + end + end + self:updateCurrencyBar() +end + +function ActBaseUI:disableUITouchSelf() + self.disableBg:setActive(true) +end + +function ActBaseUI:enableUITouchSelf() + self.disableBg:setActive(false) +end + +function ActBaseUI:showTitle(show) + self.titleBg:setActive(show) +end + +function ActBaseUI:showHelp(show) + self.helpBtn:setActive(show) +end + +return ActBaseUI \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/act_sprint_main_ui.lua.meta b/lua/app/ui/activity/common/act_base_ui.lua.meta similarity index 86% rename from lua/app/ui/activity/act_sprint_summon_all/act_sprint_main_ui.lua.meta rename to lua/app/ui/activity/common/act_base_ui.lua.meta index 99d95305..09783e46 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/act_sprint_main_ui.lua.meta +++ b/lua/app/ui/activity/common/act_base_ui.lua.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ce95387387faadd4b8e34476e0a4a7df +guid: fd5fa094182204516b79faa9a691a244 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell.meta b/lua/app/ui/activity/common/cell.meta similarity index 77% rename from lua/app/ui/activity/act_sprint_summon_all/cell.meta rename to lua/app/ui/activity/common/cell.meta index 59d3e003..3b9ec817 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell.meta +++ b/lua/app/ui/activity/common/cell.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3badef5720aa26742a9d6e505bd0b80e +guid: ab77b2271d1b244cbbbe384dc87f447b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/login_cell.lua b/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua similarity index 94% rename from lua/app/ui/activity/act_sprint_summon_all/cell/login_cell.lua rename to lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua index eeb998e0..7a7f6c2d 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/login_cell.lua +++ b/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua @@ -1,6 +1,6 @@ -local SummonActCell = class("SummonActCell", BaseCell) +local ActBountyCellV1 = class("ActBountyCellV1", BaseCell) -function SummonActCell:init() +function ActBountyCellV1:init() local uiMap = self:getUIMap() self.dayIcon = uiMap["bounty_cell.day_icon"] self.dayTx = uiMap["bounty_cell.day_icon.day_tx"] @@ -16,7 +16,7 @@ function SummonActCell:init() self.proRewardCells[i] = uiMap["bounty_cell.reward_pro.reward_cell_" .. i]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) end end -function SummonActCell:refresh(day, maxDay, info) +function ActBountyCellV1:refresh(day, maxDay, info) local curDay = DataManager.ActSprintSummonDataAll:getBountyCurrDay() local freeGot = DataManager.ActSprintSummonDataAll:getHasGotBountyReward(0, day) local proGot = DataManager.ActSprintSummonDataAll:getHasGotBountyReward(1, day) @@ -83,11 +83,11 @@ function SummonActCell:refresh(day, maxDay, info) end end -function SummonActCell:onClickClaimRewards() +function ActBountyCellV1:onClickClaimRewards() local actId = DataManager.ActSprintSummonDataAll:getActId() local actType = DataManager.ActivityData:getActType(actId) local grade = DataManager.ActSprintSummonDataAll:isUnlockBountyPro() and 1 or 0 ModuleManager.ActSprintManager:reqSprintBountySign(actType, actId, grade) end -return SummonActCell \ No newline at end of file +return ActBountyCellV1 \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/standard_cell.lua.meta b/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua.meta similarity index 86% rename from lua/app/ui/activity/act_sprint_summon_all/cell/standard_cell.lua.meta rename to lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua.meta index f0972199..edefd863 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/standard_cell.lua.meta +++ b/lua/app/ui/activity/common/cell/act_bounty_cell_v1.lua.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5a3367bd1aee89d4f8df29c64f7e9685 +guid: 5ce8b4d60daf2423789a32f157a2b2f2 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/gift_cell.lua b/lua/app/ui/activity/common/cell/act_gift_cell_v1.lua similarity index 97% rename from lua/app/ui/activity/act_sprint_summon_all/cell/gift_cell.lua rename to lua/app/ui/activity/common/cell/act_gift_cell_v1.lua index a8999cfc..65d0e134 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/gift_cell.lua +++ b/lua/app/ui/activity/common/cell/act_gift_cell_v1.lua @@ -1,4 +1,4 @@ -local GiftCell = class("GiftCell", BaseCell) +local ActGiftCellV1 = class("ActGiftCellV1", BaseCell) local REWARD_CELL_COUNT = 3 local BG_NAME_1 = "act_common_bg_27" -- 售罄 @@ -7,7 +7,7 @@ local BG_NAME_2 = "act_common_bg_28" -- 正常 local BTN_NAME_1 = "common_btn_grey_5" local BTN_NAME_2 = "common_btn_yellow_5" -function GiftCell:refresh(actId, actGiftId) +function ActGiftCellV1:refresh(actId, actGiftId) local uiMap = self:getUIMap() local bg = uiMap["gift_cell.bg"] local descTx = uiMap["gift_cell.bg.desc_tx"] @@ -117,4 +117,4 @@ function GiftCell:refresh(actId, actGiftId) end) end -return GiftCell \ No newline at end of file +return ActGiftCellV1 \ No newline at end of file diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/gift_cell.lua.meta b/lua/app/ui/activity/common/cell/act_gift_cell_v1.lua.meta similarity index 86% rename from lua/app/ui/activity/act_sprint_summon_all/cell/gift_cell.lua.meta rename to lua/app/ui/activity/common/cell/act_gift_cell_v1.lua.meta index 2337f712..0325b339 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/gift_cell.lua.meta +++ b/lua/app/ui/activity/common/cell/act_gift_cell_v1.lua.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d5597e85c63eaf342b933c03bbf3cf7c +guid: d997dbc05c6d246b4ab622b6b814bdc0 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/standard_cell.lua b/lua/app/ui/activity/common/cell/act_score_task_cell_v1.lua similarity index 51% rename from lua/app/ui/activity/act_sprint_summon_all/cell/standard_cell.lua rename to lua/app/ui/activity/common/cell/act_score_task_cell_v1.lua index 544fb9d3..782080a4 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/standard_cell.lua +++ b/lua/app/ui/activity/common/cell/act_score_task_cell_v1.lua @@ -1,39 +1,30 @@ -local StandardCell = class("StandardCell", BaseCell) +local ActScoreTaskCellV1 = class("ActScoreTaskCellV1", BaseCell) local REWARD_CELL_COUNT = 3 -function StandardCell:refresh(actId, actTaskId) +function ActScoreTaskCellV1:init() local uiMap = self:getUIMap() - local bg = uiMap["standard_cell.bg"] - local descTx = uiMap["standard_cell.bg.desc_tx"] - if not self.slider then - self.slider = uiMap["standard_cell.bg.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) + self.descTx = uiMap["task_cell.bg.desc_tx"] + self.slider = uiMap["task_cell.bg.slider_bg.slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER) + self.sliderTx = uiMap["task_cell.bg.slider_bg.slider_tx"] + self.rewardLayout = uiMap["task_cell.bg.rewards"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT) + self.rewardList = {} + for i = 1, REWARD_CELL_COUNT do + table.insert(self.rewardList, CellManager:addCellComp(uiMap["task_cell.bg.rewards.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) end - local sliderTx = uiMap["standard_cell.bg.slider_bg.tx"] - if not self.rewardList then - self.rewardList = {} - for i = 1, REWARD_CELL_COUNT do - table.insert(self.rewardList, CellManager:addCellComp(uiMap["standard_cell.bg.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) - end - end - local rewardLayout = uiMap["standard_cell.bg.rewards"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_HORIZONTAL_OR_VERTICAL_LAYOUT) +end +function ActScoreTaskCellV1:refresh(actId, actTaskId) local num = DataManager.ActTaskData:getTaskNumScore(actId, actTaskId) local type = DataManager.ActTaskData:getTaskType(actTaskId) local limit = DataManager.ActTaskData:getTaskTarget(actTaskId) local rewards = DataManager.ActTaskData:getTaskReward(actTaskId) local hasGot = DataManager.ActTaskData:getHasGotTaskRewardScore(actId, actTaskId) local canGet = num >= limit and not hasGot - -- 修订 - if num > limit then - num = limit - end - if hasGot then - num = limit - end + num = math.min(num, limit) - descTx:setText(GFunc.getTaskDesc(type, limit)) + self.descTx:setText(GFunc.getTaskDesc(type, limit)) self.slider.value = num / limit - sliderTx:setText(num .. "/" .. limit) + self.sliderTx:setText(num .. "/" .. limit) for i = 1, REWARD_CELL_COUNT do local reward = rewards and rewards[i] if reward then @@ -51,7 +42,7 @@ function StandardCell:refresh(actId, actTaskId) self.rewardList[i].baseObject:setActive(false) end end - rewardLayout:RefreshLayout() + self.rewardLayout:RefreshLayout() end -return StandardCell \ No newline at end of file +return ActScoreTaskCellV1 \ No newline at end of file diff --git a/lua/app/ui/activity/common/cell/act_score_task_cell_v1.lua.meta b/lua/app/ui/activity/common/cell/act_score_task_cell_v1.lua.meta new file mode 100644 index 00000000..38ee6b53 --- /dev/null +++ b/lua/app/ui/activity/common/cell/act_score_task_cell_v1.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 33b9c94c8bc5e41d590d6c5374e71089 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/act_sprint_summon_all/cell/task_cell.lua b/lua/app/ui/activity/common/cell/act_task_cell_v1.lua similarity index 95% rename from lua/app/ui/activity/act_sprint_summon_all/cell/task_cell.lua rename to lua/app/ui/activity/common/cell/act_task_cell_v1.lua index 5605ce5d..fc47612d 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/cell/task_cell.lua +++ b/lua/app/ui/activity/common/cell/act_task_cell_v1.lua @@ -1,7 +1,7 @@ -local TaskCell = class("TaskCell", BaseCell) +local ActTaskCellV1 = class("ActTaskCellV1", BaseCell) local REWARD_CELL_COUNT = 1 -function TaskCell:refresh(actId, actTaskId) +function ActTaskCellV1:refresh(actId, actTaskId) local uiMap = self:getUIMap() local bg = uiMap["task_cell.bg"] local descTx = uiMap["task_cell.bg.desc_tx"] @@ -73,4 +73,4 @@ function TaskCell:refresh(actId, actTaskId) end) end -return TaskCell \ No newline at end of file +return ActTaskCellV1 \ No newline at end of file diff --git a/lua/app/ui/activity/common/cell/act_task_cell_v1.lua.meta b/lua/app/ui/activity/common/cell/act_task_cell_v1.lua.meta new file mode 100644 index 00000000..03ac79e6 --- /dev/null +++ b/lua/app/ui/activity/common/cell/act_task_cell_v1.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: f4d1094a59d134a61a30e3fb96ba5a00 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/act_sprint_summon_all/comp.meta b/lua/app/ui/activity/common/comp.meta similarity index 77% rename from lua/app/ui/activity/act_sprint_summon_all/comp.meta rename to lua/app/ui/activity/common/comp.meta index 1ef7fada..deb7f80d 100644 --- a/lua/app/ui/activity/act_sprint_summon_all/comp.meta +++ b/lua/app/ui/activity/common/comp.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b984e5e58db26214e9e8c0bcfb43f0c8 +guid: 69dd1296158324e85b356ff70401bb9a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/lua/app/ui/activity/common/comp/act_bounty_comp_v1.lua b/lua/app/ui/activity/common/comp/act_bounty_comp_v1.lua new file mode 100644 index 00000000..126b04b7 --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_bounty_comp_v1.lua @@ -0,0 +1,71 @@ +local ActBountyCompV1 = class("ActBountyCompV1", LuaComponent) + +local CELL = "app/ui/activity/common/cell/act_bounty_cell_v1" + +function ActBountyCompV1:init() + local uiMap = self:getUIMap() + -- self.txTitle = uiMap["act_bounty_comp_v1.top.title_tx"] + -- self.txTime = uiMap["act_bounty_comp_v1.top.time_bg.time_tx"] + -- self.banner = uiMap["act_bounty_comp_v1.top.banner"] + self.scrollrectPrefab = uiMap["act_bounty_comp_v1.scrollrect"] + self.scrollrect = self.scrollrectPrefab:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) + + self.getBtn = uiMap["act_bounty_comp_v1.get_btn"] + self.getBtn:addClickListener(function() + local actId = self.data:getActId() + local actType = self.data:getActType(actId) + local grade = self.data:isUnlockBountyPro() and 1 or 0 + ModuleManager.ActSprintManager:reqSprintBountySign(actType, actId, grade) + end) + self.getBtnTx = uiMap["act_bounty_comp_v1.get_btn.text"] + self.getBtnTx:setText(I18N:getGlobalText(I18N.GlobalConst.ONE_KEY_GET_DESC)) + self.payBtn = uiMap["act_bounty_comp_v1.pay_btn"] + self.payBtn:addClickListener(function() + if self.data:isUnlockBountyPro() then + return + end + local giftId = self.data:getBountyProGiftId() + ModuleManager.ActSprintManager:onBuyBountyPro(giftId) + end) + self.payBtnTx = uiMap["act_bounty_comp_v1.pay_btn.text"] + + uiMap["act_bounty_comp_v1.scrollrect.title.level_tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_HERO_SUIT_DESC_4)) + uiMap["act_bounty_comp_v1.scrollrect.title.desc_tx_1"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_HERO_SUIT_DESC_5)) + uiMap["act_bounty_comp_v1.scrollrect.title.desc_tx_2"]:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_HERO_SUIT_DESC_6)) + + self.scrollrect:addInitCallback(function() + return CELL + end) + self.scrollrect:addRefreshCallback(function(index, cell) + cell:refresh(index, #self.cfgList, self.cfgList[index]) + end) + self.scrollrect:clearCells() +end + +-- function ActBountyCompV1:updateTime() +-- self.txTime:setText(Time:formatNumTimeStr(self.data:getRemainTime())) +-- end + +function ActBountyCompV1:setParentUI(parentUI, dataKey) + self.parentUI = parentUI + self.dataKey = dataKey + self.data = DataManager[dataKey] +end + +function ActBountyCompV1:refresh() + local actId = self.data:getActId() + -- self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) + -- self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) + self.getBtn:setActive(self.data:isHaveUnclaimedBountyReward()) + self.payBtn:setActive(not self.data:isUnlockBountyPro()) + local rechargeId = self.data:getBountyProRechargeId() + self.payBtnTx:setText(GFunc.getFormatPrice(rechargeId)) + self:refreshScrollRect() +end + +function ActBountyCompV1:refreshScrollRect() + self.cfgList = self.data:getBountyCfgList() + self.scrollrect:refillCells(#self.cfgList) +end + +return ActBountyCompV1 \ No newline at end of file diff --git a/lua/app/ui/activity/common/comp/act_bounty_comp_v1.lua.meta b/lua/app/ui/activity/common/comp/act_bounty_comp_v1.lua.meta new file mode 100644 index 00000000..01bcea36 --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_bounty_comp_v1.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 0bd82003a833c4184aed7439b2839bc0 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/common/comp/act_gift_comp_v1.lua b/lua/app/ui/activity/common/comp/act_gift_comp_v1.lua new file mode 100644 index 00000000..be1881ca --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_gift_comp_v1.lua @@ -0,0 +1,44 @@ +local GiftCompV1 = class("GiftCompV1", LuaComponent) +local CELL = "app/ui/activity/common/cell/act_gift_cell_v1" + +function GiftCompV1:init() + local uiMap = self:getUIMap() + -- self.banner = uiMap["gift_comp.bg.banner"] + -- self.txTitle = uiMap["gift_comp.top.title_tx"] + -- self.txTime = uiMap["gift_comp.top.time_bg.time_tx"] + self.scrollrect = uiMap["gift_comp.scrollrect"] + self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) + self.scrollRect:addInitCallback(function() + return CELL + end) + self.scrollRect:addRefreshCallback(function(index, cell) + cell:refresh(self.data:getActId(), self.giftList[index]) + end) +end + +function GiftCompV1:setParentUI(parentUI, dataKey) + self.parentUI = parentUI + self.dataKey = dataKey + self.data = DataManager[dataKey] +end + +function GiftCompV1:refresh() + local actId = self.data:getActId() + -- self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) + -- self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) + self.giftList = DataManager.ActGiftData:getGiftIdsSort(actId) + if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then + self.scrollRect:refillCells(#self.giftList) + elseif self.scrollRect:getTotalCount() ~= #self.giftList then + self.scrollRect:clearCells() + self.scrollRect:refillCells(#self.giftList) + else + self.scrollRect:updateAllCell() + end +end + +-- function GiftCompV1:updateTime() +-- self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) +-- end + +return GiftCompV1 \ No newline at end of file diff --git a/lua/app/ui/activity/common/comp/act_gift_comp_v1.lua.meta b/lua/app/ui/activity/common/comp/act_gift_comp_v1.lua.meta new file mode 100644 index 00000000..df2da70c --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_gift_comp_v1.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e168e0ab54e114033b05bd855c7af7ac +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/common/comp/act_score_task_comp_v1.lua b/lua/app/ui/activity/common/comp/act_score_task_comp_v1.lua new file mode 100644 index 00000000..1d7586f8 --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_score_task_comp_v1.lua @@ -0,0 +1,108 @@ +local ActScoreTaskCompV1 = class("ActScoreTaskCompV1", LuaComponent) +local REWARD_CELL_COUNT = 3 +local CELL = "app/ui/activity/common/cell/act_score_task_cell_v1" + +function ActScoreTaskCompV1:init() + local uiMap = self:getUIMap() + -- self.banner = uiMap["act_score_task_comp_v1.bg.banner"] + self.txTitle = uiMap["act_score_task_comp_v1.top.title_tx"] + self.txTitle2 = uiMap["act_score_task_comp_v1.top.desc_tx"] + self.txDesc = uiMap["act_score_task_comp_v1.top.turn_bg.desc_tx"] + self.txTime = uiMap["act_score_task_comp_v1.top.time_bg.time_tx"] + self.goBtn = uiMap["act_score_task_comp_v1.top.go_btn"] + self.goTx = uiMap["act_score_task_comp_v1.top.go_btn.text"] + self.getBtn = uiMap["act_score_task_comp_v1.top.turn_reward_bg.get_btn"] + self.getTx = uiMap["act_score_task_comp_v1.top.turn_reward_bg.get_btn.text"] + self.helpBtn = uiMap["act_score_task_comp_v1.top.title_tx.help_btn"] + if not self.rewardList then + self.rewardList = {} + for i = 1, REWARD_CELL_COUNT do + table.insert(self.rewardList, CellManager:addCellComp(uiMap["act_score_task_comp_v1.top.turn_reward_bg.reward_cell_" .. i], GConst.TYPEOF_LUA_CLASS.REWARD_CELL)) + end + end + self.rewardDescTx = uiMap["act_score_task_comp_v1.top.turn_reward_bg.desc_tx"] + self.scrollrect = uiMap["act_score_task_comp_v1.scrollrect"] +end + +function ActScoreTaskCompV1:setParentUI(parentUI, dataKey) + self.parentUI = parentUI + self.dataKey = dataKey + self.data = DataManager[dataKey] +end + +function ActScoreTaskCompV1:refresh() + local actId = self.data:getActId() + local turn = DataManager.ActTaskData:getTurnScore(actId) + local maxTurn = DataManager.ActTaskData:getMaxTurnScore(actId) + local canGetTurnReward = DataManager.ActTaskData:getCanGetTurnRewardScore(actId) + local gotAllTurnReward = DataManager.ActTaskData:getGotAllTurnRewardScore(actId) + + -- 轮次奖励 + local rewards = DataManager.ActTaskData:getRewardsgetMaxTurnScore(actId) + for i = 1, REWARD_CELL_COUNT do + local reward = rewards and rewards[i] + if reward then + self.rewardList[i].baseObject:setActive(true) + if gotAllTurnReward then + self.rewardList[i]:refreshByConfig(reward, true, true) + self.rewardList[i]:hideFrameAnimation() + else + self.rewardList[i]:refreshByConfig(reward) + if canGetTurnReward then + self.rewardList[i]:showFrameAnimation() + self.rewardList[i]:addClickListener(function() + ModuleManager.ActSprintManager:reqStandardReward(actId) + end) + else + self.rewardList[i]:hideFrameAnimation() + end + end + else + self.rewardList[i].baseObject:setActive(false) + end + end + + self.rewardDescTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_12)) + -- self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) + self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) + self.txTitle2:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_19)) + self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_9) .. "(" .. (turn >= maxTurn and maxTurn or (turn + 1)) .. "/" .. maxTurn .. ")") + self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) + self.goTx:setText(I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_14)) + self.goBtn:addClickListener(function() + EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CHANGE_MAIN_CITY_PAGE, {page = GConst.MainCityConst.BOTTOM_PAGE.MAIN}) + ModuleManager.SummonManager:showSummonMainUI() + end) + self.getBtn:setActive(false) + self.helpBtn:addClickListener(function() + local params = {} + params.desc = I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_17) + ModuleManager.TipsManager:showHelpTips(params) + end) + + -- 滑动窗 + self.standardList = DataManager.ActTaskData:getActTaskListScore(actId) + if self.scrollRect == nil then + self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) + self.scrollRect:addInitCallback(function() + return CELL + end) + self.scrollRect:addRefreshCallback(function(index, cell) + cell:refresh(actId, self.standardList[index]) + end) + end + if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then + self.scrollRect:refillCells(#self.standardList) + elseif self.scrollRect:getTotalCount() ~= #self.standardList then + self.scrollRect:clearCells() + self.scrollRect:refillCells(#self.standardList) + else + self.scrollRect:updateAllCell() + end +end + +function ActScoreTaskCompV1:updateTime() + self.txTime:setText(Time:formatNumTimeStr(self.data:getRemainTime())) +end + +return ActScoreTaskCompV1 \ No newline at end of file diff --git a/lua/app/ui/activity/common/comp/act_score_task_comp_v1.lua.meta b/lua/app/ui/activity/common/comp/act_score_task_comp_v1.lua.meta new file mode 100644 index 00000000..6c0ea685 --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_score_task_comp_v1.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: cd7be761f6df9492caad86e156477b67 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/activity/common/comp/act_task_comp_v1.lua b/lua/app/ui/activity/common/comp/act_task_comp_v1.lua new file mode 100644 index 00000000..3071e92a --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_task_comp_v1.lua @@ -0,0 +1,46 @@ +local TaskCompV1 = class("TaskCompV1", LuaComponent) +local CELL = "app/ui/activity/common/cell/act_task_cell_v1" + +function TaskCompV1:init() + local uiMap = self:getUIMap() + -- self.banner = uiMap["task_comp.bg.banner"] + -- self.txTitle = uiMap["task_comp.top.title_tx"] + -- self.txTime = uiMap["task_comp.top.time_bg.time_tx"] + self.scrollrect = uiMap["task_comp.scrollrect"] + self.scrollRect = self.scrollrect:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) + self.scrollRect:addInitCallback(function() + return CELL + end) + self.scrollRect:addRefreshCallback(function(index, cell) + cell:refresh(self.data:getActId(), self.taskList[index].id) + end) +end + +function TaskCompV1:setParentUI(parentUI, dataKey) + self.parentUI = parentUI + self.dataKey = dataKey + self.data = DataManager[dataKey] +end + +function TaskCompV1:refresh() + local actId = self.data:getActId() + -- self.txTitle:setText(I18N:getGlobalText(GConst.ActSprintConst.ACT_LIST_NAME[actId])) + -- self.banner:setTexture(GConst.ActSprintConst.ACT_MAIN_BANNER[actId]) + self.taskList = DataManager.ActTaskData:getTaskSortList(actId) + if self.scrollRect:getTotalCount() == nil or self.scrollRect:getTotalCount() <= 0 then + self.scrollRect:refillCells(#self.taskList) + elseif self.scrollRect:getTotalCount() ~= #self.taskList then + self.scrollRect:clearCells() + self.scrollRect:refillCells(#self.taskList) + else + self.scrollRect:updateAllCell() + end +end + +-- function TaskCompV1:updateTime(actId) +-- self:refresh(actId) + +-- self.txTime:setText(Time:formatNumTimeStr(DataManager.ActSprintSummonDataAll:getRemainTime())) +-- end + +return TaskCompV1 \ No newline at end of file diff --git a/lua/app/ui/activity/common/comp/act_task_comp_v1.lua.meta b/lua/app/ui/activity/common/comp/act_task_comp_v1.lua.meta new file mode 100644 index 00000000..aa2c133e --- /dev/null +++ b/lua/app/ui/activity/common/comp/act_task_comp_v1.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7d0ec30b8ad2e4b74ac719c3dc260289 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/main_city/main_city_ui.lua b/lua/app/ui/main_city/main_city_ui.lua index 464cc542..c94a7a73 100644 --- a/lua/app/ui/main_city/main_city_ui.lua +++ b/lua/app/ui/main_city/main_city_ui.lua @@ -710,25 +710,6 @@ function MainCityUI:checkMainPop() -- ModuleManager.FullMoonManager:showActMainUI(showType) -- return -- end - - -- 金猪满了后下次进主城要弹出来 - -- if DataManager.GoldPigData:getPopFlag() and not DataManager.TutorialData:getIsInTutorial() then - -- DataManager.GoldPigData:markPop() - -- local showType = BIReport.PAY_UI_SHOW_TYPE.TRIGGER_POP - -- if self.isFirstEnter then - -- showType = BIReport.PAY_UI_SHOW_TYPE.LOGIN_POP - -- end - -- ModuleManager.ActivityManager:showGoldPigUI(showType) - -- return - -- end - - -- if DataManager.ActBossRushData:getIsOpen() and not DataManager.TutorialData:getIsInTutorial() then -- 弹窗 - -- if not DataManager.ActBossRushData:getMarkPoped() then - -- if ModuleManager.ActBossRushManager:showPopUI() then - -- return - -- end - -- end - -- end end -- 检查引导 diff --git a/lua/app/userdata/activity/act_sprint/act_sprint_summon_data_all.lua b/lua/app/userdata/activity/act_sprint/act_sprint_summon_data_all.lua index a1ac99eb..0ed50f70 100644 --- a/lua/app/userdata/activity/act_sprint/act_sprint_summon_data_all.lua +++ b/lua/app/userdata/activity/act_sprint/act_sprint_summon_data_all.lua @@ -256,10 +256,6 @@ function ActSprintSummonData:getIsShow() return true end -function ActSprintSummonData:getActId() - return self.actId -end - function ActSprintSummonData:clearActId() self.actId = nil end @@ -363,6 +359,19 @@ function ActSprintSummonData:hasRedPoint() return false end +function ActSprintSummonData:getRpByPage(page) + if page == 1 then + return self:hasStandardRp() + elseif page == 2 then + return self:hasBountyRp() + elseif page == 3 then + return self:hasGiftRp() + elseif page == 4 then + return self:hasTaskRp() + end + return false +end + function ActSprintSummonData:getActNameStr() return I18N:getGlobalText(I18N.GlobalConst.ACT_GOGOGO_DESC_1) end diff --git a/lua/app/userdata/payment/payment_data.lua b/lua/app/userdata/payment/payment_data.lua index 7aebc17a..111fe625 100755 --- a/lua/app/userdata/payment/payment_data.lua +++ b/lua/app/userdata/payment/payment_data.lua @@ -206,9 +206,6 @@ function PaymentData:updateGiftInfo(gift, rewards) if giftType == PayManager.PURCHARSE_TYPE.SHOP_GEM then DataManager.ShopData:setDirty() - elseif giftType == PayManager.PURCHARSE_TYPE.ACT_GOLD_PIG then - BIReport:postGoldPigRewardOpt(DataManager.GoldPigData:getCacheInfo()) - DataManager.GoldPigData:setBought() elseif giftType == PayManager.PURCHARSE_TYPE.GIFT_ROUTINE then DataManager.GiftRoutineData:setDirty() elseif giftType == PayManager.PURCHARSE_TYPE.ACT_GIFT then