SimpleWindow.promptForString
This commit is contained in:
@@ -302,19 +302,19 @@
|
|||||||
(inputTexts.forEach ->text (set text.hasFocus false))))))
|
(inputTexts.forEach ->text (set text.hasFocus false))))))
|
||||||
|
|
||||||
(function :SimpleWindow promptForChoice <>[T] [:String prompt
|
(function :SimpleWindow promptForChoice <>[T] [:String prompt
|
||||||
:Array<T> choices
|
:Array<T> choices
|
||||||
:T->Void onChoice
|
:T->Void onChoice
|
||||||
&opt :FlxColor bgColor
|
&opt :FlxColor bgColor
|
||||||
:FlxColor titleColor
|
:FlxColor titleColor
|
||||||
:FlxColor choiceColor
|
:FlxColor choiceColor
|
||||||
:Float percentWidth
|
:Float percentWidth
|
||||||
:Float percentHeight
|
:Float percentHeight
|
||||||
:Bool xButton
|
:Bool xButton
|
||||||
:String xKey
|
:String xKey
|
||||||
:String leftKey
|
:String leftKey
|
||||||
:String rightKey
|
:String rightKey
|
||||||
:ShortcutAction onClose
|
:ShortcutAction onClose
|
||||||
:Bool noShortcuts]
|
:Bool noShortcuts]
|
||||||
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey onClose)
|
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey onClose)
|
||||||
choiceColor (or choiceColor titleColor FlxColor.WHITE)]
|
choiceColor (or choiceColor titleColor FlxColor.WHITE)]
|
||||||
(doFor choice choices
|
(doFor choice choices
|
||||||
@@ -327,6 +327,30 @@
|
|||||||
(window.show)
|
(window.show)
|
||||||
window))
|
window))
|
||||||
|
|
||||||
|
(function :SimpleWindow promptForString [:String prompt
|
||||||
|
:String->Void onChoice
|
||||||
|
&opt :FlxColor bgColor
|
||||||
|
:FlxColor titleColor
|
||||||
|
:FlxColor submitColor
|
||||||
|
:Float percentWidth
|
||||||
|
:Float percentHeight
|
||||||
|
:Bool xButton
|
||||||
|
:String xKey
|
||||||
|
:String leftKey
|
||||||
|
:String rightKey
|
||||||
|
:ShortcutAction onClose]
|
||||||
|
(let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight xButton xKey leftKey rightKey onClose)
|
||||||
|
buttonColor (or submitColor FlxColor.WHITE)
|
||||||
|
inputText (new KissInputText 0 0 FlxG.width "" textSize true)]
|
||||||
|
(window.addControl inputText)
|
||||||
|
(window.makeText "{enter} Submit" buttonColor
|
||||||
|
->:Void s {
|
||||||
|
(window.hide)
|
||||||
|
(onChoice inputText.text)
|
||||||
|
})
|
||||||
|
(window.show)
|
||||||
|
window))
|
||||||
|
|
||||||
(method scrollLeft []
|
(method scrollLeft []
|
||||||
(when (> cameraColumn 0)
|
(when (> cameraColumn 0)
|
||||||
(-= cameraColumn 1)
|
(-= cameraColumn 1)
|
||||||
|
Reference in New Issue
Block a user