Bunch of stuff

This commit is contained in:
2026-04-18 21:58:58 -05:00
parent 43f8af42ec
commit 30776857a2
16 changed files with 432 additions and 138 deletions

View File

@@ -0,0 +1,65 @@
module W3DHubLauncher
module Page
module Boot
class InitialSetup < CyberarmEngine::Page
include GuiExt
def setup
stack(width: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: 8, background_nine_slice_color: 0x11_ffffff, padding: HALF_PADDING) do
banner "Welcome to #{NAME}", width: 1.0, text_align: :center
tagline "Your gateway to the world of W3D Hub games.", width: 1.0, text_align: :center
end
stack(width: 1.0, fill: true, padding: PADDING) do
stack(width: 1.0, fill: true, scroll: true) do
title "Initial Setup"
caption "Please confirm launcher's default settings and make any desired tweaks.", font: FONT_REGULAR
flow(width: 1.0, height: 40, margin_top: PADDING) do
tagline "Launcher data directory", height: 1.0, text_v_align: :center
edit_line format("%s/.local/share/W3D Hub", Dir.home), fill: true
button "Browse..."
end
inscription "Location where the launcher stores it's configuration files and cache interface data."
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
tagline "Launcher package cache directory", height: 1.0, text_v_align: :center
edit_line format("%s/.local/share/W3D Hub/package-cache", Dir.home), fill: true
button "Browse..."
end
inscription "Location where the launcher will download application packages."
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
tagline "Application installation directory", height: 1.0, text_v_align: :center
edit_line format("%s/.local/share/W3D Hub/applications", Dir.home), fill: true
button "Browse..."
end
inscription "Location where the launcher will install new applications."
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
tagline "Wine context", height: 1.0, text_v_align: :center
edit_line "", fill: true
button "Browse..."
end
inscription "Location of wine context to use. Leave blank to use default."
flow(width: 1.0, height: 40, margin_top: HALF_PADDING) do
tagline "Wine command", height: 1.0, text_v_align: :center
edit_line "wine", fill: true
button "Browse..."
end
inscription "Path to wine executable. Use `wine` for system installed wine."
end
flow(width: 1.0, padding_top: PADDING) do
flow(fill: true)
button "Accept" do
page(Page::Boot::StartUp)
end
end
end
end
end
end
end
end

View File

