KLGrailDecomposeItem.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ---@class KLGrailDecomposeItem:UIKmlLuaPanelBase
  2. ---@field view KLGrailDecomposeItemView
  3. local KLGrailDecomposeItem = class(UIKmlLuaPanelBase)
  4. local this = KLGrailDecomposeItem
  5. ---创建时调用一次
  6. function this:Init()
  7. end
  8. ---注册UI事件和服务器消息
  9. function this:RegistEvents()
  10. GUI:AddOnClickEvent(self.view.grail_item, self, function()
  11. SL:OpenTips("bag", self.itemCfg, self.itemId, nil, nil, { hideBtn = true })
  12. end)
  13. end
  14. ---界面显示时调用一次
  15. function this:Show()
  16. end
  17. ---创建或者刷新界面数据时调用
  18. function this:Refresh()
  19. end
  20. function this:RefeshData(itemCfg, itemId)
  21. self.itemCfg = itemCfg
  22. self.itemId = itemId
  23. GUI:Item_setItemId(self.view.grail_item, itemCfg)
  24. local strengthlv = InfoManager.archangeEquipInfo:GetGrailStrengthLv(itemId)
  25. if strengthlv > 0 then
  26. GUI:setVisible(self.view.strengthLevel, true)
  27. GUI:Text_setString(self.view.strengthLevel, "+" .. tostring(strengthlv))
  28. else
  29. GUI:setVisible(self.view.strengthLevel, false)
  30. end
  31. end
  32. function this:Hide()
  33. end
  34. function this:Close()
  35. end
  36. return this