From 6eb8aafb77846d80d9d7043679f9b7c4fb996e4f Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 27 Sep 2021 19:44:25 -0600 Subject: [PATCH] Fix type error in PrintComponent --- projects/nat-archive-tool/src/nat/Archive.kiss | 7 ++++--- projects/nat-archive-tool/src/nat/ArchiveController.kiss | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/projects/nat-archive-tool/src/nat/Archive.kiss b/projects/nat-archive-tool/src/nat/Archive.kiss index 8326b504..9491d796 100644 --- a/projects/nat-archive-tool/src/nat/Archive.kiss +++ b/projects/nat-archive-tool/src/nat/Archive.kiss @@ -31,8 +31,9 @@ // After modifying an entry, this must be called. If you are writing in a createEntry // initializer or a system's processEntry function, this will happen automatically. -// Otherwise, you can guarantee it happens automatically by using the (withWritableEntry) -// and (withWritableComponents) macros in Lib.kiss +// Also most functions that only affect the Entry, not its components' contents, +// will call this automatically though (withWritableEntry). +// When changing components, use the (withWritableComponents) macro in Lib.kiss (method refreshEntry [:Entry e] (_saveEntry e) (doFor system systems @@ -43,7 +44,7 @@ (joinPath archiveDir "entries" (e.id.withExtension "json")) (Json.stringify e))) -(method componentData [:Entry e :String componentType] +(method :Dynamic componentData [:Entry e :String componentType] (haxe.Json.parse (File.getContent (joinPath archiveDir "components" "$(dictGet e.components componentType).json")))) (method fullData [:Entry e] diff --git a/projects/nat-archive-tool/src/nat/ArchiveController.kiss b/projects/nat-archive-tool/src/nat/ArchiveController.kiss index 8c3eca59..a05930d5 100644 --- a/projects/nat-archive-tool/src/nat/ArchiveController.kiss +++ b/projects/nat-archive-tool/src/nat/ArchiveController.kiss @@ -184,7 +184,7 @@ (defCommand PrintComponent [entries (SelectedEntries null null) componentType (Text null)] - (doFor e entries (ui.displayMessage (archive.componentData e componentType))) []) + (doFor e entries (ui.displayMessage (Std.string (archive.componentData e componentType)))) []) (defCommand CreateEntry [name (Text null)] [(archive.createEntry ->e