habit-puzzles work around key conflict handling by not allowing custom shortcuts

This commit is contained in:
2022-10-21 19:58:08 +00:00
parent 3626c93e38
commit ad6d9eac75
6 changed files with 27 additions and 18 deletions

View File

@@ -41,6 +41,7 @@
<haxelib name="kiss-tools" /> <haxelib name="kiss-tools" />
<haxelib name="kiss-flixel" /> <haxelib name="kiss-flixel" />
<haxelib name="datetime" /> <haxelib name="datetime" />
<haxelib name="re-flex" />
<assets path="assets" /> <assets path="assets" />
<assets path="puzzles/Photos by Trent Nelson" unless="CI_OS_NAME" /> <assets path="puzzles/Photos by Trent Nelson" unless="CI_OS_NAME" />
<assets path="puzzles/neuro" if="debug" /> <assets path="puzzles/neuro" if="debug" />

View File

@@ -1,29 +1,29 @@
DAILY DAILY
----- -----
MTWThF: [w]eekday chores MTWThF: weekday chores
SSu: [w]eekend chores SSu: weekend chores
healthy [b]reakfast healthy breakfast
MONTHLY MONTHLY
-------- --------
1: [p]ay rent 1: pay rent
INTERVAL INTERVAL
-------- --------
7: buy [g]roceries 7: buy groceries
BONUS BONUS
----- -----
[j]ournal journal
[c]all someone you love call someone you love
[r]eading session reading 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 Finish a book for fun/Finish a book to grow as a person/Finish a book for fun /Finish a book to learn something
play [H]abit Puzzles | play Habit Puzzles |
[d]o chores do chores
TODO TODO
---- ----
[C]ustomize my Habit Puzzles file Customize your habits and tasks
FILES FILES
----- -----

View File

@@ -44,6 +44,7 @@ import jigsawx.JigsawPiece;
import jigsawx.Jigsawx; import jigsawx.Jigsawx;
import jigsawx.math.Vec2; import jigsawx.math.Vec2;
import kiss_flixel.DragToSelectPlugin; import kiss_flixel.DragToSelectPlugin;
import re_flex.R;
typedef StartPuzzleFunc = (Int, Int) -> Void; typedef StartPuzzleFunc = (Int, Int) -> Void;

View File

@@ -146,8 +146,10 @@
(localVar title (localVar title
"Add a label for this ${typeDescriptor}, or use SHIFT+ENTER to add a ${multipleLabelDescriptor}:") "Add a label for this ${typeDescriptor}, or use SHIFT+ENTER to add a ${multipleLabelDescriptor}:")
(set entryCreationWindow (new SimpleWindow title null null 0.9 0.9 true xKey leftKey rightKey backToEntryWindow)) (set entryCreationWindow (new SimpleWindow title null null 0.9 0.9 true xKey leftKey rightKey backToEntryWindow))
// TODO don't allow /, +, $, * (set entryNameText (defAndCall method newNameInputText
(set entryNameText (new KissInputText 0 0 FlxG.width "" textSize true)) (let [t (new KissInputText 0 0 FlxG.width "" textSize true)]
(set t.customFilterPattern (new EReg (R.oneOfChars #"/+$*[]{}"# ) ""))
t)))
(entryCreationWindow.addControl entryNameText) (entryCreationWindow.addControl entryNameText)
(entryCreationWindow.makeText "Create" FlxColor.LIME ->:Void _ (addCreatedEntry)) (entryCreationWindow.makeText "Create" FlxColor.LIME ->:Void _ (addCreatedEntry))
(when entryWindow (when entryWindow
@@ -916,8 +918,7 @@
(method editLabels [:Entry e] (method editLabels [:Entry e]
(let [window (new SimpleWindow "Editing labels" null null 0.9 0.9 true xKey leftKey rightKey backToEntryWindow) (let [window (new SimpleWindow "Editing labels" null null 0.9 0.9 true xKey leftKey rightKey backToEntryWindow)
inputTexts (for l e.labels inputTexts (for l e.labels
// TODO don't allow /, +, $, * (newNameInputText))]
(new KissInputText 0 0 FlxG.width l.label textSize true))]
// TODO allow adding more labels in between/before/at end // TODO allow adding more labels in between/before/at end
// TODO allow deleting labels (keep score?) // TODO allow deleting labels (keep score?)

View File

@@ -15,7 +15,10 @@ import flixel.util.FlxTimer;
import flixel.FlxCamera; import flixel.FlxCamera;
/** /**
* KissInputText based on * KissInputText is based on FlxInputText.
*
* It is modified to be compatible with kiss_flixel's SimpleWindow
*
* FlxInputText v1.11, ported to Haxe * FlxInputText v1.11, ported to Haxe
* @author larsiusprime, (Lars Doucet) * @author larsiusprime, (Lars Doucet)
* @link http://github.com/haxeflixel/flixel-ui * @link http://github.com/haxeflixel/flixel-ui

View File

@@ -64,7 +64,10 @@
(set keyHandler.onBadKey ->:Void [key context] (set keyHandler.onBadKey ->:Void [key context]
(unless (= key xKey) (unless (= key xKey)
(print "bad key $key in context $context"))) // TODO do SOMETHING like visual/audio bell, cancel and restart (#when debug
(print "bad key $key in context $context"))
// TODO do SOMETHING like visual/audio bell, cancel and restart
))
(set keyHandler.onSelectItem (set keyHandler.onSelectItem
->:Void [:ShortcutAction a] { ->:Void [:ShortcutAction a] {
(a) (a)