[fix] added AdditionalAssets Preview toggle option

This commit is contained in:
LL
2023-06-22 17:30:30 +09:00
parent d8a5ee5b4e
commit 84a9508fe7
6 changed files with 10 additions and 2 deletions

View File

@@ -305,6 +305,7 @@ export const languageChinese = {
copied: "已复制", copied: "已复制",
useChatCopy: "使用聊天复制", useChatCopy: "使用聊天复制",
useChatSticker: "使用聊天贴纸", useChatSticker: "使用聊天贴纸",
useAdditionalAssetsPreview: "使用附加资源预览",
autoTranslateInput: "使用自动翻译输入", autoTranslateInput: "使用自动翻译输入",
enterMessageForTranslateToEnglish: "输入要翻译为英语的消息", enterMessageForTranslateToEnglish: "输入要翻译为英语的消息",
recent: '最新', recent: '最新',

View File

@@ -309,6 +309,7 @@ export const languageEnglish = {
copied: "Copied", copied: "Copied",
useChatCopy: "Use Chat Message Copy", useChatCopy: "Use Chat Message Copy",
useChatSticker: "Use Chat Sticker", useChatSticker: "Use Chat Sticker",
useAdditionalAssetsPreview: "Use Additional Assets Preview",
autoTranslateInput: "Auto Translate Input", autoTranslateInput: "Auto Translate Input",
enterMessageForTranslateToEnglish: "Enter Message for Translate to English", enterMessageForTranslateToEnglish: "Enter Message for Translate to English",
recent: 'Recent', recent: 'Recent',

View File

@@ -281,6 +281,7 @@ export const languageKorean = {
copied: "복사됨", copied: "복사됨",
useChatCopy: "채팅 메시지 복사 사용", useChatCopy: "채팅 메시지 복사 사용",
useChatSticker: "채팅 스티커 사용", useChatSticker: "채팅 스티커 사용",
useAdditionalAssetsPreview: "추가 에셋 미리보기 사용",
autoTranslateInput: "입력 자동 번역", autoTranslateInput: "입력 자동 번역",
enterMessageForTranslateToEnglish: "영어로 번역할 메시지를 입력해주세요", enterMessageForTranslateToEnglish: "영어로 번역할 메시지를 입력해주세요",
imageCompression: "이미지 압축", imageCompression: "이미지 압축",

View File

@@ -143,6 +143,9 @@
<Check bind:check={$DataBase.useChatCopy} name={language.useChatCopy}/> <Check bind:check={$DataBase.useChatCopy} name={language.useChatCopy}/>
</div> </div>
<div class="flex items-center mt-2">
<Check bind:check={$DataBase.useAdditionalAssetsPreview} name={language.useAdditionalAssetsPreview}/>
</div>
{#if $DataBase.useExperimental} {#if $DataBase.useExperimental}
<div class="flex items-center mt-2"> <div class="flex items-center mt-2">

View File

@@ -109,7 +109,7 @@
DataBase.set(database) DataBase.set(database)
loadTokenize(currentChar.data) loadTokenize(currentChar.data)
if(currentChar.type ==='character'){ if(currentChar.type ==='character' && database.useAdditionalAssetsPreview){
if(currentChar.data.additionalAssets){ if(currentChar.data.additionalAssets){
for(let i = 0; i < currentChar.data.additionalAssets.length; i++){ for(let i = 0; i < currentChar.data.additionalAssets.length; i++){
if(currentChar.data.additionalAssets[i].length > 2 && currentChar.data.additionalAssets[i][2]) { if(currentChar.data.additionalAssets[i].length > 2 && currentChar.data.additionalAssets[i][2]) {
@@ -651,7 +651,7 @@
{#each currentChar.data.additionalAssets as assets, i} {#each currentChar.data.additionalAssets as assets, i}
<tr> <tr>
<td class="font-medium truncate"> <td class="font-medium truncate">
{#if assetFilePath[i]} {#if assetFilePath[i] && database.useAdditionalAssetsPreview}
{#if assetFileExtensions[i] === 'mp4'} {#if assetFileExtensions[i] === 'mp4'}
<!-- svelte-ignore a11y-media-has-caption --> <!-- svelte-ignore a11y-media-has-caption -->
<video controls class="mt-2 px-2 w-full m-1 rounded-md"><source src={assetFilePath[i]} type="video/mp4"></video> <video controls class="mt-2 px-2 w-full m-1 rounded-md"><source src={assetFilePath[i]} type="video/mp4"></video>
@@ -663,6 +663,7 @@
{/if} {/if}
<input class="text-neutral-200 mt-2 mb-4 p-2 bg-transparent input-text focus:bg-selected w-full resize-none" bind:value={currentChar.data.additionalAssets[i][0]} placeholder="..." /> <input class="text-neutral-200 mt-2 mb-4 p-2 bg-transparent input-text focus:bg-selected w-full resize-none" bind:value={currentChar.data.additionalAssets[i][0]} placeholder="..." />
</td> </td>
<th class="font-medium cursor-pointer w-10"> <th class="font-medium cursor-pointer w-10">
<button class="hover:text-green-500" on:click={() => { <button class="hover:text-green-500" on:click={() => {
if(currentChar.type === 'character'){ if(currentChar.type === 'character'){

View File

@@ -524,6 +524,7 @@ export interface Database{
}, },
classicMaxWidth: boolean, classicMaxWidth: boolean,
useChatSticker:boolean, useChatSticker:boolean,
useAdditionalAssetsPreview:boolean,
} }
interface hordeConfig{ interface hordeConfig{