mirror of
https://github.com/DaanVandenBosch/phantasmal-world.git
synced 2025-04-05 07:18:29 +08:00
Only the current area's event chains are now shown.
This commit is contained in:
parent
a72b51511c
commit
2ed9659d9b
@ -17,24 +17,30 @@ export class EventsView extends ResizableWidget {
|
||||
super();
|
||||
|
||||
this.disposables(
|
||||
quest_editor_store.current_quest.observe(({ value: quest }) => {
|
||||
this.quest_disposer.dispose_all();
|
||||
|
||||
if (quest) {
|
||||
this.quest_disposer.add(
|
||||
bind_children_to(
|
||||
this.element,
|
||||
quest.event_chains,
|
||||
this.create_chain_element,
|
||||
),
|
||||
);
|
||||
}
|
||||
}),
|
||||
quest_editor_store.current_quest.observe(this.update),
|
||||
quest_editor_store.current_area.observe(this.update),
|
||||
);
|
||||
|
||||
this.finalize_construction(EventsView.prototype);
|
||||
}
|
||||
|
||||
private update = (): void => {
|
||||
this.quest_disposer.dispose_all();
|
||||
|
||||
const quest = quest_editor_store.current_quest.val;
|
||||
const area = quest_editor_store.current_area.val;
|
||||
|
||||
if (quest && area) {
|
||||
this.quest_disposer.add(
|
||||
bind_children_to(
|
||||
this.element,
|
||||
quest.event_chains.filtered(chain => chain.events.get(0).area_id === area.id),
|
||||
this.create_chain_element,
|
||||
),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
private create_chain_element = (chain: QuestEventChainModel): [HTMLElement, Disposable] => {
|
||||
const disposer = new Disposer();
|
||||
const element = el.div(
|
||||
|
Loading…
Reference in New Issue
Block a user