mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Added filter for NamePromptDialog, configurations can now be renamed
This commit is contained in:
@@ -5,7 +5,7 @@ module TAC
|
||||
background Gosu::Color::GRAY
|
||||
flow width: 1.0 do
|
||||
label "Name", width: 0.25
|
||||
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", width: 0.70
|
||||
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", filter: method(:filter), width: 0.70
|
||||
end
|
||||
@name_error = label "", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@name_error.hide
|
||||
@@ -37,6 +37,10 @@ module TAC
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def filter(text)
|
||||
text.match(/[A-Za-z0-9,._\-]/) ? text : ""
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user