mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-15 05:22:34 +00:00
Compare commits
4 Commits
acc0792d17
...
07fdf0055e
| Author | SHA1 | Date | |
|---|---|---|---|
| 07fdf0055e | |||
| 2a8a2d1bbf | |||
| 48b4d6ddcf | |||
| 0cd4475a8f |
16
Gemfile.lock
16
Gemfile.lock
@@ -1,16 +1,13 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
clipboard (1.3.6)
|
||||
cri (2.1.0)
|
||||
cyberarm_engine (0.19.1)
|
||||
clipboard (~> 1.3.5)
|
||||
excon (~> 0.78.0)
|
||||
cyberarm_engine (0.23.0)
|
||||
excon (~> 0.88)
|
||||
gosu (~> 1.1)
|
||||
gosu_more_drawables (~> 0.3)
|
||||
excon (0.78.1)
|
||||
ffi (1.15.4-x64-mingw32)
|
||||
gosu (1.2.0)
|
||||
excon (0.98.0)
|
||||
gosu (1.4.5)
|
||||
gosu_more_drawables (0.3.1)
|
||||
gosu_notifications (0.1.0)
|
||||
ocra (1.3.11)
|
||||
@@ -22,16 +19,15 @@ GEM
|
||||
rake (>= 0.9.2.2)
|
||||
|
||||
PLATFORMS
|
||||
x64-mingw-ucrt
|
||||
x64-mingw32
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
clipboard
|
||||
cyberarm_engine
|
||||
ffi
|
||||
gosu_notifications
|
||||
ocra
|
||||
releasy
|
||||
|
||||
BUNDLED WITH
|
||||
2.2.28
|
||||
2.4.3
|
||||
|
||||
4
Rakefile
4
Rakefile
@@ -18,12 +18,12 @@ Releasy::Project.new do
|
||||
"media/music/.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
|
||||
|
||||
add_build :windows_folder do
|
||||
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.
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6,6 +6,18 @@ module TAC
|
||||
@active_group = 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
|
||||
if @options[:group_is_preset]
|
||||
title "Editing group preset: #{@options[:group].name}"
|
||||
@@ -213,20 +225,33 @@ module TAC
|
||||
@active_group = @options[:group]
|
||||
@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_actions_list(@active_group)
|
||||
populate_variables_list(@active_action) if @active_action
|
||||
|
||||
@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]
|
||||
@active_action = @options[:action]
|
||||
@active_action_label.value = @active_action.name
|
||||
|
||||
populate_variables_list(@options[:action])
|
||||
populate_variables_list(@active_action)
|
||||
|
||||
@groups_menu.hide
|
||||
@actions_menu.hide
|
||||
|
||||
scroll_into_view(@active_action)
|
||||
scroll_into_view(@options[:variable]) if @options[:variable]
|
||||
|
||||
else
|
||||
if @options[:group]
|
||||
populated_groups_list = true
|
||||
@@ -237,6 +262,8 @@ module TAC
|
||||
populate_groups_list
|
||||
populate_actions_list(@active_group) unless @options[:action]
|
||||
|
||||
scroll_into_view(@active_group)
|
||||
|
||||
if @options[:action]
|
||||
@active_action = @options[:action]
|
||||
@active_action_label.value = @active_action.name
|
||||
@@ -245,9 +272,8 @@ module TAC
|
||||
|
||||
populate_variables_list(@active_action)
|
||||
|
||||
if @options[:variable]
|
||||
# Scroll into view?
|
||||
end
|
||||
scroll_into_view(@active_action)
|
||||
scroll_into_view(@options[:variable]) if @options[:variable]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -463,8 +489,7 @@ module TAC
|
||||
|
||||
item_container = find_element_by_tag(list_container, item.name)
|
||||
|
||||
@scroll_into_view_list_container = list_container
|
||||
@scroll_into_view_item_container = item_container
|
||||
@scroll_into_view_list << { list: list_container, item: item_container }
|
||||
end
|
||||
|
||||
def populate_groups_list
|
||||
@@ -597,25 +622,49 @@ module TAC
|
||||
end
|
||||
end
|
||||
|
||||
def draw
|
||||
super
|
||||
|
||||
unless @highlight_animator.complete?
|
||||
current_state.request_repaint
|
||||
|
||||
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
|
||||
|
||||
list_container = @scroll_into_view_list_container
|
||||
item_container = @scroll_into_view_item_container
|
||||
while (hash = @scroll_into_view_list.shift)
|
||||
list_container = hash[:list]
|
||||
item_container = hash[:item]
|
||||
|
||||
return unless list_container
|
||||
return unless item_container
|
||||
return unless list_container
|
||||
return unless item_container
|
||||
|
||||
unless item_container.x.between?(list_container.x, list_container.x + list_container.width) &&
|
||||
item_container.y.between?(list_container.y, list_container.y + list_container.height)
|
||||
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) - item_container.height
|
||||
list_container.scroll_top = (item_container.y + item_container.height) - (list_container.y + list_container.height)
|
||||
|
||||
list_container.recalculate
|
||||
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
|
||||
|
||||
@scroll_into_view_list_container = nil
|
||||
@scroll_into_view_item_container = nil
|
||||
end
|
||||
|
||||
def button_down(id)
|
||||
|
||||
@@ -22,7 +22,7 @@ module TAC
|
||||
shared_index = 0
|
||||
|
||||
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?
|
||||
title "Groups"
|
||||
|
||||
@@ -44,7 +44,9 @@ module TAC
|
||||
search_results.actions.each do |result|
|
||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||
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 })
|
||||
end
|
||||
|
||||
@@ -63,7 +65,9 @@ module TAC
|
||||
search_results.variables.each do |result|
|
||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||
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 })
|
||||
end
|
||||
end
|
||||
@@ -73,13 +77,14 @@ module TAC
|
||||
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?
|
||||
title "Group Presets"
|
||||
|
||||
search_results.group_presets.each do |result|
|
||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||
background shared_index.even? ? THEME_EVEN_COLOR : THEME_ODD_COLOR
|
||||
|
||||
button result.highlight(result.group.name), width: 1.0 do
|
||||
page(TAC::Pages::Editor, { group: result.group, group_is_preset: true, is_search: true })
|
||||
end
|
||||
@@ -95,7 +100,9 @@ module TAC
|
||||
search_results.action_presets.each do |result|
|
||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||
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?
|
||||
page(TAC::Pages::Editor, { action: result.action, action_is_preset: true, is_search: true })
|
||||
else
|
||||
@@ -118,7 +125,9 @@ module TAC
|
||||
search_results.variables_from_presets.each do |result|
|
||||
stack(width: 1.0, **THEME_ITEM_CONTAINER_PADDING) do
|
||||
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?
|
||||
page(TAC::Pages::Editor, { action: result.action, variable: result.variable, action_is_preset: true, is_search: true })
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module TAC
|
||||
NAME = "TimeCrafters Configuration Tool"
|
||||
VERSION = "0.6.0"
|
||||
VERSION = "0.7.0"
|
||||
RELEASE_NAME = "Beta"
|
||||
end
|
||||
Reference in New Issue
Block a user