装备升级材料获取
This commit is contained in:
parent
4ea04aadc5
commit
bafb8673ec
@ -5,7 +5,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[2]={
|
||||
["name"]="诅咒灯灵(第2层)",
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
},
|
||||
[3]={
|
||||
["name"]="黄金灯灵(第3层)",
|
||||
@ -17,7 +17,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[5]={
|
||||
["name"]="霜峰灯灵(第5层)",
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
},
|
||||
[6]={
|
||||
["name"]="邪眸灯灵(第6层)",
|
||||
@ -25,7 +25,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[7]={
|
||||
["name"]="诅咒灯灵(第7层)",
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
},
|
||||
[8]={
|
||||
["name"]="黄金灯灵(第8层)",
|
||||
@ -37,7 +37,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[10]={
|
||||
["name"]="霜峰灯灵(第10层)",
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
},
|
||||
[11]={
|
||||
["name"]="邪眸灯灵(第11层)",
|
||||
@ -45,7 +45,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[12]={
|
||||
["name"]="诅咒灯灵(第12层)",
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
},
|
||||
[13]={
|
||||
["name"]="黄金灯灵(第13层)",
|
||||
@ -57,7 +57,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[15]={
|
||||
["name"]="霜峰灯灵(第15层)",
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
},
|
||||
[16]={
|
||||
["name"]="邪眸灯灵(第16层)",
|
||||
@ -65,7 +65,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[17]={
|
||||
["name"]="诅咒灯灵(第17层)",
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
["desc"]="他是一位古代有名的厨师,原本喜欢用美食帮助他人,由于爱人的死去让他执着于找寻神灯而被神灯封印。他的美食也变成了<color=#ffde35>邪恶的诅咒</color>。"
|
||||
},
|
||||
[18]={
|
||||
["name"]="黄金灯灵(第18层)",
|
||||
@ -77,7 +77,7 @@ local chapter_dungeon_equip = {
|
||||
},
|
||||
[20]={
|
||||
["name"]="霜峰灯灵(第20层)",
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘的心他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
["desc"]="他本是冰雪山峰的部落首领,带领部落人民翻越雪山时遇上了雪崩,不甘心的他成为了霜峰灯灵。在懊悔的岁月里他领悟了<color=#ffde35>冰霜的奥秘</color>。"
|
||||
}
|
||||
}
|
||||
local config = {
|
||||
|
||||
@ -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"] = "阵容修改",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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
|
||||
|
||||
9
lua/app/module/dungeon/dungeon_const.lua
Normal file
9
lua/app/module/dungeon/dungeon_const.lua
Normal file
@ -0,0 +1,9 @@
|
||||
local DungeonConst = {}
|
||||
|
||||
-- 副本类型类型
|
||||
DungeonConst.TYPE = {
|
||||
WEAPON = 1, -- 武器副本
|
||||
ARMOR = 2, -- 防具副本
|
||||
}
|
||||
|
||||
return DungeonConst
|
||||
10
lua/app/module/dungeon/dungeon_const.lua.meta
Normal file
10
lua/app/module/dungeon/dungeon_const.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 843d929b86535d944be8159e39194b90
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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("<color=#49FF49>%s</color>/%s", curProgress, self.targetTotalProgress)
|
||||
if curProgress >= self.target.value then
|
||||
progressTx = string.format("<color=#49FF49>%s</color>/%s", curProgress, self.target.value)
|
||||
else
|
||||
progressTx = string.format("<color=#FF4949>%s</color>/%s", curProgress, self.targetTotalProgress)
|
||||
progressTx = string.format("<color=#FF4949>%s</color>/%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
|
||||
8
lua/app/ui/dungeon/cell.meta
Normal file
8
lua/app/ui/dungeon/cell.meta
Normal file
@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cdb6637dff815334e93aebe3070c399b
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
121
lua/app/ui/dungeon/cell/dungeon_target_cell.lua
Normal file
121
lua/app/ui/dungeon/cell/dungeon_target_cell.lua
Normal file
@ -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
|
||||
10
lua/app/ui/dungeon/cell/dungeon_target_cell.lua.meta
Normal file
10
lua/app/ui/dungeon/cell/dungeon_target_cell.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44945e5552167a94b9e05a970452fae0
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
93
lua/app/ui/dungeon/item_get_ui.lua
Normal file
93
lua/app/ui/dungeon/item_get_ui.lua
Normal file
@ -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
|
||||
10
lua/app/ui/dungeon/item_get_ui.lua.meta
Normal file
10
lua/app/ui/dungeon/item_get_ui.lua.meta
Normal file
@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e5040fa8cbe53747ac9daae96856bb9
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}
|
||||
@ -3,7 +3,7 @@ local DungeonArmorEntity = class("DungeonArmorEntity", DungeonBaseEntity)
|
||||
|
||||
-- 支线副本数据
|
||||
function DungeonArmorEntity:clear()
|
||||
DataManager:unregisterCrossDayFunc("DungeonWeaponEntity")
|
||||
DataManager:unregisterCrossDayFunc("DungeonArmorEntity")
|
||||
end
|
||||
|
||||
function DungeonArmorEntity:init(data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user