Hogy tudnám megcsinálni uitooltip.py-ben, hogy külön színt adhassak az ÁK / KK pozitív értékeinek?
def __AppendAttributeInformation(self, attrSlot):
if 0 != attrSlot:
for i in xrange(player.ATTRIBUTE_SLOT_MAX_NUM):
type = attrSlot[i][0]
value = attrSlot[i][1]
if 0 == value:
continue
affectString = self.__GetAffectString(type, value)
if affectString:
affectColor = self.__GetAttributeColor(i, type, value)
self.AppendTextLine(affectString, affectColor)
def __GetAttributeColor(self, index, type, value):
if value > 0:
if index >= 5:
return self.SPECIAL_POSITIVE_COLOR2
else:
if type in [item.APPLY_SKILL_DAMAGE_BONUS,item.APPLY_NORMAL_HIT_DAMAGE_BONUS]:
#[R,G,B,255]-nel a 255 az alpha ne modositsd, kulonben atlatszo lesz!
#Ertelemszeruen R,G es B helyere az uj szinkodot adod meg.
return grp.GenerateColor(*map(lambda c:c/255.,[R,G,B,255]))
else:
return self.SPECIAL_POSITIVE_COLOR
elif value == 0:
return self.NORMAL_COLOR
else:
return self.NEGATIVE_COLOR
RGB színkódra egy példa:
[spoiler](https://board.ddmt2.net/proxy.php?request=http%3A%2F%2Fpuu.sh%2Fhig7E%2F181f35639c.jpg&hash=4c5ffb82d98047b16ed45b2e4bace46bb0b5915e)[22,98,131,255]
[/spoiler]
Ha valami nem érthető, az nem baj, csak érthetően írd le mi nem az.
Nincs tesztelve, de ránézésre működnie kell(ene).
Működik, köszönöm :D