Ver código fonte

wquery fixes

tags/v0.3.0
Big Bad Waffle 5 anos atrás
pai
commit
cbf77a7fe1
4 arquivos alterados com 31 adições e 35 exclusões
  1. +27
    -31
      helpers/passives/client/js/input.js
  2. +1
    -1
      src/client/ui/templates/inventory/inventory.js
  3. +2
    -2
      src/client/ui/templates/options/options.js
  4. +1
    -1
      src/server/components/stats.js

+ 27
- 31
helpers/passives/client/js/input.js Ver arquivo

@@ -9,17 +9,17 @@ define([
) {
return {
mappings: {
'8': 'backspace',
'9': 'tab',
'13': 'enter',
'16': 'shift',
'17': 'ctrl',
'27': 'esc',
'37': 'left',
'38': 'up',
'39': 'right',
'40': 'down',
'46': 'del'
8: 'backspace',
9: 'tab',
13: 'enter',
16: 'shift',
17: 'ctrl',
27: 'esc',
37: 'left',
38: 'up',
39: 'right',
40: 'down',
46: 'del'
},

mouse: {
@@ -43,9 +43,8 @@ define([
},

resetKeys: function () {
for (var k in this.keys) {
for (let k in this.keys)
events.emit('onKeyUp', k);
}

this.keys = {};
},
@@ -58,20 +57,17 @@ define([
this.mappings[charCode] ||
String.fromCharCode(charCode).toLowerCase()
);

},

isKeyDown: function (key, consume) {
var down = this.keys[key];
let down = this.keys[key];
if (down != null) {
if (!consume)
return true;
else {
this.keys[key] = 2;
return (down == 1);
}
} else
return false;
this.keys[key] = 2;
return (down == 1);
} return false;
},

events: {
@@ -82,7 +78,7 @@ define([
if ((e.keyCode == 9) || (e.keyCode == 8) || (e.keyCode == 122))
e.preventDefault();

var key = this.getMapping(e.which);
let key = this.getMapping(e.which);

if (this.keys[key] != null)
this.keys[key] = 2;
@@ -99,7 +95,7 @@ define([
if (e.target != document.body)
return;

var key = this.getMapping(e.which);
let key = this.getMapping(e.which);

delete this.keys[key];

@@ -109,11 +105,11 @@ define([

mouse: {
onMouseDown: function (e) {
var el = $(e.target);
let el = $(e.target);
if ((!el.hasClass('canvas')) || (el.hasClass('blocking')))
return;

var button = e.button;
let button = e.button;
this.mouse.button = button;
this.mouse.down = true;
this.mouse.event = e;
@@ -122,11 +118,11 @@ define([
},

onMouseUp: function (e) {
var el = $(e.target);
let el = $(e.target);
if ((!el.hasClass('canvas')) || (el.hasClass('blocking')))
return;

var button = e.button;
let button = e.button;
this.mouse.down = false;

events.emit('onMouseUp', this.mouse);
@@ -143,12 +139,12 @@ define([
if (!e)
return;

var el = $(e.target);
let el = $(e.target);
if ((!el.hasClass('canvas')) || (el.hasClass('blocking')))
return;

var x = ~~((renderer.pos.x + (e.offsetX / renderer.currentZoom)) / constants.gridSize);
var y = ~~((renderer.pos.y + (e.offsetY / renderer.currentZoom)) / constants.gridSize);
let x = ~~((renderer.pos.x + (e.offsetX / renderer.currentZoom)) / constants.gridSize);
let y = ~~((renderer.pos.y + (e.offsetY / renderer.currentZoom)) / constants.gridSize);

this.mouse.x = x;
this.mouse.y = y;
@@ -158,7 +154,7 @@ define([

onMouseWheel: function (e) {
events.emit('onMouseWheel', {
delta: (e.originalEvent.deltaY > 0) ? 1 : -1
delta: (e.deltaY > 0) ? 1 : -1
});
}
}


+ 1
- 1
src/client/ui/templates/inventory/inventory.js Ver arquivo

@@ -392,7 +392,7 @@ define([
let item = this.find('.split-box').data('item');
let delta = amount;
if (e)
delta = (e.originalEvent.deltaY > 0) ? -1 : 1;
delta = (e.deltaY > 0) ? -1 : 1;
if (input.isKeyDown('shift', true))
delta *= 10;
let elAmount = this.find('.split-box .amount');


+ 2
- 2
src/client/ui/templates/options/options.js Ver arquivo

@@ -57,9 +57,9 @@ define([
sound.unload();

events.emit('onShowCharacterSelect');
$('[class^="ui"]:not(.ui-container)').each(function (i, el) {
$('[class^="ui"]:not(.ui-container)').each(el => {
let ui = $(el).data('ui');
if ((ui) && (ui.destroy))
if (ui && ui.destroy)
ui.destroy();
});
factory.build('characters', {});


+ 1
- 1
src/server/components/stats.js Ver arquivo

@@ -565,7 +565,7 @@ module.exports = {
x: this.obj.x,
y: this.obj.y,
components: [deathAnimation]
});
}, -1);
}

if (this.obj.inventory) {


Carregando…
Cancelar
Salvar