Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. -- A function to draw the date and time.
  2. function NEXUS:DrawDateTime()
  3. local colorWhite = nexus.schema.GetColor("white");
  4. local info = {
  5. width = ScrW() * 0.1,
  6. x = 8,
  7. y = 8
  8. };
  9.  
  10. if ( nexus.mount.Call("PlayerCanSeeDateTime") ) then
  11. local dateTimeFont = nexus.schema.GetFont("date_time_text");
  12. local dateString = nexus.date.GetString();
  13. local timeString = nexus.time.GetString();
  14. local dayName = nexus.time.GetDayName();
  15. local text = string.upper(dateString..". "..dayName..", "..timeString..".");
  16.  
  17. self:OverrideMainFont(dateTimeFont);
  18. info.y = self:DrawInfo(text, info.x, info.y, colorWhite, 255, true);
  19. self:OverrideMainFont(false);
  20.  
  21. local textWidth, textHeight = NEXUS:GetCachedTextSize(dateTimeFont, text);
  22.  
  23. if (textWidth and textHeight) then
  24. info.width = textWidth;
  25. end;
  26. end;
  27.  
  28. self:DrawBars(info);
  29. nexus.mount.Call("NexusDateTimeDrawn", info);
  30. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement