phantasmal-world/src/quest_editor/rendering/QuestRunner3DModelManager.ts
Daan Vanden Bosch de20e7b82f - Bugfix: FlatMappedListProperty wouldn't recompute its value and emit an event when it's computed property changed
- Event section IDs are now immutable
- Top level events can now be added
2019-12-27 23:33:34 +01:00

38 lines
1.3 KiB
TypeScript

import { QuestRenderer } from "./QuestRenderer";
import { AreaVariantDetails, Quest3DModelManager } from "./Quest3DModelManager";
import { QuestRunner } from "../QuestRunner";
import { AreaAssetLoader } from "../loading/AreaAssetLoader";
import { EntityAssetLoader } from "../loading/EntityAssetLoader";
import { property } from "../../core/observable";
/**
* Model loader used while debugging a quest.
*/
export class QuestRunner3DModelManager extends Quest3DModelManager {
constructor(
private readonly quest_runner: QuestRunner,
renderer: QuestRenderer,
area_asset_loader: AreaAssetLoader,
entity_asset_loader: EntityAssetLoader,
) {
super(property(undefined), renderer, area_asset_loader, entity_asset_loader);
this.disposer.add_all(
this.quest_runner.game_state.current_area_variant.observe(this.area_variant_changed, {
call_now: true,
}),
);
}
protected get_area_variant_details(): AreaVariantDetails {
const game_state = this.quest_runner.game_state;
return {
episode: game_state.episode,
area_variant: game_state.current_area_variant.val,
npcs: game_state.npcs,
objects: game_state.objects,
};
}
}