EntryLink component

This commit is contained in:
2023-12-25 13:08:09 -07:00
parent 3da0a10948
commit 14e7ba2e56
3 changed files with 13 additions and 0 deletions

View File

@@ -539,8 +539,14 @@
(addComponent archive e Dates [=>"Created" (Date.now)])
})])
(defCommand AddEntryLink [entries (SelectedEntries 1 null) linkTo OneEntry]
(for e entries
(addEntryLink archive e linkTo)))
(defCommand InvokeEntry [e SelectedEntry]
(cond
((hasComponent e EntryLink)
(InvokeEntry (dictGet archive.entries (readComponent e EntryLink))))
((hasComponent e NATCommand)
(tryRunCommand (readComponent e NATCommand)) 0)
((hasComponent e NATCommands)

View File

@@ -149,6 +149,10 @@
(doFor e2 entriesToRemove (conn.remove e2.id))))
e)
(function addEntryLink [:nat.Archive archive :nat.Entry e :nat.Entry eLink]
(addComponent archive e EntryLink eLink.id)
e)
(function colorIFromF [:nat.components.ColorF cf]
(object r (Std.int (* 255 cf.r)) g (Std.int (* 255 cf.g)) b (Std.int (* 255 cf.b)) a (Std.int (* 255 cf.a))))

View File

@@ -0,0 +1,3 @@
package nat.components;
typedef EntryLink = EntryRef;