mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Stubbed preset manager state, added confirm and variable dialogs, variables can now be created, everything is now mutatable
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, text_size: 18
|
||||
@name = edit_line "", width: 0.70, text_size: 18
|
||||
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", width: 0.70, text_size: 18
|
||||
end
|
||||
|
||||
flow width: 1.0 do
|
||||
@@ -13,11 +13,15 @@ module TAC
|
||||
close
|
||||
end
|
||||
|
||||
button @options[:submit_label], width: 0.475, text_size: 18 do
|
||||
button @options[:renaming] ? "Update" : "Add", 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)
|
||||
if @options[:renaming]
|
||||
@options[:callback_method].call(@options[:renaming], @name.value.strip)
|
||||
else
|
||||
@options[:callback_method].call(@name.value.strip)
|
||||
end
|
||||
|
||||
close
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user