feat: add updateGUI

This commit is contained in:
kwaroran
2024-07-29 01:10:09 +09:00
parent 6cc8bc8792
commit 616a66db28
4 changed files with 23 additions and 15 deletions

View File

@@ -2,7 +2,7 @@ import { getChatVar, risuChatParser, setChatVar, type simpleCharacterArgument }
import { LuaEngine, LuaFactory } from "wasmoon";
import { DataBase, setDatabase, type Chat, type character, type groupChat } from "../storage/database";
import { get } from "svelte/store";
import { CurrentCharacter, CurrentChat, selectedCharID } from "../stores";
import { CurrentCharacter, CurrentChat, CurrentVariablePointer, ReloadGUIPointer, selectedCharID } from "../stores";
import { alertError, alertInput, alertNormal } from "../alert";
import { HypaProcesser } from "./memory/hypamemory";
import { generateAIImage } from "./stableDiff";
@@ -191,6 +191,10 @@ export async function runLua(code:string, arg:{
console.log(JSON.parse(value))
})
luaEngine.global.set('updateGUI', () => {
ReloadGUIPointer.set(get(ReloadGUIPointer) + 1)
})
//Low Level Access
luaEngine.global.set('similarity', async (id:string, source:string, value:string[]) => {
if(!LuaLowLevelIds.has(id)){

View File

@@ -38,6 +38,7 @@ export const CurrentShowMemoryLimit = writable(false) as Writable<boolean>
export const ShowVN = writable(false)
export const SettingsMenuIndex = writable(-1)
export const CurrentVariablePointer = writable({} as {[key:string]: string|number|boolean})
export const ReloadGUIPointer = writable(0)
export const OpenRealmStore = writable(false)
export const ShowRealmFrameStore = writable('')
export const PlaygroundStore = writable(0)