mirror of
https://github.com/Terncode/pixel.horse.git
synced 2026-09-25 06:05:52 +02:00
Revert codestyle changes (#40)
* Revert "7f7efbb94bab8574e42d942ad82d414e007b2970" Code style changes should probably be part of a PR
This commit is contained in:
@@ -8,36 +8,36 @@ import { Model } from '../../services/model';
|
||||
// import { SWAP_TIMEOUT, SECOND } from '../../../common/constants';
|
||||
|
||||
@Component({
|
||||
selector: 'swap-box',
|
||||
templateUrl: 'swap-box.pug',
|
||||
styleUrls: ['swap-box.scss'],
|
||||
selector: 'swap-box',
|
||||
templateUrl: 'swap-box.pug',
|
||||
styleUrls: ['swap-box.scss'],
|
||||
})
|
||||
export class SwapBox {
|
||||
readonly swapIcon = faExchangeAlt;
|
||||
readonly timerIcon = faClock;
|
||||
previewInfo: any;
|
||||
@ViewChild('dropdown', { static: true }) dropdown!: Dropdown;
|
||||
timeout = false;
|
||||
constructor(private game: PonyTownGame, private zone: NgZone, private model: Model) {
|
||||
}
|
||||
toggleSwapDropdown() {
|
||||
this.zone.run(() => setTimeout(() => { }, 10));
|
||||
}
|
||||
swapPony(pony: PonyObject) {
|
||||
this.game.send(server => server.actionParam(Action.SwapCharacter, pony.id));
|
||||
setTimeout(() => {
|
||||
this.dropdown && this.dropdown.close();
|
||||
pony.lastUsed = (new Date()).toISOString();
|
||||
this.model.sortPonies();
|
||||
});
|
||||
readonly swapIcon = faExchangeAlt;
|
||||
readonly timerIcon = faClock;
|
||||
previewInfo: any;
|
||||
@ViewChild('dropdown', { static: true }) dropdown!: Dropdown;
|
||||
timeout = false;
|
||||
constructor(private game: PonyTownGame, private zone: NgZone, private model: Model) {
|
||||
}
|
||||
toggleSwapDropdown() {
|
||||
this.zone.run(() => setTimeout(() => { }, 10));
|
||||
}
|
||||
swapPony(pony: PonyObject) {
|
||||
this.game.send(server => server.actionParam(Action.SwapCharacter, pony.id));
|
||||
setTimeout(() => {
|
||||
this.dropdown && this.dropdown.close();
|
||||
pony.lastUsed = (new Date()).toISOString();
|
||||
this.model.sortPonies();
|
||||
});
|
||||
|
||||
// if (!this.timeout) {
|
||||
// this.timeout = true;
|
||||
// setTimeout(() => this.timeout = false, SWAP_TIMEOUT + SECOND);
|
||||
// }
|
||||
}
|
||||
preview(pony: PonyObject | undefined) {
|
||||
const info = pony && pony.ponyInfo;
|
||||
this.previewInfo = info && toPalette(info, mockPaletteManager);
|
||||
}
|
||||
// if (!this.timeout) {
|
||||
// this.timeout = true;
|
||||
// setTimeout(() => this.timeout = false, SWAP_TIMEOUT + SECOND);
|
||||
// }
|
||||
}
|
||||
preview(pony: PonyObject | undefined) {
|
||||
const info = pony && pony.ponyInfo;
|
||||
this.previewInfo = info && toPalette(info, mockPaletteManager);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user