fix repeated show() calls
This commit is contained in:
@@ -52,18 +52,23 @@
|
||||
|
||||
// TODO makeButton
|
||||
// TODO make inputText
|
||||
(prop &mut _shown false)
|
||||
|
||||
(method show []
|
||||
(unless _shown
|
||||
(FlxG.state.add this)
|
||||
(FlxG.state.add controls)
|
||||
(windowStack.push this)
|
||||
(keyHandler.start))
|
||||
(keyHandler.start)
|
||||
(set _shown true)))
|
||||
|
||||
(method hide []
|
||||
(when _shown
|
||||
(FlxG.state.remove this)
|
||||
(FlxG.state.remove controls)
|
||||
(windowStack.remove this)
|
||||
(keyHandler.cancel))
|
||||
(keyHandler.cancel)
|
||||
(set _shown false)))
|
||||
|
||||
(method &override update [:Float elapsed]
|
||||
(super.update elapsed)
|
||||
|
Reference in New Issue
Block a user