Merge pull request #16 from terncode/master

Improved code
This commit is contained in:
Chris Multhaupt
2019-09-11 15:17:32 +02:00
committed by GitHub
2 changed files with 2 additions and 8 deletions
@@ -13,7 +13,7 @@ import { AutocompleteState, autocompleteMesssage, replaceEmojis, emojis } from '
import { replaceNodes } from '../../../client/htmlUtils'; import { replaceNodes } from '../../../client/htmlUtils';
import { invalidEnumReturn } from '../../../common/utils'; import { invalidEnumReturn } from '../../../common/utils';
import { findMatchingEntityNames, findEntityOrMockByAnyMeans, findBestEntityByName } from '../../../client/handlers'; import { findMatchingEntityNames, findEntityOrMockByAnyMeans, findBestEntityByName } from '../../../client/handlers';
import * as _ from 'lodash'; import { sample } from 'lodash';
const chatTypeNames: string[] = []; const chatTypeNames: string[] = [];
const chatTypeClasses: string[] = []; const chatTypeClasses: string[] = [];
@@ -295,7 +295,7 @@ export class ChatBox implements AfterViewInit, OnDestroy {
} }
onMouseEnterEmojiButton(event: MouseEvent) { onMouseEnterEmojiButton(event: MouseEvent) {
if (!event.target) return; if (!event.target) return;
const emoji = _.sample(emojis)!; const emoji = sample(emojis)!;
this.btnEmoji = emoji.names[0]; this.btnEmoji = emoji.names[0];
} }
toggleChatType() { toggleChatType() {
@@ -530,12 +530,6 @@ export class ChatLog implements AfterViewInit, OnDestroy, DoCheck {
} }
return hsl; return hsl;
} }
fixColor(color: string) {
while (color.length <= 7) {
color = `0${color}`;
}
return color.substr(0, 6);
}
private getCharacterColors(id: number | undefined) { private getCharacterColors(id: number | undefined) {
if (!id) return; if (!id) return;
const entity = findEntityById(this.game.map, id) as Pony; const entity = findEntityById(this.game.map, id) as Pony;