Allow edited action to keep its name when editing it (fixes: #1), made dialogs respond to enter and escape, Confirm dialog now shows dark red color for dangerous operations and prevents enter for accepting it

This commit is contained in:
2021-02-10 22:21:53 -06:00
parent 9999026969
commit 3cc4c204a7
12 changed files with 94 additions and 44 deletions

View File

@@ -54,6 +54,9 @@ module TAC
text.match(/[A-Za-z0-9._\- ]/) ? text : ""
end
def try_commit
end
def draw
@previous_state.draw
Gosu.flush
@@ -73,6 +76,17 @@ module TAC
center_dialog
end
def button_down(id)
super
case id
when Gosu::KB_ENTER, Gosu::KB_RETURN
try_commit
when Gosu::KB_ESCAPE
close
end
end
def close
$window.pop_state
end