@@ -0,0 +1,82 @@
module W3DHubLauncher
module Page
module Boot
class StartUp < CyberarmEngine::Page
include GuiExt
def setup
stack(width: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: 8, background_nine_slice_color: 0x11_ffffff, padding: HALF_PADDING) do
banner "Establishing Battlefield Control", width: 1.0, text_align: :center
tagline "Please stand by...", width: 1.0, text_align: :center
end
stack(width: 1.0, fill: true, padding: PADDING) do
stack(width: 1.0, fill: true, scroll: true) do
a = flow(width: 1.0, height: HALF_PADDING + PADDING, visible: false) do
image safe_get_image("./media/icons/checkmark.png"), height: 1.0, v_align: :center
tagline "DNS resolution", height: 1.0, text_v_align: :center
end
after(500) do
a.show
end
b = flow(width: 1.0, height: HALF_PADDING + PADDING, visible: false) do
image safe_get_image("./media/icons/information.png"), height: 1.0, v_align: :center, color: 0xff_ff8800
tagline "Upstream backend", height: 1.0, text_v_align: :center
caption "Notice: Unreachable. Accounts will be unavailable.", height: 1.0, text_v_align: :center, color: 0xff_ff8800
end
after(1000) do
b.show
end
c = flow(width: 1.0, height: HALF_PADDING + PADDING, visible: false) do
image safe_get_image("./media/icons/checkmark.png"), height: 1.0, v_align: :center
tagline "Alternate backend", height: 1.0, text_v_align: :center
end
after(1500) do
c.show
end
d = flow(width: 1.0, height: HALF_PADDING + PADDING, visible: false) do
image safe_get_image("./media/icons/information.png"), height: 1.0, v_align: :center, color: 0xff_ff8800
tagline "Refresh account session", height: 1.0, text_v_align: :center
caption "Notice: Upstream backend unavailable, session not refreshed.", height: 1.0, text_v_align: :center, color: 0xff_ff8800
end
after(2000) do
d.show
end
e = flow(width: 1.0, height: HALF_PADDING + PADDING, visible: false) do
image safe_get_image("./media/icons/checkmark.png"), height: 1.0, v_align: :center
tagline "Fetch game servers", height: 1.0, text_v_align: :center
end
after(2500) do
e.show
end
f = flow(width: 1.0, height: HALF_PADDING + PADDING, visible: false) do
image safe_get_image("./media/icons/cross.png"), height: 1.0, v_align: :center, color: 0xff_ff0000
tagline "Fetch applications", height: 1.0, text_v_align: :center
caption "Fatal: Failed to retrieve applications list and no local cache exists. Cannot continue.", height: 1.0, text_v_align: :center, color: 0xff_ff0000
end
after(3000) do
f.show
@progress_bar.type = :linear
@progress_bar.value = 0.0
end
after(3500) do
parent.page_host.clear do
banner "Battlefield control established".upcase, width: 1.0, height: 1.0, text_v_align: :center, text_align: :center
end
end
after(3600) do
pop_state
push_state(States::Interface)
end
end
flow(width: 1.0, padding_top: PADDING) do
@progress_bar = progress width: 1.0, type: :marquee
end
end
end
end
end
end
end

38
lib/pages/boot/terms.rb Normal file
View File

@@ -0,0 +1,38 @@
module W3DHubLauncher
module Page
module Boot
class Terms < CyberarmEngine::Page
include GuiExt
TERMS_AND_CONDITIONS = <<~TERMS
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.
TERMS
def setup
flow(width: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: 8, background_nine_slice_color: 0x11_ffffff, padding: HALF_PADDING) do
banner "Terms and Conditions", width: 1.0, text_align: :center
end
stack(width: 1.0, fill: true, padding: PADDING) do
stack(width: 1.0, fill: true, scroll: true, padding_bottom: PADDING) do
tagline TERMS_AND_CONDITIONS, font: FONT_REGULAR
end
flow(width: 1.0) do
flow(fill: true)
button "Decline", margin_right: PADDING do
window.close
end
button "Accept" do
page(Page::Boot::InitialSetup)
end
end
end
end
end
end
end
end

View File

