This commit is contained in:
puxuan 2025-10-24 11:04:35 +08:00
parent 8280343377
commit 741b918779
6 changed files with 169 additions and 134 deletions

View File

@ -937,6 +937,7 @@ local LocalizationGlobalConst =
FUNC_OPEN_STAGE_OR_SEVER = "FUNC_OPEN_STAGE_OR_SEVER",
ACT_TURNTABLE_DESC_5 = "ACT_TURNTABLE_DESC_5",
VALUE_DESC = "VALUE_DESC",
USING_DESC = "USING_DESC",
}
return LocalizationGlobalConst

View File

@ -937,6 +937,7 @@ local localization_global =
["FUNC_OPEN_STAGE_OR_SEVER"] = "通关章节{0}或{1}/{2}天后解锁",
["ACT_TURNTABLE_DESC_5"] = "跳过动画",
["VALUE_DESC"] = "超值",
["USING_DESC"] = "使用",
}
return localization_global

View File

@ -24,4 +24,27 @@ function ItemManager:rspRecoveryNtf(result)
end
end
--@region 协议
-- 宝箱奖励
BIReport.ITEM_GET_TYPE.BOX_REWARD = "box_reward"
BIReport.ITEM_GET_TYPE.SELECT_BOX_REWARD = "select_box_reward"
function ItemManager:reqOpenBoxReward(id, count, idx)
-- idx只有自选奖励才有
local bi = BIReport.ITEM_GET_TYPE.BOX_REWARD
if idx and idx > 0 then
bi = BIReport.ITEM_GET_TYPE.SELECT_BOX_REWARD
end
self:sendMessage(ProtoMsgType.FromMsgEnum.ItemUseReq, {id = id, count = count, index = idx}, self.rspOpenBoxReward, bi)
end
function ItemManager:rspOpenBoxReward(result)
if result.err_code ~= GConst.ERROR_STR.SUCCESS then
return
end
GFunc.showRewardBox(result.rewards)
DataManager.BagData.ItemData:setDirty()
end
--@endregion
return ItemManager

View File

@ -57,6 +57,10 @@ function BagMainUI:onLoadRootComplete()
end)
end)
self.scrollRectComp:clearCells()
self:bind(DataManager.BagData.ItemData, "dirty", function()
self:onRefresh()
end)
end
function BagMainUI:onRefresh()

View File

@ -61,11 +61,12 @@ function CommonBoxUI:onLoadRootComplete()
self.btnSub = uiMap["common_box_ui.content.select.btn_sub"]
self.btnAdd = uiMap["common_box_ui.content.select.btn_add"]
self.btnMax = uiMap["common_box_ui.content.select.btn_max"]
self.txMax = uiMap["common_box_ui.content.select.btn_max.tx_max"]
self.btnMin = uiMap["common_box_ui.content.select.btn_min"]
-- self.txMax = uiMap["common_box_ui.content.select.btn_max.tx_max"]
self.btnUse = uiMap["common_box_ui.content.btn_use"]
self.txUse = uiMap["common_box_ui.content.btn_use.tx_desc"]
self.txMax:setText(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_2))
-- self.txMax:setText(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_2))
self.txUse:setText(I18N:getGlobalText(I18N.GlobalConst.USING_DESC))
self.btnSub:addClickListener(function()
@ -89,6 +90,10 @@ function CommonBoxUI:onLoadRootComplete()
self.curCount = self.maxCount
self:onRefresh()
end)
self.btnMin:addClickListener(function()
self.curCount = 1
self:onRefresh()
end)
self.btnUse:addClickListener(function()
if self.itemType == GConst.ItemConst.ITEM_TYPE.BOX_SELECT and (self.curIndex == nil or self.curIndex <= 0) then
GFunc.showToast(I18N:getGlobalText(I18N.GlobalConst.ITEM_DESC_3))

View File

@ -63,6 +63,7 @@ function SummonShopCell:refreshHero()
self.icon:setSprite(GConst.ATLAS_PATH.ICON_HERO_2, tostring(heroInfo.icon))
self.nameTx:setText(ModuleManager.HeroManager:getHeroName(self.heroId))
self.maskImg:setActive(not self.isOwn)
self.matchImg:setSprite(GConst.ATLAS_PATH.ICON_HERO, GConst.HeroConst.MATCH_ICON_NAME[heroInfo.position])
end
function SummonShopCell:refreshItem()