diff --git a/src/kiss_flixel/SimpleWindow.kiss b/src/kiss_flixel/SimpleWindow.kiss index b4e03ad..5b4e4c1 100644 --- a/src/kiss_flixel/SimpleWindow.kiss +++ b/src/kiss_flixel/SimpleWindow.kiss @@ -5,7 +5,7 @@ (prop &mut keyboardEnabled true) // TODO tooltip support with left-click and right-click action -// icons and explanations +// icons and explanations? (defNew [&opt :String _title :FlxColor bgColor @@ -129,4 +129,23 @@ } { (set text.color color) - }))))))) \ No newline at end of file + }))))))) + +(function :SimpleWindow promptForChoice <>[T] [:String prompt + :Array choices + :T->Void onChoice + &opt :FlxColor bgColor + :FlxColor titleColor + :FlxColor choiceColor + :Float percentWidth + :Float percentHeight] + (let [window (new SimpleWindow prompt bgColor titleColor percentWidth percentHeight) + choiceColor (or choiceColor titleColor FlxColor.WHITE)] + (doFor choice choices + (window.makeText (Std.string choice) choiceColor + ->:Void s { + (window.hide) + (onChoice choice) + })) + (window.show) + window)) \ No newline at end of file