diff --git a/src/lib/Others/AlertComp.svelte b/src/lib/Others/AlertComp.svelte index 8d418612..f6f35c13 100644 --- a/src/lib/Others/AlertComp.svelte +++ b/src/lib/Others/AlertComp.svelte @@ -21,12 +21,20 @@ import ModuleChatMenu from "../Setting/Pages/Module/ModuleChatMenu.svelte"; import { ColorSchemeTypeStore } from "src/ts/gui/colorscheme"; import Help from "./Help.svelte"; + import { getChatBranches } from "src/ts/gui/branches"; + import { getCurrentCharacter } from "src/ts/storage/database.svelte"; + import { message } from "@tauri-apps/plugin-dialog"; let btn let input = $state('') let cardExportType = $state('realm') let cardExportType2 = $state('') let cardLicense = $state('') let generationInfoMenuIndex = $state(0) + let branchHover:null|{ + x:number, + y:number, + content:string, + } = $state(null) $effect.pre(() => { if(btn){ btn.focus() @@ -34,6 +42,9 @@ if($alertStore.type !== 'input'){ input = '' } + if($alertStore.type !== 'branches'){ + branchHover = null + } if($alertStore.type !== 'cardexport'){ cardExportType = 'realm' cardExportType2 = '' @@ -69,7 +80,7 @@ } }}> -{#if $alertStore.type !== 'none' && $alertStore.type !== 'toast' && $alertStore.type !== 'cardexport' && $alertStore.type !== 'selectModule' && $alertStore.type !== 'pukmakkurit'} +{#if $alertStore.type !== 'none' && $alertStore.type !== 'toast' && $alertStore.type !== 'cardexport' && $alertStore.type !== 'branches' && $alertStore.type !== 'selectModule' && $alertStore.type !== 'pukmakkurit'}
{#if $alertStore.type === 'error'} @@ -551,7 +562,78 @@
+{:else if $alertStore.type === 'branches'} +
+ {#if branchHover !== null} +
+ {branchHover.content} +
+ {/if} +
+ +
+ + {#each getChatBranches() as obj} + + +
{ + if(branchHover === null){ + const char = getCurrentCharacter() + branchHover = { + x: obj.x, + y: obj.y, + content: char.chats[obj.chatId].message[obj.y - 1].data + } + } + }} + onclick={() => { + if(branchHover === null){ + const char = getCurrentCharacter() + branchHover = { + x: obj.x, + y: obj.y, + content: char.chats[obj.chatId].message[obj.y - 1].data + } + } + }} + onmouseleave={() => { + branchHover = null + }} + > + +
+ {#if obj.connectX === obj.x} + {#if obj.multiChild} +
+ +
+ {:else} +
+ +
+ {/if} + {:else if obj.connectX !== -1} +
+ +
+ + {/if} + {/each} +
{/if}