Register for your free account! | Forgot your password?

You last visited: Today at 07:05

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Python] Features tooltip on objects

Discussion on [Python] Features tooltip on objects within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Arrow [Python] Features tooltip on objects

Gallery photo:

For who want to see how it works code:​
Code:
#root/uiToolTip.py
#1.) Search for:
	def __SetSpecialItemTitle(self):
		self.AppendTextLine(item.GetItemName(), self.SPECIAL_TITLE_COLOR)
#2.) Add after:		
	def __SetFeaturesToolTip(self, itemVnum):
		######################################################
		# title_name        : Features tooltip on objects
		# date_created      : 2017.01.11
		# author            : VegaS

		image = ui.ImageBox()
		image.SetParent(self)
		image.Show()			

		self.main = {
			"vnums" : [
				140, 150, 3130, 270, 12010, 12020, 12030, 12040, 480, 460, 470, 5120, 7120, 20250, 20750, 20000, 180, 190]
		}
		######################################################################################################
		# Example: vnums[480] = 480, 481, 482, 483, 484, 485, 486, 487, 488, 489 Put more items (need only first index from +0, and automatically will be increment from +0 to +9.)
					
		for k in xrange(10):
			for v in xrange(len(self.main["vnums"])):
				tokens, index, iterator = self.main["vnums"][v], str(itemVnum)[-1:], str(k)

				if ((tokens <= itemVnum and itemVnum <= tokens + 9) and (index == iterator)):
					image.LoadImage("icon/item/features_tooltip/%d.tga" % (k))

					image.SetPosition(self.toolTipWidth/2 - 75, self.toolTipHeight)
					self.toolTipHeight += 18
					self.childrenList.append(image)
					self.ResizeToolTip()

#1.) Search in def AddItemData(.......)
		self.__AdjustMaxWidth(attrSlot, itemDesc)
		self.__SetItemTitle(itemVnum, metinSlot, attrSlot)
#2.) Add after:
		self.__SetFeaturesToolTip(itemVnum)
Attached Images
File Type: psd stars_tooltip.psd (51.6 KB, 205 views)
Attached Files
File Type: rar tooltip_features.rar (43.9 KB, 216 views)
VegaS ♆ is offline  
Thanks
16 Users
Old 01/11/2017, 06:25   #2
 
elite*gold: 0
Join Date: Nov 2011
Posts: 32
Received Thanks: 7
I think, the two is good, type of equipement and with vnum.

Like this is, if you want only put this for special equipement (like difficult for up to +9), you can make difference color for the stars.

The release look nice, and is a good idea
Nadellia is offline  
Thanks
1 User
Old 01/11/2017, 06:28   #3
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Quote:
Originally Posted by Exygo View Post
Hey, you can actually make it with type condition for equipment only instead of inserting them in list, and get only the last digit of the vnum
Welcome on epvp
____________________________________
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 **** 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.

When a release is posted free is not importantly method what you used If them do same.
In programming exist a lot a method for make one thing, so you not need to be sad about that, go to sleep and all is done.

I not will continue with this circle, have fun.
VegaS ♆ is offline  
Thanks
6 Users
Old 01/11/2017, 10:48   #4
 
elite*gold: 0
Join Date: Jan 2017
Posts: 4
Received Thanks: 0
Dont work :/
GrünesUniversum is offline  
Old 01/11/2017, 15:09   #5
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Post

Quote:
Originally Posted by Exygo View Post
And why would you do this :


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 View Post
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.
VegaS ♆ is offline  
Thanks
4 Users
Old 01/11/2017, 15:42   #6
 
VegaS ♆'s Avatar
 
elite*gold: 10
Join Date: Jul 2013
Posts: 93
Received Thanks: 416
Oh yeah, i did 10 images, what is your problem xD, you can't sleep?
I see you edit your post every 2 seconds, and you make refresh on every one second on this topic, so bad..you are hungry ^^

I notice that despite mills, because you're obsessed, you made 100 reply to showing a ****, which has no a thing about it, it ceases to kill python.

EDIT:
That is all over 35 lines with code **** for what?
Here is better dude, stop to make a post with a lot a things **** what people not will use.

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 to search attention with my name.

As i see you check my profile on some forums in every day and my website, you really have a obsessed for me, thanks.

Using what method and what code you want, nobody care about you.

Stop to try continue conversation with me, if you want to speak with me about personal things like what you did now, you can write me a message private, no need to search attention here, already you get some popularity here from this conversation with me, good luck.
VegaS ♆ is offline  
Thanks
6 Users
Old 01/11/2017, 16:10   #7
 
elite*gold: 0
Join Date: Nov 2012
Posts: 3
Received Thanks: 1
nice release guys
ganea21 is offline  
Old 01/11/2017, 19:29   #8
 
elite*gold: 0
Join Date: Nov 2011
Posts: 32
Received Thanks: 7
I just see someone who use code from another to do do someting.

Sorry, but Vegas is not my friend, but since some days ( no, week) I think he is the only one who's always posted something without waiting something from the other.

