mirror of
https://github.com/TimeCrafters/timecrafters_configuration_tool_desktop.git
synced 2025-12-16 05:42:35 +00:00
Replace usages of label with para, WIP new Editor (v3)
This commit is contained in:
@@ -4,15 +4,15 @@ module TAC
|
||||
def build
|
||||
background Gosu::Color::GRAY
|
||||
|
||||
label "Name", width: 1.0, text_align: :center
|
||||
@name_error = label "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
para "Name", width: 1.0, text_align: :center
|
||||
@name_error = para "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@name_error.hide
|
||||
@name = edit_line @options[:action] ? @options[:action].name : "", filter: method(:name_filter), width: 1.0, autofocus: true, focus: true
|
||||
@name.subscribe(:changed) do |sender, value|
|
||||
valid?
|
||||
end
|
||||
|
||||
label "Comment", width: 1.0, text_align: :center
|
||||
para "Comment", width: 1.0, text_align: :center
|
||||
@comment = edit_line @options[:action] ? @options[:action].comment : "", width: 1.0
|
||||
|
||||
flow width: 1.0, margin_top: THEME_DIALOG_BUTTON_PADDING do
|
||||
|
||||
@@ -3,7 +3,7 @@ module TAC
|
||||
class AlertDialog < Dialog
|
||||
def build
|
||||
background Gosu::Color::GRAY
|
||||
label @options[:message]
|
||||
para @options[:message]
|
||||
|
||||
button "Close", width: 1.0, margin_top: THEME_DIALOG_BUTTON_PADDING do
|
||||
try_commit
|
||||
|
||||
@@ -11,7 +11,7 @@ module TAC
|
||||
@titlebar.style.default[:background] = [ color, darken(color, 50) ]
|
||||
|
||||
background Gosu::Color::GRAY
|
||||
label @options[:message]
|
||||
para @options[:message]
|
||||
|
||||
flow width: 1.0, margin_top: THEME_DIALOG_BUTTON_PADDING do
|
||||
button "Cancel", width: 0.5 do
|
||||
|
||||
@@ -5,8 +5,8 @@ module TAC
|
||||
|
||||
def build
|
||||
background Gosu::Color::GRAY
|
||||
label "Name", width: 1.0, text_align: :center
|
||||
@name_error = label "", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
para "Name", width: 1.0, text_align: :center
|
||||
@name_error = para "", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@name_error.hide
|
||||
@name = edit_line @options[:renaming] ? @options[:renaming].name : "", filter: method(:name_filter), width: 1.0, autofocus: true, focus: true
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ module TAC
|
||||
@titlebar.style.default[:background] = [ Palette::TACNET_PRIMARY, Palette::TACNET_SECONDARY ]
|
||||
|
||||
background Gosu::Color::GRAY
|
||||
label @options[:message], width: 1.0
|
||||
para @options[:message], width: 1.0
|
||||
|
||||
@sound = Gosu::Sample.new("#{TAC::MEDIA_PATH}/error_alarm.ogg").play(1, 1, true)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ module TAC
|
||||
class TACNETStatusDialog < Dialog
|
||||
def build
|
||||
background Gosu::Color::GRAY
|
||||
@message_label = label CyberarmEngine::Window.instance.backend.tacnet.full_status
|
||||
@message_label = para CyberarmEngine::Window.instance.backend.tacnet.full_status
|
||||
|
||||
button "Close", width: 1.0, margin_top: THEME_DIALOG_BUTTON_PADDING do
|
||||
try_commit
|
||||
|
||||
@@ -6,16 +6,16 @@ module TAC
|
||||
|
||||
@type = @options[:variable].type if @options[:variable]
|
||||
|
||||
label "Name", width: 1.0, text_align: :center
|
||||
@name_error = label "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
para "Name", width: 1.0, text_align: :center
|
||||
@name_error = para "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@name_error.hide
|
||||
@name = edit_line @options[:variable] ? @options[:variable].name : "", filter: method(:name_filter), width: 1.0, autofocus: true, focus: true
|
||||
@name.subscribe(:changed) do |sender, value|
|
||||
valid?
|
||||
end
|
||||
|
||||
label "Type", width: 1.0, text_align: :center
|
||||
@type_error = label "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
para "Type", width: 1.0, text_align: :center
|
||||
@type_error = para "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@type_error.hide
|
||||
|
||||
@var_type = list_box items: [:float, :double, :integer, :long, :string, :boolean], choose: @type ? @type : :double, width: 1.0 do |item|
|
||||
@@ -35,8 +35,8 @@ module TAC
|
||||
@type ||= @var_type.value.to_sym
|
||||
|
||||
@value_container = stack width: 1.0 do
|
||||
label "Value", width: 1.0, text_align: :center
|
||||
@value_error = label "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
para "Value", width: 1.0, text_align: :center
|
||||
@value_error = para "Error", color: TAC::Palette::TACNET_CONNECTION_ERROR
|
||||
@value_error.hide
|
||||
@value = edit_line @options[:variable] ? @options[:variable].value : "", width: 1.0
|
||||
@value_boolean = check_box "Boolean", checked: @options[:variable] ? @options[:variable].value == "true" : false
|
||||
|
||||
Reference in New Issue
Block a user