[feat] global scripts
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { get } from "svelte/store";
|
||||
import { CharEmotion, selectedCharID } from "../stores";
|
||||
import type { character } from "../database";
|
||||
import { DataBase, type character } from "../database";
|
||||
|
||||
const dreg = /{{data}}/g
|
||||
|
||||
@@ -11,7 +11,9 @@ export function processScript(char:character, data:string, mode:ScriptMode){
|
||||
}
|
||||
|
||||
export function processScriptFull(char:character, data:string, mode:ScriptMode){
|
||||
let db = get(DataBase)
|
||||
let emoChanged = false
|
||||
const scripts = char.customscript.concat(db.globalscript ?? [])
|
||||
for (const script of char.customscript){
|
||||
if(script.type === mode){
|
||||
const reg = new RegExp(script.in,'g')
|
||||
|
||||
Reference in New Issue
Block a user