Add suffixInjector hook

This commit is contained in:
Misode
2020-12-05 16:30:14 +01:00
parent 3eb179c0a2
commit 53c2973c34
7 changed files with 60 additions and 53 deletions

View File

@@ -23,6 +23,7 @@ export class BiomeNoisePreview extends Preview {
this.biomeColors = new Property({})
this.biomeColors.set(JSON.parse(localStorage.getItem(LOCAL_STORAGE_BIOME_COLORS) ?? '{}'))
this.noise = []
this.biomeColors.watch(() => this.redraw())
}
getName() {

View File

@@ -4,6 +4,7 @@ import { View } from "../views/View"
export abstract class Preview {
state: any
path?: ModelPath
redraw: () => void = () => {}
dirty(path: ModelPath): boolean {
return JSON.stringify(this.state) !== JSON.stringify(path.get())