commit 7054d6bf2aa52792527ebbe645f94a7786ccd7ab Author: Cyberarm Date: Sun Apr 12 14:08:29 2026 -0500 Initial Commit: v2 in progress diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a678732 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +pkg/ +*.json +data/cache/* +!data/cache/.gitkeep +data/logs/* +!data/logs/.gitkeep +_*.* +*.log +media/icons/* +!media/icons/app.* +!media/icons/default_icon.png +!media/icons/w3dhub.png diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..a4e4437 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,8 @@ +Style/StringLiterals: + EnforcedStyle: double_quotes + +Metrics/MethodLength: + Max: 40 + +Style/EmptyMethod: + EnforcedStyle: expanded diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..6cec934 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +ruby diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..3c21f18 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://gem.coop" + +gem "cyberarm_engine" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..4bd2415 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,20 @@ +GEM + remote: https://gem.coop/ + specs: + cyberarm_engine (0.25.1) + gosu (~> 1.1) + gosu (1.4.6) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + cyberarm_engine + +CHECKSUMS + cyberarm_engine (0.25.1) + gosu (1.4.6) + +BUNDLED WITH + 4.0.8 diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..0a4296e --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +Copyright (c) 2021 cyberarm + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5469897 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# Cyberarm's W3D Hub Linux Launcher 2.0 + +Rebuilding from the ground up with over 5 years UI/UX learnings. diff --git a/lib/window.rb b/lib/window.rb new file mode 100644 index 0000000..f293bf0 --- /dev/null +++ b/lib/window.rb @@ -0,0 +1,132 @@ +module W3DHubLauncher + class Window < CyberarmEngine::Window + def setup + self.show_cursor = true + self.caption = "Cyberarm's W3D Hub Linux Launcher | v2.0.0 alpha" + + push_state(Interface) + end + end + + class Interface < CyberarmEngine::GuiState + LARGE_PADDING = 40 + PADDING = 20 + HALF_PADDING = 10 + ALPHA_BLACK = 0x88_000000 + + def setup + theme({ + TextBlock: { + text_static: true, + font: "Noto Sans" + }, + Link: { + color: 0xff_dddddd, + hover: { + color: 0xff_ffffff + }, + active: { + color: 0xff_aaaaaa + } + } + }) + + # root container - background image + stack(width: 1.0, height: 1.0, background_image: get_image("./media/background.png"), background_image_mode: :fill) do + # root container - background image tint + flow(width: 1.0, height: 1.0, background: 0x88_000000) do + # content container + stack(fill: true, height: 1.0, margin: PADDING, margin_right: LARGE_PADDING) do + # header bar container + flow(width: 1.0, height: 80, background: ALPHA_BLACK, margin_bottom: PADDING) do + title "LOGO" + title "GAMES" + title "SERVERS" + flow(fill: true) + title "_" + title "I" + end + + # page content container + stack(width: 1.0, fill: true) do + # game bar container + flow(width: 1.0, height: 60) do + flow(width: 220, height: 1.0, background: ALPHA_BLACK) do + link "ALL GAMES" + end + + flow(fill: true, height: 1.0, background: ALPHA_BLACK, margin_left: PADDING) do + image get_image("./data/cache/apb.png"), height: 1.0, padding: HALF_PADDING, background:0x88_5e5c64, border_thickness: 3, border_color_bottom: 0xff_3584e4, tip: "Red Alert: A Path Beyond" + image get_image("./data/cache/ren.png"), height: 1.0, padding: HALF_PADDING, tip: "Command & Conquer: Renegade" + image get_image("./data/cache/tsr.png"), height: 1.0, padding: HALF_PADDING, tip: "Tiberian Sun: Reborn" + image get_image("./data/cache/woa.png"), height: 1.0, padding: HALF_PADDING, tip: "Battle for Dune: War of Assassins" + end + end + + # game content container + flow(width: 1.0, height: 1.0, margin_top: PADDING) do + # game info container + stack(width: 340, height: 1.0, debug: true) do + # logo + image get_image("./media/background.png"), width: 1.0, max_height: 124 + + # web links + stack(width: 1.0, fill: nil, padding: 0, padding_top: LARGE_PADDING, padding_bottom: nil, debug_color: 0xff_0000ff, debug: true) do + link "Modifications" + link "Bug Tracker", padding_top: LARGE_PADDING + link "Player Statistics" + end + + # launching ta game + caption "Game Version" + list_box items: [ "Release", "Open Testing" ], width: 1.0 + flow(width: 1.0) do + button "PLAY", fill: true + button "{}" + button "[]" + end + inscription "Version: 3.9.2.15" + end + + # game events and news container + stack(fill: true, height: 1.0, margin_left: LARGE_PADDING) do + flow(width: 1.0, max_height: 380, background: ALPHA_BLACK) do + image get_image("./media/background.png"), fill: true, aspect_ratio: 16.0 / 9.0 + + stack(fill: true, height: 1.0, margin_left: PADDING) do + caption "Upcoming Event", color: 0xff_22aa11 + title "Red Alert: A Path Beyond Game Night" + tagline "July 11, 2028" + + flow(fill: true) + + button "Read More", margin_left: PADDING, margin_right: LARGE_PADDING, margin_bottom: PADDING, width: 1.0 + end + end + end + end + end + end + + # battleview/friends container + stack(width: 0.25, max_width: 300, height: 1.0, margin: PADDING, margin_left: 0, background: 0x88_888888) do + title "FRIENDS" + end + end + end + end + + def setup + stack(width: 1.0, height: 1.0, background: 0xff_111111) do + button "HELLO", margin: 40 + stack(width: 50, height: 50, margin: 32, padding: 16, border_thickness: 10, border_color: 0xff424242, background: 0xff_242424) { para "HI" } + stack(width: 0.5, height: 0.5, margin_top: 40, margin_left: 40, border_thickness: 10, border_color: 0xff424242, background: 0xff_242424) do + stack(width: 0.5, fill: true, margin_top: 40, margin_left: 40, border_thickness: 10, border_color: 0xff424242, background: 0xff_242424) do + stack(width: 0.5, fill: true, margin_top: 40, margin_left: 40, border_thickness: 10, border_color: 0xff424242, background: 0xff_242424) do + end + end + end + end + end + end +end diff --git a/media/background.png b/media/background.png new file mode 100644 index 0000000..d287a4b Binary files /dev/null and b/media/background.png differ diff --git a/w3d_hub_linux_launcher.rb b/w3d_hub_linux_launcher.rb new file mode 100644 index 0000000..5212df1 --- /dev/null +++ b/w3d_hub_linux_launcher.rb @@ -0,0 +1,11 @@ +begin + require_relative "../cyberarm_engine/lib/cyberarm_engine" +rescue LoadError + require "cyberarm_engine" +end + +require_relative "lib/window" + +GUI_DEBUG = true +window = W3DHubLauncher::Window.new(width: 1280, height: 800, resizable: true) +window.show