Module Feature.Time.Time
Project: Clock – Tamriel Standard Time
Author: Arne Rantzen (Tyx) Created: 2020–01–22 Updated: 2020–03–06 License: GPL-3.0
Functions
UpdatePositions () | Update the Time anchor |
RemoveFragment () | Function to remove the fragment from all scenes and delete the reference |
UpdateVisibility () | Update the visibility and fragment visibility of the Time object |
UpdateMouse () | Update if the object is interactable with the mouse |
UpdateBackground () | Update the background texture and alpha value |
UpdateSize () | Update the dimension and offset of the control Only if the sizeHasUpdated variable is true! |
UpdateStyle () | Update the Style of the label |
UpdateFormats () | Update the content of the label and tooltip |
CreateTimeReplacements (loreTime) | Create the values for the time to be exchanged with their respective chars |
CreateDateReplacements (loreDate) | Create the values for the date to be exchanged with their respective chars |
UpdateTime (time, date) | Function to be given to the LibClockTST for the time and date updates It will handle the updates of the label and tooltip |
ResetReplacement () | Reset the previous saved replacements and mark the size as updated |
RegisterForUpdates () | Register the update function with the LibClockTST |
UnregisterForUpdates () | Remove this object from receiving further updates from the LibClockTST |
SetupTooltip () | Setup the tooltip to show when hovering over the label |
SetupMovement () | Setup the movement of the Time and link it with the Moon control |
SetupScale () | Setup the mouse wheel interaction to change the size of the font when scrolling |
SetupControls (control) | Setup all controls and the Time fragment |
New (control) | Create a new time object |
Clock_TST:SetupTime () | function to reload all values from the settings |
Local Functions
Replace (format, symbol, date, time) | Replace a date and time string with a given time and date |
AddZero (value) | Add a zero in front of a number if smaller than 10 |
Functions
- UpdatePositions ()
- Update the Time anchor
- RemoveFragment ()
- Function to remove the fragment from all scenes and delete the reference
- UpdateVisibility ()
- Update the visibility and fragment visibility of the Time object
- UpdateMouse ()
- Update if the object is interactable with the mouse
- UpdateBackground ()
- Update the background texture and alpha value
- UpdateSize ()
- Update the dimension and offset of the control Only if the sizeHasUpdated variable is true!
- UpdateStyle ()
- Update the Style of the label
- UpdateFormats ()
- Update the content of the label and tooltip
- CreateTimeReplacements (loreTime)
-
Create the values for the time to be exchanged with their respective chars
Parameters:
- loreTime table is the lore time object with { hour = h, minute = m, second = s }
- CreateDateReplacements (loreDate)
-
Create the values for the date to be exchanged with their respective chars
Parameters:
- loreDate table is the lore date object with { day = d, weekDay = w, month = m, year = y }
- UpdateTime (time, date)
-
Function to be given to the LibClockTST for the time and date updates
It will handle the updates of the label and tooltip
Parameters:
- time table for the time object { hour = h, minute = m, second = s }
- date table for the date object { day = d, weekDay = w, month = m, year = y }
- ResetReplacement ()
- Reset the previous saved replacements and mark the size as updated
- RegisterForUpdates ()
- Register the update function with the LibClockTST
- UnregisterForUpdates ()
- Remove this object from receiving further updates from the LibClockTST
- SetupTooltip ()
- Setup the tooltip to show when hovering over the label
- SetupMovement ()
- Setup the movement of the Time and link it with the Moon control
- SetupScale ()
- Setup the mouse wheel interaction to change the size of the font when scrolling
- SetupControls (control)
-
Setup all controls and the Time fragment
Parameters:
- control table of the TopLevelControl
- New (control)
-
Create a new time object
Parameters:
- control table control of the time object
- Clock_TST:SetupTime ()
- function to reload all values from the settings
Local Functions
- Replace (format, symbol, date, time)
-
Replace a date and time string with a given time and date
Parameters:
- format string in the typical date format
- symbol string of the symbol to be replaced. % needs to be escaped as %%.
- date table of the date values
- time table of the time values
Returns:
-
string format with the replaced values.
- AddZero (value)
-
Add a zero in front of a number if smaller than 10
Parameters:
- value number is the number