Add support for compass rose in all 8 cardinal directions

This commit is contained in:
Mike Primm 2011-07-21 02:50:29 -05:00
parent b9882955af
commit ee3f07c6cd
13 changed files with 51 additions and 17 deletions

View file

@ -565,31 +565,57 @@
* Compass
*/
.compass {
.compass, .compass_NE, .compass_SE, .compass_NW, .compass_SW {
display: block;
position: absolute;
z-index: 10;
top: 20px;
right: 32px;
height: 84px;
width: 83px;
background-repeat: no-repeat;
}
.compass, .compass_SE {
background-image: url(../images/compass.png);
}
.compass_flat {
.compass_NE {
background-image: url(../images/compass_NE.png);
}
.compass_NW {
background-image: url(../images/compass_NW.png);
}
.compass_SW {
background-image: url(../images/compass_SW.png);
}
.compass_flat, .compass_N, .compass_E, .compass_W, .compass_S {
top: 10px;
right: 21px;
height: 105px;
width: 105px;
}
.compass_flat, .compass_S {
background-image: url(../images/compass_flat.png);
}
.compass_N {
background-image: url(../images/compass_N.png);
}
.compass_E {
background-image: url(../images/compass_E.png);
}
.compass_W {
background-image: url(../images/compass_W.png);
}
/*******************
* Chat
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Before After
Before After

BIN
web/images/compass_E.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
web/images/compass_N.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
web/images/compass_NE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

BIN
web/images/compass_NW.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

BIN
web/images/compass_SW.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
web/images/compass_W.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

@ -292,7 +292,6 @@ DynMap.prototype = {
var updateHeight = function() {
playerlist.height(sidebar.innerHeight() - (playerlist.offset().top - worldlist.offset().top) - 64); // here we need a fix to avoid the static value, but it works fine this way :P
console.log('scrollheight=' + playerlist.scrollHeight() + ', height=' + playerlist.height());
var scrollable = playerlist.scrollHeight() < playerlist.height();
upbtn.toggle(scrollable);
downbtn.toggle(scrollable);
@ -357,8 +356,10 @@ DynMap.prototype = {
}
$(me).trigger('mapchanging');
if (me.maptype) {
$('.compass').removeClass('compass_' + me.maptype.compassview);
$('.compass').removeClass('compass_' + me.maptype.name);
}
$('.compass').addClass('compass_' + map.compassview);
$('.compass').addClass('compass_' + map.name);
var worldChanged = me.world !== map.world;
var projectionChanged = me.map.getProjection() !== map.projection;