dazscript-framework
Version:
The **DazScript Framework** is a TypeScript-based framework for writing Daz Studio scripts. It provides all the advantages of a typed language such as autocompletion, error checking, and method parameter documentation and hinting. The framework also inclu
33 lines (25 loc) • 725 B
text/typescript
import { DialogBuilder } from '@dsf/dialog/builders/dialog-builder';
export abstract class BasicDialog {
protected dialog: DzBasicDialog
protected readonly builder: DialogBuilder
protected get add(): DialogBuilder {
return this.builder
}
constructor(name: string, id?: string) {
this.builder = new DialogBuilder(name, id)
}
protected abstract build(): void
protected init() {
this.builder.build(() => {
this.dialog = this.builder.context.dialog
this.build()
})
}
run(): boolean {
this.init()
return this.dialog.exec()
}
close() {
this.dialog.close()
}
}