Advertisement
Guest User

uitooltip.py

a guest
Jul 16th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. def __AppendAttributeInformation(self, attrSlot, itemAbsChance = 0, vnum = 0):
  2. if 0 != attrSlot:
  3. for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
  4. type = attrSlot[i][0]
  5. value = attrSlot[i][1]
  6. if 0 == value:
  7. continue
  8.  
  9. affectString = self.__GetAffectString(type, value)
  10. if app.ENABLE_SASH_SYSTEM:
  11. if item.GetItemType() == item.ITEM_TYPE_COSTUME and item.GetItemSubType() == item.COSTUME_TYPE_SASH and itemAbsChance:
  12. value = self.CalcSashValue(value, itemAbsChance)
  13. affectString = self.__GetAffectString(type, value)
  14.  
  15. if affectString:
  16. affectColor = self.__GetAttributeColor(i, value, type, vnum)
  17. self.AppendTextLine(affectString, affectColor)
  18.  
  19. def __GetAttributeColor(self, index, bonus, value, type = 0):
  20. if value > 0:
  21. if index >= 5:
  22. if self.MAX_5_BONUS(bonus) and value == self.MAX_5_BONUS[bonus]:
  23. return self.SPECIAL_POSITIVE_COLOR_MAX5
  24. else:
  25. return self.SPECIAL_POSITIVE_COLOR2
  26. else:
  27. if vnum > 0 and MAX_7_BONUS(bonus) and value == MAX_7_BONUS[bonus]:
  28. return self.SPECIAL_POSITIVE_COLOR_MAX7
  29. else:
  30. return self.SPECIAL_POSITIVE_COLOR
  31. elif value == 0:
  32. return self.NORMAL_COLOR
  33. else:
  34. return self.NEGATIVE_COLOR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement