From ea9aeef9d8790db51c59a99927cd47ea9423be88 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 18 Nov 2021 18:45:58 +0900 Subject: refactor(client): refactor dialog functions to improve type inference --- packages/client/src/scripts/aiscript/api.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages/client/src/scripts/aiscript') diff --git a/packages/client/src/scripts/aiscript/api.ts b/packages/client/src/scripts/aiscript/api.ts index 20c15d809e..01b8fd05fe 100644 --- a/packages/client/src/scripts/aiscript/api.ts +++ b/packages/client/src/scripts/aiscript/api.ts @@ -9,16 +9,15 @@ export function createAiScriptEnv(opts) { USER_NAME: $i ? values.STR($i.name) : values.NULL, USER_USERNAME: $i ? values.STR($i.username) : values.NULL, 'Mk:dialog': values.FN_NATIVE(async ([title, text, type]) => { - await os.dialog({ + await os.alert({ type: type ? type.value : 'info', title: title.value, text: text.value, }); }), 'Mk:confirm': values.FN_NATIVE(async ([title, text, type]) => { - const confirm = await os.dialog({ + const confirm = await os.confirm({ type: type ? type.value : 'question', - showCancelButton: true, title: title.value, text: text.value, }); -- cgit v1.2.3-freya