UIItemTipsCtr.lua 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. local UIItemTipsCtr = class("UIItemTipsCtr", require("UICtrBase"))
  2. function UIItemTipsCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIItemTipsCtr:SetData(data)
  6. self.data = data
  7. self.asyncIdx = 0
  8. end
  9. function UIItemTipsCtr:GetAsyncIdx()
  10. self.asyncIdx = self.asyncIdx + 1
  11. return self.asyncIdx
  12. end
  13. function UIItemTipsCtr:GetData()
  14. return self.data
  15. end
  16. ---@generic 从哪里进入的tips
  17. function UIItemTipsCtr:IsOpenFuncBtn()
  18. return (self.data.enterType == Enum.ItemIEnterType.Bag)
  19. end
  20. ---@generic 获得道具配置id
  21. function UIItemTipsCtr:GetCfgId()
  22. return self.data.cfgId == nil and self.data.Id or self.data.cfgId
  23. end
  24. function UIItemTipsCtr:GetEnterType()
  25. return self.data.enterType
  26. end
  27. function UIItemTipsCtr:GetExtData()
  28. return self.data.extData
  29. end
  30. function UIItemTipsCtr:OnDispose()
  31. self.data = nil
  32. self.enterType = nil
  33. end
  34. function UIItemTipsCtr:SendComposeChip()
  35. ManagerContainer.NetManager:SendMessage(ProtoMsgId.CS_CHIP_COMPOSE_REQ, { config_id = self:GetCfgId() })
  36. end
  37. return UIItemTipsCtr