bring back startingPoints in the habit save file

This commit is contained in:
2022-08-02 00:22:23 +00:00
parent 31afc7f912
commit 744f99bc46
2 changed files with 34 additions and 3 deletions

View File

@@ -0,0 +1,29 @@
DAILY
-----
MTWThF: [w]eekday chores
SSu: [w]eekend chores
healthy [b]reakfast
MONTHLY
--------
1: [p]ay rent
INTERVAL
--------
7: buy [g]roceries
BONUS
-----
[j]ournal
[c]all someone you love
[r]eading session
[R]ead a book for fun /[R]ead a book to grow/[R]ead a book for fun /[R]ead a book to learn
play [H]abit Puzzles |
[d]o chores
TODO
----
[C]ustomize my Habit Puzzles file
FILES
-----

View File

@@ -27,9 +27,11 @@
(continue))
((Some "") (continue))
// Types won't unify with the next case, so this is its own:
((when (= lastHeader "FILES") (Some path))
((when (= lastHeader "FILES") (Some line))
(rewardFiles.push
(let [startingPoints (* rewardFiles.length HabitState.TOTAL_PIECES)]
(let [parts (line.split " ")
startingPoints (Std.parseInt (parts.pop))
path (parts.join " ")]
(objectWith path startingPoints))))
((Some line)
(.push
@@ -136,7 +138,7 @@
"${label.label} $(* "|" label.points)") "/")")
(function :String stringifyRewardFile [:RewardFile rewardFile]
rewardFile.path)
"${rewardFile.path} ${rewardFile.startingPoints}")
(method :Void save []
(localVar &mut content "DAILY\n-----\n")