mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-28 13:15:30 +01:00
Added option for digital clock to timeofday.
This commit is contained in:
parent
f93eb8dcbc
commit
060f4641d4
@ -89,8 +89,9 @@ web:
|
|||||||
messagettl: 5
|
messagettl: 5
|
||||||
- type: playermarkers
|
- type: playermarkers
|
||||||
showplayerfaces: true
|
showplayerfaces: true
|
||||||
- type: digitalclock
|
#- type: digitalclock
|
||||||
#- type: timeofdayclock
|
- type: timeofdayclock
|
||||||
|
showdigitalclock: true
|
||||||
|
|
||||||
defaultworld: world
|
defaultworld: world
|
||||||
worlds:
|
worlds:
|
||||||
|
@ -22,6 +22,7 @@ componentconstructors['timeofdayclock'] = function(dynmap, configuration) {
|
|||||||
.css('background-position', (-150) + 'px ' + (-150) + 'px')
|
.css('background-position', (-150) + 'px ' + (-150) + 'px')
|
||||||
.appendTo(sun);
|
.appendTo(sun);
|
||||||
|
|
||||||
|
if (configuration.showdigitalclock) {
|
||||||
var clock = $('<div/>')
|
var clock = $('<div/>')
|
||||||
.addClass('timeofday')
|
.addClass('timeofday')
|
||||||
.addClass('digitalclock')
|
.addClass('digitalclock')
|
||||||
@ -57,6 +58,10 @@ componentconstructors['timeofdayclock'] = function(dynmap, configuration) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$(dynmap).bind('worldupdated', function(event, update) {
|
||||||
|
setTime(update.servertime);
|
||||||
|
});
|
||||||
|
}
|
||||||
$(dynmap).bind('worldupdated', function(event, update) {
|
$(dynmap).bind('worldupdated', function(event, update) {
|
||||||
var sunangle;
|
var sunangle;
|
||||||
var time = update.servertime;
|
var time = update.servertime;
|
||||||
@ -80,7 +85,5 @@ componentconstructors['timeofdayclock'] = function(dynmap, configuration) {
|
|||||||
|
|
||||||
sun.css('background-position', (-50 * Math.cos(sunangle)) + 'px ' + (-50 * Math.sin(sunangle)) + 'px');
|
sun.css('background-position', (-50 * Math.cos(sunangle)) + 'px ' + (-50 * Math.sin(sunangle)) + 'px');
|
||||||
moon.css('background-position', (-50 * Math.cos(moonangle)) + 'px ' + (-50 * Math.sin(moonangle)) + 'px');
|
moon.css('background-position', (-50 * Math.cos(moonangle)) + 'px ' + (-50 * Math.sin(moonangle)) + 'px');
|
||||||
|
|
||||||
setTime(update.servertime);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user