Quote:
Originally Posted by Exygo
And why would you do this :
[Only registered and activated users can see links. Click Here To Register...]
on every item's tooltip LOL ?
|
I write this as request of one guy from skype and i made via teamviewer on him pc in some minutes, i not spend my time to do the best method for one release, but code works ok and nothing "is so bad", be happy is for free, because some people try to sell things like this shit for money, and also i not request your money for that, is a simple release, you not need to say 'Hey noob' because you not like method or release, exist button exit and leave this page.
This is him server and him client, and he added rest of vnums in list not me, because i not tested nothing on my pc because my dedicated server is offline since 5 days. ^^
Quote:
Originally Posted by Exygo
And the final code:
Code:
# Exygo append item quality
def AppendItemQualityRate(self, vnum):
itemType = item.GetItemType()
if itemType in (item.ITEM_TYPE_WEAPON,item.ITEM_TYPE_ARMOR):
max_quality = 9 # +9
# window
xPosStep = 0
yPosStep = self.toolTipHeight
# stars
xPos = 0
window = ui.MakeWindow(self,xPosStep,yPosStep,17*max_quality,17)
window.SetWindowHorizontalAlignCenter()
for n in xrange(max_quality):
if n < int(str(vnum)[-1:]):
image = ui.MakeImageBox(window,"exygo/icon/stars/1.tga",xPos,0)
else:
image = ui.MakeImageBox(window,"exygo/icon/stars/0.tga",xPos,0)
xPos += 17
self.childrenList.append(image)
self.childrenList.append(window)
self.toolTipHeight += self.TEXT_LINE_HEIGHT
self.ResizeToolTip()
|
Ohh br0..
- You can test execution timer and you will get a rekt alone.
If you not understand how it works code and what he do, no try to speak about that.
Your method is a best of shit what i see in my life.
Stop to kill python again.
I could easily do what you want to say, but it sucks.
This feature has no charm if for all items.
This feature is only for some special items to be highlighted more than their value, it is a matter of design something that helps players way because players can see the extent of the item in the name of that item.
So this is the method to be used by any server.
With my code they can add what theywant.
Example, you need only to add the first element from vnum what you want to start stars and automatically will up by range vnum min/max, you need only to declare the first element (that means min) and will be up to max.
I did this because the guy for what i make he not was want for all items or special category, he was want only for specials items from list (items what can be evolution), and as i say you can put in list for bracelet, index: [14205], and automatically will be work only for [14205 -> 14209] and will show you corectly stars.
Ok now i will explain you how it works this code.
Code:
for k in xrange(player.MAX_REFINE_VNUM + 1): # Make a loop from +MIN to +MAX.
for v in xrange(len(vnums)): # Returns the number of elements(vnums) in the list.
tokens = vnums[v] # Get the index vnum from list.
var = str(itemVnum)[-1:] # Get last digit from vnum [MIN - MAX] and convert in string.
it = str(k) # Convert iterator k [MIN - MAX] in string.
(tokens <= itemVnum and itemVnum <= tokens + 9) # Calculate itemVnum value min/max if exist in range.
(var == it) # When last digit is equal with iterator
image.LoadImage("icon/item/features_tooltip/%d.tga" % (k)) # Append image from iterator [MIN - MAX]
vnums = [14205, 11806, 140, 12012, 184]
# What means this list.
# Element 14205 means will have check from 14205 to 14209.
# Element 11802 means will have check from 11802 to 11809.
# Element 140 means will have check from 140 to 149.
Code:
def __SetFeaturesToolTip(self, itemVnum):
vnums = [140, 150, 3130, 270, 12010, 12020, 12030, 12040, 480, 460, 470, 5120, 7120, 20250, 20750, 20000, 180, 190]
for k in xrange(player.MAX_REFINE_VNUM + 1):
for v in xrange(len(vnums)):
tokens, var, it = vnums[v], str(itemVnum)[-1:], str(k)
if ((tokens <= itemVnum and itemVnum <= tokens + 9) and (var == it)):
image.LoadImage("icon/item/features_tooltip/%d.tga" % (k))
Stop this circus you will not get anything already is too off-topic.
Using what method and what code you want, nobody care about you.
Have fun and sorry for my english.