UIPlayRuleCtr.lua 871 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. local UIPlayRuleCtr = class("UIPlayRuleCtr", require("UICtrBase"))
  2. function UIPlayRuleCtr:Init(view)
  3. self.view = view
  4. end
  5. ---@param data table {[1] = languageKey, [2] = languageKey}
  6. function UIPlayRuleCtr:SetData(data)
  7. self.asyncIdx = 0
  8. if data == nil then return end
  9. self.data = data
  10. end
  11. function UIPlayRuleCtr:GetAsyncIdx()
  12. self.asyncIdx = self.asyncIdx + 1
  13. return self.asyncIdx
  14. end
  15. function UIPlayRuleCtr:GetData()
  16. return self.data
  17. end
  18. function UIPlayRuleCtr:OnDispose()
  19. self.data = nil
  20. self.view = nil
  21. end
  22. function UIPlayRuleCtr:GetTitleStr()
  23. local key = self.data and self.data[1] or ''
  24. return string.formatbykey(key)
  25. end
  26. function UIPlayRuleCtr:GetContentStr()
  27. local key = self.data and self.data[2] or ''
  28. return string.formatbykey(key)
  29. end
  30. function UIPlayRuleCtr:IsCopy()
  31. return self.data and self.data[3] or false
  32. end
  33. return UIPlayRuleCtr