mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 19:19:52 +02:00
feat: dynamic model defs
This commit is contained in:
1 parent
3889c0f75d
commit
8ba56069c4
18 files changed
+127
-57
No files matched your search
@@ -5,12 +5,14 @@ import { create } from 'zustand';
|
||||
import { subscribeWithSelector } from 'zustand/middleware';
|
||||
import { ArmorType } from '../components/Armor/components/SpacedArmorScene';
|
||||
import { ExternalModuleVariant } from '../components/Armor/components/SpacedArmorSceneComponent';
|
||||
import { ModelDefinition } from '../core/blitzkit/modelDefinitions';
|
||||
import { createNextSafeStore } from '../core/zustand/createNextSafeStore';
|
||||
|
||||
interface TankopediaEphemeral {
|
||||
shot?: Shot;
|
||||
skills: Record<string, number>;
|
||||
controlsEnabled: boolean;
|
||||
model: ModelDefinition;
|
||||
highlightArmor?: {
|
||||
name: string;
|
||||
point: Vector3;
|
||||
@@ -86,10 +88,11 @@ export type ArmorPiercingLayer =
|
||||
};
|
||||
|
||||
export const { Provider, use, useMutation, useStore } = createNextSafeStore(
|
||||
() =>
|
||||
(model: ModelDefinition) =>
|
||||
create<TankopediaEphemeral>()(
|
||||
subscribeWithSelector<TankopediaEphemeral>(() => ({
|
||||
skills: {},
|
||||
model,
|
||||
controlsEnabled: true,
|
||||
})),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user