mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 21:32:35 +00:00
Added PickPresetDialog for importing from preset, enable importing presets for groups and actions
This commit is contained in:
23
lib/dialogs/pick_preset_dialog.rb
Normal file
23
lib/dialogs/pick_preset_dialog.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
module TAC
|
||||
class Dialog
|
||||
class PickPresetDialog < Dialog
|
||||
def build
|
||||
@limit = @options[:limit]
|
||||
|
||||
list = window.backend.config.presets.groups if @limit == :groups
|
||||
list = window.backend.config.presets.actions if @limit == :actions
|
||||
|
||||
background Gosu::Color::GRAY
|
||||
|
||||
stack(width: 1.0, height: 512, scroll: true) do
|
||||
list.each do |item|
|
||||
button item.name, width: 1.0 do
|
||||
close
|
||||
@options[:callback_method].call(item)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user