From 85c2866a1422e3bda0b89d943a7002c14a0abdc2 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 31 Aug 2022 22:18:55 +0000 Subject: [PATCH] more reasonable behavior for label sequences on non-bonus habits --- .../playtest-todo.txt | 26 +++++++++---------- .../source/HabitModel.kiss | 14 +++++----- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/projects/flixel-desktop-habit-puzzle-game/playtest-todo.txt b/projects/flixel-desktop-habit-puzzle-game/playtest-todo.txt index 97d2b978..6d420390 100644 --- a/projects/flixel-desktop-habit-puzzle-game/playtest-todo.txt +++ b/projects/flixel-desktop-habit-puzzle-game/playtest-todo.txt @@ -1,17 +1,17 @@ -~~first time opening, choose puzzle pack menu doesn't go away~~ +-[x] first time opening, choose puzzle pack menu doesn't go away -- create task menu goes away after choosing type? -- no way to cancel deleting task/etc. (Forces them to delete one) - - can only delete one at a time -- delete key shouldn't close the application -- press escape to work on puzzle needs explanation/a more intuitive way to do it -- Explain that clicking on habits marks them finished -- right click rotates pieces explanation/tooltip -- add a label for this [TYPE OF] habit -- don't allow slash in habit labels (unless inside brackets) +-[ ] create task menu goes away after choosing type? +-[ ] no way to cancel deleting task/etc. (Forces them to delete one) + -[ ] can only delete one at a time (window closes after) +-[ ] delete key shouldn't close the application +-[ ] press escape to work on puzzle needs explanation/a more intuitive way to do it +-[ ] Explain that clicking on habits marks them finished +-[ ] right click (and space bar) rotates pieces ONLY WHEN HOLDING explanation/tooltip +-[x] add a label for this [TYPE OF] habit +-[ ] don't allow slash in habit labels (unless inside brackets) -- Interval multi-part tasks (i.e. laundry) will behave counter-intuitively (i.e. it tells you to dry your laundry a week after washing it) - - but sometimes the counter-intuitive behavior may be wanted +-[x] Interval multi-part tasks (i.e. laundry) will behave counter-intuitively (i.e. it tells you to dry your laundry a week after washing it) + -[x] but sometimes the counter-intuitive behavior may be wanted (I doubt it) -- fullscreen button \ No newline at end of file +-[ ] fullscreen button \ No newline at end of file diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss index 72ac070d..2dbe72b6 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitModel.kiss @@ -237,10 +237,12 @@ (method addPoint [:Entry e] (let [label (activeLabel e)] (+= label.points 1) - (whenLet [(Daily days lastDayDone) e.type] - (set e.type (Daily days (HabitModel.todayString)))) - (whenLet [(Monthly days lastDayDone) e.type] - (set e.type (Monthly days (.toString (DateTime.now))))) - (whenLet [(Interval days lastDayDone) e.type] - (set e.type (Interval days (.toString (DateTime.now)))))) + // For task-list types, set lastDayDone when the final label is done + (when (apply = (for label e.labels label.points)) + (whenLet [(Daily days lastDayDone) e.type] + (set e.type (Daily days (HabitModel.todayString)))) + (whenLet [(Monthly days lastDayDone) e.type] + (set e.type (Monthly days (.toString (DateTime.now))))) + (whenLet [(Interval days lastDayDone) e.type] + (set e.type (Interval days (.toString (DateTime.now))))))) (save)) \ No newline at end of file