Aller au contenu
Top-Metin2.org - Vous êtes à la recherche d'un serveur Metin 2 ? ×
×
×
  • Créer...

Python - Pourcentage de Vie dans le Target


Messages recommandés

  • Robot

Centre de Téléchargement

Hidden Content

    Give reaction to this post to see the hidden content.
( Interne )

Bonjour,

 

Tutoriel assez court pour vous apprendre à faire ceci : 03553717FEh.png

Dépackez votre root et ouvrez votre uitarget.py.

 

Cherchez :

def __init__(self):
Vous aurez :
		hpGauge = ui.Gauge()
	hpGauge.SetParent(self)
	hpGauge.MakeGauge(130, "red")
	hpGauge.Hide()
 

Ajoutez :

		hpPercenttxt = ui.TextLine()
	hpPercenttxt.SetParent(self)
	hpPercenttxt.SetPosition(160, 13)
	hpPercenttxt.SetText("")
	hpPercenttxt.Hide()
 

Ce qui donne :

	def __init__(self):
	ui.ThinBoard.__init__(self)

	name = ui.TextLine()
	name.SetParent(self)
	name.SetDefaultFontName()
	name.SetOutline()
	name.Show()

	hpGauge = ui.Gauge()
	hpGauge.SetParent(self)
	hpGauge.MakeGauge(130, "red")
	hpGauge.Hide()

	hpPercenttxt = ui.TextLine()
	hpPercenttxt.SetParent(self)
	hpPercenttxt.SetPosition(160, 13)
	hpPercenttxt.SetText("")
	hpPercenttxt.Hide()

	closeButton = ui.Button()
	closeButton.SetParent(self)
	closeButton.SetUpVisual("d:/ymir work/ui/public/close_button_01.sub")
	closeButton.SetOverVisual("d:/ymir work/ui/public/close_button_02.sub")
	closeButton.SetDownVisual("d:/ymir work/ui/public/close_button_03.sub")
	closeButton.SetPosition(30, 13)
Cherchez :
		self.name = name
	self.hpGauge = hpGauge
Ajoutez  en dessous :
		self.hpPercenttxt = hpPercenttxt
Cherchez :
def Destroy(self):
 

Ajoutez :

self.hpPercenttxt = None
Cherchez :
def ResetTargetBoard(self):
Vous aurez :
self.hpGauge.Hide()
Ajoutez :
self.hpPercenttxt.Hide()
Cherchez :
def SetHP(self, hpPercentage):
Vous aurez :
self.UpdatePosition()
Ajoutez :
			self.hpPercenttxt.SetPosition(200 + 7*self.nameLength-205, 13)
		self.hpPercenttxt.Show()
Enfin, cherchez :
self.hpGauge.SetPercentage(hpPercentage, 100)
Et puis ajoutez :
self.hpPercenttxt.SetText("%d%%" % (hpPercentage))
Vous pouvez repacker, c'est fini !

 

Source : Mt2dev

 

Cordialement, Takuma.

  • Love 6

french_banner.gif

Lien vers le commentaire
Partager sur d’autres sites

  • Réponses 9
  • Créé
  • Dernière réponse

Meilleurs contributeurs dans ce sujet

  • 6 mois après...
  • 2 mois après...


  • brilliantdiscord_widget
  • Flux d'Activité

    1. 21

      Metin2 en 2020 peut-on en parler?

    2. 0

      METIN2Project

    3. 3

      Ressources - UnPack - Metin2 Client - Officiel

    4. 0

      Barre des tâches d'argent étendue

    5. 16

      Redémarrage automatique des channels

    6. 16

      Multi Logo GM / SGM / GA

    7. 0

      comment extraire les fichiers locale.epk locale.eix sur le serveur officiel ?

    8. 2

      Funky-emu.net -> fr.metin2.dev

  • En ligne récemment

    • Aucun utilisateur enregistré regarde cette page.

Information importante

Conditions d’utilisation / Politique de confidentialité / Règles / Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.