Jump to content

AffectShower Update


Recommended Posts

  • Forum Moderator

Thank you for the release, here's a small suggestion to improve your format time code.

9 hours ago, filipw1 said:
	def FormatTime(self, time):
		text = ""

		d = time // (24 * 3600)
		time = time % (24 * 3600)
		h = time // 3600
		time %= 3600
		m = time // 60
		time %= 60
		s = time

		if d:
			text += "%dd " % d
		if text or h:
			text += "%dg " % h
		if text or m:
			text += "%dm " % m
		if text or s:
			text += "%ds " % s

		return text[:-1]

 

This is the hidden content, please

As a result, it can easily be extended to weeks or months.

Edited by VegaS™
  • Metin2 Dev 106
  • Facepalm 1
  • Angry 1
  • Not Good 3
  • Think 1
  • Good 20
  • Love 1
  • Love 19
Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...
  • 7 months later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.