@vylos/core 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="relative w-full h-full overflow-hidden bg-black" style="container-type: size">
|
|
3
3
|
<!-- z-0: Background -->
|
|
4
|
-
<
|
|
4
|
+
<component :is="backgroundLayerComponent" />
|
|
5
5
|
|
|
6
6
|
<!-- z-10: Foreground / character sprites -->
|
|
7
|
-
<
|
|
7
|
+
<component :is="foregroundLayerComponent" />
|
|
8
8
|
|
|
9
9
|
<!-- UI layer — hidden with H key (Ren'Py style) -->
|
|
10
10
|
<template v-if="!engineState.uiHidden">
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
import { computed } from 'vue';
|
|
36
36
|
import { useEngineStateStore } from '../../stores/engineState';
|
|
37
37
|
import { getComponentOverride } from '../../engine/core/EngineFactory';
|
|
38
|
-
import
|
|
39
|
-
import
|
|
38
|
+
import DefaultBackgroundLayer from '../core/BackgroundLayer.vue';
|
|
39
|
+
import DefaultForegroundLayer from '../core/ForegroundLayer.vue';
|
|
40
40
|
import DefaultDrawableOverlay from '../core/DrawableOverlay.vue';
|
|
41
41
|
import DefaultDialogueBox from '../core/DialogueBox.vue';
|
|
42
42
|
import DefaultChoicePanel from '../core/ChoicePanel.vue';
|
|
@@ -48,6 +48,8 @@ import DefaultTopBar from '../menu/TopBar.vue';
|
|
|
48
48
|
const engineState = useEngineStateStore();
|
|
49
49
|
const hideHud = computed(() => !!engineState.dialogue || !!engineState.choices);
|
|
50
50
|
|
|
51
|
+
const backgroundLayerComponent = computed(() => getComponentOverride('BackgroundLayer') ?? DefaultBackgroundLayer);
|
|
52
|
+
const foregroundLayerComponent = computed(() => getComponentOverride('ForegroundLayer') ?? DefaultForegroundLayer);
|
|
51
53
|
const topBarComponent = computed(() => getComponentOverride('TopBar') ?? DefaultTopBar);
|
|
52
54
|
const actionOverlayComponent = computed(() => getComponentOverride('ActionOverlay') ?? DefaultActionOverlay);
|
|
53
55
|
const locationOverlayComponent = computed(() => getComponentOverride('LocationOverlay') ?? DefaultLocationOverlay);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { InjectionKey } from 'vue';
|
|
2
2
|
import type { VylosConfig } from '../engine/types';
|
|
3
3
|
|
|
4
|
-
export const CONFIG_INJECT_KEY: InjectionKey<VylosConfig> = Symbol('vylos-config');
|
|
4
|
+
export const CONFIG_INJECT_KEY: InjectionKey<VylosConfig> = Symbol.for('vylos-config');
|
|
@@ -27,8 +27,10 @@ export const DI_TOKENS = {
|
|
|
27
27
|
Engine: 'Engine',
|
|
28
28
|
} as const;
|
|
29
29
|
|
|
30
|
-
/** Component override map —
|
|
31
|
-
const
|
|
30
|
+
/** Component override map — stored on globalThis to survive dual-module resolution */
|
|
31
|
+
const GLOBAL_KEY = '__vylos_component_overrides__';
|
|
32
|
+
const componentOverrides: Record<string, Component> =
|
|
33
|
+
(globalThis as any)[GLOBAL_KEY] ??= shallowReactive<Record<string, Component>>({});
|
|
32
34
|
|
|
33
35
|
/** Register all default managers in a DI container */
|
|
34
36
|
function registerDefaults(c: DependencyContainer): void {
|