From 2d0acbcbfb0755580ea39aee25a5ec4a69fb6a5f Mon Sep 17 00:00:00 2001 From: enzi221 Date: Tue, 6 Oct 2026 00:36:53 +0900 Subject: [PATCH] feat: Allow setting inlay name in Lua Co-Authored-By: Claude Opus 5.5 --- src/ts/process/scriptings.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ts/process/scriptings.ts b/src/ts/process/scriptings.ts index a221d85784..657e731de6 100644 --- a/src/ts/process/scriptings.ts +++ b/src/ts/process/scriptings.ts @@ -389,17 +389,21 @@ export async function runScripted(code:string, arg:{ } }) - declareAPI('generateImage', async (id:string, value:string, negValue:string = '') => { + declareAPI('generateImage', async (id: string, value: string, negValue: string = '', options?: { name?: string }) => { if(!ScriptingLowLevelIds.has(id)){ return } + const gen = await generateAIImage(value, char as character, negValue, 'inlay') if(!gen){ return 'Error: Image generation failed' } + const imgHTML = new Image() imgHTML.src = gen - const inlay = await writeInlayImage(imgHTML) + + const name = typeof options?.name === 'string' && options.name ? options.name : undefined + const inlay = await writeInlayImage(imgHTML, { name }) return `{{inlay::${inlay}}}` })