From 9be118b1ad1bd90b5d494aaa4a751bff3d207924 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Sat, 19 Feb 2022 15:56:54 -0600 Subject: [PATCH] Added prototype welcome screen --- lib/states/welcome.rb | 107 ++++++++++++++++++++++++++++++++++++++ w3d_hub_linux_launcher.rb | 1 + 2 files changed, 108 insertions(+) create mode 100644 lib/states/welcome.rb diff --git a/lib/states/welcome.rb b/lib/states/welcome.rb new file mode 100644 index 0000000..c9fbdf4 --- /dev/null +++ b/lib/states/welcome.rb @@ -0,0 +1,107 @@ +class W3DHub + class States + class Welcome < CyberarmEngine::GuiState + def setup + window.show_cursor = true + + theme(W3DHub::THEME) + background 0x88_252525 + + + @card_container = stack(width: 1.0, height: 1.0, margin: 128, padding: 16) do + background 0xff_252525 + end + + @card_container.clear do + card_welcome + end + end + + def card_welcome + stack(width: 1.0, height: 0.9) do + banner "Welcome", width: 1.0, border_thickness_bottom: 4, border_color_bottom: 0xff_000000 + title "Welcome to the #{I18n.t(:app_name_simple)}" + caption "The #{I18n.t(:app_name_simple)} is a one-stop shop for your W3D gaming needs, providing game downloads, automatic updating, an integrated server browser, and centralized management of in-game options.", width: 1.0, margin_left: 32 + end + + flow(width: 1.0, height: 0.1) do + stack(width: 0.83, height: 1.0) do + link "Skip", border_color_bottom: 0xff_777777 do + pop_state + end + end + + button "Next >" do + @card_container.clear { card_getting_started } + end + end + end + + def card_getting_started + stack(width: 1.0, height: 0.9) do + banner "Getting Started", width: 1.0, border_thickness_bottom: 4, border_color_bottom: 0xff_000000 + title "Import C&C Renegade" + caption "You can import your installed copy of Renegade if it wasn't automatically imported from the Games tab. If you need to procure a copy of Renegade, EA's Origin Store has the Command & Conquer The Ultimate Collection available. We cannot provide Renegade for installation.", width: 1.0, margin_left: 32 + + stack(width: 1.0, height: 2, background: 0x88_ffffff) + + title "Install one of our standalone games" + caption "Browse our selection of games from the left panel of the Games tab.\n• Interim Apex - Renegade but with hundreds of vehicles and characters.\n• Red Alert: A Path Beyond - DESCRIPTION\n• Tiberian Sun: Reborn - DESCRIPTION\n\nAnd more... Check out the left panel on the Games tab.", width: 1.0, margin_left: 32 + end + + flow(width: 1.0, height: 0.9) do + flow(width: 0.83, height: 1.0) do + button "< Back" do + @card_container.clear { card_welcome } + end + + link "Skip", border_color_bottom: 0xff_777777, margin_left: 16 do + pop_state + end + end + + button "Next >" do + @card_container.clear { card_communitiy } + end + end + end + + def card_communitiy + stack(width: 1.0, height: 0.9) do + banner "W3D Hub Community", width: 1.0, border_thickness_bottom: 4, border_color_bottom: 0xff_000000 + title "Forums" + caption "Join our forum community", margin_left: 32 + + title "Facebook" + caption "Like us on Facebook", margin_left: 32 + + title "Discord" + caption "Join our Discord community server", margin_left: 32 + + title "YouTube" + caption "Subscribe to our YouTube channel", margin_left: 32 + end + + flow(width: 1.0, height: 0.1) do + flow(width: 0.83, height: 1.0) do + button "< Back" do + @card_container.clear { card_getting_started } + end + end + + button "Done" do + pop_state + end + end + end + + def draw + previous_state&.draw + + Gosu.flush + + super + end + end + end +end diff --git a/w3d_hub_linux_launcher.rb b/w3d_hub_linux_launcher.rb index fcfb0ff..bb369d0 100644 --- a/w3d_hub_linux_launcher.rb +++ b/w3d_hub_linux_launcher.rb @@ -61,6 +61,7 @@ require_relative "lib/application_manager/tasks/importer" require_relative "lib/states/demo_input_delay" require_relative "lib/states/boot" require_relative "lib/states/interface" +require_relative "lib/states/welcome" require_relative "lib/states/message_dialog" require_relative "lib/states/prompt_dialog" require_relative "lib/states/confirm_dialog"