Allow tab completion to work in battles

This commit is contained in:
urkerab
2015-10-30 13:58:34 +00:00
parent 2b4393921a
commit 457bf20f16
2 changed files with 4 additions and 0 deletions

View File

@@ -2169,6 +2169,7 @@ var Battle = (function () {
// external
this.resumeButton = this.play;
this.users = {};
this.preloadCache = {};
this.preloadEffects();
@@ -5679,12 +5680,14 @@ var Battle = (function () {
break;
case 'join':
case 'j':
this.users[toUserid(args[1])] = ' ' + args[1];
if (!this.ignoreSpects) {
this.log('<div class="chat"><small>' + Tools.escapeHTML(args[1]) + ' joined.</small></div>', preempt);
}
break;
case 'leave':
case 'l':
delete this.users[toUserid(args[1])];
if (!this.ignoreSpects) {
this.log('<div class="chat"><small>' + Tools.escapeHTML(args[1]) + ' left.</small></div>', preempt);
}

View File

@@ -38,6 +38,7 @@
BattleSound.setMute(Tools.prefs('mute'));
this.battle = new Battle(this.$battle, this.$chatFrame);
this.users = this.battle.users;
this.$chat = this.$chatFrame.find('.inner');