Added logo, added Boot screen, renamed dump_config packet to upload_config, misc changes and UX improvements

This commit is contained in:
2020-06-08 16:08:41 -05:00
parent ef0174fb06
commit f04dfb01e7
13 changed files with 124 additions and 42 deletions

36
lib/states/boot.rb Normal file
View File

@@ -0,0 +1,36 @@
module TAC
class States
class Boot < CyberarmEngine::GuiState
def setup
stack width: 1.0, height: 1.0 do
background [TAC::Palette::TIMECRAFTERS_PRIMARY, TAC::Palette::TIMECRAFTERS_SECONDARY, TAC::Palette::TIMECRAFTERS_TERTIARY, TAC::Palette::TIMECRAFTERS_PRIMARY]
end
@title_font = CyberarmEngine::Text.new(TAC::NAME, z: 100, size: 72, shadow: true, shadow_size: 3, font: THEME[:Label][:font])
@logo = Gosu::Image.new("#{TAC::ROOT_PATH}/media/logo.png")
@animator = CyberarmEngine::Animator.new(start_time: 0, duration: 3_000, from: 0, to: 255)
@transition_color = Gosu::Color.new(0x00_000000)
end
def draw
super
@title_font.draw
@logo.draw(window.width / 2 - @logo.width / 2, window.height / 2 - @logo.height / 2, 99)
Gosu.draw_rect(0, 0, window.width, window.height, @transition_color, 10_00)
end
def update
super
@title_font.x = window.width / 2 - @title_font.width / 2
@title_font.y = window.height / 2 - (@logo.height / 2 + @title_font.height)
@transition_color.alpha = @animator.transition(0, 255, :sine)
push_state(Editor) if @transition_color.alpha >= 255
end
end
end
end

View File

@@ -37,7 +37,7 @@ module TAC
window.backend.upload_config
end
button "", text_size: 18, margin_left: 10, tip: "Download remote config, if connected." do
push_state(Dialog::ConfirmDialog, title: "Are you sure?", message: "Replace local config with\n remote config?", callback_method: proc { window.backend.download_config })
window.backend.download_config
end
end
end
@@ -57,7 +57,7 @@ module TAC
when :connected, :connecting
window.backend.tacnet.close
when :not_connected, :connection_error
window.backend.tacnet.connect("localhost")
window.backend.tacnet.connect("localhost")#("192.168.1.5")
end
end
button "Status", text_size: 18, width: 0.475 do
@@ -77,8 +77,8 @@ module TAC
button "+", text_size: 18 do
push_state(TAC::Dialog::NamePromptDialog, title: "Create Group", callback_method: method(:create_group))
end
button "Clone", text_size: 18
button "Create Preset", text_size: 18
button "Clone", text_size: 18, tip: "Clone currently selected group"
button "Create Preset", text_size: 18, tip: "Save group as preset"
end
@groups_list = stack width: 1.0 do
@@ -95,8 +95,8 @@ module TAC
push_state(TAC::Dialog::AlertDialog, title: "Error", message: "Unable to create action,\nno group selected.")
end
end
button "Clone", text_size: 18
button "Create Preset", text_size: 18
button "Clone", text_size: 18, tip: "Clone currently selected action"
button "Create Preset", text_size: 18, tip: "Save action as preset"
end
@actions_list = stack width: 1.0 do