Rel [TW]Horse GUI - Owner code

07/04/2013 06:42 STREL#1
Hi, well as I am tired of the incompetence and f*** people come to share my horse interface code, I have created myself to as it was my old team, TW and now I share with you for letting me in things that life and be a good person, probably later share the total interface free distribution (I was a clone who LOM interface)

This is a horse gui:

the class in uiaffectShower.* (root..):
Code:
class HorseImage(ui.ExpandedImageBox):

			FILE_PATH = "d:/ymir work/ui/pattern/HorseState/"
			PORCIENTO_BARRA = {
				00 : 0,
				01 : 0,
				02 : 0,
				03 : 0,
				10 : 10,
				11 : 15,
				12 : 20,
				13 : 30,
				20 : 35,
				21 : 40,
				22 : 45,
				23 : 50,
				30 : 55,
				31 : 60,
				32 : 70,
				33 : 100,
			}	
			BARRA_BARRA = {
				00 : "negrogauge",
				01 : "negrogauge",
				02 : "negrogauge",
				03 : "negrogauge",
				10 : "rojogauge",
				11 : "rojogauge",
				12 : "rojogauge",
				13 : "rojogauge",
				20 : "amarillogauge",
				21 : "amarillogauge",
				22 : "amarillogauge",
				23 : "amarillogauge",
				30 : "greengauge",
				31 : "greengauge",
				32 : "greengauge",
				33 : "greengauge",
			}
			FILE_DICT = {
				00 : FILE_PATH+"00.dds",
				01 : FILE_PATH+"00.dds",
				02 : FILE_PATH+"00.dds",
				03 : FILE_PATH+"00.dds",
				10 : FILE_PATH+"10.dds",
				11 : FILE_PATH+"11.dds",
				12 : FILE_PATH+"12.dds",
				13 : FILE_PATH+"13.dds",
				20 : FILE_PATH+"20.dds",
				21 : FILE_PATH+"21.dds",
				22 : FILE_PATH+"22.dds",
				23 : FILE_PATH+"23.dds",
				30 : FILE_PATH+"30.dds",
				31 : FILE_PATH+"31.dds",
				32 : FILE_PATH+"32.dds",
				33 : FILE_PATH+"33.dds",
			}

			def __init__(self):
				ui.ExpandedImageBox.__init__(self)
				
				#self.textLineList = []
				self.toolTip = uiToolTip.ToolTip(100)
				self.toolTip.HideToolTip()
				self.CB= ui.ImageBox()
				self.CB.LoadImage("d:/global/horse/viewer.dds")
				self.CB.SetPosition(255, 5)
				self.CB.Show()
				self.CB.AddFlag("movable")
				self.CB.AddFlag("attach")
				self.CAB= ui.ImageBox()
				self.CAB.SetParent(self.CB)
				self.CAB.SetPosition(16, 17)		
				self.CAB.Show()
				self.Gauge3 = ui.AniImageBox()		
				self.Gauge3.SetDelay(5)
				self.Gauge3.Show()		
				self.Gauge3.SetParent(self.CAB)		
				self.Gauge3.SetPercentage(100, 100)
				self.NivelC = ui.TextLine()
				self.NivelC.SetFeather()
				self.NivelC.SetOutline()
				self.NivelC.SetPackedFontColor(0xffFFFBF6)
				self.NivelC.Show()		
				self.NivelC.SetParent(self.CB)
				self.NivelC.SetPosition(22, 2)
				self.Hambre = ui.TextLine()
				self.Hambre.SetFeather()
				self.Hambre.SetOutline()
				self.Hambre.SetPackedFontColor(0xffFFFBF6)
				self.Hambre.Show()			
				self.Hambre.SetParent(self.CB)
				self.Hambre.SetPosition(60, 26)		
				self.Descansar = ui.TextLine()
				self.Descansar.SetFeather()
				self.Descansar.SetOutline()
				self.Descansar.SetPackedFontColor(0xffFF8C00)
				self.Descansar.Show()					
				self.Descansar.SetParent(self.CB)
				self.Descansar.SetPosition(60, 36)
				
			def __GetHorseGrade(self, level):
				if 0 == level:
					return 0

				return (level-1)/10 + 1

			def SetState(self, level, health, battery):
				#self.textLineList=[]
				self.toolTip.ClearToolTip()
				
				if level>0:

					try:
						grade = self.__GetHorseGrade(level)
						self.__AppendText(locale.LEVEL_LIST[grade])
						self.NivelC.SetText(locale.LEVEL_LIST[grade])
						LEVEL_IMAGE=["", "d:/global/horse/horse_1.dds", "d:/global/horse/horse_2.dds", "d:/global/horse/horse_3.dds"]
						self.CAB.LoadImage(LEVEL_IMAGE[grade])
					except IndexError:
						print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
						return

					try:
						healthName=locale.HEALTH_LIST[health]
						if len(healthName)>0:
							self.__AppendText(healthName)
							
						self.Hambre.SetText(healthName)	
					except IndexError:
						print "HorseImage.SetState(level=%d, health=%d, battery=%d) - Unknown Index" % (level, health, battery)
						return

					if health>0:
						if battery==0:
							self.__AppendText(locale.NEEFD_REST)
							self.Descansar.SetText("Cansado")

					try:
						fileName=self.FILE_DICT[health*10+battery]
						pogresoactual=self.PORCIENTO_BARRA[health*10+battery]
						BarraActual=self.BARRA_BARRA[health*10+battery]
					except KeyError:
						print "HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery)

					try:
						
						for x in range(int(1),int(7)):
							self.Gauge3.AppendImage("d:/global/"+BarraActual+"/0"+str(x)+".tga")
						self.Gauge3.SetPosition(44, 3)
						self.Gauge3.SetPercentage(pogresoactual, 100)
					except:
						print "HorseImage.SetState(level=%d, health=%d, battery=%d) - LoadError %s" % (level, health, battery, fileName, pogresoactual)
				
				self.SetScale(0.7, 0.7)

			def __AppendText(self, text):

				self.toolTip.AppendTextLine(text)
				self.toolTip.ResizeToolTip()

				#x=self.GetWidth()/2
				#textLine = ui.TextLine()
				#textLine.SetParent(self)
				#textLine.SetSize(0, 0)
				#textLine.SetOutline()
				#textLine.Hide()
				#textLine.SetPosition(x, 40+len(self.textLineList)*16)
				#textLine.SetText(text)
				#self.textLineList.append(textLine)

			def OnMouseOverIn(self):
				#for textLine in self.textLineList:
				#	textLine.Show()

				self.toolTip.ShowToolTip()

			def OnMouseOverOut(self):
				#for textLine in self.textLineList:
				#	textLine.Hide()

				self.toolTip.HideToolTip()
