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-flixel" />
<haxelib name="datetime" />
<haxelib name="re-flex" />
<assets path="assets" />
<assets path="puzzles/Photos by Trent Nelson" unless="CI_OS_NAME" />
<assets path="puzzles/neuro" if="debug" />

View File

@@ -1,29 +1,29 @@
DAILY
-----
MTWThF: [w]eekday chores
SSu: [w]eekend chores
healthy [b]reakfast
MTWThF: weekday chores
SSu: weekend chores
healthy breakfast
MONTHLY
--------
1: [p]ay rent
1: pay rent
INTERVAL
--------
7: buy [g]roceries
7: buy groceries
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
journal
call someone you love
reading session
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 Habit Puzzles |
do chores
TODO
----
[C]ustomize my Habit Puzzles file
Customize your habits and tasks
FILES
-----

View File

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

View File

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

View File

@@ -15,7 +15,10 @@ import flixel.util.FlxTimer;
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
* @author larsiusprime, (Lars Doucet)
* @link http://github.com/haxeflixel/flixel-ui

View File

@@ -64,7 +64,10 @@
(set keyHandler.onBadKey ->:Void [key context]
(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
->:Void [:ShortcutAction a] {
(a)