Updated VariableDialog to use list_box instead of several buttons, make Variable store real type instead of mashing everything into value

This commit is contained in:
2020-08-22 16:59:58 -05:00
parent d3fdc2d7dd
commit 08ada79e5b
3 changed files with 50 additions and 49 deletions

View File

@@ -269,8 +269,9 @@ module TAC
populate_variables_list(@active_action)
end
def update_variable(variable, name, value)
def update_variable(variable, name, type, value)
variable.name = name
variable.type = type
variable.value = value
window.backend.config_changed!
@@ -354,7 +355,7 @@ module TAC
flow width: 1.0, **THEME_ITEM_CONTAINER_PADDING do
background i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
button "#{variable.name} [Type: #{variable.raw_type}, Value: #{variable.raw_value}]", width: 0.925, tip: "Edit variable" do
button "#{variable.name} [Type: #{variable.type}, Value: #{variable.value}]", width: 0.925, tip: "Edit variable" do
push_state(Dialog::VariableDialog, title: "Edit Variable", variable: variable, callback_method: method(:update_variable))
end
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete variable", **THEME_DANGER_BUTTON do