Improve AiScript

This commit is contained in:
syuilo
2019-05-01 14:54:34 +09:00
parent d0af2c2a98
commit 52ebf2055e
6 changed files with 80 additions and 75 deletions

View File

@@ -25,6 +25,9 @@
<section v-else-if="value.type === 'ref'" class="hpdwcrvs">
<select v-model="value.value">
<option v-for="v in aiScript.getVarsByType(getExpectedType ? getExpectedType() : null).filter(x => x.name !== name)" :value="v.name">{{ v.name }}</option>
<optgroup :label="$t('script.argVariables')">
<option v-for="v in fnSlots" :value="v.name">{{ v.name }}</option>
</optgroup>
<optgroup :label="$t('script.pageVariables')">
<option v-for="v in aiScript.getPageVarsByType(getExpectedType ? getExpectedType() : null)" :value="v">{{ v }}</option>
</optgroup>
@@ -33,11 +36,6 @@
</optgroup>
</select>
</section>
<section v-else-if="value.type === 'in'" class="hpdwcrvs">
<select v-model="value.value">
<option v-for="v in fnSlots" :value="v.name">{{ v.name }}</option>
</select>
</section>
<section v-else-if="value.type === 'fn'" class="" style="padding:0 16px 16px 16px;">
<ui-textarea v-model="slots">
<span>{{ $t('script.blocks._fn.slots') }}</span>
@@ -115,6 +113,7 @@ export default Vue.extend({
},
typeText(): any {
if (this.value.type === null) return null;
if (this.value.type.startsWith('fn:')) return this.value.type.split(':')[1];
return this.$t(`script.blocks.${this.value.type}`);
},
},

View File

@@ -77,6 +77,7 @@
<template v-if="moreDetails">
<ui-info><span v-html="$t('variables-info2')"></span></ui-info>
<ui-info><span v-html="$t('variables-info3')"></span></ui-info>
<ui-info><span v-html="$t('variables-info4')"></span></ui-info>
</template>
</div>
</ui-container>