When creating a new quest and saving it, the filename of a quest that was loaded earlier was shown. This is now fixed.

This commit is contained in:
Daan Vanden Bosch 2019-08-07 14:22:47 +02:00
parent c8ae97d8f6
commit 194df177ab

View File

@ -82,8 +82,7 @@ class QuestEditorStore {
try {
const buffer = yield read_file(file);
const quest = parse_quest(new ArrayBufferCursor(buffer, Endianness.Little));
this.current_quest_filename = filename;
this.set_quest(quest);
this.set_quest(quest, filename);
} catch (e) {
logger.error("Couldn't read file.", e);
}
@ -146,7 +145,13 @@ class QuestEditorStore {
};
@action
private set_quest = flow(function* set_quest(this: QuestEditorStore, quest?: Quest) {
private set_quest = flow(function* set_quest(
this: QuestEditorStore,
quest?: Quest,
filename?: string
) {
this.current_quest_filename = filename;
if (quest !== this.current_quest) {
this.undo.reset();
this.script_undo.reset();