¡Warning! Tabs...
Or in attachment exist one py
and the files:(in attachment)
Screen cap: [Only registered and activated users can see links. Click Here To Register...]

I fyou have any error, reply this post :P
07/04/2013 07:27 gizemligenc#2
Share troll works :D
07/04/2013 08:00 sneidder#3
se me hace familiar esta inferface
07/04/2013 10:11 [Patrick]#4
I love your IG Design..
:D
----------------------
Thanks..
07/04/2013 10:43 -TÜRK-#5
Hey can you give us gui design?
07/04/2013 11:55 CrystalPrime#6
It looks very crappy and ugly
now I mean your complete design and Gui
07/08/2013 12:09 DEMONKING.#7
Nice work

your IG gui is pub now ^^
i have it
10/13/2013 18:12 abassaziz#8
It doesn't work i don't get it help plzzzz ...

can somewhone show the : etc_xml plzz...
10/13/2013 19:19 .yorliK#9
Quote:
Originally Posted by DEMONKING. View Post
Nice work

your IG gui is pub now ^^
i have it
where i can find this gui design?
10/13/2013 20:02 .Alpha.#10
Loong Online?
[Only registered and activated users can see links. Click Here To Register...]
10/13/2013 20:25 miguelmig#11
Quote:
Originally Posted by .Nova. View Post
Loong Online?
[Only registered and activated users can see links. Click Here To Register...]
Still better than Metin2's GUI :)
10/15/2013 00:06 abassaziz#12
Look what it does by me help plz !

[Only registered and activated users can see links. Click Here To Register...]