Flesh out about dialog a bit more, added tooltips to server browser server list item elements

This commit is contained in:
2026-04-18 12:30:08 -05:00
parent 33de050cd2
commit 43f8af42ec
4 changed files with 40 additions and 13 deletions

17
lib/attribution.rb Normal file
View File

@@ -0,0 +1,17 @@
module W3DHubLauncher
module Attribution
Item = Data.define(:name, :description, :url, :license, :license_url)
SPECIAL_THANKS = [
Item.new("Yukihiro \"matz\" Matsumoto", "Creating the Ruby language", "https://matz.rubyist.net", "", ""),
Item.new("Kenney", "Creating awesome game assets and releasing them completely for free.\nThe launcher uses their UI Icon pack.", "https://kenney.nl", "CC0", "https://creativecommons.org/publicdomain/zero/1.0/")
]
LIBRARIES = [
Item.new("Ruby", "Programming language. A Programmer's Best Friend", "https://ruby-lang.org", "2-clause BSDL", "https://www.ruby-lang.org/en/about/license.txt"),
Item.new("gosu", "Light-weight game library", "https://libgosu.org", "MIT", "https://github.com/gosu/gosu/blob/master/COPYING"),
Item.new("SDL2", "Simple DirectMedia Layer", "https://libsdl.org", "MIT", "https://github.com/libsdl-org/SDL/blob/SDL2/LICENSE.txt"),
Item.new("MojoAL", "OpenAL sound library implementation in a single C file", "https://icculus.org/mojoAL/", "MIT", "https://github.com/icculus/mojoAL/blob/main/LICENSE.txt"),
]
end
end

View File

@@ -20,17 +20,14 @@ module W3DHubLauncher
para "© 2026 cyberarm", margin_left: PADDING para "© 2026 cyberarm", margin_left: PADDING
link "MIT licence", margin_left: PADDING link "MIT licence", margin_left: PADDING
title "Thanks", margin_top: LARGE_PADDING title "Special Thanks", margin_top: LARGE_PADDING
10.times do W3DHubLauncher::Attribution::SPECIAL_THANKS.each do |item|
tagline "NAME", margin_left: PADDING present_item(item)
para "REASON", margin_left: LARGE_PADDING
end end
title "Libraries", margin_top: LARGE_PADDING title "Software / Libraries", margin_top: LARGE_PADDING
10.times do W3DHubLauncher::Attribution::LIBRARIES.each do |item|
tagline "LIBRARY", margin_left: PADDING present_item(item)
para "LEGAL TEXT", margin_left: LARGE_PADDING
link "ABREV licence", margin_left: LARGE_PADDING
end end
end end
@@ -41,6 +38,16 @@ module W3DHubLauncher
end end
end end
end end
def present_item(item)
unless item.url.empty?
link item.name, tip: item.url, margin_left: PADDING, font: FONT_BOLD
else
tagline item.name, margin_left: PADDING
end
para item.description, margin_left: LARGE_PADDING
link item.license, tip: item.license_url, margin_left: PADDING + LARGE_PADDING unless item.license.empty?
end
end end
end end
end end

View File

@@ -26,12 +26,13 @@ module W3DHubLauncher
10.times 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: 0x44_000000, hover: { background_nine_slice_color: 0x88_000000 }) do
# app icon container # app icon container
image(safe_get_image("./data/cache/apb.png"), width: 48, height: 1.0, margin_left: HALF_PADDING) 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 # friend name and status container
stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do
stack(v_align: :center) do stack(v_align: :center) do
# server name # server name
caption ["Really Long Server Name Goes Here", "[US][W3D Hub] APB Game Night", "[US][W3D Hub] APB Co-op 3.7", "Really Long Server Name Goes Here Really Long Server Name Goes Here"].sample, text_wrap: :none server_name = ["Really Long Server Name Goes Here", "[US][W3D Hub] APB Game Night", "[US][W3D Hub] APB Co-op 3.7", "Really Long Server Name Goes Here Really Long Server Name Goes Here"].sample
caption server_name, text_wrap: :none, tip: server_name
# server info # server info
a = ["North America", "South America", "Europe", "Asia", "Antarctica", "Arctica", "Oceania"] a = ["North America", "South America", "Europe", "Asia", "Antarctica", "Arctica", "Oceania"]
inscription "#{a.sample} • 13:52 / #{rand > 0.5 ? '∞' : '30:00'}", text_wrap: :none, margin_top: -HALF_PADDING inscription "#{a.sample} • 13:52 / #{rand > 0.5 ? '∞' : '30:00'}", text_wrap: :none, margin_top: -HALF_PADDING
@@ -40,7 +41,8 @@ module W3DHubLauncher
# server map # server map
stack(width: 256, height: 1.0, margin_left: HALF_PADDING) do stack(width: 256, height: 1.0, margin_left: HALF_PADDING) do
stack(width: 1.0, fill: true, v_align: :center) do stack(width: 1.0, fill: true, v_align: :center) do
caption ["RA_Under", "C&C Superduple Long Map Name Goes Here", "RA_NorthByNorthWest", "RA_HostileWatersParadox", "RA_PacificThreat"].sample, text_wrap: :none, width: 1.0, text_align: :center server_map = ["RA_Under", "C&C Superduple Long Map Name Goes Here", "RA_NorthByNorthWest", "RA_HostileWatersParadox", "RA_PacificThreat"].sample
caption server_map, tip: server_map, text_wrap: :none, width: 1.0, text_align: :center
inscription "map", text_wrap: :none, width: 1.0, text_align: :center, margin_top: -HALF_PADDING inscription "map", text_wrap: :none, width: 1.0, text_align: :center, margin_top: -HALF_PADDING
end end
end end
@@ -55,7 +57,7 @@ module W3DHubLauncher
# server ping # server ping
flow(width: 96, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do flow(width: 96, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do
stack(fill: true, height: 1.0, v_align: :center) do stack(fill: true, height: 1.0, v_align: :center) do
caption format("%d ms", rand(16..360)), width: 1.0, text_align: :center caption rand > 0.85 ? "?" : format("%d ms", rand(16..360)), width: 1.0, text_align: :center
inscription "ping", text_wrap: :none, width: 1.0, text_align: :center, margin_top: -HALF_PADDING inscription "ping", text_wrap: :none, width: 1.0, text_align: :center, margin_top: -HALF_PADDING
end end
stack(width: 8, height: rand(0.25..1.0), v_align: :center, min_height: 8, background_nine_slice: NINE_SLICE_ROUNDED_SMALL, background_nine_slice_from_edge: NINE_SLICE_EDGE_SMALL, background_nine_slice_color: [0xff_26a269, 0xff_e5a50a, 0xff_a51d2d, 0xff_3d3846].sample) stack(width: 8, height: rand(0.25..1.0), v_align: :center, min_height: 8, background_nine_slice: NINE_SLICE_ROUNDED_SMALL, background_nine_slice_from_edge: NINE_SLICE_EDGE_SMALL, background_nine_slice_color: [0xff_26a269, 0xff_e5a50a, 0xff_a51d2d, 0xff_3d3846].sample)

View File

@@ -5,6 +5,7 @@ rescue LoadError
end end
require_relative "lib/version" require_relative "lib/version"
require_relative "lib/attribution"
require_relative "lib/gui_ext" require_relative "lib/gui_ext"
require_relative "lib/theme" require_relative "lib/theme"
require_relative "lib/pages/games" require_relative "lib/pages/games"