diff --git a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss index 19b490ef..a2289d43 100644 --- a/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss +++ b/projects/flixel-desktop-habit-puzzle-game/source/HabitState.kiss @@ -123,8 +123,8 @@ (set typeAdding type) (set labelsAdding []) (set addingLabels true) - (localVar &mut title "Alternating labels for this habit:") - (whenLet [Todo type] (set title "Steps for completing this task:")) + (localVar &mut title "Add a label for this habit, or use SHIFT+ENTER to add a series of alternating labels:") + (whenLet [Todo type] (set title "Add a label for this task, or use SHIFT+ENTER to add a series of steps for completing this task:")) (set entryCreationWindow (new SimpleWindow title null null 0.9 0.9)) (set entryNameText (new FlxInputText 0 0 FlxG.width "" textSize true)) (entryCreationWindow.addControl entryNameText) @@ -136,11 +136,14 @@ (when (and entryNameText FlxG.keys.justPressed.ENTER) (cond + ((and FlxG.keys.pressed.SHIFT addingLabels) + (when (entryNameText.text.trim) + (entryCreationWindow.makeText entryNameText.text) + (labelsAdding.push entryNameText.text) + (set entryNameText.text "") + (set entryNameText.caretIndex 0))) (addingLabels - (entryCreationWindow.makeText entryNameText.text) - (labelsAdding.push entryNameText.text) - (set entryNameText.text "") - (set entryNameText.caretIndex 0)) + (addCreatedEntry)) (true (startAddingInterval)))) } @@ -825,7 +828,7 @@ (method addCreatedEntry [] // addEntry() calls save() - (when entryNameText.text + (when (entryNameText.text.trim) (labelsAdding.push entryNameText.text)) (unless labelsAdding (return)) diff --git a/projects/kiss-flixel/src/kiss_flixel/SimpleWindow.kiss b/projects/kiss-flixel/src/kiss_flixel/SimpleWindow.kiss index d6d225bc..c5349517 100644 --- a/projects/kiss-flixel/src/kiss_flixel/SimpleWindow.kiss +++ b/projects/kiss-flixel/src/kiss_flixel/SimpleWindow.kiss @@ -54,6 +54,7 @@ // TODO could make a camera on the window so the controls are clipped by the camera (method addControl [:FlxSprite control] + (set control.cameras this.cameras) (set control.x nextControlX) (set control.y nextControlY) (controls.add control)