diff --git a/projects/habit-puzzle-game/source/HabitModel.kiss b/projects/habit-puzzle-game/source/HabitModel.kiss index 675c3beb..cf191ec1 100644 --- a/projects/habit-puzzle-game/source/HabitModel.kiss +++ b/projects/habit-puzzle-game/source/HabitModel.kiss @@ -92,7 +92,7 @@ (otherwise (break)))))) (method :Int totalPoints [] - (apply + (for l (flatten (for e (the Array (concat dailyEntries bonusEntries todoEntries)) e.labels)) l.points))) + (apply + (for l (flatten (for e (the Array (concat dailyEntries intervalEntries bonusEntries todoEntries)) e.labels)) l.points))) (function :String stringify [:Entry e] "$(ifLet [(Daily days lastDayDone) e.type] diff --git a/projects/habit-puzzle-game/source/HabitState.hx b/projects/habit-puzzle-game/source/HabitState.hx index 4fbb6052..2b1d3547 100644 --- a/projects/habit-puzzle-game/source/HabitState.hx +++ b/projects/habit-puzzle-game/source/HabitState.hx @@ -15,6 +15,7 @@ import kiss.List; import kiss_tools.FlxKeyShortcutHandler; import HabitModel; import hx.strings.Strings; +import datetime.DateTime; @:build(kiss.Kiss.build()) class HabitState extends FlxState {} diff --git a/projects/habit-puzzle-game/source/HabitState.kiss b/projects/habit-puzzle-game/source/HabitState.kiss index c03bb4c5..19e8008b 100644 --- a/projects/habit-puzzle-game/source/HabitState.kiss +++ b/projects/habit-puzzle-game/source/HabitState.kiss @@ -69,13 +69,15 @@ (set textY 0) (set color FlxColor.ORANGE) (map (m.activeDailyEntries) makeText) + (set color FlxColor.BLUE) + (map (m.activeIntervalEntries) makeText) (set color FlxColor.WHITE) (map (m.activeBonusEntries) makeText) (set color FlxColor.YELLOW) (map (m.activeTodoEntries) makeText) (add entryTexts) - (doFor e (the Array (concat m.dailyEntries m.bonusEntries m.todoEntries)) + (doFor e (the Array (concat m.dailyEntries m.intervalEntries m.bonusEntries m.todoEntries)) (when (HabitModel.isActive e) (let [label (HabitModel.activeLabel e)] (shortcutHandler.registerItem label.label e)))) @@ -86,6 +88,8 @@ (+= label.points 1) (whenLet [(Daily days lastDayDone) e.type] (set e.type (Daily days (HabitModel.todayString)))) + (whenLet [(Interval days lastDayDone) e.type] + (set e.type (Interval days (.toString (DateTime.now))))) (m.save) (setModel m) (shortcutHandler.start)))