diff --git a/lua/app/module/item/item_const.lua b/lua/app/module/item/item_const.lua index ee03b321..83a76b94 100644 --- a/lua/app/module/item/item_const.lua +++ b/lua/app/module/item/item_const.lua @@ -5,6 +5,9 @@ ItemConst.ITEM_ID_GEM = 2 ItemConst.ITEM_ID_VIT = 3 ItemConst.ITEM_ID_BOUNTY_EXP = 7 ItemConst.ITEM_ID_EXP = 12 +ItemConst.ITEM_ID_BOX_KEY_LV_1 = 13 +ItemConst.ITEM_ID_BOX_KEY_LV_2 = 14 +ItemConst.ITEM_ID_BOX_KEY_LV_3 = 15 ItemConst.ITEM_ID_RANDOM_FRAGMENT = 19 ItemConst.ITEM_TYPE = { diff --git a/lua/app/ui/shop/cell/box_sell_cell.lua b/lua/app/ui/shop/cell/box_sell_cell.lua index 60064328..d3d4de60 100644 --- a/lua/app/ui/shop/cell/box_sell_cell.lua +++ b/lua/app/ui/shop/cell/box_sell_cell.lua @@ -89,7 +89,9 @@ function BoxSellCell:refreshCost() if GFunc.checkCost(costItem1.id, costItem1.num, false) then self.boxBuyBtnCoin1:setSprite(GFunc.getIconRes(costItem1.id)) - self.boxBuyBtnTx1:setText(costItem1.num) + local totalCount = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_BOX_KEY_LV_1) + local totalCountStr = totalCount <= 99 and tostring(totalCount) or "99" + self.boxBuyBtnTx1:setText(tostring(costItem1.num) .. "/" .. totalCountStr) else self.boxBuyBtnCoin1:setSprite(GFunc.getIconRes(cost1.id)) self.boxBuyBtnTx1:setText(cost1.num) @@ -98,7 +100,9 @@ function BoxSellCell:refreshCost() if GFunc.checkCost(costItem2.id, costItem2.num, false) then self.boxBuyBtnCoin2:setSprite(GFunc.getIconRes(costItem2.id)) - self.boxBuyBtnTx2:setText(costItem2.num) + local totalCount = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_BOX_KEY_LV_2) + local totalCountStr = totalCount <= 99 and tostring(totalCount) or "99" + self.boxBuyBtnTx2:setText(tostring(costItem2.num) .. "/" .. totalCountStr) else self.boxBuyBtnCoin2:setSprite(GFunc.getIconRes(cost2.id)) self.boxBuyBtnTx2:setText(cost2.num) @@ -107,7 +111,9 @@ function BoxSellCell:refreshCost() if GFunc.checkCost(costItem3.id, costItem3.num, false) then self.boxBuyBtnCoin3:setSprite(GFunc.getIconRes(costItem3.id)) - self.boxBuyBtnTx3:setText(costItem3.num) + local totalCount = DataManager.BagData.ItemData:getItemNumById(GConst.ItemConst.ITEM_ID_BOX_KEY_LV_3) + local totalCountStr = totalCount <= 99 and tostring(totalCount) or "99" + self.boxBuyBtnTx3:setText(tostring(costItem3.num) .. "/" .. totalCountStr) else self.boxBuyBtnCoin3:setSprite(GFunc.getIconRes(cost3.id)) self.boxBuyBtnTx3:setText(cost3.num)