paste into NAT text input
This commit is contained in:
@@ -22,6 +22,8 @@ using kiss_flixel.CameraTools;
|
|||||||
import kiss_tools.KeyShortcutHandler;
|
import kiss_tools.KeyShortcutHandler;
|
||||||
import kiss_tools.FlxKeyShortcutHandler;
|
import kiss_tools.FlxKeyShortcutHandler;
|
||||||
import nat.systems.PlaygroundSystem;
|
import nat.systems.PlaygroundSystem;
|
||||||
|
import flash.desktop.Clipboard;
|
||||||
|
import flash.desktop.ClipboardFormats;
|
||||||
|
|
||||||
@:build(kiss.Kiss.build())
|
@:build(kiss.Kiss.build())
|
||||||
class PlayState extends FlxState implements ArchiveUI {}
|
class PlayState extends FlxState implements ArchiveUI {}
|
||||||
|
|||||||
@@ -115,16 +115,25 @@
|
|||||||
(when sh.currentMap
|
(when sh.currentMap
|
||||||
(sh.update))
|
(sh.update))
|
||||||
|
|
||||||
|
(when (and FlxG.keys.justPressed.V FlxG.keys.pressed.CONTROL)
|
||||||
|
(when (and textInput textInput.hasFocus)
|
||||||
|
(whenLet [text (Clipboard.generalClipboard.getData ClipboardFormats.TEXT_FORMAT)]
|
||||||
|
(when (textInput.text.endsWith "v")
|
||||||
|
(set textInput.text (substr textInput.text 0 -1)))
|
||||||
|
(+= textInput.text text)
|
||||||
|
(set textInput.caretIndex textInput.text.length))))
|
||||||
|
|
||||||
(when FlxG.keys.justPressed.ESCAPE
|
(when FlxG.keys.justPressed.ESCAPE
|
||||||
(if (and textInput textInput.hasFocus)
|
(cond
|
||||||
{
|
((and textInput textInput.hasFocus)
|
||||||
(set textInput.callback null)
|
(set textInput.callback null)
|
||||||
(hideUI textInput)
|
(hideUI textInput)
|
||||||
// This part is hacky...
|
// This part is hacky...
|
||||||
(set lastUI textInputLabel)
|
(set lastUI textInputLabel)
|
||||||
(hideUI textInputLabel)
|
(hideUI textInputLabel))
|
||||||
}
|
(sh.currentMap
|
||||||
(Sys.exit 0)))
|
(sh.cancel))
|
||||||
|
(true (Sys.exit 0))))
|
||||||
|
|
||||||
// Press ENTER to type a command to run
|
// Press ENTER to type a command to run
|
||||||
(when (and !textInput FlxG.keys.justPressed.ENTER)
|
(when (and !textInput FlxG.keys.justPressed.ENTER)
|
||||||
|
|||||||
Reference in New Issue
Block a user