|
|
@ -1,4 +1,4 @@
|
|
|
|
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';
|
|
|
|
import { AfterViewInit, ChangeDetectorRef, Component, ElementRef, Input, NgZone, OnInit, ViewChild } from '@angular/core';
|
|
|
|
import { NgxMoveableComponent, OnDragEnd, OnResize, OnResizeEnd } from 'ngx-moveable';
|
|
|
|
import { NgxMoveableComponent, OnDragEnd, OnResize, OnResizeEnd } from 'ngx-moveable';
|
|
|
|
import { OnDrag } from 'ngx-moveable';
|
|
|
|
import { OnDrag } from 'ngx-moveable';
|
|
|
|
import { ConfigService } from '../services/config.service';
|
|
|
|
import { ConfigService } from '../services/config.service';
|
|
|
@ -38,30 +38,28 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
settingsOpen: boolean = false;
|
|
|
|
settingsOpen: boolean = false;
|
|
|
|
init: boolean = false;
|
|
|
|
init: boolean = false;
|
|
|
|
hasAttachedOnce: boolean = false;
|
|
|
|
hasAttachedOnce: boolean = false;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private events: EventsService, private configService: ConfigService, private cdr: ChangeDetectorRef, private shortcut: ShortcutService, public planService: PlanService, public worldAreaService: WorldAreaService, public overlayService: OverlayService) {
|
|
|
|
constructor(private events: EventsService, private configService: ConfigService, private cdr: ChangeDetectorRef, private shortcut: ShortcutService, public planService: PlanService, public worldAreaService: WorldAreaService, public overlayService: OverlayService, private zone: NgZone) {
|
|
|
|
// for (let i = 0; i < 100; i++) {
|
|
|
|
window.addEventListener("resize", this.windowInitHandler.bind(this));
|
|
|
|
// this.slides.push(i);
|
|
|
|
|
|
|
|
// }
|
|
|
|
const test = this.events.listen<StateEvent>("OverlayStateChange").subscribe(event => {
|
|
|
|
window.addEventListener("resize", this.windowInitHandler.bind(this));
|
|
|
|
if (!this.hasAttachedOnce) {
|
|
|
|
const test = this.events.listen<StateEvent>("OverlayStateChange").subscribe(event => {
|
|
|
|
this.hasAttachedOnce = true;
|
|
|
|
if (!this.hasAttachedOnce) {
|
|
|
|
test.unsubscribe();
|
|
|
|
this.hasAttachedOnce = true;
|
|
|
|
if (!event.payload.Hidden)
|
|
|
|
test.unsubscribe();
|
|
|
|
overlayService.setInteractable();
|
|
|
|
if(!event.payload.Hidden)
|
|
|
|
}
|
|
|
|
overlayService.setInteractable();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
appWindow.listen("entered", (entered) => {
|
|
|
|
appWindow.listen("entered", (entered) => {
|
|
|
|
console.log("entered", entered);
|
|
|
|
console.log("entered", entered);
|
|
|
|
if (this.planService.currentPlan) {
|
|
|
|
if (this.planService.currentPlan) {
|
|
|
|
const current = this.planService.currentPlan.current;
|
|
|
|
const current = this.planService.currentPlan.current;
|
|
|
|
const length = this.planService.currentPlan.plan.length;
|
|
|
|
const length = this.planService.currentPlan.plan.length;
|
|
|
|
if (current + 1 < length) {
|
|
|
|
if (current + 1 < length) {
|
|
|
|
if (entered.payload === this.planService.currentPlan.plan[current + 1]) {
|
|
|
|
if (entered.payload === this.planService.currentPlan.plan[current + 1].area_key) {
|
|
|
|
this.next();
|
|
|
|
this.zone.run(() => this.next());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -159,11 +157,17 @@ export class PlanDisplayComponent implements AfterViewInit, OnInit {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
next() {
|
|
|
|
next() {
|
|
|
|
|
|
|
|
if (this.planService.currentPlan!.current + 1 < this.planService.currentPlan!.plan.length) {
|
|
|
|
|
|
|
|
this.planService.currentPlan!.current++;
|
|
|
|
|
|
|
|
}
|
|
|
|
this.currentSlides?.next();
|
|
|
|
this.currentSlides?.next();
|
|
|
|
this.zoneSlides?.next();
|
|
|
|
this.zoneSlides?.next();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
prev() {
|
|
|
|
prev() {
|
|
|
|
|
|
|
|
if (this.planService.currentPlan!.current - 1 >= 0) {
|
|
|
|
|
|
|
|
this.planService.currentPlan!.current--;
|
|
|
|
|
|
|
|
}
|
|
|
|
this.currentSlides?.prev();
|
|
|
|
this.currentSlides?.prev();
|
|
|
|
this.zoneSlides?.prev();
|
|
|
|
this.zoneSlides?.prev();
|
|
|
|
}
|
|
|
|
}
|
|
|
|