UIFashionWashCtr.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. local UIFashionWashCtr = class("UIFashionWashCtr", require("UICtrBase"))
  2. function UIFashionWashCtr:Init(view)
  3. self.view = view
  4. end
  5. function UIFashionWashCtr:SetData(data)
  6. self.asyncIdx = 0
  7. if data == nil then return end
  8. self.data = data
  9. end
  10. function UIFashionWashCtr:GetAsyncIdx()
  11. self.asyncIdx = self.asyncIdx + 1
  12. return self.asyncIdx
  13. end
  14. function UIFashionWashCtr:GetData()
  15. return self.data
  16. end
  17. function UIFashionWashCtr:GetJobTypeName(jobType)
  18. if not jobType then return "" end
  19. local colorStr = "<color=%s>%s</color>"
  20. local leaderColor = GlobalConfig.Instance:GetConfigStrValue(306)
  21. local name = string.format(colorStr, leaderColor, I18N.T("protagonist"))
  22. if jobType > 0 then
  23. --伙伴
  24. local name1, color = ManagerContainer.CfgMgr:GetPartnerCfgDataByJobType(jobType)
  25. name = string.format(colorStr, color, I18N.T(name1))
  26. end
  27. return name
  28. end
  29. function UIFashionWashCtr:SendFashionWash(state)
  30. local fashionId = self:GetData()
  31. ManagerContainer.DataMgr.FashionData:SendFashionWash(fashionId, state)
  32. end
  33. function UIFashionWashCtr:OnDispose()
  34. self.data = nil
  35. self.view = nil
  36. end
  37. return UIFashionWashCtr