SimpleWindow.notify
This commit is contained in:
@@ -629,6 +629,34 @@
|
|||||||
(when FlxG.mouse.justPressed
|
(when FlxG.mouse.justPressed
|
||||||
(inputTexts.forEach ->text (set text.hasFocus false))))))))
|
(inputTexts.forEach ->text (set text.hasFocus false))))))))
|
||||||
|
|
||||||
|
(function :SimpleWindow notify [:String message
|
||||||
|
:Void->Void onDismiss
|
||||||
|
&opt :FlxColor bgColor
|
||||||
|
:FlxColor titleColor
|
||||||
|
:FlxColor choiceColor
|
||||||
|
:Float percentWidth
|
||||||
|
:Float percentHeight
|
||||||
|
:Bool xButton
|
||||||
|
:String xKey
|
||||||
|
:String enterKey]
|
||||||
|
(promptForChoice
|
||||||
|
message
|
||||||
|
["OK"]
|
||||||
|
->_ (onDismiss)
|
||||||
|
bgColor
|
||||||
|
titleColor
|
||||||
|
choiceColor
|
||||||
|
percentWidth
|
||||||
|
percentHeight
|
||||||
|
xButton
|
||||||
|
xKey
|
||||||
|
null
|
||||||
|
null
|
||||||
|
null
|
||||||
|
null
|
||||||
|
enterKey
|
||||||
|
onDismiss))
|
||||||
|
|
||||||
(function :SimpleWindow promptForChoice <>[T] [:String prompt
|
(function :SimpleWindow promptForChoice <>[T] [:String prompt
|
||||||
:Array<T> choices
|
:Array<T> choices
|
||||||
:T->Void onChoice
|
:T->Void onChoice
|
||||||
@@ -646,7 +674,7 @@
|
|||||||
:String enterKey
|
:String enterKey
|
||||||
:ShortcutAction onClose
|
:ShortcutAction onClose
|
||||||
:Bool noShortcuts]
|
:Bool noShortcuts]
|
||||||
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey upKey downKey enterKey onClose)
|
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey upKey downKey enterKey onClose)
|
||||||
choiceColor (or choiceColor titleColor FlxColor.WHITE)]
|
choiceColor (or choiceColor titleColor FlxColor.WHITE)]
|
||||||
(doFor choice choices
|
(doFor choice choices
|
||||||
(window.makeText (Std.string choice) choiceColor
|
(window.makeText (Std.string choice) choiceColor
|
||||||
@@ -674,7 +702,7 @@
|
|||||||
:String downKey
|
:String downKey
|
||||||
:String enterKey
|
:String enterKey
|
||||||
:ShortcutAction onClose]
|
:ShortcutAction onClose]
|
||||||
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey upKey downKey enterKey onClose)
|
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey upKey downKey enterKey onClose)
|
||||||
buttonColor (or submitColor FlxColor.WHITE)
|
buttonColor (or submitColor FlxColor.WHITE)
|
||||||
inputText (new KissInputText 0 0 FlxG.width "" textSize true)]
|
inputText (new KissInputText 0 0 FlxG.width "" textSize true)]
|
||||||
(window.addControl inputText)
|
(window.addControl inputText)
|
||||||
|
|||||||
Reference in New Issue
Block a user