diff --git a/src/core/stores/GuiStore.ts b/src/core/stores/GuiStore.ts index 1924d1f9..8f1cacbf 100644 --- a/src/core/stores/GuiStore.ts +++ b/src/core/stores/GuiStore.ts @@ -43,7 +43,11 @@ class GuiStore implements Disposable { window.removeEventListener("keydown", this.dispatch_global_keydown); } - on_global_keydown(tool: GuiTool, binding: string, handler: (e: KeyboardEvent) => void): Disposable { + on_global_keydown( + tool: GuiTool, + binding: string, + handler: (e: KeyboardEvent) => void, + ): Disposable { const key = this.handler_key(tool, binding); this.global_keydown_handlers.set(key, handler); diff --git a/src/quest_editor/gui/AsmEditorToolBar.ts b/src/quest_editor/gui/AsmEditorToolBar.ts index e7a28a1b..be3df717 100644 --- a/src/quest_editor/gui/AsmEditorToolBar.ts +++ b/src/quest_editor/gui/AsmEditorToolBar.ts @@ -6,8 +6,9 @@ export class AsmEditorToolBar extends ToolBar { constructor() { const inline_args_mode_checkbox = new CheckBox(true, { label: "Inline args mode", - tooltip: asm_editor_store.has_issues.map((has_issues) => { - let text = "Transform arg_push* opcodes to be inline with the opcode the arguments are given to."; + tooltip: asm_editor_store.has_issues.map(has_issues => { + let text = + "Transform arg_push* opcodes to be inline with the opcode the arguments are given to."; if (has_issues) { text += "\nThis mode cannot be toggled because there are issues in the script."; @@ -18,9 +19,7 @@ export class AsmEditorToolBar extends ToolBar { }); super({ - children: [ - inline_args_mode_checkbox - ], + children: [inline_args_mode_checkbox], }); this.disposables( @@ -29,7 +28,6 @@ export class AsmEditorToolBar extends ToolBar { inline_args_mode_checkbox.enabled.bind_to(asm_editor_store.has_issues.map(b => !b)), ); - this.finalize_construction(AsmEditorToolBar.prototype); } } diff --git a/src/quest_editor/scripting/AssemblyAnalyser.ts b/src/quest_editor/scripting/AssemblyAnalyser.ts index 39087048..24c2b439 100644 --- a/src/quest_editor/scripting/AssemblyAnalyser.ts +++ b/src/quest_editor/scripting/AssemblyAnalyser.ts @@ -134,7 +134,7 @@ export class AssemblyAnalyser implements Disposable { update_settings(changed_settings: Partial): void { const message: AssemblySettingsChangeInput = { type: InputMessageType.SettingsChange, - settings: changed_settings + settings: changed_settings, }; this.worker.postMessage(message); } diff --git a/src/quest_editor/scripting/assembly.ts b/src/quest_editor/scripting/assembly.ts index aabdd4d2..bf05a205 100644 --- a/src/quest_editor/scripting/assembly.ts +++ b/src/quest_editor/scripting/assembly.ts @@ -36,7 +36,7 @@ export type AssemblyWarning = { export type AssemblyError = AssemblyWarning; export type AssemblySettings = { - manual_stack: boolean + manual_stack: boolean; }; export function assemble( diff --git a/src/quest_editor/scripting/assembly_worker.ts b/src/quest_editor/scripting/assembly_worker.ts index f428dcb0..f3d274e9 100644 --- a/src/quest_editor/scripting/assembly_worker.ts +++ b/src/quest_editor/scripting/assembly_worker.ts @@ -26,7 +26,7 @@ const messages: AssemblyWorkerInput[] = []; let timeout: any; const assembly_settings: AssemblySettings = { - manual_stack: false + manual_stack: false, }; ctx.onmessage = (e: MessageEvent) => { diff --git a/src/quest_editor/scripting/assembly_worker_messages.ts b/src/quest_editor/scripting/assembly_worker_messages.ts index fb82b52e..bb6936dd 100644 --- a/src/quest_editor/scripting/assembly_worker_messages.ts +++ b/src/quest_editor/scripting/assembly_worker_messages.ts @@ -9,7 +9,11 @@ export enum InputMessageType { SettingsChange, } -export type AssemblyWorkerInput = NewAssemblyInput | AssemblyChangeInput | SignatureHelpInput | AssemblySettingsChangeInput; +export type AssemblyWorkerInput = + | NewAssemblyInput + | AssemblyChangeInput + | SignatureHelpInput + | AssemblySettingsChangeInput; export type NewAssemblyInput = { readonly type: InputMessageType.NewAssembly; diff --git a/src/quest_editor/stores/AsmEditorStore.ts b/src/quest_editor/stores/AsmEditorStore.ts index e4a40b32..5b663983 100644 --- a/src/quest_editor/stores/AsmEditorStore.ts +++ b/src/quest_editor/stores/AsmEditorStore.ts @@ -100,8 +100,9 @@ export class AsmEditorStore implements Disposable { }), assembly_analyser.issues.observe(({ value }) => { - this.has_issues.val = Boolean(value.warnings.length) || Boolean(value.errors.length); - }) + this.has_issues.val = + Boolean(value.warnings.length) || Boolean(value.errors.length); + }), ); } @@ -225,10 +226,8 @@ export class AsmEditorStore implements Disposable { const manual_stack = !this.inline_args_mode.val; const assembly = assembly_analyser.disassemble(quest, manual_stack); - const model = this.model_disposer.add( - editor.createModel(assembly.join("\n"), "psoasm"), - ); - + const model = this.model_disposer.add(editor.createModel(assembly.join("\n"), "psoasm")); + this.setup_editor_model_features(model); this._model.val = model; @@ -236,7 +235,7 @@ export class AsmEditorStore implements Disposable { private update_assembly_settings(): void { assembly_analyser.update_settings({ - manual_stack: !this.inline_args_mode.val + manual_stack: !this.inline_args_mode.val, }); } }