From bafb8673ecfa2d3a2442d48e5aef1e74d72ea613 Mon Sep 17 00:00:00 2001 From: Fang Date: Thu, 20 Jul 2023 11:47:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E5=A4=87=E5=8D=87=E7=BA=A7=E6=9D=90?= =?UTF-8?q?=E6=96=99=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../strings/cn/chapter_dungeon_equip.lua | 16 +-- lua/app/config/strings/cn/global.lua | 2 +- lua/app/global/global_const.lua | 1 + lua/app/module/common/common_manager.lua | 6 +- lua/app/module/dungeon/dungeon_const.lua | 9 ++ lua/app/module/dungeon/dungeon_const.lua.meta | 10 ++ .../dungeon_armor/dungeon_armor_manager.lua | 7 +- .../dungeon_weapon/dungeon_weapon_manager.lua | 7 +- lua/app/module/equip/equip_manager.lua | 10 +- lua/app/ui/common/cell/reward_cell.lua | 2 +- lua/app/ui/common/mop_up_ui.lua | 24 ++-- lua/app/ui/dungeon/cell.meta | 8 ++ .../ui/dungeon/cell/dungeon_target_cell.lua | 121 ++++++++++++++++++ .../dungeon/cell/dungeon_target_cell.lua.meta | 10 ++ lua/app/ui/dungeon/item_get_ui.lua | 93 ++++++++++++++ lua/app/ui/dungeon/item_get_ui.lua.meta | 10 ++ .../userdata/dungeon/dungeon_armor_entity.lua | 2 +- 17 files changed, 298 insertions(+), 40 deletions(-) create mode 100644 lua/app/module/dungeon/dungeon_const.lua create mode 100644 lua/app/module/dungeon/dungeon_const.lua.meta create mode 100644 lua/app/ui/dungeon/cell.meta create mode 100644 lua/app/ui/dungeon/cell/dungeon_target_cell.lua create mode 100644 lua/app/ui/dungeon/cell/dungeon_target_cell.lua.meta create mode 100644 lua/app/ui/dungeon/item_get_ui.lua create mode 100644 lua/app/ui/dungeon/item_get_ui.lua.meta diff --git a/lua/app/config/strings/cn/chapter_dungeon_equip.lua b/lua/app/config/strings/cn/chapter_dungeon_equip.lua index 85f4ef55..05adbccd 100644 --- a/lua/app/config/strings/cn/chapter_dungeon_equip.lua +++ b/lua/app/config/strings/cn/chapter_dungeon_equip.lua @@ -5,7 +5,7 @@ local chapter_dungeon_equip = { }, [2]={ ["name"]="诅咒灯灵(第2层)", - ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" + ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" }, [3]={ ["name"]="黄金灯灵(第3层)", @@ -17,7 +17,7 @@ local chapter_dungeon_equip = { }, [5]={ ["name"]="霜峰灯灵(第5层)", - ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" + ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" }, [6]={ ["name"]="邪眸灯灵(第6层)", @@ -25,7 +25,7 @@ local chapter_dungeon_equip = { }, [7]={ ["name"]="诅咒灯灵(第7层)", - ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" + ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" }, [8]={ ["name"]="黄金灯灵(第8层)", @@ -37,7 +37,7 @@ local chapter_dungeon_equip = { }, [10]={ ["name"]="霜峰灯灵(第10层)", - ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" + ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" }, [11]={ ["name"]="邪眸灯灵(第11层)", @@ -45,7 +45,7 @@ local chapter_dungeon_equip = { }, [12]={ ["name"]="诅咒灯灵(第12层)", - ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" + ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" }, [13]={ ["name"]="黄金灯灵(第13层)", @@ -57,7 +57,7 @@ local chapter_dungeon_equip = { }, [15]={ ["name"]="霜峰灯灵(第15层)", - ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" + ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" }, [16]={ ["name"]="邪眸灯灵(第16层)", @@ -65,7 +65,7 @@ local chapter_dungeon_equip = { }, [17]={ ["name"]="诅咒灯灵(第17层)", - ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" + ["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了邪恶的诅咒。" }, [18]={ ["name"]="黄金灯灵(第18层)", @@ -77,7 +77,7 @@ local chapter_dungeon_equip = { }, [20]={ ["name"]="霜峰灯灵(第20层)", - ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" + ["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了冰霜的奥秘。" } } local config = { diff --git a/lua/app/config/strings/cn/global.lua b/lua/app/config/strings/cn/global.lua index 61c4ca64..91a62c66 100644 --- a/lua/app/config/strings/cn/global.lua +++ b/lua/app/config/strings/cn/global.lua @@ -353,7 +353,7 @@ local localization_global = ["DUNGEON_ARMOR_DESC_1"] = "时空裂隙", ["DUNGEON_ARMOR_DESC_2"] = "1.时空裂隙将根据主线章节进行解锁。\n2.三星通关可对裂隙进行扫荡获得防具材料。\n3.关卡通关后,每天将重置挑战次数。", ["DUNGEON_ARMOR_DESC_3"] = "与曾经的对手相遇,战胜他们获取防具材料。", - ["DUNGEON_WEAPON_DESC_1"] = "最强灯神", + ["DUNGEON_WEAPON_DESC_1"] = "灯神之塔", ["DUNGEON_WEAPON_DESC_2"] = "1.灯神层数将根据等级进行解锁。\n2.通关后可进行扫荡。\n3.所有层数的扫荡次数共用,每日重置。", ["DUNGEON_WEAPON_DESC_3"] = "挑战灯神们,获得珍贵的武器材料。", ["DUNGEON_WEAPON_DESC_4"] = "阵容修改", diff --git a/lua/app/global/global_const.lua b/lua/app/global/global_const.lua index d64fce8b..17ff189a 100644 --- a/lua/app/global/global_const.lua +++ b/lua/app/global/global_const.lua @@ -13,6 +13,7 @@ local CONST_PATHS = { HeroConst = "app/module/hero/hero_const", FormationConst = "app/module/formation/formation_const", EquipConst = "app/module/equip/equip_const", + DungeonConst = "app/module/dungeon/dungeon_const", ShopConst = "app/module/shop/shop_const", SummonConst = "app/module/summon/summon_const", MailConst = "app/module/mail/mail_const", diff --git a/lua/app/module/common/common_manager.lua b/lua/app/module/common/common_manager.lua index 92b789d4..81a19d06 100644 --- a/lua/app/module/common/common_manager.lua +++ b/lua/app/module/common/common_manager.lua @@ -1,6 +1,6 @@ local CommonManager = class("CommonManager", BaseModule) -function CommonManager:showMopUpUI(rewards, remainCount, callback, customtitleTx, targetReward, targetDesc, targetTotalProgress) +function CommonManager:showMopUpUI(rewards, remainCount, callback, customtitleTx, target) local params = { customtitleTx = customtitleTx, rewards = rewards, @@ -8,9 +8,7 @@ function CommonManager:showMopUpUI(rewards, remainCount, callback, customtitleTx callback = callback, ---- 有目标的扫荡 可为nil - targetReward = targetReward, - targetDesc = targetDesc, - targetTotalProgress = targetTotalProgress, + target = target, } UIManager:showUI("app/ui/common/mop_up_ui", params) end diff --git a/lua/app/module/dungeon/dungeon_const.lua b/lua/app/module/dungeon/dungeon_const.lua new file mode 100644 index 00000000..439c1d33 --- /dev/null +++ b/lua/app/module/dungeon/dungeon_const.lua @@ -0,0 +1,9 @@ +local DungeonConst = {} + +-- 副本类型类型 +DungeonConst.TYPE = { + WEAPON = 1, -- 武器副本 + ARMOR = 2, -- 防具副本 +} + +return DungeonConst \ No newline at end of file diff --git a/lua/app/module/dungeon/dungeon_const.lua.meta b/lua/app/module/dungeon/dungeon_const.lua.meta new file mode 100644 index 00000000..e602cd0c --- /dev/null +++ b/lua/app/module/dungeon/dungeon_const.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 843d929b86535d944be8159e39194b90 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/module/dungeon_armor/dungeon_armor_manager.lua b/lua/app/module/dungeon_armor/dungeon_armor_manager.lua index c551dfda..f9ab48ad 100644 --- a/lua/app/module/dungeon_armor/dungeon_armor_manager.lua +++ b/lua/app/module/dungeon_armor/dungeon_armor_manager.lua @@ -94,7 +94,7 @@ function DungeonArmorManager:rsqEndChallenge(result) end -- 请求扫荡副本 -function DungeonArmorManager:reqSweep(chapterId) +function DungeonArmorManager:reqSweep(chapterId, target) local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR) -- 判断次数 @@ -116,6 +116,7 @@ function DungeonArmorManager:reqSweep(chapterId) local parmas = { chapter_armor_id = chapterId, + target = target, -- 扫荡目标(客户端用) } self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterArmorChallengeFarmReq, parmas, {}, self.respSweep, BIReport.ITEM_GET_TYPE.DUNGEON_ARMOR_SWEEP) end @@ -135,9 +136,9 @@ function DungeonArmorManager:respSweep(result) GFunc.mergeRewards2(result.rewards, newRewards) ModuleManager.CommonManager:showMopUpUI(newRewards, remainCount, function() if result.reqData then - self:reqSweep(result.reqData.chapter_armor_id) + self:reqSweep(result.reqData.chapter_armor_id, result.reqData.target) end - end) + end, nil, result.reqData.target) end end diff --git a/lua/app/module/dungeon_weapon/dungeon_weapon_manager.lua b/lua/app/module/dungeon_weapon/dungeon_weapon_manager.lua index 5a12faf5..0106643f 100644 --- a/lua/app/module/dungeon_weapon/dungeon_weapon_manager.lua +++ b/lua/app/module/dungeon_weapon/dungeon_weapon_manager.lua @@ -95,7 +95,7 @@ function DungeonWeaponManager:rsqEndChallenge(result) end -- 请求扫荡副本 -function DungeonWeaponManager:reqSweep(chapterId) +function DungeonWeaponManager:reqSweep(chapterId, target) local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON) -- 判断次数 @@ -110,6 +110,7 @@ function DungeonWeaponManager:reqSweep(chapterId) local parmas = { chapter_weapon_id = chapterId, + target = target, -- 扫荡目标(客户端用) } self:sendMessage(ProtoMsgType.FromMsgEnum.ChapterWeaponChallengeFarmReq, parmas, {}, self.respSweep, BIReport.ITEM_GET_TYPE.DUNGEON_WEAPON_SWEEP) end @@ -125,8 +126,8 @@ function DungeonWeaponManager:respSweep(result) local newRewards = {} GFunc.mergeRewards2(result.rewards, newRewards) ModuleManager.CommonManager:showMopUpUI(newRewards, remainCount, function() - self:reqSweep(result.reqData.chapter_weapon_id) - end) + self:reqSweep(result.reqData.chapter_weapon_id, result.reqData.target) + end, nil, result.reqData.target) end end diff --git a/lua/app/module/equip/equip_manager.lua b/lua/app/module/equip/equip_manager.lua index bca09d29..a81ebd78 100644 --- a/lua/app/module/equip/equip_manager.lua +++ b/lua/app/module/equip/equip_manager.lua @@ -7,10 +7,12 @@ function EquipManager:reqUpgrade(id, part) return end - if not entity:isEnoughMaterial() then - GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_8)) - -- 打开副本界面 - return + for index, cost in ipairs(entity:getUpgradeMaterials()) do + if cost.num > DataManager.BagData.ItemData:getItemNumById(cost.id) then + GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_8)) + UIManager:showUI("app/ui/dungeon/item_get_ui", {id = cost.id, value = cost.num}) + return + end end if not entity:isEnoughGold() then diff --git a/lua/app/ui/common/cell/reward_cell.lua b/lua/app/ui/common/cell/reward_cell.lua index a7f5672e..e289591a 100644 --- a/lua/app/ui/common/cell/reward_cell.lua +++ b/lua/app/ui/common/cell/reward_cell.lua @@ -71,7 +71,7 @@ end function RewardCell:_refreshItem(info, count) self.numTx:setVisible(true) self.frameBg:setSprite(GConst.ATLAS_PATH.ICON_ITEM, GConst.FRAME_QLT[info.qlt]) - if count > 0 then + if count and count > 0 then if count > 100 then self.numTx:setText(GFunc.num2Str(count)) else diff --git a/lua/app/ui/common/mop_up_ui.lua b/lua/app/ui/common/mop_up_ui.lua index 9ea6db60..110e5bcb 100644 --- a/lua/app/ui/common/mop_up_ui.lua +++ b/lua/app/ui/common/mop_up_ui.lua @@ -15,9 +15,7 @@ function MopUpUI:ctor(params) self.callback = params.callback ---- 有目标的扫荡 - self.targetReward = params.targetReward - self.targetDesc = params.targetDesc - self.targetTotalProgress = params.targetTotalProgress + self.target = params.target end function MopUpUI:onLoadRootComplete() @@ -75,7 +73,7 @@ function MopUpUI:refreshTarget() local uiMap = self.root:genAllChildren() local bg = uiMap["mop_up_ui.bg"] local node = uiMap["mop_up_ui.bg.item_node"] - if not self.targetReward then + if not self.target then node:setVisible(false) bg:setSizeDeltaY(518) return @@ -87,23 +85,19 @@ function MopUpUI:refreshTarget() self.rewardCell = CellManager:addCellComp(uiMap["mop_up_ui.bg.item_node.reward_cell"], GConst.TYPEOF_LUA_CLASS.REWARD_CELL) end - self.rewardCell:refreshByConfig(self.targetReward) + self.rewardCell:refreshItemById(self.target.id) self.rewardCell:hideCountTx() - uiMap["mop_up_ui.bg.item_node.desc_1"]:setText(self.targetDesc) - local curProgress = 0 - if GFunc.getRewardType(self.targetReward) == GConst.REWARD_TYPE.ITEM then - local id = GFunc.getRewardId(self.targetReward) - curProgress = DataManager.BagData.ItemData:getItemNumById(id) or 0 - end + uiMap["mop_up_ui.bg.item_node.desc_1"]:setText(GFunc.getRewardName(GConst.REWARD_TYPE.ITEM, self.target.id)) + local curProgress = DataManager.BagData.ItemData:getItemNumById(self.target.id) or 0 local progressTx - if curProgress >= self.targetTotalProgress then - progressTx = string.format("%s/%s", curProgress, self.targetTotalProgress) + if curProgress >= self.target.value then + progressTx = string.format("%s/%s", curProgress, self.target.value) else - progressTx = string.format("%s/%s", curProgress, self.targetTotalProgress) + progressTx = string.format("%s/%s", curProgress, self.target.value) end uiMap["mop_up_ui.bg.item_node.desc_2"]:setText(progressTx) - uiMap["mop_up_ui.bg.item_node.progress_slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = curProgress / self.targetTotalProgress + uiMap["mop_up_ui.bg.item_node.progress_slider"]:getComponent(GConst.TYPEOF_UNITY_CLASS.BF_SLIDER).value = curProgress / self.target.value end return MopUpUI \ No newline at end of file diff --git a/lua/app/ui/dungeon/cell.meta b/lua/app/ui/dungeon/cell.meta new file mode 100644 index 00000000..e40b29fb --- /dev/null +++ b/lua/app/ui/dungeon/cell.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cdb6637dff815334e93aebe3070c399b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua new file mode 100644 index 00000000..ea130f59 --- /dev/null +++ b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua @@ -0,0 +1,121 @@ +local DungeonTargetCell = class("DungeonTargetCell", BaseCell) + +function DungeonTargetCell:init() + local uiMap = self:getUIMap() + + self.txDesc = uiMap["dungeon_target_cell.tx_desc"] + self.btn = uiMap["dungeon_target_cell.right.btn"] + self.txBtn = uiMap["dungeon_target_cell.right.btn.tx_btn"] + -- 有扫荡次数 + self.timeObj = uiMap["dungeon_target_cell.time"] + self.txTime = uiMap["dungeon_target_cell.time.tx_time"] + self.powerObj = uiMap["dungeon_target_cell.right.power"] + self.imgPowerIcon = uiMap["dungeon_target_cell.right.power.img_icon"] + self.txPowerNum = uiMap["dungeon_target_cell.right.power.tx_num"] + + self:bind(DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON), "isDirty", function() + self:refresh() + end) +end + +function DungeonTargetCell:refresh(target, getWay, id) + self.getWay = getWay or self.getWay + self.dungeonId = id or self.dungeonId + self.target = target or self.target + + if self.getWay == GConst.DungeonConst.TYPE.WEAPON then + self:showWeapon() + elseif self.getWay == GConst.DungeonConst.TYPE.ARMOR then + self:showArmor() + end +end + +-- 显示武器副本 +function DungeonTargetCell:showWeapon() + local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON) + + local remainTime = weaponData:getRemianFarmCount() + + self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_19, self.dungeonId)) + + if weaponData:canFightChapter(self.dungeonId) and weaponData:canFarmChapter(self.dungeonId) and remainTime > 0 then + -- 扫荡 + self.isSmash = true + self.timeObj:setActive(true) + self.powerObj:setActive(true) + self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH)) + self.btn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_green_3") + self.txTime:setText(remainTime .."/" .. weaponData:getDialyFarmLimit()) + self.txPowerNum:setText(GFunc.getRewardNum(weaponData:getChallengeHpCost())) + GFunc.centerImgAndTx(self.imgPowerIcon, self.txPowerNum, 3) + self.btn:setTouchEnable(true) + + elseif weaponData:canFightChapter(self.dungeonId) then + -- 前往 + self.timeObj:setActive(false) + self.powerObj:setActive(false) + self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_21)) + self.btn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_3") + self.btn:setTouchEnable(true) + else + -- 未开启 + self.timeObj:setActive(false) + self.powerObj:setActive(false) + self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_22)) + self.btn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_3") + self.btn:setTouchEnable(false) + end + self.btn:addClickListener(function() + if self.isSmash then + ModuleManager.DungeonWeaponManager:reqSweep(self.dungeonId, self.target) + else + ModuleManager.DungeonWeaponManager:showMainUI() + end + end) +end + +-- 显示防具副本 +function DungeonTargetCell:showArmor() + local armorData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR) + + local remainTime = armorData:getRemianFarmCount() + + self.txDesc:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_19, self.dungeonId)) + + if armorData:canFightChapter(self.dungeonId) and armorData:canFarmChapter(self.dungeonId) and remainTime > 0 then + -- 扫荡 + self.isSmash = true + self.timeObj:setVisible(true) + self.powerObj:setVisible(true) + self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.SMASH)) + self.btn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_green_3") + self.txTime:setText(remainTime .."/" .. armorData:getDialyFarmLimit()) + self.txPowerNum:setText(GFunc.getRewardNum(armorData:getChallengeHpCost())) + GFunc.centerImgAndTx(self.imgPowerIcon, self.txPowerNum, 3) + self.btn:setTouchEnable(true) + + elseif armorData:canFightChapter(self.dungeonId) then + -- 前往 + self.timeObj:setVisible(false) + self.powerObj:setVisible(false) + self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_21)) + self.btn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_3") + self.btn:setTouchEnable(true) + else + -- 未开启 + self.timeObj:setVisible(false) + self.powerObj:setVisible(false) + self.txBtn:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_22)) + self.btn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_3") + self.btn:setTouchEnable(false) + end + self.btn:addClickListener(function() + if self.isSmash then + ModuleManager.DungeonArmorManager:reqSweep(self.dungeonId, self.target) + else + ModuleManager.DungeonArmorManager:showMainUI() + end + end) +end + +return DungeonTargetCell \ No newline at end of file diff --git a/lua/app/ui/dungeon/cell/dungeon_target_cell.lua.meta b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua.meta new file mode 100644 index 00000000..1b980951 --- /dev/null +++ b/lua/app/ui/dungeon/cell/dungeon_target_cell.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 44945e5552167a94b9e05a970452fae0 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/dungeon/item_get_ui.lua b/lua/app/ui/dungeon/item_get_ui.lua new file mode 100644 index 00000000..128ca4a2 --- /dev/null +++ b/lua/app/ui/dungeon/item_get_ui.lua @@ -0,0 +1,93 @@ +local ItemGetUI = class("ItemGetUI", BaseUI) + +function ItemGetUI:isFullScreen() + return false +end + +function ItemGetUI:getPrefabPath() + return "assets/prefabs/ui/dungeon/item_get_ui.prefab" +end + +function ItemGetUI:onPressBackspace() + self:closeUI() +end + +function ItemGetUI:onClose() +end + +function ItemGetUI:ctor(parmas) + self.target = parmas +end + +function ItemGetUI:onLoadRootComplete() + local uiMap = self.root:genAllChildren() + + self.txTitle = uiMap["item_get_ui.content.title.tx_title"] + self.btnClose = uiMap["item_get_ui.content.btn_close"] + self.rewardCell = uiMap["item_get_ui.content.reward_cell"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.REWARD_CELL) + self.txDesc = uiMap["item_get_ui.content.tx_desc"] + self.txGet = uiMap["item_get_ui.content.tx_get"] + self.scrollRectComp = uiMap["item_get_ui.content.scroll_view"]:addLuaComponent(GConst.TYPEOF_LUA_CLASS.SCROLL_RECT_BASE) + + self.txTitle:setText(I18N:getText("item", self.target.id, "name")) + self.txDesc:setText(I18N:getText("item", self.target.id, "desc")) + self.txGet:setText(I18N:getGlobalText(I18N.GlobalConst.EQUIP_DESC_23)) + -- self.rewardCell:refreshItemById(self.target.id) + + local itemCfg = ConfigManager:getConfig("item")[self.target.id] + if itemCfg == nil or itemCfg.get_way_type == nil or itemCfg.get_way == nil or #itemCfg.get_way == 0 then + self:closeUI() + return + end + + self.wayType = itemCfg.get_way_type + self.wayList = {} + + if self.wayType == GConst.DungeonConst.TYPE.WEAPON then + local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_WEAPON) + local unlock = {} + local lock = {} + for index, id in ipairs(itemCfg.get_way) do + if weaponData:canFightChapter(id) then + table.insert(unlock, id) + else + table.insert(lock, id) + end + end + table.sort(unlock, function(a, b) return a > b end) + table.sort(lock, function(a, b) return a > b end) + self.wayList = table.addArray(unlock, lock) + elseif self.wayType == GConst.DungeonConst.TYPE.ARMOR then + local weaponData = DataManager.DungeonData:getDungeonDataByType(ModuleManager.MODULE_KEY.DUNGEON_ARMOR) + local unlock = {} + local lock = {} + for index, id in ipairs(itemCfg.get_way) do + if weaponData:canFightChapter(id) then + table.insert(unlock, id) + else + table.insert(lock, id) + end + end + table.sort(unlock, function(a, b) return a > b end) + table.sort(lock, function(a, b) return a > b end) + self.wayList = table.addArray(unlock, lock) + end + + self.scrollRectComp:addInitCallback(function() + return "app/ui/dungeon/cell/dungeon_target_cell" + end) + self.scrollRectComp:addRefreshCallback(function(index, cell) + cell:refresh(self.target, self.wayType, self.wayList[index]) + end) + + self.btnClose:addClickListener(function() + self:closeUI() + end) +end + +function ItemGetUI:onRefresh() + self.scrollRectComp:clearCells() + self.scrollRectComp:refillCells(#self.wayList) +end + +return ItemGetUI \ No newline at end of file diff --git a/lua/app/ui/dungeon/item_get_ui.lua.meta b/lua/app/ui/dungeon/item_get_ui.lua.meta new file mode 100644 index 00000000..85cc79b8 --- /dev/null +++ b/lua/app/ui/dungeon/item_get_ui.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 5e5040fa8cbe53747ac9daae96856bb9 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/userdata/dungeon/dungeon_armor_entity.lua b/lua/app/userdata/dungeon/dungeon_armor_entity.lua index c1ed4e45..26e4eb49 100644 --- a/lua/app/userdata/dungeon/dungeon_armor_entity.lua +++ b/lua/app/userdata/dungeon/dungeon_armor_entity.lua @@ -3,7 +3,7 @@ local DungeonArmorEntity = class("DungeonArmorEntity", DungeonBaseEntity) -- 支线副本数据 function DungeonArmorEntity:clear() - DataManager:unregisterCrossDayFunc("DungeonWeaponEntity") + DataManager:unregisterCrossDayFunc("DungeonArmorEntity") end function DungeonArmorEntity:init(data)