improve Prompt and use it to ask for level and file name when exporting
This commit is contained in:
@@ -18,6 +18,8 @@ Prompt = {
|
||||
pos = { x = 10, y = 10 },
|
||||
input = "",
|
||||
name = "input",
|
||||
canceled = false,
|
||||
closing = false,
|
||||
|
||||
active_prompt = nil,
|
||||
}
|
||||
@@ -32,9 +34,12 @@ end
|
||||
function Prompt:keypressed(key, scancode, isrepeat)
|
||||
if key == "backspace" then
|
||||
self.input = backspace(self.input)
|
||||
elseif key == "return" or key == "kpenter" then
|
||||
elseif key == "return" or key == "kpenter" or key == "escape" then
|
||||
if key == "escape" then
|
||||
self.canceled = true
|
||||
end
|
||||
self.closing = true
|
||||
self:func()
|
||||
Prompt.active_prompt = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user