@@ -6,14 +6,14 @@ module W3DHubLauncher
def setup
# game bar container
flow(width: 1.0, height: 60) do
flow(width: 220, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK) do
flow(width: 220, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY) do
flow(width: 1.0, height: 40, margin_left: PADDING, v_align: :center, h_align: :center) do
image safe_get_image("./media/icons/menuGrid.png"), height: 40, color: 0xff_bbbbbb
link "ALL GAMES", text_size: 24, font: FONT_BLACK, height: 1.0, text_v_align: :center
end
end
flow(fill: true, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK, margin_left: PADDING) do
flow(fill: true, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY, margin_left: PADDING) do
image safe_get_image("./data/cache/apb.png"), height: 1.0, padding: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0x88_5e5c64, border_thickness_bottom: 3, border_color_bottom: 0xff_3584e4, tip: "Red Alert: A Path Beyond"
image safe_get_image("./data/cache/ren.png"), height: 1.0, padding: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, tip: "Command & Conquer: Renegade"
image safe_get_image("./data/cache/tsr.png"), height: 1.0, padding: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, tip: "Tiberian Sun: Reborn"
@@ -48,7 +48,7 @@ module W3DHubLauncher
# game events and news container
stack(fill: true, height: 1.0, margin_left: LARGE_PADDING, scroll: true) do
flow(width: 1.0, height: 1.0, max_height: 380, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK) do
flow(width: 1.0, height: 1.0, max_height: 380, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY) do
image safe_get_image("./media/background.png"), fill: true, aspect_ratio: 16.0 / 9.0
stack(fill: true, height: 1.0, margin_left: PADDING) do
@@ -65,9 +65,9 @@ module W3DHubLauncher
# news container
flow(width: 1.0, margin_top: PADDING) do
9.times do
stack(width: 1.0 / 3, height: 345, aspect_ratio: 1, margin_left: HALF_PADDING, margin_right: HALF_PADDING, margin_bottom: PADDING) do
stack(width: 1.0 / 3, min_width: 345, height: 345, aspect_ratio: 1, margin_left: HALF_PADDING, margin_right: HALF_PADDING, margin_bottom: PADDING) do
stack(width: 1.0, fill: true, background_image: safe_get_image("./media/background.png"), background_image_mode: :fill)
stack(width: 1.0, height: 1.0 / 3, padding: PADDING, v_align: :bottom, background_nine_slice: NINE_SLICE_ROUNDED_BOTTOM, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK, border_thickness_top: 1, border_color_top: Gosu::Color::BLACK) do
stack(width: 1.0, height: 1.0 / 3, padding: PADDING, v_align: :bottom, background_nine_slice: NINE_SLICE_ROUNDED_BOTTOM, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY, border_thickness_top: 1, border_color_top: Gosu::Color::BLACK) do
caption "NEWS", color: 0x88_ffffff
tagline "A News Item Post A News Item Post"
end

View File

@@ -6,14 +6,14 @@ module W3DHubLauncher
def setup
# game bar container
flow(width: 1.0, height: 60) do
flow(width: 220, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK) do
flow(width: 220, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY) do
flow(width: 1.0, height: 40, margin_left: PADDING, v_align: :center, h_align: :center) do
image safe_get_image("./media/icons/menuGrid.png"), height: 40, color: 0xff_bbbbbb
link "ALL SERVERS", text_size: 24, font: FONT_BLACK, height: 1.0, text_v_align: :center
end
end
flow(fill: true, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_BLACK, margin_left: PADDING) do
flow(fill: true, height: 1.0, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY, margin_left: PADDING) do
image safe_get_image("./data/cache/apb.png"), height: 1.0, padding: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0x88_5e5c64, border_thickness_bottom: 3, border_color_bottom: 0xff_3584e4, tip: "Red Alert: A Path Beyond"
image safe_get_image("./data/cache/ren.png"), height: 1.0, padding: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, tip: "Command & Conquer: Renegade"
image safe_get_image("./data/cache/tsr.png"), height: 1.0, padding: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED_TOP, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0, tip: "Tiberian Sun: Reborn"
@@ -24,7 +24,7 @@ module W3DHubLauncher
# game content container
stack(width: 1.0, fill: true, margin_top: LARGE_PADDING, scroll: true) do
10.times do
flow(width: 1.0, height: 48, padding_top: HALF_PADDING, padding_bottom: HALF_PADDING, margin_bottom: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: 0x44_000000, hover: { background_nine_slice_color: 0x88_000000 }) do
flow(width: 1.0, height: 48, padding_top: HALF_PADDING, padding_bottom: HALF_PADDING, margin_bottom: HALF_PADDING, background_nine_slice: NINE_SLICE_ROUNDED, background_nine_slice_from_edge: NINE_SLICE_EDGE, background_nine_slice_color: ALPHA_GRAY, hover: { background_nine_slice_color: 0xff_5e5c64 } , active: { background_nine_slice_color: 0xaa_5e5c64 }) do
# app icon container
image(safe_get_image("./data/cache/apb.png"), tip: "Red Alert: A Path Beyond", width: 48, height: 1.0, margin_left: HALF_PADDING)
# friend name and status container