NAT use SimpleWindow. Close #108
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
package kiss_flixel;
|
||||
|
||||
import kiss.Prelude;
|
||||
import kiss.List;
|
||||
import kiss_tools.KeyShortcutHandler;
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
@:build(kiss.Kiss.build())
|
||||
class KeyShortcutWindow<T> extends SimpleWindow {}
|
@@ -1,29 +0,0 @@
|
||||
// Wraps a given generic KeyShortcutHandler within
|
||||
// the FlxKeyShortcutHandler that every SimpleWindow has,
|
||||
// using the window to display available mappings
|
||||
// from the currently active prefix map
|
||||
(defNew [&prop :KeyShortcutHandler<T> innerKeyShortcuts
|
||||
&prop :T->String elementToStringWithoutBrackets
|
||||
&opt :String title
|
||||
:FlxColor bgColor
|
||||
:FlxColor textColor
|
||||
:Float percentWidth
|
||||
:Float percentHeight]
|
||||
(super title bgColor textColor percentWidth percentHeight)
|
||||
(set innerKeyShortcuts.onSelectPrefixMap ->map {
|
||||
(clearControls)
|
||||
(doFor =>key keyBehavior map
|
||||
(case keyBehavior
|
||||
((Final item)
|
||||
(makeText "[${key}] - $(elementToString item)" null ->_ (innerKeyShortcuts.onSelectItem item)))
|
||||
((Prefix innerMap)
|
||||
(makeText "[${key}] - $(count innerMap) more options" null ->_ (innerKeyShortcuts.onSelectPrefixMap innerMap)))
|
||||
(null null)))}))
|
||||
|
||||
(method &override :Void show []
|
||||
(super.show)
|
||||
(innerKeyShortcuts.start))
|
||||
|
||||
(method &override :Void hide []
|
||||
(super.hide)
|
||||
(innerKeyShortcuts.cancel))
|
Reference in New Issue
Block a user