mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-19 06:43:58 -07:00
Rebuild the counters every 250ms instead of every frame and minimize object creation. Differential Revision: https://code.wildfiregames.com/D2391 Comments By: Stan This was SVN commit r23096.
21 lines
495 B
JavaScript
21 lines
495 B
JavaScript
/**
|
|
* Shows the current time to the player in their current timezone.
|
|
*/
|
|
OverlayCounterTypes.prototype.Realtime = class extends OverlayCounter
|
|
{
|
|
constructor(overlayCounterManager)
|
|
{
|
|
super(overlayCounterManager);
|
|
this.date = new Date();
|
|
}
|
|
|
|
get()
|
|
{
|
|
this.date.setTime(Date.now());
|
|
return this.date.toLocaleTimeString();
|
|
}
|
|
};
|
|
|
|
OverlayCounterTypes.prototype.Realtime.prototype.Config = "overlay.realtime";
|
|
|
|
OverlayCounterTypes.prototype.Realtime.prototype.Hotkey = "realtime.toggle";
|