1 mesaj
Administrator Administrator
  • Mesaje: 3449
  • Reacții: 48380
  • Mesaje utile: 29
  • Status: Pe aici.. 🤠
  • Server: Saga2 - Soon
  • Regat: Jinno
  • [ID Discord]
  • Contact:
    *Descriere:

    Interfata pentru sistemul de Cal.

    FIX dupa ce bagati sistemul:
    Code:
    #Horse_GUI by DasNipples
    class HorseImage(ui.ExpandedImageBox):
    
    	FILE_PATH = "d:/ymir work/ui/pattern/HorseState/"
    
    	SZAZALEK = {
    		0: 0,
    		1: 0,
    		2: 0,
    		3: 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
    	}
    
    	BAR_B = {
    		0: "blackgauge",
    		1: "blackgauge",
    		2: "blackgauge",
    		3: "blackgauge",
    		10: "redgauge",
    		11: "redgauge",
    		12: "redgauge",
    		13: "redgauge",
    		20: "yellowgauge",
    		21: "yellowgauge",
    		22: "yellowgauge",
    		23: "yellowgauge",
    		30: "greengauge",
    		31: "greengauge",
    		32: "greengauge",
    		33: "greengauge"
    	}
    
    	FILE_DICT = {
    		0: FILE_PATH+"00.dds",
    		1: FILE_PATH+"00.dds",
    		2: FILE_PATH+"00.dds",
    		3: 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.Gui = ui.ImageBox()
    		self.Gui.LoadImage("dnproducts/horsegui/gui.tga")
    		self.Gui.SetPosition(255, 5)
    		self.Gui.Show()
    		self.Gui.AddFlag("movable")
    		self.Gui.AddFlag("attach")
    
    		self.Fej = ui.ImageBox()
    		self.Fej.SetParent(self.Gui)
    		self.Fej.SetPosition(4, 9)
    		self.Fej.Show()
    
    		self.Gauge3 = ui.AniImageBox()
    		self.Gauge3.SetDelay(5)
    		self.Gauge3.Show()
    		self.Gauge3.SetParent(self.Fej)
    		self.Gauge3.SetPercentage(100, 100)
    
    		self.Szint = ui.TextLine()
    		self.Szint.SetFeather()
    		self.Szint.SetOutline()
    		self.Szint.SetPackedFontColor(-1034)
    		self.Szint.Show()
    		self.Szint.SetParent(self.Gui)
    		self.Szint.SetPosition(55, 4)
    
    		self.Ehseg = ui.TextLine()
    		self.Ehseg.SetFeather()
    		self.Ehseg.SetOutline()
    		self.Ehseg.SetPackedFontColor(-1034)
    		self.Ehseg.Show()
    		self.Ehseg.SetParent(self.Gui)
    		self.Ehseg.SetPosition(60, 26)
    
    		self.Faradtsag = ui.TextLine()
    		self.Faradtsag.SetFeather()
    		self.Faradtsag.SetOutline()
    		self.Faradtsag.SetPackedFontColor(-29696)
    		self.Faradtsag.Show()
    		self.Faradtsag.SetParent(self.Gui)
    		self.Faradtsag.SetPosition(40, 36)
    
    	def __GetHorseGrade(self, level):
    		if level == 0:
    			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.Szint.SetText(locale.LEVEL_LIST[grade])
    				LEVEL_IMAGE = [
    					"",
    					"dnproducts/horsegui/face_1.tga",
    					"dnproducts/horsegui/face_2.tga",
    					"dnproducts/horsegui/face_3.tga"
    				]
    				self.Fej.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.Ehseg.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.Faradtsag.SetText(elements.RENDIDO)
    				try:
    					fileName = self.FILE_DICT[(health * 10 + battery)]
    					folyamat = self.SZAZALEK[(health * 10 + battery)]
    					ActualBar = self.BAR_B[(health * 10 + battery)]
    				except KeyError:
    					print("HorseImage.SetState(level=%d, health=%d, battery=%d) - KeyError" % (level, health, battery))
    
    				try:
    					for x in range(1, 7):
    						self.Gauge3.AppendImage(f"dnproducts/{ActualBar}/0{x}.tga")
    
    					self.Gauge3.SetPosition(55, 12)
    					self.Gauge3.SetPercentage(folyamat, 57)
    				except:
    					print("HorseImage.SetState(level=%d, health=%d, battery=%d) - LoadError %s" % (level, health, battery, fileName, folyamat))
    
    		self.SetScale(0.7, 0.7)
    
    	#DEBUGGING by [007]Dawis
    	def __AppendText(self, text):
    		self.toolTip.AppendTextLine(text)
    		self.toolTip.ResizeToolTip()
    
    	def OnMouseOverIn(self):
    		self.toolTip.ShowToolTip()
    
    	def OnMouseOverOut(self):
    		self.toolTip.HideToolTip()
    #End of DEBUGGING by [007]Dawis
    #End of Horse_GUI
    


    *Poze / Video:
    [Py] Horse GUI - Interfata Mount - Mesaj 1 - Imagine 1
    *Link download / Code:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.

    Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo
    Te asteptam si pe serverul de Discord :p - aici ne-am strans toata comunitatea de Metin2 din Romania.
    Link: https://discord.gg/jWxeDSf7HP

    Suntem peste 1700 membri! - Avem chat activ zilnic, support, cereri, resurse. :D :ymcowboy:




    See full signature

    🔥 Hai pe Discord! - Chat activ și support direct

    Te așteptăm și pe serverul de Discord - aici ne-am strâns toată comunitatea de Metin2 din România.

    Alătură-te acum!
    1300+ de membri activi!
    Robot Discord
    Roboțelu'
    Anunț

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “Îmbunătățiri”

    Informații

    Utilizatori ce navighează pe acest forum: Absolute, alexmrn6322, ethalor2official, Vaynz, Wedow1710, wenor0686 și 7 vizitatori

    Discord ID copiat: