mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Compare commits
11 Commits
27d0b7314f
...
v0.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
| caa2000e91 | |||
| 7bcc32097f | |||
| 2d2a4e0733 | |||
| d61785c98a | |||
| 07fdf0055e | |||
| 2a8a2d1bbf | |||
| 48b4d6ddcf | |||
| 0cd4475a8f | |||
| acc0792d17 | |||
| 6f211adf28 | |||
| 3d29ff46e6 |
16
Gemfile.lock
16
Gemfile.lock
@@ -1,16 +1,13 @@
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
clipboard (1.3.6)
|
|
||||||
cri (2.1.0)
|
cri (2.1.0)
|
||||||
cyberarm_engine (0.19.1)
|
cyberarm_engine (0.23.0)
|
||||||
clipboard (~> 1.3.5)
|
excon (~> 0.88)
|
||||||
excon (~> 0.78.0)
|
|
||||||
gosu (~> 1.1)
|
gosu (~> 1.1)
|
||||||
gosu_more_drawables (~> 0.3)
|
gosu_more_drawables (~> 0.3)
|
||||||
excon (0.78.1)
|
excon (0.98.0)
|
||||||
ffi (1.15.4-x64-mingw32)
|
gosu (1.4.5)
|
||||||
gosu (1.2.0)
|
|
||||||
gosu_more_drawables (0.3.1)
|
gosu_more_drawables (0.3.1)
|
||||||
gosu_notifications (0.1.0)
|
gosu_notifications (0.1.0)
|
||||||
ocra (1.3.11)
|
ocra (1.3.11)
|
||||||
@@ -22,16 +19,15 @@ GEM
|
|||||||
rake (>= 0.9.2.2)
|
rake (>= 0.9.2.2)
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
|
x64-mingw-ucrt
|
||||||
x64-mingw32
|
x64-mingw32
|
||||||
x86_64-linux
|
x86_64-linux
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
clipboard
|
|
||||||
cyberarm_engine
|
cyberarm_engine
|
||||||
ffi
|
|
||||||
gosu_notifications
|
gosu_notifications
|
||||||
ocra
|
ocra
|
||||||
releasy
|
releasy
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.2.28
|
2.4.3
|
||||||
|
|||||||
4
Rakefile
4
Rakefile
@@ -18,12 +18,12 @@ Releasy::Project.new do
|
|||||||
"media/music/.gitkeep",
|
"media/music/.gitkeep",
|
||||||
"media/particles/.gitkeep"
|
"media/particles/.gitkeep"
|
||||||
]
|
]
|
||||||
exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
|
# exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
|
||||||
verbose
|
verbose
|
||||||
|
|
||||||
add_build :windows_folder do
|
add_build :windows_folder do
|
||||||
icon "media/icon.ico"
|
icon "media/icon.ico"
|
||||||
executable_type :console # Assuming you don't want it to run with a console window.
|
executable_type :windows # Assuming you don't want it to run with a console window.
|
||||||
add_package :exe # Windows self-extracting archive.
|
add_package :exe # Windows self-extracting archive.
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,6 +6,18 @@ module TAC
|
|||||||
@active_group = nil
|
@active_group = nil
|
||||||
@active_action = nil
|
@active_action = nil
|
||||||
|
|
||||||
|
@scroll_into_view_list = []
|
||||||
|
@highlight_item_container = nil
|
||||||
|
@highlight_from_color = Gosu::Color.rgba(0, 0, 0, 0)
|
||||||
|
@highlight_to_color = Gosu::Color.rgba(THEME_HIGHLIGHTED_COLOR.red, THEME_HIGHLIGHTED_COLOR.green, THEME_HIGHLIGHTED_COLOR.blue, 200)
|
||||||
|
|
||||||
|
@highlight_animator = CyberarmEngine::Animator.new(
|
||||||
|
start_time: Gosu.milliseconds - 1,
|
||||||
|
duration: 0,
|
||||||
|
from: Gosu::Color.rgba(0, 0, 0, 0),
|
||||||
|
to: THEME_HIGHLIGHTED_COLOR
|
||||||
|
)
|
||||||
|
|
||||||
menu_bar.clear do
|
menu_bar.clear do
|
||||||
if @options[:group_is_preset]
|
if @options[:group_is_preset]
|
||||||
title "Editing group preset: #{@options[:group].name}"
|
title "Editing group preset: #{@options[:group].name}"
|
||||||
@@ -47,7 +59,13 @@ module TAC
|
|||||||
window.backend.config.groups << clone
|
window.backend.config.groups << clone
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_groups_list
|
@groups_list.append do
|
||||||
|
add_group_container(clone)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@groups_list)
|
||||||
|
|
||||||
|
scroll_into_view(clone)
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to clone group, no group selected.")
|
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to clone group, no group selected.")
|
||||||
@@ -81,7 +99,13 @@ module TAC
|
|||||||
window.backend.config.groups.sort_by! { |g| g.name.downcase }
|
window.backend.config.groups.sort_by! { |g| g.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_groups_list
|
@groups_list.append do
|
||||||
|
add_group_container(clone)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@groups_list)
|
||||||
|
|
||||||
|
scroll_into_view(clone)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -113,7 +137,13 @@ module TAC
|
|||||||
@active_group.actions << clone
|
@active_group.actions << clone
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_actions_list(@active_group)
|
@actions_list.append do
|
||||||
|
add_action_container(clone)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@actions_list)
|
||||||
|
|
||||||
|
scroll_into_view(clone)
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to clone action, no action selected.")
|
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to clone action, no action selected.")
|
||||||
@@ -150,7 +180,13 @@ module TAC
|
|||||||
@active_group.actions.sort_by! { |a| a.name.downcase }
|
@active_group.actions.sort_by! { |a| a.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_actions_list(@active_group)
|
@actions_list.append do
|
||||||
|
add_action_container(clone)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@actions_list)
|
||||||
|
|
||||||
|
scroll_into_view(clone)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
@@ -189,20 +225,33 @@ module TAC
|
|||||||
@active_group = @options[:group]
|
@active_group = @options[:group]
|
||||||
@active_group_label.value = @active_group.name
|
@active_group_label.value = @active_group.name
|
||||||
|
|
||||||
|
if @options[:action]
|
||||||
|
@active_action = @options[:action]
|
||||||
|
@active_action_label.value = @active_action.name
|
||||||
|
end
|
||||||
|
|
||||||
populate_groups_list
|
populate_groups_list
|
||||||
populate_actions_list(@active_group)
|
populate_actions_list(@active_group)
|
||||||
|
populate_variables_list(@active_action) if @active_action
|
||||||
|
|
||||||
@groups_menu.hide
|
@groups_menu.hide
|
||||||
|
|
||||||
|
scroll_into_view(@active_group)
|
||||||
|
scroll_into_view(@active_action) if @active_action
|
||||||
|
scroll_into_view(@options[:variable]) if @options[:variable]
|
||||||
|
|
||||||
elsif @options[:action_is_preset]
|
elsif @options[:action_is_preset]
|
||||||
@active_action = @options[:action]
|
@active_action = @options[:action]
|
||||||
@active_action_label.value = @active_action.name
|
@active_action_label.value = @active_action.name
|
||||||
|
|
||||||
populate_variables_list(@options[:action])
|
populate_variables_list(@active_action)
|
||||||
|
|
||||||
@groups_menu.hide
|
@groups_menu.hide
|
||||||
@actions_menu.hide
|
@actions_menu.hide
|
||||||
|
|
||||||
|
scroll_into_view(@active_action)
|
||||||
|
scroll_into_view(@options[:variable]) if @options[:variable]
|
||||||
|
|
||||||
else
|
else
|
||||||
if @options[:group]
|
if @options[:group]
|
||||||
populated_groups_list = true
|
populated_groups_list = true
|
||||||
@@ -213,6 +262,8 @@ module TAC
|
|||||||
populate_groups_list
|
populate_groups_list
|
||||||
populate_actions_list(@active_group) unless @options[:action]
|
populate_actions_list(@active_group) unless @options[:action]
|
||||||
|
|
||||||
|
scroll_into_view(@active_group)
|
||||||
|
|
||||||
if @options[:action]
|
if @options[:action]
|
||||||
@active_action = @options[:action]
|
@active_action = @options[:action]
|
||||||
@active_action_label.value = @active_action.name
|
@active_action_label.value = @active_action.name
|
||||||
@@ -221,9 +272,8 @@ module TAC
|
|||||||
|
|
||||||
populate_variables_list(@active_action)
|
populate_variables_list(@active_action)
|
||||||
|
|
||||||
if @options[:variable]
|
scroll_into_view(@active_action)
|
||||||
# Scroll into view?
|
scroll_into_view(@options[:variable]) if @options[:variable]
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -238,17 +288,30 @@ module TAC
|
|||||||
window.backend.config.groups.sort_by! { |g| g.name.downcase }
|
window.backend.config.groups.sort_by! { |g| g.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_groups_list
|
@groups_list.append do
|
||||||
|
add_group_container(group)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@groups_list)
|
||||||
|
|
||||||
scroll_into_view(group)
|
scroll_into_view(group)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_group(group, name)
|
def update_group(group, name)
|
||||||
|
old_name = group.name
|
||||||
|
|
||||||
group.name = name
|
group.name = name
|
||||||
window.backend.config.groups.sort_by! { |g| g.name.downcase }
|
window.backend.config.groups.sort_by! { |g| g.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_groups_list
|
group_container = find_element_by_tag(@groups_list, old_name)
|
||||||
|
label = find_element_by_tag(group_container, "label")
|
||||||
|
|
||||||
|
label.value = name
|
||||||
|
|
||||||
|
group_container.style.tag = name
|
||||||
|
|
||||||
|
update_list_children(@groups_list)
|
||||||
|
|
||||||
scroll_into_view(group)
|
scroll_into_view(group)
|
||||||
end
|
end
|
||||||
@@ -267,16 +330,25 @@ module TAC
|
|||||||
@actions_list.clear
|
@actions_list.clear
|
||||||
@variables_list.clear
|
@variables_list.clear
|
||||||
|
|
||||||
populate_groups_list
|
# Remove deleted action from list
|
||||||
|
container = find_element_by_tag(@groups_list, group.name)
|
||||||
|
@groups_list.remove(container)
|
||||||
|
|
||||||
|
update_list_children(@groups_list)
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_action(name, comment)
|
def create_action(name, comment)
|
||||||
action = TAC::Config::Action.new(name: name, comment: comment, enabled: true, variables: [])
|
action = TAC::Config::Action.new(name: name, comment: comment, enabled: true, variables: [])
|
||||||
|
|
||||||
@active_group.actions << action
|
@active_group.actions << action
|
||||||
@active_group.actions.sort_by! { |a| a.name.downcase }
|
@active_group.actions.sort_by! { |a| a.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_actions_list(@active_group)
|
@actions_list.append do
|
||||||
|
add_action_container(action)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@actions_list)
|
||||||
|
|
||||||
scroll_into_view(action)
|
scroll_into_view(action)
|
||||||
end
|
end
|
||||||
@@ -289,10 +361,23 @@ module TAC
|
|||||||
@active_group.actions.sort_by! { |a| a.name.downcase }
|
@active_group.actions.sort_by! { |a| a.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
a = @actions_list.children.find { |a| a.style.tag == old_name.downcase }
|
action_container = find_element_by_tag(@actions_list, old_name)
|
||||||
label = a.children.find { |a| a.style.tag == "label" }
|
label = find_element_by_tag(action_container, "label")
|
||||||
# comment = a.children.find { |a| a.style.tag == "comment" }
|
comment_container = find_element_by_tag(action_container, "comment_container")
|
||||||
|
comment_label = find_element_by_tag(action_container, "comment")
|
||||||
|
|
||||||
label.value = name
|
label.value = name
|
||||||
|
if comment.empty?
|
||||||
|
action_container.style.height = 36
|
||||||
|
comment_container.hide
|
||||||
|
comment_label.value = ""
|
||||||
|
else
|
||||||
|
action_container.style.height = 72
|
||||||
|
comment_container.show
|
||||||
|
comment_label.value = comment.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
action_container.style.tag = name
|
||||||
|
|
||||||
update_list_children(@actions_list)
|
update_list_children(@actions_list)
|
||||||
|
|
||||||
@@ -309,7 +394,7 @@ module TAC
|
|||||||
@variables_list.clear
|
@variables_list.clear
|
||||||
|
|
||||||
# Remove deleted action from list
|
# Remove deleted action from list
|
||||||
container = @actions_list.children.find { |a| a.style.tag == action.name.downcase }
|
container = find_element_by_tag(@actions_list, action.name)
|
||||||
@actions_list.remove(container)
|
@actions_list.remove(container)
|
||||||
|
|
||||||
update_list_children(@actions_list)
|
update_list_children(@actions_list)
|
||||||
@@ -322,12 +407,18 @@ module TAC
|
|||||||
@active_action.variables.sort_by! { |v| v.name.downcase }
|
@active_action.variables.sort_by! { |v| v.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_variables_list(@active_action)
|
@variables_list.append do
|
||||||
|
add_variable_container(variable)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_list_children(@variables_list)
|
||||||
|
|
||||||
scroll_into_view(variable)
|
scroll_into_view(variable)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_variable(variable, name, type, value)
|
def update_variable(variable, name, type, value)
|
||||||
|
old_name = variable.name
|
||||||
|
|
||||||
variable.name = name
|
variable.name = name
|
||||||
variable.type = type
|
variable.type = type
|
||||||
variable.value = value
|
variable.value = value
|
||||||
@@ -336,7 +427,18 @@ module TAC
|
|||||||
|
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_variables_list(@active_action)
|
variable_container = find_element_by_tag(@variables_list, old_name)
|
||||||
|
label = find_element_by_tag(variable_container, "label")
|
||||||
|
type = find_element_by_tag(variable_container, "type")
|
||||||
|
value = find_element_by_tag(variable_container, "value")
|
||||||
|
|
||||||
|
label.value = name
|
||||||
|
type.value = "Type: #{variable.type}"
|
||||||
|
value.value = "Value: #{variable.value}"
|
||||||
|
|
||||||
|
variable_container.style.tag = name
|
||||||
|
|
||||||
|
update_list_children(@variables_list)
|
||||||
|
|
||||||
scroll_into_view(variable)
|
scroll_into_view(variable)
|
||||||
end
|
end
|
||||||
@@ -346,7 +448,11 @@ module TAC
|
|||||||
@active_action.variables.sort_by! { |v| v.name.downcase }
|
@active_action.variables.sort_by! { |v| v.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_variables_list(@active_action)
|
# Remove deleted variable from list
|
||||||
|
container = find_element_by_tag(@variables_list, variable.name)
|
||||||
|
@variables_list.remove(container)
|
||||||
|
|
||||||
|
update_list_children(@variables_list)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_list_children(list)
|
def update_list_children(list)
|
||||||
@@ -354,12 +460,12 @@ module TAC
|
|||||||
is_action = list == @actions_list
|
is_action = list == @actions_list
|
||||||
is_variable = list == @variables_list
|
is_variable = list == @variables_list
|
||||||
|
|
||||||
list.children.sort_by! { |i| i.style.tag }
|
list.children.sort_by! { |i| i.style.tag.downcase }
|
||||||
|
|
||||||
list.children.each_with_index do |child, i|
|
list.children.each_with_index do |child, i|
|
||||||
bg_color = i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
bg_color = i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
bg_color = THEME_HIGHLIGHTED_COLOR if is_group && @active_group&.name&.downcase == child.style.tag
|
bg_color = THEME_HIGHLIGHTED_COLOR if is_group && @active_group&.name == child.style.tag
|
||||||
bg_color = THEME_HIGHLIGHTED_COLOR if is_action && @active_action&.name&.downcase == child.style.tag
|
bg_color = THEME_HIGHLIGHTED_COLOR if is_action && @active_action&.name == child.style.tag
|
||||||
|
|
||||||
child.style.default[:background] = bg_color
|
child.style.default[:background] = bg_color
|
||||||
|
|
||||||
@@ -368,12 +474,22 @@ module TAC
|
|||||||
end
|
end
|
||||||
|
|
||||||
def scroll_into_view(item)
|
def scroll_into_view(item)
|
||||||
|
list_container = nil
|
||||||
|
item_container = nil
|
||||||
|
|
||||||
if item.is_a?(TAC::Config::Group)
|
if item.is_a?(TAC::Config::Group)
|
||||||
|
list_container = @groups_list
|
||||||
elsif item.is_a?(TAC::Config::Action)
|
elsif item.is_a?(TAC::Config::Action)
|
||||||
|
list_container = @actions_list
|
||||||
elsif item.is_a?(TAC::Config::Variable)
|
elsif item.is_a?(TAC::Config::Variable)
|
||||||
|
list_container = @variables_list
|
||||||
else
|
else
|
||||||
raise "Unsupported item type: #{item.class}"
|
raise "Unsupported item type: #{item.class}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
item_container = find_element_by_tag(list_container, item.name)
|
||||||
|
|
||||||
|
@scroll_into_view_list << { list: list_container, item: item_container }
|
||||||
end
|
end
|
||||||
|
|
||||||
def populate_groups_list
|
def populate_groups_list
|
||||||
@@ -386,24 +502,53 @@ module TAC
|
|||||||
end
|
end
|
||||||
|
|
||||||
@groups_list.clear do
|
@groups_list.clear do
|
||||||
groups.each_with_index do |group, i|
|
groups.each do |group|
|
||||||
flow width: 1.0, height: 36, **THEME_ITEM_CONTAINER_PADDING, tag: group.name.downcase do |container|
|
add_group_container(group)
|
||||||
background group == @active_group ? THEME_HIGHLIGHTED_COLOR : (i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR)
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def populate_actions_list(group)
|
||||||
|
@actions_list.scroll_top = 0
|
||||||
|
|
||||||
|
actions = group.actions
|
||||||
|
|
||||||
|
@actions_list.clear do
|
||||||
|
actions.each do |action|
|
||||||
|
add_action_container(action)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def populate_variables_list(action)
|
||||||
|
@variables_list.scroll_top = 0
|
||||||
|
|
||||||
|
variables = action.variables
|
||||||
|
|
||||||
|
@variables_list.clear do
|
||||||
|
variables.each do |variable|
|
||||||
|
add_variable_container(variable)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_group_container(group)
|
||||||
|
index = window.backend.config.groups.index(group)
|
||||||
|
|
||||||
|
flow width: 1.0, height: 36, **THEME_ITEM_CONTAINER_PADDING, tag: group.name do |container|
|
||||||
|
background group == @active_group ? THEME_HIGHLIGHTED_COLOR : (index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR)
|
||||||
@active_group_container = container if group == @active_group
|
@active_group_container = container if group == @active_group
|
||||||
|
|
||||||
button group.name, fill: true, text_size: THEME_ICON_SIZE - 3, tag: "label" do
|
button group.name, fill: true, text_size: THEME_ICON_SIZE - 3, tag: "label" do
|
||||||
if (old_i = groups.index(@active_group))
|
|
||||||
@active_group_container.style.default[:background] = old_i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
|
||||||
end
|
|
||||||
|
|
||||||
@active_group = group
|
@active_group = group
|
||||||
@active_group_container = container
|
@active_group_container = container
|
||||||
@active_group_container.style.default[:background] = THEME_HIGHLIGHTED_COLOR
|
|
||||||
@active_group_label.value = group.name
|
@active_group_label.value = group.name
|
||||||
@active_action = nil
|
@active_action = nil
|
||||||
@active_action_container = nil
|
@active_action_container = nil
|
||||||
@active_action_label.value = ""
|
@active_action_label.value = ""
|
||||||
|
|
||||||
|
update_list_children(@groups_list)
|
||||||
|
|
||||||
populate_actions_list(group)
|
populate_actions_list(group)
|
||||||
@variables_list.clear
|
@variables_list.clear
|
||||||
end
|
end
|
||||||
@@ -416,31 +561,22 @@ module TAC
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def populate_actions_list(group)
|
def add_action_container(action)
|
||||||
@actions_list.scroll_top = 0
|
index = @active_group.actions.index(action)
|
||||||
|
|
||||||
actions = group.actions
|
stack width: 1.0, height: action.comment.empty? ? 36 : 72, **THEME_ITEM_CONTAINER_PADDING, tag: action.name do |container|
|
||||||
|
background action == @active_action ? THEME_HIGHLIGHTED_COLOR : (index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR)
|
||||||
@actions_list.clear do
|
|
||||||
actions.each_with_index do |action, i|
|
|
||||||
stack width: 1.0, height: action.comment.empty? ? 36 : 72, **THEME_ITEM_CONTAINER_PADDING, tag: action.name.downcase do |container|
|
|
||||||
background action == @active_action ? THEME_HIGHLIGHTED_COLOR : (i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR)
|
|
||||||
@active_action_container = container if action == @active_action
|
@active_action_container = container if action == @active_action
|
||||||
|
|
||||||
flow width: 1.0, height: 36 do
|
flow width: 1.0, height: 36 do
|
||||||
button action.name, fill: true, text_size: THEME_ICON_SIZE - 3, tag: "label" do
|
button action.name, fill: true, text_size: THEME_ICON_SIZE - 3, tag: "label" do
|
||||||
if (old_i = actions.index(@active_action))
|
|
||||||
@active_action_container.style.default[:background] = old_i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
|
||||||
end
|
|
||||||
|
|
||||||
@active_action = action
|
@active_action = action
|
||||||
@active_action_container = container
|
@active_action_container = container
|
||||||
@active_action_container.style.default[:background] = THEME_HIGHLIGHTED_COLOR
|
|
||||||
@active_action_label.value = action.name
|
@active_action_label.value = action.name
|
||||||
|
|
||||||
|
update_list_children(@actions_list)
|
||||||
|
|
||||||
populate_variables_list(action)
|
populate_variables_list(action)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -459,28 +595,20 @@ module TAC
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
unless action.comment.empty?
|
stack(width: 1.0, fill: true, scroll: true, visible: !action.comment.empty?, tag: "comment_container") do
|
||||||
stack(width: 1.0, fill: true, scroll: true) do
|
|
||||||
caption action.comment.to_s, width: 1.0, text_wrap: :word_wrap, text_border: true, text_border_size: 1, text_border_color: 0xaa_000000, tag: "comment"
|
caption action.comment.to_s, width: 1.0, text_wrap: :word_wrap, text_border: true, text_border_size: 1, text_border_color: 0xaa_000000, tag: "comment"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def populate_variables_list(action)
|
def add_variable_container(variable)
|
||||||
@variables_list.scroll_top = 0
|
index = @active_action.variables.index(variable)
|
||||||
|
|
||||||
variables = action.variables
|
stack width: 1.0, height: 96, **THEME_ITEM_CONTAINER_PADDING, tag: variable.name do
|
||||||
|
background index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
@variables_list.clear do
|
|
||||||
variables.each_with_index do |variable, i|
|
|
||||||
stack width: 1.0, height: 96, **THEME_ITEM_CONTAINER_PADDING, tag: variable.name.downcase do
|
|
||||||
background i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
|
||||||
|
|
||||||
flow(width: 1.0, fill: true) do
|
flow(width: 1.0, fill: true) do
|
||||||
button "#{variable.name}", fill: true, text_size: THEME_ICON_SIZE - 3, tip: "Edit variable", tag: "label" do
|
button variable.name, fill: true, text_size: THEME_ICON_SIZE - 3, tip: "Edit variable", tag: "label" do
|
||||||
push_state(Dialog::VariableDialog, title: "Edit Variable", variable: variable, list: @active_action.variables, callback_method: method(:update_variable))
|
push_state(Dialog::VariableDialog, title: "Edit Variable", variable: variable, list: @active_action.variables, callback_method: method(:update_variable))
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -493,6 +621,49 @@ module TAC
|
|||||||
caption "Value: #{variable.value}", tag: "value", fill: true
|
caption "Value: #{variable.value}", tag: "value", fill: true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def draw
|
||||||
|
super
|
||||||
|
|
||||||
|
unless @highlight_animator.complete?
|
||||||
|
item = @highlight_item_container
|
||||||
|
|
||||||
|
Gosu.draw_rect(
|
||||||
|
item.x, item.y,
|
||||||
|
item.width, item.height,
|
||||||
|
@highlight_animator.color_transition,
|
||||||
|
item.z + 1
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
super
|
||||||
|
|
||||||
|
current_state.request_repaint unless @highlight_animator.complete?
|
||||||
|
|
||||||
|
while (hash = @scroll_into_view_list.shift)
|
||||||
|
list_container = hash[:list]
|
||||||
|
item_container = hash[:item]
|
||||||
|
|
||||||
|
return unless list_container
|
||||||
|
return unless item_container
|
||||||
|
|
||||||
|
unless (item_container.y + item_container.height).between?(list_container.y, list_container.y + list_container.height)
|
||||||
|
|
||||||
|
list_container.scroll_top = (item_container.y + item_container.height) - (list_container.y + list_container.height)
|
||||||
|
|
||||||
|
list_container.recalculate
|
||||||
|
end
|
||||||
|
|
||||||
|
@highlight_item_container = item_container
|
||||||
|
@highlight_animator = CyberarmEngine::Animator.new(
|
||||||
|
start_time: Gosu.milliseconds,
|
||||||
|
duration: 750,
|
||||||
|
from: @highlight_from_color,
|
||||||
|
to: @highlight_to_color,
|
||||||
|
tween: :ease_in_out_back
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -19,21 +19,106 @@ module TAC
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@scroll_into_view_list = []
|
||||||
|
@highlight_item_container = nil
|
||||||
|
@highlight_from_color = Gosu::Color.rgba(0, 0, 0, 0)
|
||||||
|
@highlight_to_color = Gosu::Color.rgba(THEME_HIGHLIGHTED_COLOR.red, THEME_HIGHLIGHTED_COLOR.green, THEME_HIGHLIGHTED_COLOR.blue, 200)
|
||||||
|
|
||||||
|
@highlight_animator = CyberarmEngine::Animator.new(
|
||||||
|
start_time: Gosu.milliseconds - 1,
|
||||||
|
duration: 0,
|
||||||
|
from: Gosu::Color.rgba(0, 0, 0, 0),
|
||||||
|
to: THEME_HIGHLIGHTED_COLOR
|
||||||
|
)
|
||||||
|
|
||||||
populate_group_presets
|
populate_group_presets
|
||||||
populate_action_presets
|
populate_action_presets
|
||||||
end
|
end
|
||||||
|
|
||||||
def populate_group_presets
|
def draw
|
||||||
@group_presets.clear do
|
super
|
||||||
window.backend.config.presets.groups.each_with_index do |group, i|
|
|
||||||
flow(width: 1.0, height: 36, **THEME_ITEM_CONTAINER_PADDING) do
|
|
||||||
background i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
|
||||||
|
|
||||||
button group.name, fill: true, text_size: THEME_ICON_SIZE - 3 do
|
unless @highlight_animator.complete?
|
||||||
|
item = @highlight_item_container
|
||||||
|
|
||||||
|
Gosu.draw_rect(
|
||||||
|
item.x, item.y,
|
||||||
|
item.width, item.height,
|
||||||
|
@highlight_animator.color_transition,
|
||||||
|
item.z + 1
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update
|
||||||
|
super
|
||||||
|
|
||||||
|
current_state.request_repaint unless @highlight_animator.complete?
|
||||||
|
|
||||||
|
while (hash = @scroll_into_view_list.shift)
|
||||||
|
list_container = hash[:list]
|
||||||
|
item_container = hash[:item]
|
||||||
|
|
||||||
|
return unless list_container
|
||||||
|
return unless item_container
|
||||||
|
|
||||||
|
unless (item_container.y + item_container.height).between?(list_container.y, list_container.y + list_container.height)
|
||||||
|
|
||||||
|
list_container.scroll_top = (item_container.y + item_container.height) - (list_container.y + list_container.height)
|
||||||
|
|
||||||
|
list_container.recalculate
|
||||||
|
end
|
||||||
|
|
||||||
|
@highlight_item_container = item_container
|
||||||
|
@highlight_animator = CyberarmEngine::Animator.new(
|
||||||
|
start_time: Gosu.milliseconds,
|
||||||
|
duration: 750,
|
||||||
|
from: @highlight_from_color,
|
||||||
|
to: @highlight_to_color,
|
||||||
|
tween: :ease_in_out_back
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_list_children(list)
|
||||||
|
list.children.sort_by! { |i| i.style.tag.downcase }
|
||||||
|
|
||||||
|
list.children.each_with_index do |child, i|
|
||||||
|
child.style.default[:background] = i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
|
|
||||||
|
child.root.gui_state.request_recalculate
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def scroll_into_view(item)
|
||||||
|
list_container = nil
|
||||||
|
item_container = nil
|
||||||
|
|
||||||
|
if item.is_a?(TAC::Config::Group)
|
||||||
|
list_container = @group_presets
|
||||||
|
elsif item.is_a?(TAC::Config::Action)
|
||||||
|
list_container = @action_presets
|
||||||
|
else
|
||||||
|
raise "Unsupported item type: #{item.class}"
|
||||||
|
end
|
||||||
|
|
||||||
|
item_container = find_element_by_tag(list_container, item.name)
|
||||||
|
|
||||||
|
@scroll_into_view_list << { list: list_container, item: item_container }
|
||||||
|
end
|
||||||
|
|
||||||
|
def add_group_container(group)
|
||||||
|
index = window.backend.config.presets.groups.index(group)
|
||||||
|
|
||||||
|
flow width: 1.0, height: 36, **THEME_ITEM_CONTAINER_PADDING, tag: group.name do |container|
|
||||||
|
background group == @active_group ? THEME_HIGHLIGHTED_COLOR : (index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR)
|
||||||
|
@active_group_container = container if group == @active_group
|
||||||
|
|
||||||
|
button group.name, fill: true, text_size: THEME_ICON_SIZE - 3, tag: "label" do
|
||||||
page(TAC::Pages::Editor, { group: group, group_is_preset: true })
|
page(TAC::Pages::Editor, { group: group, group_is_preset: true })
|
||||||
end
|
end
|
||||||
|
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/gear.png"), image_width: THEME_ICON_SIZE, tip: "Edit group preset" do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/gear.png"), image_width: THEME_ICON_SIZE, tip: "Edit group" do
|
||||||
push_state(
|
push_state(
|
||||||
Dialog::NamePromptDialog,
|
Dialog::NamePromptDialog,
|
||||||
title: "Rename Group Preset",
|
title: "Rename Group Preset",
|
||||||
@@ -43,7 +128,7 @@ module TAC
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete group preset", **THEME_DANGER_BUTTON do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete group", **THEME_DANGER_BUTTON do
|
||||||
push_state(
|
push_state(
|
||||||
Dialog::ConfirmDialog,
|
Dialog::ConfirmDialog,
|
||||||
title: "Are you sure?",
|
title: "Are you sure?",
|
||||||
@@ -53,30 +138,30 @@ module TAC
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def populate_action_presets
|
def add_action_container(action)
|
||||||
@action_presets.clear do
|
index = window.backend.config.presets.actions.index(action)
|
||||||
window.backend.config.presets.actions.each_with_index do |action, i|
|
|
||||||
flow(width: 1.0, height: 36, **THEME_ITEM_CONTAINER_PADDING) do
|
|
||||||
background i.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
|
||||||
|
|
||||||
button action.name, fill: true, text_size: THEME_ICON_SIZE - 3 do
|
stack width: 1.0, height: action.comment.empty? ? 36 : 72, **THEME_ITEM_CONTAINER_PADDING, tag: action.name do |container|
|
||||||
|
background action == @active_action ? THEME_HIGHLIGHTED_COLOR : (index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR)
|
||||||
|
@active_action_container = container if action == @active_action
|
||||||
|
|
||||||
|
flow width: 1.0, height: 36 do
|
||||||
|
button action.name, fill: true, text_size: THEME_ICON_SIZE - 3, tag: "label" do
|
||||||
page(TAC::Pages::Editor, { action: action, action_is_preset: true })
|
page(TAC::Pages::Editor, { action: action, action_is_preset: true })
|
||||||
end
|
end
|
||||||
|
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/gear.png"), image_width: THEME_ICON_SIZE, tip: "Edit action preset" do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/gear.png"), image_width: THEME_ICON_SIZE, tip: "Edit action" do
|
||||||
push_state(
|
push_state(
|
||||||
Dialog::NamePromptDialog,
|
Dialog::ActionDialog,
|
||||||
title: "Rename Action Preset",
|
title: "Edit Action Preset",
|
||||||
renaming: action,
|
action: action,
|
||||||
list: window.backend.config.presets.actions,
|
list: window.backend.config.presets.actions,
|
||||||
callback_method: method(:update_action_preset)
|
callback_method: method(:update_action_preset)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete action preset", **THEME_DANGER_BUTTON do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: THEME_ICON_SIZE, tip: "Delete action", **THEME_DANGER_BUTTON do
|
||||||
push_state(
|
push_state(
|
||||||
Dialog::ConfirmDialog,
|
Dialog::ConfirmDialog,
|
||||||
title: "Are you sure?",
|
title: "Are you sure?",
|
||||||
@@ -85,16 +170,46 @@ module TAC
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
stack(width: 1.0, fill: true, scroll: true, visible: !action.comment.empty?, tag: "comment_container") do
|
||||||
|
caption action.comment.to_s, width: 1.0, text_wrap: :word_wrap, text_border: true, text_border_size: 1, text_border_color: 0xaa_000000, tag: "comment"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def populate_group_presets
|
||||||
|
@group_presets.clear do
|
||||||
|
window.backend.config.presets.groups.each do |group|
|
||||||
|
add_group_container(group)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def populate_action_presets
|
||||||
|
@action_presets.clear do
|
||||||
|
window.backend.config.presets.actions.each do |action|
|
||||||
|
add_action_container(action)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_group_preset(group, name)
|
def update_group_preset(group, name)
|
||||||
|
old_name = group.name
|
||||||
|
|
||||||
group.name = name
|
group.name = name
|
||||||
window.backend.config.presets.groups.sort_by! { |g| g.name.downcase }
|
window.backend.config.presets.groups.sort_by! { |g| g.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_group_presets
|
group_container = find_element_by_tag(@group_presets, old_name)
|
||||||
|
label = find_element_by_tag(group_container, "label")
|
||||||
|
|
||||||
|
label.value = name
|
||||||
|
|
||||||
|
group_container.style.tag = name
|
||||||
|
|
||||||
|
update_list_children(@group_presets)
|
||||||
|
|
||||||
|
scroll_into_view(group)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_group_preset(group)
|
def delete_group_preset(group)
|
||||||
@@ -102,15 +217,42 @@ module TAC
|
|||||||
window.backend.config.presets.groups.sort_by! { |g| g.name.downcase }
|
window.backend.config.presets.groups.sort_by! { |g| g.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_group_presets
|
# Remove deleted action from list
|
||||||
|
container = find_element_by_tag(@group_presets, group.name)
|
||||||
|
@group_presets.remove(container)
|
||||||
|
|
||||||
|
update_list_children(@group_presets)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_action_preset(action, name)
|
def update_action_preset(action, name, comment)
|
||||||
|
old_name = action.name
|
||||||
|
|
||||||
action.name = name
|
action.name = name
|
||||||
|
action.comment = comment
|
||||||
window.backend.config.presets.actions.sort_by! { |a| a.name.downcase }
|
window.backend.config.presets.actions.sort_by! { |a| a.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_action_presets
|
action_container = find_element_by_tag(@action_presets, old_name)
|
||||||
|
label = find_element_by_tag(action_container, "label")
|
||||||
|
comment_container = find_element_by_tag(action_container, "comment_container")
|
||||||
|
comment_label = find_element_by_tag(action_container, "comment")
|
||||||
|
|
||||||
|
label.value = name
|
||||||
|
if comment.empty?
|
||||||
|
action_container.style.height = 36
|
||||||
|
comment_container.hide
|
||||||
|
comment_label.value = ""
|
||||||
|
else
|
||||||
|
action_container.style.height = 72
|
||||||
|
comment_container.show
|
||||||
|
comment_label.value = comment.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
action_container.style.tag = name
|
||||||
|
|
||||||
|
update_list_children(@action_presets)
|
||||||
|
|
||||||
|
scroll_into_view(action)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_action_preset(action)
|
def delete_action_preset(action)
|
||||||
@@ -118,7 +260,11 @@ module TAC
|
|||||||
window.backend.config.presets.actions.sort_by! { |a| a.name.downcase }
|
window.backend.config.presets.actions.sort_by! { |a| a.name.downcase }
|
||||||
window.backend.config_changed!
|
window.backend.config_changed!
|
||||||
|
|
||||||
populate_action_presets
|
# Remove deleted action from list
|
||||||
|
container = find_element_by_tag(@action_presets, action.name)
|
||||||
|
@action_presets.remove(container)
|
||||||
|
|
||||||
|
update_list_children(@action_presets)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ module TAC
|
|||||||
shared_index = 0
|
shared_index = 0
|
||||||
|
|
||||||
flow(width: 1.0, height: 1.0) do
|
flow(width: 1.0, height: 1.0) do
|
||||||
stack(width: 0.495, height: 1.0, scroll: true) do
|
stack(fill: true, height: 1.0, scroll: true, padding: 20, padding_right: 10) do
|
||||||
if search_results.groups.size.positive?
|
if search_results.groups.size.positive?
|
||||||
title "Groups"
|
title "Groups"
|
||||||
|
|
||||||
@@ -44,7 +44,9 @@ module TAC
|
|||||||
search_results.actions.each do |result|
|
search_results.actions.each do |result|
|
||||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||||
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
button result.highlight(result.action.name), width: 1.0 do
|
tip = "Group: #{result.group.name}"
|
||||||
|
|
||||||
|
button result.highlight(result.action.name), width: 1.0, tip: tip do
|
||||||
page(TAC::Pages::Editor, { group: result.group, action: result.action, is_search: true })
|
page(TAC::Pages::Editor, { group: result.group, action: result.action, is_search: true })
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -63,7 +65,9 @@ module TAC
|
|||||||
search_results.variables.each do |result|
|
search_results.variables.each do |result|
|
||||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||||
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
button "#{result.highlight(result.variable.name)} [#{result.highlight(result.variable.value)}]", width: 1.0 do
|
tip = "Group: #{result.group.name}, Action: #{result.action.name}"
|
||||||
|
|
||||||
|
button "#{result.highlight(result.variable.name)} [#{result.variable.type}: #{result.highlight(result.variable.value)}]", width: 1.0, tip: tip do
|
||||||
page(TAC::Pages::Editor, { group: result.group, action: result.action, variable: result.variable, is_search: true })
|
page(TAC::Pages::Editor, { group: result.group, action: result.action, variable: result.variable, is_search: true })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -73,13 +77,14 @@ module TAC
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
stack(width: 0.495, height: 1.0, scroll: true) do
|
stack(fill: true, height: 1.0, scroll: true, padding: 20, padding_left: 10) do
|
||||||
if search_results.group_presets.size.positive?
|
if search_results.group_presets.size.positive?
|
||||||
title "Group Presets"
|
title "Group Presets"
|
||||||
|
|
||||||
search_results.group_presets.each do |result|
|
search_results.group_presets.each do |result|
|
||||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||||
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
|
|
||||||
button result.highlight(result.group.name), width: 1.0 do
|
button result.highlight(result.group.name), width: 1.0 do
|
||||||
page(TAC::Pages::Editor, { group: result.group, group_is_preset: true, is_search: true })
|
page(TAC::Pages::Editor, { group: result.group, group_is_preset: true, is_search: true })
|
||||||
end
|
end
|
||||||
@@ -95,7 +100,9 @@ module TAC
|
|||||||
search_results.action_presets.each do |result|
|
search_results.action_presets.each do |result|
|
||||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||||
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
button result.highlight(result.action.name), width: 1.0 do
|
tip = result.group ? "Group: #{result.group.name}" : nil
|
||||||
|
|
||||||
|
button result.highlight(result.action.name), width: 1.0, tip: tip do
|
||||||
if result.group.nil?
|
if result.group.nil?
|
||||||
page(TAC::Pages::Editor, { action: result.action, action_is_preset: true, is_search: true })
|
page(TAC::Pages::Editor, { action: result.action, action_is_preset: true, is_search: true })
|
||||||
else
|
else
|
||||||
@@ -118,7 +125,9 @@ module TAC
|
|||||||
search_results.variables_from_presets.each do |result|
|
search_results.variables_from_presets.each do |result|
|
||||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||||
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||||
button "#{result.highlight(result.variable.name)} [#{result.highlight(result.variable.value)}]", width: 1.0 do
|
tip = result.group ? "Group: #{result.group.name}, Action: #{result.action.name}" : "Action: #{result.action.name}"
|
||||||
|
|
||||||
|
button "#{result.highlight(result.variable.name)} [#{result.variable.type}: #{result.highlight(result.variable.value)}]", width: 1.0, tip: tip do
|
||||||
if result.group.nil?
|
if result.group.nil?
|
||||||
page(TAC::Pages::Editor, { action: result.action, variable: result.variable, action_is_preset: true, is_search: true })
|
page(TAC::Pages::Editor, { action: result.action, variable: result.variable, action_is_preset: true, is_search: true })
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
module TAC
|
module TAC
|
||||||
NAME = "TimeCrafters Configuration Tool"
|
NAME = "TimeCrafters Configuration Tool"
|
||||||
VERSION = "0.6.0"
|
VERSION = "0.7.1"
|
||||||
RELEASE_NAME = "Beta"
|
RELEASE_NAME = "Beta"
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user