AiScript関連

This commit is contained in:
syuilo
2020-04-12 19:38:19 +09:00
parent c62aff76af
commit f07047d1e8
12 changed files with 58 additions and 133 deletions

View File

@ -31,6 +31,7 @@ import { AiScript, parse, utils, values } from '@syuilo/aiscript';
import i18n from '../i18n';
import MkContainer from '../components/ui/container.vue';
import MkButton from '../components/ui/button.vue';
import { createAiScriptEnv } from '../scripts/create-aiscript-env';
export default Vue.extend({
i18n,
@ -71,24 +72,7 @@ export default Vue.extend({
methods: {
async run() {
this.logs = [];
const aiscript = new AiScript({
dialog: values.FN_NATIVE(async ([title, text, type]) => {
await this.$root.dialog({
type: type ? type.value : 'info',
title: title.value,
text: text.value,
});
}),
confirm: values.FN_NATIVE(async ([title, text]) => {
const confirm = await this.$root.dialog({
type: 'warning',
showCancelButton: true,
title: title.value,
text: text.value,
});
return confirm.canceled ? values.FALSE : values.TRUE
}),
}, {
const aiscript = new AiScript(createAiScriptEnv(this), {
in: (q) => {
return new Promise(ok => {
this.$root.dialog({