Mostly a proof-of-concept of how to add things to the Nexus interface. A few lines of code that add to the status bar the current date and season.
1) add to your
onLoad near the top:
// create a new UI element in the status bar
var newNode = document.createElement('div');
newNode.setAttribute("id", "status-date");
var referenceNode = document.querySelector('#status-ping');
referenceNode.after(newNode);
send_GMCP("IRE.Time.Request", "");
2) add to your
onGMCP, or integrate into any existing
IRE.Time.List and I
RE.Time.Update logic you have there:
if (args.gmcp_method == "IRE.Time.List" || args.gmcp_method == "IRE.Time.Update") {
$('#status-date').text(args.gmcp_args.year + '-' + String(args.gmcp_args.mon).padStart(2,'0') + '-' + String(args.gmcp_args.day).padStart(2,'0') + ' ' + ['mwinter','lwinter','espring','mspring','lspring','esummer','msummer','lsummer','eautumn','mautumn','lautumn','e-winter'][args.gmcp_args.mon-1]);
};
Result:
![Image: https://cdn.discordapp.com/attachments/664482450440716288/751824527608250518/unknown.png](https://cdn.discordapp.com/attachments/664482450440716288/751824527608250518/unknown.png)
Adding a display of the moon phase is left as an exercise for the student. (Note though that Nexus is going to keep forcing the width of this element to what it likes, no matter how much you set it to what you like, so you might find it works better to add a second element for that. As it is, I had to abbreviate the season names pretty harshly.)