Component-oriented playgrounds - Close #124
This commit is contained in:
@@ -211,7 +211,6 @@
|
||||
(archive.addSystem ps)
|
||||
(set ps.setupProcess true)
|
||||
(ps.process archive ui)
|
||||
(set ps.setupProcess false)
|
||||
(ps.switchPlaygroundKey (dictGet archive.playgrounds "default")))
|
||||
|
||||
// Just for testing:
|
||||
@@ -243,7 +242,11 @@
|
||||
|
||||
(defCommand CreateEntry [name (Text null)]
|
||||
[(archive.createEntry ->e
|
||||
(addComponent archive e Name name))])
|
||||
{
|
||||
(when (and playgroundSystem (playgroundSystem.currentDefaultTags))
|
||||
(addTags archive e (playgroundSystem.currentDefaultTags)))
|
||||
(addComponent archive e Name name)
|
||||
})])
|
||||
|
||||
(defCommand CreateEntries [names (VarText null)]
|
||||
// createEntry returns a list, so these lists must be flattened
|
||||
@@ -338,11 +341,14 @@
|
||||
(true (addComponent archive e Scale scale))))
|
||||
entries)
|
||||
|
||||
(defCommand CreatePlayground [name (Text null) catsMatchExp (Text null)]
|
||||
// TODO use VarTags
|
||||
(defCommand CreatePlayground [name (Text null) catsMatchExp (Text null) defaultTags (VarText null)]
|
||||
(archive.changePlaygrounds ->:Void [:DynamicAccess<Dynamic> p]
|
||||
(dictSet p name (object catsMatch catsMatchExp)))
|
||||
// TODO make the corresponding playground entry and return it
|
||||
[])
|
||||
(let [[e] (CreateTaggedEntry ["playground"] name)]
|
||||
(addComponent archive e CatsMatchExp catsMatchExp)
|
||||
(addComponent archive e TagList defaultTags)
|
||||
[e]))
|
||||
|
||||
(defCommand SwitchPlayground [name (Text null)]
|
||||
(archive.changePlaygrounds ->:Void [:DynamicAccess<Dynamic> p] (dictSet p "default" name))
|
||||
|
@@ -1,7 +1,7 @@
|
||||
(load "../Lib.kiss")
|
||||
|
||||
(prop &mut :String _playgroundKey "")
|
||||
(prop &mut :TagList currentDefaultTags [])
|
||||
(method :TagList currentDefaultTags [] (or (dictGet playgroundDefaultTags _playgroundKey) []))
|
||||
(method :String getPlaygroundKey [] _playgroundKey)
|
||||
|
||||
(prop :Map<String,TagList> playgroundDefaultTags (new Map))
|
||||
@@ -50,10 +50,11 @@
|
||||
(prop &mut :Bool setupProcess false)
|
||||
|
||||
(method &override :Void process [:Archive archive &opt :ArchiveUI ui]
|
||||
(when _playgroundKey
|
||||
(set setupProcess true)
|
||||
(when setupProcess
|
||||
(super.process archive ui)
|
||||
(set setupProcess false)
|
||||
(return))
|
||||
(when _playgroundKey
|
||||
(super.process archive ui)
|
||||
(doFor e (entries.iterator)
|
||||
(when (hasComponent e Positions)
|
||||
|
Reference in New Issue
Block a user