Config is now saved and synced when updated

This commit is contained in:
2020-06-07 22:47:53 -05:00
parent ab6edb7a58
commit 151df4ca57
14 changed files with 162 additions and 59 deletions

View File

@@ -0,0 +1,14 @@
module TAC
class Dialog
class AlertDialog < Dialog
def build
background Gosu::Color::GRAY
label @options[:message], text_size: 18
button "Close", width: 1.0, text_size: 18 do
close
end
end
end
end
end

View File

@@ -3,20 +3,24 @@ module TAC
class NamePromptDialog < Dialog
def build
background Gosu::Color::GRAY
label @options[:subtitle]
flow width: 1.0 do
label "Name", width: 0.25
edit_line "", width: 0.70
label "Name", width: 0.25, text_size: 18
@name = edit_line "", width: 0.70, text_size: 18
end
flow width: 1.0 do
button "Cancel", width: 0.475 do
button "Cancel", width: 0.475, text_size: 18 do
close
end
button @options[:submit_label], width: 0.475 do
@options[:callback].call(self)
button @options[:submit_label], width: 0.475, text_size: 18 do
if @name.value.strip.empty?
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Name cannot be blank.\nName cannot only be whitespace.")
else
@options[:callback_method].call(@name.value.strip)
close
end
end
end
end