From cab056ef5c8f394cc0420f56fe15f1a122c974b3 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 12 Sep 2011 02:24:01 +0800 Subject: [PATCH 1/3] Add pumpkin and melon stems --- src/main/resources/models.txt | 20 ++++++++++++++++++++ src/main/resources/texture.txt | 6 ++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/resources/models.txt b/src/main/resources/models.txt index ce77c719..b4fd3fb1 100644 --- a/src/main/resources/models.txt +++ b/src/main/resources/models.txt @@ -2390,3 +2390,23 @@ layer:9,10,11 # Fence gate - east and west neighbor block:id=107,data=10,scale=16 rotate:id=107,data=5,rot=90 +# Pumpkin stem +# Mellon stem +block:id=104,id=105,data=*,scale=16 +layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 +---------------- +---------------- +---------------- +---*--------*--- +----*------*---- +-----*----*----- +------*--*------ +-------**------- +-------**------- +------*--*------ +-----*----*----- +----*------*---- +---*--------*--- +---------------- +---------------- +---------------- diff --git a/src/main/resources/texture.txt b/src/main/resources/texture.txt index 2c26d6e6..77537d20 100644 --- a/src/main/resources/texture.txt +++ b/src/main/resources/texture.txt @@ -503,8 +503,10 @@ block:id=101,allsides=85,topbottom=22,transparency=TRANSPARENT block:id=102,allsides=12049,topbottom=12263,transparency=TRANSPARENT # Watermellon block:id=103,allsides=136,topbottom=137 -# Pumpkin stem (104) -# Melon stem (105) +# Pumpkin stem +block:id=104,allsides=1111 +# Melon stem +block:id=105,allsides=1111 # Vines block:id=106,allsides=1143,transparency=TRANSPARENT # Fence gate From 571c2acfc3d638892e80862c254819e4ef7372c9 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 12 Sep 2011 02:31:09 +0800 Subject: [PATCH 2/3] Fix new stair and stem transparency --- src/main/resources/texture.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/resources/texture.txt b/src/main/resources/texture.txt index 77537d20..15dbb9e9 100644 --- a/src/main/resources/texture.txt +++ b/src/main/resources/texture.txt @@ -504,14 +504,14 @@ block:id=102,allsides=12049,topbottom=12263,transparency=TRANSPARENT # Watermellon block:id=103,allsides=136,topbottom=137 # Pumpkin stem -block:id=104,allsides=1111 +block:id=104,allsides=1111,transparency=TRANSPARENT # Melon stem -block:id=105,allsides=1111 +block:id=105,allsides=1111,transparency=TRANSPARENT # Vines block:id=106,allsides=1143,transparency=TRANSPARENT # Fence gate block:id=107,allsides=4,topbottom=4004,transparency=TRANSPARENT # Brick stair -block:id=108,allfaces=7 +block:id=108,allfaces=7,transparency=SEMITRANSPARENT # Stone brick stair -block:id=109,allfaces=54 +block:id=109,allfaces=54,transparency=SEMITRANSPARENT From f824a17704b0b94a3e42420903e60c52c3364a2f Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 12 Sep 2011 06:48:04 +0800 Subject: [PATCH 3/3] Add 'coord' client component - show world coords of mouse pointer --- src/main/resources/configuration.txt | 5 ++++ web/css/dynmap_style.css | 21 +++++++++++++++ web/js/coord.js | 40 ++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 web/js/coord.js diff --git a/src/main/resources/configuration.txt b/src/main/resources/configuration.txt index 1a80ffb7..5e7482e6 100644 --- a/src/main/resources/configuration.txt +++ b/src/main/resources/configuration.txt @@ -77,6 +77,11 @@ components: type: timeofdayclock showdigitalclock: true #showweather: true + # Mouse pointer world coordinate display + - class: org.dynmap.ClientComponent + type: coord + label: "Location" + #- class: org.dynmap.ClientComponent # type: logo # text: "Dynmap" diff --git a/web/css/dynmap_style.css b/web/css/dynmap_style.css index 2e96a9e6..1aa75f4a 100644 --- a/web/css/dynmap_style.css +++ b/web/css/dynmap_style.css @@ -779,3 +779,24 @@ left: -8px; z-index: 18; } + +.dynmap .coord-control { + color: #000; + + border: 1px solid rgba(128,128,128,0.6); + background-color: #bbb; + border-style: solid; + + padding: 2px; + width: 80px; + -moz-border-radius: 5px; + border-radius: 5px; +} + +.dynmap .coord-control .coord-control-label { + +} + +.dynmap .coord-control .coord-control-value { + font-weight: bold; +} diff --git a/web/js/coord.js b/web/js/coord.js new file mode 100644 index 00000000..7441be9f --- /dev/null +++ b/web/js/coord.js @@ -0,0 +1,40 @@ +componentconstructors['coord'] = function(dynmap, configuration) { + + var Coord = L.Class.extend({ + valfield: $(''), + + onAdd: function(map) { + this._container = L.DomUtil.create('div', 'coord-control'); + this._map = map; + $('').addClass('coord-control-label').text((configuration.label || 'x,y,z') + ': ').appendTo(this._container); + $('
').appendTo(this._container); + this.valfield.addClass('coord-control-value').text('').appendTo(this._container); + + this._update(); + }, + + getPosition: function() { + return L.Control.Position.TOP_LEFT; + }, + + getContainer: function() { + return this._container; + }, + + _update: function() { + if (!this._map) return; + } + }); + + var coord = new Coord(); + dynmap.map.addControl(coord); + dynmap.map.on('mousemove', function(mevent) { + if(!dynmap.map) return; + var loc = dynmap.getProjection().fromLatLngToLocation(mevent.latlng, 64); + coord.valfield.text(Math.round(loc.x) + ',' + loc.y + ',' + Math.round(loc.z)); + }); + dynmap.map.on('mouseout', function(mevent) { + if(!dynmap.map) return; + coord.valfield.text('---,---,---'); + }); +}; \ No newline at end of file