Browse Source

fixed shownameplates not disabling after relog

tags/v0.1.10^2
Big Bad Waffle 6 years ago
parent
commit
e9bd454e07
4 changed files with 20 additions and 11 deletions
  1. +5
    -0
      helpers/item-tooltip/styles.css
  2. +5
    -4
      src/client/js/objects/objects.js
  3. +7
    -7
      src/server/config/quests/templates/questKillX.js
  4. +3
    -0
      src/server/objects/objects.js

+ 5
- 0
helpers/item-tooltip/styles.css View File

@@ -69,3 +69,8 @@ body {
.stat {
margin-bottom: 5px;
}

.stat:before {
content: '*';
margin-right: 5px;
}

+ 5
- 4
src/client/js/objects/objects.js View File

@@ -20,9 +20,10 @@ define([
events.on('onGetObject', this.onGetObject.bind(this));
events.on('onRezone', this.onRezone.bind(this));
events.on('onChangeHoverTile', this.getLocation.bind(this));
//Get saved value for showNames, or use the value set above
this.showNames = window.localStorage.getItem('iwd_opt_shownames') || this.showNames;
var showNames = window.localStorage.getItem('iwd_opt_shownames');
this.showNames = showNames ? (showNames == 'true') : this.showNames;
},

getLocation: function (x, y) {
@@ -298,10 +299,10 @@ define([
onKeyDown: function (key) {
if (key == 'v') {
this.showNames = !this.showNames;
//Set new value in localStorage for showNames
window.localStorage.setItem('iwd_opt_shownames', this.showNames);
var showNames = this.showNames;

var objects = this.objects;


+ 7
- 7
src/server/config/quests/templates/questKillX.js View File

@@ -1,6 +1,6 @@
define([

], function(
], function (

) {
return {
@@ -11,7 +11,7 @@ define([

type: 'killX',

build: function() {
build: function () {
//If we're not in the correct zone, don't do this check, it'll just crash the server
// since the mob won't be available (most likely) in the zoneFile
if (this.obj.zoneName == this.zoneName) {
@@ -25,7 +25,7 @@ define([

if (!this.mobName) {
var mobCounts = this.obj.instance.spawners.mobTypes;
var keys = Object.keys(mobTypes).filter(function(m) {
var keys = Object.keys(mobTypes).filter(function (m) {
var mobBlueprint = mobTypes[m];

return (
@@ -44,7 +44,7 @@ define([

this.mobType = keys[~~(Math.random() * keys.length)];
var needMax = 8;
this.mobName = this.mobType.replace(/\w\S*/g, function(txt) {
this.mobName = this.mobType.replace(/\w\S*/g, function (txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});

@@ -58,8 +58,8 @@ define([
},

events: {
afterKillMob: function(mob) {
if ((mob.name != this.mobName) || (this.have >= this.need))
afterKillMob: function (mob) {
if ((mob.name.toLowerCase() != this.mobName.toLowerCase()) || (this.have >= this.need))
return;

this.have++;
@@ -72,4 +72,4 @@ define([
}
}
};
});
});

+ 3
- 0
src/server/objects/objects.js View File

@@ -137,6 +137,9 @@ define([
this.physics.addRegion(obj);
}

if (obj.aggro)
obj.aggro.move();

if (lLen == 1)
return obj;
}


Loading…
Cancel
Save