import { useState } from 'react'; import { invoke } from '@tauri-apps/api/core'; import { useAppStore } from '../../store/appStore'; import LeftPanel from './LeftPanel'; import CenterPanel from './CenterPanel'; import RightPanel from './RightPanel'; import ConfigScreen from '../config/ConfigScreen'; import UpdateChecker from '../update/UpdateChecker'; import styles from './AppShell.module.css'; export default function AppShell() { const { centerMode, setCenterMode, uoRoot, servuoScripts } = useAppStore(); const [indexingAssets, setIndexingAssets] = useState(false); const [indexingScripts, setIndexingScripts] = useState(false); async function handleIndexAssets() { if (!uoRoot) return; setIndexingAssets(true); try { const count = await invoke('index_assets', { uoRoot }); alert(`Indexed ${count.toLocaleString()} tiles.`); } catch (e) { alert(`Asset index failed: ${e}`); } finally { setIndexingAssets(false); } } async function handleIndexScripts() { if (!servuoScripts) { alert('Set the ServUO Scripts path in Config first.'); return; } setIndexingScripts(true); try { const count = await invoke('index_scripts', { scriptsPath: servuoScripts }); alert(`Indexed ${count.toLocaleString()} classes.`); } catch (e) { alert(`Script index failed: ${e}`); } finally { setIndexingScripts(false); } } return (
Artificer's Scrollwork
{centerMode === 'config' ? ( setCenterMode('empty')} /> ) : (
)}
); }