mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 13:52:34 +00:00
Replace usages of label with para, WIP new Editor (v3)
This commit is contained in:
@@ -27,8 +27,8 @@ module TAC
|
||||
|
||||
status_bar.clear do
|
||||
flow(width: 1.0, max_width: 720, h_align: :center) do
|
||||
label "Current Configuration: "
|
||||
@config_label = label window.backend.settings.config
|
||||
para "Current Configuration: "
|
||||
@config_label = para window.backend.settings.config
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -30,13 +30,13 @@ module TAC
|
||||
|
||||
status_bar.clear do
|
||||
flow(width: 0.3333) do
|
||||
label "Active group:", margin_right: 20
|
||||
@active_group_label = label ""
|
||||
para "Active group:", margin_right: 20
|
||||
@active_group_label = para ""
|
||||
end
|
||||
|
||||
flow(width: 0.3333) do
|
||||
label "Active action:", margin_right: 20
|
||||
@active_action_label = label ""
|
||||
para "Active action:", margin_right: 20
|
||||
@active_action_label = para ""
|
||||
end
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ module TAC
|
||||
flow(width: 1.0, height: 1.0) do
|
||||
stack fill: true, height: 1.0, padding_left: 2, padding_right: 2, border_thickness_right: 1, border_color: Gosu::Color::BLACK do
|
||||
@groups_menu = flow(width: 1.0, height: 36) do
|
||||
label "Groups", text_size: THEME_SUBHEADING_TEXT_SIZE, fill: true, text_align: :center
|
||||
para "Groups", text_size: THEME_SUBHEADING_TEXT_SIZE, fill: true, text_align: :center
|
||||
|
||||
button get_image("#{TAC::MEDIA_PATH}/icons/plus.png"), image_width: THEME_ICON_SIZE, tip: "Add group" do
|
||||
push_state(TAC::Dialog::NamePromptDialog, title: "Create Group", list: window.backend.config.groups, callback_method: method(:create_group))
|
||||
@@ -117,7 +117,7 @@ module TAC
|
||||
|
||||
stack fill: true, height: 1.0, padding_left: 2, padding_right: 2, border_thickness_right: 1, border_color: Gosu::Color::BLACK do
|
||||
@actions_menu = flow(width: 1.0, height: 36) do
|
||||
label "Actions", text_size: THEME_SUBHEADING_TEXT_SIZE, fill: true, text_align: :center
|
||||
para "Actions", text_size: THEME_SUBHEADING_TEXT_SIZE, fill: true, text_align: :center
|
||||
|
||||
# TODO: Implement this
|
||||
# button get_image("#{TAC::MEDIA_PATH}/icons/barsHorizontal.png"), image_width: THEME_ICON_SIZE, tip: "Auto renumber engine actions", margin_right: 16, enabled: false do
|
||||
@@ -221,7 +221,7 @@ module TAC
|
||||
|
||||
stack fill: true, height: 1.0, padding_left: 2, padding_right: 2 do
|
||||
@variables_menu = flow(width: 1.0, height: 36) do
|
||||
label "Variables", text_size: THEME_SUBHEADING_TEXT_SIZE, fill: true, text_align: :center
|
||||
para "Variables", text_size: THEME_SUBHEADING_TEXT_SIZE, fill: true, text_align: :center
|
||||
button get_image("#{TAC::MEDIA_PATH}/icons/plus.png"), image_width: THEME_ICON_SIZE, tip: "Add variable" do
|
||||
if @active_action
|
||||
push_state(TAC::Dialog::VariableDialog, title: "Create Variable", list: @active_action.variables, callback_method: method(:create_variable))
|
||||
@@ -325,7 +325,7 @@ module TAC
|
||||
window.backend.config_changed!
|
||||
|
||||
group_container = find_element_by_tag(@groups_list, old_name)
|
||||
label = find_element_by_tag(group_container, "label")
|
||||
para = find_element_by_tag(group_container, "label")
|
||||
|
||||
label.value = name
|
||||
|
||||
@@ -382,7 +382,7 @@ module TAC
|
||||
window.backend.config_changed!
|
||||
|
||||
action_container = find_element_by_tag(@actions_list, old_name)
|
||||
label = find_element_by_tag(action_container, "label")
|
||||
para = 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")
|
||||
|
||||
@@ -454,7 +454,7 @@ module TAC
|
||||
window.backend.config_changed!
|
||||
|
||||
variable_container = find_element_by_tag(@variables_list, old_name)
|
||||
label = find_element_by_tag(variable_container, "label")
|
||||
para = find_element_by_tag(variable_container, "label")
|
||||
type = find_element_by_tag(variable_container, "type")
|
||||
value = find_element_by_tag(variable_container, "value")
|
||||
|
||||
|
||||
@@ -6,33 +6,33 @@ module TAC
|
||||
|
||||
body.clear do
|
||||
stack(width: 1.0, height: 1.0) do
|
||||
label TAC::NAME, width: 1.0, text_size: 48, text_align: :center
|
||||
para TAC::NAME, width: 1.0, text_size: 48, text_align: :center
|
||||
|
||||
stack(width: 1.0, height: 8) do
|
||||
background 0xff_006000
|
||||
end
|
||||
|
||||
if window.backend.settings.config.empty?
|
||||
label "TODO: Introduction"
|
||||
label "Get Started", text_size: 28
|
||||
para "TODO: Introduction"
|
||||
para "Get Started", text_size: 28
|
||||
button "1. Create a configuration" do
|
||||
page(TAC::Pages::Configurations)
|
||||
end
|
||||
label "2. Add a group"
|
||||
label "3. Add an action"
|
||||
label "4. Add a variable"
|
||||
label "5. Profit?"
|
||||
para "2. Add a group"
|
||||
para "3. Add an action"
|
||||
para "4. Add a variable"
|
||||
para "5. Profit?"
|
||||
else
|
||||
label "Display config stats or something?"
|
||||
para "Display config stats or something?"
|
||||
|
||||
config = window.backend.config
|
||||
groups = config.groups
|
||||
actions = config.groups.map { |g| g.actions }.flatten
|
||||
variables = actions.map { |a| a.variables }.flatten
|
||||
|
||||
label "Total groups: #{groups.size}"
|
||||
label "Total actions: #{actions.size}"
|
||||
label "Total variables: #{variables.size}"
|
||||
para "Total groups: #{groups.size}"
|
||||
para "Total actions: #{actions.size}"
|
||||
para "Total variables: #{variables.size}"
|
||||
end
|
||||
|
||||
stack(width: 1.0, fill: true, scroll: true, margin_top: 32) do
|
||||
|
||||
@@ -201,7 +201,7 @@ module TAC
|
||||
window.backend.config_changed!
|
||||
|
||||
group_container = find_element_by_tag(@group_presets, old_name)
|
||||
label = find_element_by_tag(group_container, "label")
|
||||
para = find_element_by_tag(group_container, "label")
|
||||
|
||||
label.value = name
|
||||
|
||||
@@ -233,7 +233,7 @@ module TAC
|
||||
window.backend.config_changed!
|
||||
|
||||
action_container = find_element_by_tag(@action_presets, old_name)
|
||||
label = find_element_by_tag(action_container, "label")
|
||||
para = 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")
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ module TAC
|
||||
end
|
||||
|
||||
status_bar.clear do
|
||||
@simulation_status = label ""
|
||||
@simulation_status = para ""
|
||||
end
|
||||
|
||||
body.clear do
|
||||
|
||||
@@ -6,9 +6,9 @@ module TAC
|
||||
|
||||
menu_bar.clear do
|
||||
@connect_menu = flow(width: 1.0, height: 1.0) do
|
||||
label "Hostname", text_size: 28
|
||||
para "Hostname", text_size: 28
|
||||
hostname = edit_line window.backend.settings.hostname, width: 0.33, height: 1.0, text_size: 28
|
||||
label "Port", text_size: 28
|
||||
para "Port", text_size: 28
|
||||
port = edit_line window.backend.settings.port, width: 0.33, height: 1.0, text_size: 28
|
||||
button "Connect", height: 1.0, text_size: 28 do
|
||||
if hostname.value != window.backend.settings.hostname || port.value.to_i != window.backend.settings.port
|
||||
@@ -31,11 +31,11 @@ module TAC
|
||||
|
||||
status_bar.clear do
|
||||
@tacnet_icon = image "#{TAC::MEDIA_PATH}/icons/signal3.png", height: 26
|
||||
@status_label = label "TACNET: Not Connected", text_size: 26
|
||||
@status_label = para "TACNET: Not Connected", text_size: 26
|
||||
end
|
||||
|
||||
body.clear do
|
||||
@full_status_label = label ""
|
||||
@full_status_label = para ""
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user