feat(tokens): app-local non-player tokens with session moves and UI polish
Add token library/placements, keep play-time moves for the session, lock presentation interactions, and fix export/import modal layout plus freeform trap label. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { ipcChannels } from '../../../shared/ipc/contracts';
|
||||
import type { AppToken } from '../../../shared/types';
|
||||
import { getDndApi } from '../dndApi';
|
||||
|
||||
export function useAppTokens(): AppToken[] {
|
||||
const api = getDndApi();
|
||||
const [tokens, setTokens] = useState<AppToken[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
void api.invoke(ipcChannels.tokens.list, {}).then(({ tokens: list }) => setTokens(list));
|
||||
return api.on(ipcChannels.tokens.stateChanged, ({ tokens: list }) => setTokens(list));
|
||||
}, [api]);
|
||||
|
||||
return tokens;
|
||||
}
|
||||
Reference in New Issue
Block a user