源战役客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.2 KiB

  1. StarMapPropItem = StarMapPropItem or BaseClass(BaseItem)
  2. function StarMapPropItem:__init()
  3. self.base_file = "starMap"
  4. self.layout_file = "StarMapPropItem"
  5. self:Load()
  6. end
  7. function StarMapPropItem:Load_callback()
  8. self.bg = self:GetChild("bg").gameObject
  9. self.title = self:GetChild("title"):GetComponent("Text")
  10. self.value = self:GetChild("value"):GetComponent("Text")
  11. self.up = self:GetChild("up").gameObject
  12. self.up_value = self:GetChild("up/value"):GetComponent("Text")
  13. if self.need_refreData then
  14. self:SetData(self.attr_list,self.next_val,self.index)
  15. end
  16. end
  17. function StarMapPropItem:SetData(attr_list,next_val,index)
  18. self.attr_list = attr_list
  19. self.next_val = next_val
  20. self.index = index
  21. if not self.is_loaded then self.need_refreData = true return end
  22. self.need_refreData = false
  23. self.title.text = WordManager:GetProperties(tonumber(attr_list.attr_type )).." : "
  24. self.value.text = attr_list.attr_value
  25. if next_val > 0 then
  26. self.up:SetActive(true)
  27. self.up_value.text = next_val
  28. else
  29. self.up:SetActive(false)
  30. end
  31. if index ~= nil and index % 2 == 0 then
  32. self.bg:SetActive(true)
  33. else
  34. self.bg:SetActive(false)
  35. end
  36. end
  37. function StarMapPropItem:__delete()
  38. end