This commit is contained in:
Mike Primm 2020-05-02 17:50:22 -05:00
parent e7fefeae8d
commit 15cf132ada
9 changed files with 17 additions and 2 deletions

View File

@ -1 +0,0 @@
/main/

View File

@ -3,6 +3,7 @@ componentconstructors['coord'] = function(dynmap, configuration) {
var Coord = L.Control.extend({ var Coord = L.Control.extend({
valfield: $('<span/>'), valfield: $('<span/>'),
mcrfield: $('<span/>'), mcrfield: $('<span/>'),
chunkfield: $('<span/>'),
onAdd: function(map) { onAdd: function(map) {
if(configuration.hidey) if(configuration.hidey)
@ -17,6 +18,10 @@ componentconstructors['coord'] = function(dynmap, configuration) {
$('<br/>').appendTo(this._container); $('<br/>').appendTo(this._container);
this.mcrfield.addClass('coord-control-value').text('').appendTo(this._container); this.mcrfield.addClass('coord-control-value').text('').appendTo(this._container);
} }
if(configuration['show-chunk']) {
$('<br/>').appendTo(this._container);
this.chunkfield.addClass('coord-control-value').text('').appendTo(this._container);
}
this._update(); this._update();
return this.getContainer(); return this.getContainer();
}, },
@ -44,7 +49,9 @@ componentconstructors['coord'] = function(dynmap, configuration) {
else else
coord.valfield.text(Math.round(loc.x) + ',' + loc.y + ',' + Math.round(loc.z)); coord.valfield.text(Math.round(loc.x) + ',' + loc.y + ',' + Math.round(loc.z));
if(configuration['show-mcr']) if(configuration['show-mcr'])
coord.mcrfield.text('r.' + Math.floor(loc.x/512) + '.' + Math.floor(loc.z/512) + '.mcr'); coord.mcrfield.text('r.' + Math.floor(loc.x/512) + '.' + Math.floor(loc.z/512) + '.mca');
if(configuration['show-chunk'])
coord.chunkfield.text('Chunk: ' + Math.floor(loc.x/16) + ',' + Math.floor(loc.z/16));
}); });
dynmap.map.on('mouseout', function(mevent) { dynmap.map.on('mouseout', function(mevent) {
if(!dynmap.map) return; if(!dynmap.map) return;
@ -54,5 +61,7 @@ componentconstructors['coord'] = function(dynmap, configuration) {
coord.valfield.text('---,---,---'); coord.valfield.text('---,---,---');
if(configuration['show-mcr']) if(configuration['show-mcr'])
coord.mcrfield.text('--------'); coord.mcrfield.text('--------');
if(configuration['show-chunk'])
coord.chunkfield.text('Chunk: ---,---');
}); });
}; };

View File

@ -175,6 +175,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent

View File

@ -175,6 +175,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent

View File

@ -175,6 +175,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent

View File

@ -175,6 +175,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent

View File

@ -175,6 +175,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent

View File

@ -175,6 +175,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent

View File

@ -176,6 +176,7 @@ components:
label: "Location" label: "Location"
hidey: false hidey: false
show-mcr: false show-mcr: false
show-chunk: false
# Note: more than one logo component can be defined # Note: more than one logo component can be defined
#- class: org.dynmap.ClientComponent #- class: org.dynmap.ClientComponent