You cry about his code, but sorry, if the code look really ugly for you, just change it for your server, like some people do without say someting.
Nadellia is offline  
Thanks
1 User
Old 01/11/2017, 21:17   #9


 
elite*gold: 1810
Join Date: Jan 2012
Posts: 2,180
Received Thanks: 1,617
Nice idea I like it

Quote:
You did 10 images for each plus =)))
P.S3: Why you do not have real, pro mlg, developer,mature arguments when I humiliate you ?
It's ok dude this isn't such of difference.
MaxChri is offline  
Thanks
1 User
Old 01/12/2017, 19:24   #10
 
elite*gold: 0
Join Date: Jul 2013
Posts: 50
Received Thanks: 24
Nice release. ^^
Thanks
jma96 is offline  
Thanks
1 User
Old 01/16/2017, 12:06   #11
 
xCPx's Avatar
 
elite*gold: 20
Join Date: Jun 2011
Posts: 2,897
Received Thanks: 3,336
Sorry Guys, but stop beefing.

For me both of your examples arent really good coded. I mean there is allways something to do better. Beeing sad because someone says your code is **** is as stupid as saying his code is ****, mine is better.

So actually just see it as something you could might learn and not as a kinda "i am better than you".

because coding simply isnt about competition. If it works and it works fine, why should you then be sad?

I mean for example i would write it like this:
Code:
def __IsCustomStarVnum(self, vnum):
		customs=[10, 20, 30, 40]
		vnum = int("%s0" % str(vnum)[:-1])
		if vnum in customs:
			return TRUE
		return FALSE
	def __IsCustomStarType(self, vnum):
		allowed_types = [item.ITEM_TYPE_WEAPON,item.ITEM_TYPE_ARMOR]
		return (item.GetItemType() in allowed_types)
		
	def __IsCustomStarItem(self, vnum, type):
		x = self.__IsCustomStarType(vnum)
		y = self.__IsCustomStarVnum(vnum)
		if type == 2:
			return x
		if type == 1:
			return y
		if type == 0:
			return x or y
		return FALSE
		
	def __SetStars(self, vnum, type = 0):
		#0 = use customTypes and Itemtype #1 = Use ItemType #2 = use customtype
		grd = int(str(vnum)[-1:])
		if self.__IsCustomStarItem(vnum, type):
			img = ui.ImageBox()
			img.SetParent(self)
			img.Show()
			mage.LoadImage("icon/item/features_tooltip/%d.tga" % (grd))
			img.SetPosition(self.toolTipWidth/2 - 75, self.toolTipHeight)
			self.toolTipHeight += 18
			self.childrenList.append(img)
			self.ResizeToolTip()

But its up to everyone what he wants to use.

but one thing i actually dont get:

Why do you both use an for loop when there is no need for it?

I mean for rarity 9 you dont need to append all images from 0-9, its enough to show image 9.tga ?

Greetings,
Micha


Btw:
VegaS? We should write more in skype
xCPx is offline  
Thanks
6 Users
Reply

Tags
python, vegas


Similar Threads Similar Threads
Python Problem Tooltip
07/07/2016 - Metin2 Private Server - 3 Replies
Hallo Liebe Community, Ich hab sowas ähnliches wie ein Wiki wenn man über das Item mit Maus drüber fährt wurde dann ja die Bonis und so des Items angezeigt aber seid dem ich das Schulterbandsystem drin hab kommt mir der Fehler: 0706 20:09:38364 :: IndexError 0706 20:09:38364 :: : 0706 20:09:38364 :: list index out of range
[Python]Item Tooltip auf einen Button
03/09/2016 - Metin2 Private Server - 4 Replies
Hallo, Ich möchte in Python einen Button machen und als Tooltip soll wie bei einem richtigen Item die Beschreibung kommen. Allerdings will ich dort den Text noch etwas verändern. Wäre nett wenn mir jemand helfen könnte^^
[Python]Frage Button Tooltip
09/24/2015 - Metin2 Private Server - 2 Replies
Hey leutzz, Ich hab mal ne Frage, Von dem Abschiedsrelease (Killroy.) hab ich mir das Sideboard gezogen und es eingefügt. Ich würd gern ein Button Tooltip rein haben, funktioniert jedoch nich so ganz. Ich hab die python datei von ihm schon ein wenig abgeändert aber es will nicht rein gehen. Im syserr steht nix diesbezüglich. Hier meine .py datei: import ui import dbg
Tooltip auf Label
10/22/2011 - AutoIt - 7 Replies
Hallo Epvp... Ich wollte mal fragen , ob man ein Tooltip erstellen kann , dass nur erscheint , wenn die Maus auf einem BEstimmtem Label zeigt / steht..... Danke :D
Edit script in python and add features.
11/23/2010 - Metin2 Private Server - 0 Replies
Hello. Is it to add to this script, python, import serverInfo serverNum=` serverChannel=1 addr_new = serverInfo.REGION_DICT port_new = serverInfo.REGION_DICT account_addr_new = serverInfo.REGION_AUTH_SERVER_DICT account_port_new = serverInfo.REGION_AUTH_SERVER_DICT addr=addr_new



All times are GMT +2. The time now is 07:05.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.