From c42ca9cfc1ae3fe09829a2ffb06dd4a5653ca086 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Sat, 4 Jan 2025 09:00:54 +0100 Subject: [PATCH] Fix plugin template --- base/sources/box_preferences.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/base/sources/box_preferences.ts b/base/sources/box_preferences.ts index c8fd19fa..85a65395 100644 --- a/base/sources/box_preferences.ts +++ b/base/sources/box_preferences.ts @@ -814,15 +814,15 @@ function box_preferences_show() { let plugin_name: string = ui_text_input(h, tr("Name")); if (ui_button(tr("OK")) || ui.is_return_down) { let template: string = -"let plugin = create();\ +"let plugin = plugin_create();\ let h1 = ui_handle_create();\ -plugin.draw_ui = function (ui) {\ +plugin_notify_on_ui(plugin, function() {\ if (ui_panel(h1, \"New Plugin\")) {\ if (ui_button(\"Button\")) {\ - console.error(\"Hello\");\ + console_info(\"Hello\");\ }\ }\ -}\ +});\ "; if (!ends_with(plugin_name, ".js")) { plugin_name += ".js";