HabitModel get activeLabel of Entry
This commit is contained in:
@@ -80,3 +80,9 @@
|
||||
(+= content (.join (map todoEntries stringify) "\n") "\n")
|
||||
(File.saveContent textFile
|
||||
content))
|
||||
|
||||
// With rotating entries, the active one is the first one with the lowest score:
|
||||
(function :EntryLabel activeLabel [:Entry e]
|
||||
(let [lowScore (apply min (for label e.labels label.points))]
|
||||
(doFor label e.labels (when (= lowScore label.points) (return label)))
|
||||
(throw "no active?!")))
|
||||
|
@@ -2,4 +2,6 @@
|
||||
(method &override :Void update [:Float elapsed] (super.update elapsed))
|
||||
|
||||
(prop &mut :HabitModel model null)
|
||||
(method setModel [m] (set model ~m))
|
||||
(method setModel [m]
|
||||
(set model m)
|
||||
(doFor e model.bonusEntries ~(HabitModel.activeLabel e)))
|
Reference in New Issue
Block a user