Browse Source

Revert "#126"

This reverts commit d6b96bc417
tags/v0.1.3^2
W01fw00d 7 years ago
parent
commit
feef9f1ada
2 changed files with 8 additions and 22 deletions
  1. +5
    -13
      src/client/js/components/spellbook.js
  2. +3
    -9
      src/client/js/objects/objects.js

+ 5
- 13
src/client/js/components/spellbook.js View File

@@ -80,7 +80,7 @@ define([
this.spells.splice(existIndex, 1, s);
return;
}
if (this.spells.length - 1 >= s.id)
this.spells.splice(s.id, 0, s);
else
@@ -141,11 +141,7 @@ define([
},

tabTarget: function() {
this.onMouseDown(null, objects.getClosest(window.player.x, window.player.y, 10, false, this.target));
},

shiftTabTarget: function() {
this.onMouseDown(null, objects.getClosest(window.player.x, window.player.y, 10, true, this.target));
this.onMouseDown(null, objects.getClosest(window.player.x, window.player.y, 10, this.target));
},

build: function(destroy) {
@@ -155,7 +151,7 @@ define([
data: {
instanceModule: 'customMap',
method: 'customize',
data: {
data: {
tile: 189,
direction: this.obj.keyboardMover.direction,
destroy: destroy
@@ -179,11 +175,7 @@ define([
this.shiftDown = true;
return;
} else if (key == 'tab') {
if (this.shiftDown) {
this.shiftTabTarget();
} else {
this.tabTarget();
}
this.tabTarget();
return;
}

@@ -296,4 +288,4 @@ define([
this.targetSprite.y = this.target.y * scale;
}
};
});
});

+ 3
- 9
src/client/js/objects/objects.js View File

@@ -46,7 +46,7 @@ define([
events.emit('onMobHover', mob);
},

getClosest: function(x, y, maxDistance, reverse, fromMob, callback) {
getClosest: function(x, y, maxDistance, fromMob, callback) {
var objects = this.objects;
var oLen = objects.length;

@@ -79,13 +79,7 @@ define([
return (l.id == fromMob.id);
});

if (reverse) {
fromIndex = (fromIndex === 0 ? list.length : fromIndex) - 1;
} else {
fromIndex = (fromIndex + 1) % list.length;
}
console.log(fromIndex);
return list[fromIndex];
return list[(fromIndex + 1) % list.length];
},

onRezone: function(oldZone) {
@@ -347,4 +341,4 @@ define([
}
}
};
});
});

Loading…
Cancel
Save