mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Stubbed simulator, renamed app, added more tooltips and use more icons
This commit is contained in:
@@ -26,8 +26,10 @@ module TAC
|
|||||||
end
|
end
|
||||||
|
|
||||||
flow width: 0.395 do
|
flow width: 0.395 do
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/right.png"), image_width: 18, margin_left: 10, tip: "Simulate robot path"
|
button get_image("#{TAC::ROOT_PATH}/media/icons/right.png"), image_width: 18, margin_left: 10, tip: "Simulator" do
|
||||||
button "Presets", text_size: 18, margin_left: 10, tip: "Manage presets" do
|
push_state(Simulator)
|
||||||
|
end
|
||||||
|
button get_image("#{TAC::ROOT_PATH}/media/icons/menuList.png"), image_width: 18, margin_left: 10, tip: "Manage presets" do
|
||||||
push_state(ManagePresets)
|
push_state(ManagePresets)
|
||||||
end
|
end
|
||||||
button get_image("#{TAC::ROOT_PATH}/media/icons/save.png"), image_width: 18, margin_left: 10, tip: "Save config to disk" do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/save.png"), image_width: 18, margin_left: 10, tip: "Save config to disk" do
|
||||||
@@ -60,7 +62,7 @@ module TAC
|
|||||||
window.backend.tacnet.connect("localhost")#("192.168.1.5")
|
window.backend.tacnet.connect("localhost")#("192.168.1.5")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
button "Status", text_size: 18, width: 0.475 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/information.png"), image_width: 18, width: 0.475 do
|
||||||
push_state(Dialog::AlertDialog, title: "TACNET Status", message: window.backend.tacnet.full_status)
|
push_state(Dialog::AlertDialog, title: "TACNET Status", message: window.backend.tacnet.full_status)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -74,11 +76,11 @@ module TAC
|
|||||||
background TAC::Palette::GROUPS_PRIMARY
|
background TAC::Palette::GROUPS_PRIMARY
|
||||||
flow do
|
flow do
|
||||||
label "Groups"
|
label "Groups"
|
||||||
button "+", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/plus.png"), image_width: 18, tip: "Add group" do
|
||||||
push_state(TAC::Dialog::NamePromptDialog, title: "Create Group", callback_method: method(:create_group))
|
push_state(TAC::Dialog::NamePromptDialog, title: "Create Group", callback_method: method(:create_group))
|
||||||
end
|
end
|
||||||
button "Clone", text_size: 18, tip: "Clone currently selected group"
|
button get_image("#{TAC::ROOT_PATH}/media/icons/button2.png"), image_width: 18, tip: "Clone currently selected group"
|
||||||
button "Create Preset", text_size: 18, tip: "Save group as preset"
|
button get_image("#{TAC::ROOT_PATH}/media/icons/save.png"), image_width: 18, tip: "Save group as preset"
|
||||||
end
|
end
|
||||||
|
|
||||||
@groups_list = stack width: 1.0 do
|
@groups_list = stack width: 1.0 do
|
||||||
@@ -88,15 +90,15 @@ module TAC
|
|||||||
background TAC::Palette::ACTIONS_PRIMARY
|
background TAC::Palette::ACTIONS_PRIMARY
|
||||||
flow do
|
flow do
|
||||||
label "Actions"
|
label "Actions"
|
||||||
button "+", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/plus.png"), image_width: 18, tip: "Add action" do
|
||||||
if @active_group
|
if @active_group
|
||||||
push_state(TAC::Dialog::NamePromptDialog, title: "Create Action", callback_method: method(:create_action))
|
push_state(TAC::Dialog::NamePromptDialog, title: "Create Action", callback_method: method(:create_action))
|
||||||
else
|
else
|
||||||
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to create action,\nno group selected.")
|
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to create action,\nno group selected.")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
button "Clone", text_size: 18, tip: "Clone currently selected action"
|
button get_image("#{TAC::ROOT_PATH}/media/icons/button2.png"), image_width: 18, tip: "Clone currently selected action"
|
||||||
button "Create Preset", text_size: 18, tip: "Save action as preset"
|
button get_image("#{TAC::ROOT_PATH}/media/icons/save.png"), image_width: 18, tip: "Save action as preset"
|
||||||
end
|
end
|
||||||
|
|
||||||
@actions_list = stack width: 1.0 do
|
@actions_list = stack width: 1.0 do
|
||||||
@@ -106,7 +108,7 @@ module TAC
|
|||||||
background TAC::Palette::VARIABLES_PRIMARY
|
background TAC::Palette::VARIABLES_PRIMARY
|
||||||
flow do
|
flow do
|
||||||
label "Values"
|
label "Values"
|
||||||
button "+", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/plus.png"), image_width: 18, tip: "Add variable" do
|
||||||
if @active_action
|
if @active_action
|
||||||
push_state(TAC::Dialog::VariableDialog, title: "Create Value", callback_method: method(:create_variable))
|
push_state(TAC::Dialog::VariableDialog, title: "Create Value", callback_method: method(:create_variable))
|
||||||
else
|
else
|
||||||
@@ -248,10 +250,10 @@ module TAC
|
|||||||
@variables_list.clear
|
@variables_list.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
button "E", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/wrench.png"), image_width: 18, tip: "Edit group" do
|
||||||
push_state(Dialog::NamePromptDialog, title: "Rename Group", renaming: group, callback_method: method(:update_group))
|
push_state(Dialog::NamePromptDialog, title: "Rename Group", renaming: group, callback_method: method(:update_group))
|
||||||
end
|
end
|
||||||
button "D", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: 18, tip: "Delete group" do
|
||||||
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Delete group and all\nof its actions and variables?", callback_method: proc { delete_group(group) })
|
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Delete group and all\nof its actions and variables?", callback_method: proc { delete_group(group) })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -272,10 +274,10 @@ module TAC
|
|||||||
populate_variables_list(action)
|
populate_variables_list(action)
|
||||||
end
|
end
|
||||||
|
|
||||||
button "E", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/wrench.png"), image_width: 18, tip: "Edit action" do
|
||||||
push_state(Dialog::NamePromptDialog, title: "Rename Action", renaming: action, callback_method: method(:update_action))
|
push_state(Dialog::NamePromptDialog, title: "Rename Action", renaming: action, callback_method: method(:update_action))
|
||||||
end
|
end
|
||||||
button "D", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: 18, tip: "Delete action" do
|
||||||
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Delete action and all\nof its variables?", callback_method: proc { delete_action(action) })
|
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Delete action and all\nof its variables?", callback_method: proc { delete_action(action) })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -293,10 +295,10 @@ module TAC
|
|||||||
|
|
||||||
label variable.name, text_size: 18, width: 0.855
|
label variable.name, text_size: 18, width: 0.855
|
||||||
|
|
||||||
button "E", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/wrench.png"), image_width: 18, tip: "Edit variable" do
|
||||||
push_state(Dialog::VariableDialog, title: "Edit Variable", variable: variable, callback_method: method(:update_variable))
|
push_state(Dialog::VariableDialog, title: "Edit Variable", variable: variable, callback_method: method(:update_variable))
|
||||||
end
|
end
|
||||||
button "D", text_size: 18 do
|
button get_image("#{TAC::ROOT_PATH}/media/icons/trashcan.png"), image_width: 18, tip: "Delete variable" do
|
||||||
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Delete variable?", callback_method: proc { delete_variable(variable) })
|
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Delete variable?", callback_method: proc { delete_variable(variable) })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ module TAC
|
|||||||
|
|
||||||
stack width: 1.0, height: 0.1 do
|
stack width: 1.0, height: 0.1 do
|
||||||
background [TAC::Palette::TIMECRAFTERS_PRIMARY, TAC::Palette::TIMECRAFTERS_SECONDARY]
|
background [TAC::Palette::TIMECRAFTERS_PRIMARY, TAC::Palette::TIMECRAFTERS_SECONDARY]
|
||||||
label "Manage Presets", text_size: 28
|
label "#{TAC::NAME} ― Manage Presets", text_size: 28, color: Gosu::Color::BLACK
|
||||||
button "Close", text_size: 18 do
|
button "Close", text_size: 18 do
|
||||||
pop_state
|
pop_state
|
||||||
end
|
end
|
||||||
|
|||||||
21
lib/states/simulator.rb
Normal file
21
lib/states/simulator.rb
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
module TAC
|
||||||
|
class States
|
||||||
|
class Simulator < CyberarmEngine::GuiState
|
||||||
|
def setup
|
||||||
|
theme(THEME)
|
||||||
|
|
||||||
|
stack width: 1.0, height: 0.1 do
|
||||||
|
background [TAC::Palette::TIMECRAFTERS_PRIMARY, TAC::Palette::TIMECRAFTERS_SECONDARY]
|
||||||
|
label "#{TAC::NAME} ― Simulator", text_size: 28, color: Gosu::Color::BLACK
|
||||||
|
button "Close", text_size: 18 do
|
||||||
|
pop_state
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
flow width: 1.0, height: 1.0 do
|
||||||
|
background [Gosu::Color::GRAY, Gosu::Color::BLACK]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
module TAC
|
module TAC
|
||||||
NAME = "TimeCrafters Action Configurator"
|
NAME = "TimeCrafters Configuration Tool"
|
||||||
VERSION = "0.1.0"
|
VERSION = "0.1.0"
|
||||||
RELEASE_NAME = "IN-DEV"
|
RELEASE_NAME = "IN-DEV"
|
||||||
end
|
end
|
||||||
@@ -11,6 +11,7 @@ require_relative "lib/backend"
|
|||||||
require_relative "lib/config"
|
require_relative "lib/config"
|
||||||
require_relative "lib/states/boot"
|
require_relative "lib/states/boot"
|
||||||
require_relative "lib/states/editor"
|
require_relative "lib/states/editor"
|
||||||
|
require_relative "lib/states/simulator"
|
||||||
require_relative "lib/states/manage_presets"
|
require_relative "lib/states/manage_presets"
|
||||||
require_relative "lib/theme"
|
require_relative "lib/theme"
|
||||||
require_relative "lib/logger"
|
require_relative "lib/logger"
|
||||||
|
|||||||
Reference in New Issue
Block a user