View Single Post
08/24/21, 02:16 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,993
I've moved your thread to the other forum "LUA/XML help" as this is more a lua request than an addon request.


Before changing the addons you should ask the authors if they can add this feature, else you'd have to do it again after each update of the addon. This can be frustrating, believe me
Please use the addon comments of these addons for this request, or if the author portal is enabled, the feature request button there.
-> Like described here: https://www.esoui.com/forums/showthread.php?t=9885

Changing the time format in ESO cannot be done that easy "for all addons". ZOs provides a few functions for it which have pre-defined formats. If you change the functions you will most likely break other addons, which rely on them.
If you do this locally for yourself, fine.
If you add it to addon code an release this: Please don't! Nobody wants to hunt for user reporting weird stuff caused by hidden overwritten functions.

Here are the time related functions of ZOs:
https://github.com/esoui/esoui/blob/...obals/time.lua
e.g.
ZO_FormatCountdownTimer
which internally uses ZO_FormatTime
So you need to define your own function like ZO_FormatCountdownTimer whch then formats the timer according to your needs.

ZO_FormatCountdownTimer e.g. checks for 3 seconds left and formats the tme differently. Your funcion needs to check for something <=60 seconds left and formats it your way then, as example.

Possible global constants for the time formating can be found inside the esouidocumentation_pxx.txt files linked at the Wiki's APIVersion history->current API version "live" (or PTS if you develop there):
https://wiki.esoui.com/APIVersion -> https://wiki.esoui.com/APIVersion#live_API_version -> "API TXT Documentation:" Downlaod linked txt file


e.g.
Code:
TIME_FORMAT_DIRECTION_ASCENDING = 0
TIME_FORMAT_DIRECTION_DESCENDING = 1
TIME_FORMAT_DIRECTION_NONE = 2
TIME_FORMAT_PRECISION_MILLISECONDS = 5
TIME_FORMAT_PRECISION_MILLISECONDS_NO_HOURS_OR_DAYS = 6
TIME_FORMAT_PRECISION_SECONDS = 0
TIME_FORMAT_PRECISION_TENTHS = 1
TIME_FORMAT_PRECISION_TENTHS_RELEVANT = 2
TIME_FORMAT_PRECISION_TWELVE_HOUR = 3
TIME_FORMAT_PRECISION_TWELVE_HOUR_NO_SECONDS = 7
TIME_FORMAT_PRECISION_TWENTY_FOUR_HOUR = 4
TIME_FORMAT_STYLE_CAST_TIME = 4
TIME_FORMAT_STYLE_CHANNEL_TIME = 6
TIME_FORMAT_STYLE_CLOCK_TIME = 11
TIME_FORMAT_STYLE_COLONS = 0
TIME_FORMAT_STYLE_COOLDOWN_TIME = 5
TIME_FORMAT_STYLE_DESCRIPTIVE = 7
TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL = 14
TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_HIDE_ZEROES = 16
TIME_FORMAT_STYLE_DESCRIPTIVE_MINIMAL_SHOW_TENTHS_SECS = 15
TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT = 8
TIME_FORMAT_STYLE_DESCRIPTIVE_SHORT_SHOW_ZERO_SECS = 9
TIME_FORMAT_STYLE_DURATION = 12
TIME_FORMAT_STYLE_RELATIVE_TIMESTAMP = 10
TIME_FORMAT_STYLE_SHOW_LARGEST_TWO_UNITS = 17
TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT = 1
TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE = 2
TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE_COLOR = 13
TIME_FORMAT_STYLE_SHOW_LARGEST_UNIT_DESCRIPTIVE_SHORT = 3
Maybe that the constants ehre, adn tehf unctions of ZOs are not designed to make your wished format to work, you need to test this.

Last edited by Baertram : 08/24/21 at 02:39 AM.
  Reply With Quote