parent
35e2ba31b4
commit
95a69df695
@ -1,8 +1,8 @@
|
|||||||
<div *ngIf="overlayService.visible">
|
<div *ngIf="overlayService.visible">
|
||||||
<plan-display [plan]="true" [backgroundColor]="planColor"></plan-display>
|
<plan-display *ngIf="planService.currentPlan" [backgroundColor]="planColor"></plan-display>
|
||||||
|
|
||||||
<span *ngIf="worldAreas.matcher">matched init</span>
|
|
||||||
|
|
||||||
<color-picker [initialColor]="'#00000010'" (color)="planColor = $event">Click me for color picker!</color-picker>
|
<color-picker [initialColor]="'#00000010'" (color)="planColor = $event">Click me for color picker!</color-picker>
|
||||||
|
|
||||||
|
<button (click)="openDialog()">Browse Plans</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
import { WorldArea } from "./world-area";
|
import { WorldArea } from "./world-area";
|
||||||
|
|
||||||
export class Plan {
|
export interface Plan {
|
||||||
|
elements: PlanElement[];
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PlanElement {
|
interface PlanElement {
|
||||||
area: WorldArea;
|
area: WorldArea;
|
||||||
note: string;
|
note: string;
|
||||||
prev: boolean;
|
|
||||||
current: boolean;
|
|
||||||
next: boolean;
|
|
||||||
}
|
}
|
@ -1,9 +1,28 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
import { invoke } from '@tauri-apps/api';
|
||||||
|
import { from } from 'rxjs';
|
||||||
|
import { Plan } from '../models/plan';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class PlanService {
|
export class PlanService {
|
||||||
|
currentPlan?: Plan;
|
||||||
|
planStore: string[] = [];
|
||||||
|
|
||||||
constructor() { }
|
constructor() {
|
||||||
|
this.getPreviousPlans();
|
||||||
|
}
|
||||||
|
|
||||||
|
loadPlan(path: string) {
|
||||||
|
console.log("loading path: ", path);
|
||||||
|
from(invoke<Plan>('load_plan', {path})).subscribe(plan => {
|
||||||
|
console.log("got plan: ", plan);
|
||||||
|
this.currentPlan = plan;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getPreviousPlans() {
|
||||||
|
from(invoke<string[]>('load_stored_plans')).subscribe(plans => this.planStore = plans);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue