mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user