More styling changes

This commit is contained in:
2024-02-28 18:14:41 -06:00
parent f9d401e713
commit 0b9b519848
11 changed files with 150 additions and 122 deletions

View File

@@ -22,7 +22,7 @@ class W3DHub
def initialize(hash) def initialize(hash)
@data = hash @data = hash
@id = @data[:id] @id = @data[:id].to_s
@name = @data[:name] @name = @data[:name]
@type = @data[:type] @type = @data[:type]
@category = @data[:category] @category = @data[:category]
@@ -44,7 +44,7 @@ class W3DHub
def initialize(hash) def initialize(hash)
@data = hash @data = hash
@id = @data[:id] @id = @data[:id].to_s
@name = @data[:name] @name = @data[:name]
@user_level = @data[:"user-level"] @user_level = @data[:"user-level"]
@current_version = @data[:"current-version"] @current_version = @data[:"current-version"]

View File

@@ -459,6 +459,13 @@ class W3DHub
Store.applications.games.detect { |g| g.id == app_id }&.name Store.applications.games.detect { |g| g.id == app_id }&.name
end end
def channel_name(app_id, channel_id)
app = Store.applications.games.detect { |g| g.id.to_s == app_id.to_s }
return unless app
app.channels.detect { |g| g.id.to_s == channel_id.to_s }&.name
end
# No application tasks are being done # No application tasks are being done
def idle? def idle?
!busy? !busy?

View File

@@ -45,10 +45,10 @@ class W3DHub
tagline "<b>Help & Support</b>" tagline "<b>Help & Support</b>"
flow(width: 1.0) do flow(width: 1.0) do
para "For help and support using this launcher or playing any W3D Hub game visit the" para "For help and support using this launcher or playing any W3D Hub game visit the"
link("W3D Hub forums", text_size: 16, tip: "https://w3dhub.com/forum/") { W3DHub.url("https://w3dhub.com/forum/") } link("W3D Hub forums", text_size: 22, tip: "https://w3dhub.com/forum/") { W3DHub.url("https://w3dhub.com/forum/") }
para "or join us in" para "or join us in"
image "#{GAME_ROOT_PATH}/media/social_media_icons/discord.png", height: 16, padding_top: 4 image "#{GAME_ROOT_PATH}/media/social_media_icons/discord.png", height: 16, padding_top: 4
link("#tech-support", text_size: 16, tip: "https://discord.com/invite/GYhW7eV") { W3DHub.url("https://discord.com/invite/GYhW7eV") } link("#tech-support", text_size: 22, tip: "https://discord.com/invite/GYhW7eV") { W3DHub.url("https://discord.com/invite/GYhW7eV") }
para "on the W3D Hub Discord server" para "on the W3D Hub Discord server"
end end
end end
@@ -113,15 +113,15 @@ class W3DHub
# stack(width: 0.6, height: 1.0) do # stack(width: 0.6, height: 1.0) do
# stack(width: 1.0, height: 112) do # stack(width: 1.0, height: 112) do
# link "<b>#{item.title}</b>", text_size: 18 do # link "<b>#{item.title}</b>", text_size: 22 do
# W3DHub.url(item.uri) # W3DHub.url(item.uri)
# end # end
# inscription item.blurb.gsub(/\n+/, "\n").strip[0..180] # para item.blurb.gsub(/\n+/, "\n").strip[0..180]
# end # end
# flow(width: 1.0) do # flow(width: 1.0) do
# inscription item.timestamp.strftime("%Y-%m-%d"), width: 0.499 # para item.timestamp.strftime("%Y-%m-%d"), width: 0.499
# link I18n.t(:"games.read_more"), width: 0.5, text_align: :right, text_size: 16 do # link I18n.t(:"games.read_more"), width: 0.5, text_align: :right, text_size: 22 do
# W3DHub.url(item.uri) # W3DHub.url(item.uri)
# end # end
# end # end
@@ -139,12 +139,12 @@ class W3DHub
stack(fill: true, height: 1.0, padding: 4, border_thickness_left: 1, border_color_left: lighten(Gosu::Color.new(0xff_252525))) do stack(fill: true, height: 1.0, padding: 4, border_thickness_left: 1, border_color_left: lighten(Gosu::Color.new(0xff_252525))) do
tagline "<b>#{item.title}</b>", width: 1.0 tagline "<b>#{item.title}</b>", width: 1.0
inscription item.blurb.gsub(/\n+/, "\n").strip[0..1024], fill: true para item.blurb.gsub(/\n+/, "\n").strip[0..1024], fill: true
flow(width: 1.0, height: 32, margin_top: 8) do flow(width: 1.0, height: 36, margin_top: 8) do
stack(fill: true, height: 1.0) do stack(fill: true, height: 1.0) do
flow(fill: true) flow(fill: true)
inscription "#{item.author}#{item.timestamp.strftime("%Y-%m-%d")}" para "#{item.author}#{item.timestamp.strftime("%Y-%m-%d")}"
end end
button I18n.t(:"games.read_more"), width: 1.0, max_width: 128, padding_top: 4, padding_bottom: 4 do button I18n.t(:"games.read_more"), width: 1.0, max_width: 128, padding_top: 4, padding_bottom: 4 do

View File

@@ -39,19 +39,19 @@ class W3DHub
stack(margin_left: 8, width: 0.75) do stack(margin_left: 8, width: 0.75) do
@application_name_label = tagline "#{task.application.name}" @application_name_label = tagline "#{task.application.name}"
@application_version_label = inscription "Version: #{task.target_version} (#{task.channel.id})" @application_version_label = para "Version: #{task.target_version} (#{task.channel.id})"
end end
end end
flow(width: 0.30, height: 1.0) do flow(width: 0.30, height: 1.0) do
stack(width: 0.499, height: 1.0) do stack(width: 0.499, height: 1.0) do
para "Download Speed", width: 1.0, text_align: :center para "Download Speed", width: 1.0, text_align: :center
@download_speed_label = inscription "- b/s", width: 1.0, text_align: :center @download_speed_label = para "- b/s", width: 1.0, text_align: :center
end end
stack(width: 0.5, height: 1.0) do stack(width: 0.5, height: 1.0) do
para "Downloaded", width: 1.0, text_align: :center para "Downloaded", width: 1.0, text_align: :center
inscription "---- b / ---- b", width: 1.0, text_align: :center para "---- b / ---- b", width: 1.0, text_align: :center
end end
end end
end end
@@ -68,8 +68,8 @@ class W3DHub
background 0xff_333333 if i.odd? background 0xff_333333 if i.odd?
flow(width: 1.0, height: 22) do flow(width: 1.0, height: 22) do
@operation_info["#{key}_name"] = inscription operation.label, width: 0.7, text_wrap: :none, tag: "#{key}_name" @operation_info["#{key}_name"] = para operation.label, width: 0.7, text_wrap: :none, tag: "#{key}_name"
@operation_info["#{key}_status"] = inscription operation.value, width: 0.3, text_align: :right, text_wrap: :none, tag: "#{key}_status" @operation_info["#{key}_status"] = para operation.value, width: 0.3, text_align: :right, text_wrap: :none, tag: "#{key}_status"
end end
@operation_info["#{key}_progress"] = progress fraction: operation.progress, height: 2, width: 1.0, tag: "#{key}_progress" @operation_info["#{key}_progress"] = progress fraction: operation.progress, height: 2, width: 1.0, tag: "#{key}_progress"

View File

@@ -63,7 +63,7 @@ class W3DHub
image "#{GAME_ROOT_PATH}/media/ui_icons/import.png", width: 24, margin_left: -4, margin_top: -6, color: 0xff_ff8800 if Store.application_manager.updateable?(game.id, game.channels.first.id) image "#{GAME_ROOT_PATH}/media/ui_icons/import.png", width: 24, margin_left: -4, margin_top: -6, color: 0xff_ff8800 if Store.application_manager.updateable?(game.id, game.channels.first.id)
end end
# inscription game.name, width: 1.0, text_align: :center, text_size: 16 # para game.name, width: 1.0, text_align: :center
end end
def game_button.hit_element?(x, y) def game_button.hit_element?(x, y)
@@ -128,7 +128,7 @@ class W3DHub
flow(width: 1.0, height: 22, margin_bottom: 8) do flow(width: 1.0, height: 22, margin_bottom: 8) do
image "#{GAME_ROOT_PATH}/media/ui_icons/#{hash[:icon]}.png", width: 24 if hash[:icon] image "#{GAME_ROOT_PATH}/media/ui_icons/#{hash[:icon]}.png", width: 24 if hash[:icon]
image EMPTY_IMAGE, width: 24 unless hash[:icon] image EMPTY_IMAGE, width: 24 unless hash[:icon]
link key, text_size: 18, enabled: hash.key?(:enabled) ? hash[:enabled] : true do link key, text_size: 22, enabled: hash.key?(:enabled) ? hash[:enabled] : true do
hash[:block]&.call hash[:block]&.call
end end
end end
@@ -138,7 +138,7 @@ class W3DHub
game.web_links.each do |item| game.web_links.each do |item|
flow(width: 1.0, height: 22, margin_bottom: 8) do flow(width: 1.0, height: 22, margin_bottom: 8) do
image "#{GAME_ROOT_PATH}/media/ui_icons/share1.png", width: 24 image "#{GAME_ROOT_PATH}/media/ui_icons/share1.png", width: 24
link item.name, text_size: 18 do link item.name, text_size: 22 do
W3DHub.url(item.uri) W3DHub.url(item.uri)
end end
end end
@@ -148,7 +148,7 @@ class W3DHub
if game.channels.count > 1 if game.channels.count > 1
# Release channel # Release channel
inscription I18n.t(:"games.game_version"), width: 1.0, text_align: :center para I18n.t(:"games.game_version"), width: 1.0, text_align: :center
flow(width: 1.0, height: 48) do flow(width: 1.0, height: 48) do
# background 0xff_444411 # background 0xff_444411
@@ -225,7 +225,7 @@ class W3DHub
# Height should match Game Banner container height # Height should match Game Banner container height
stack(width: 1.0, padding: 16) do stack(width: 1.0, padding: 16) do
title "About #{game.name}", border_bottom_color: 0xff_666666, border_bottom_thickness: 1, width: 1.0 title "About #{game.name}", border_bottom_color: 0xff_666666, border_bottom_thickness: 1, width: 1.0
para "Command & Conquer: Tiberian Sun is a 1999 real-time stretegy video game by Westwood Studios, published by Electronic Arts, releaseed exclusively for Microsoft Windows on August 27th, 1999. The game is the sequel to the 1995 game Command & Conquer. It featured new semi-3D graphics, a more futuristic sci-fi setting, and new gameplay features such as vehicles capable of hovering and burrowing.", width: 1.0, text_size: 20 para "Command & Conquer: Tiberian Sun is a 1999 real-time stretegy video game by Westwood Studios, published by Electronic Arts, releaseed exclusively for Microsoft Windows on August 27th, 1999. The game is the sequel to the 1995 game Command & Conquer. It featured new semi-3D graphics, a more futuristic sci-fi setting, and new gameplay features such as vehicles capable of hovering and burrowing.", width: 1.0
end end
end end
@@ -325,7 +325,7 @@ class W3DHub
stack(width: 166, height: 224, margin: 8, background: 0x88_151515, border_color: game.color, border_thickness: 1) do stack(width: 166, height: 224, margin: 8, background: 0x88_151515, border_color: game.color, border_thickness: 1) do
flow(width: 1.0, height: 24, padding: 8) do flow(width: 1.0, height: 24, padding: 8) do
para "Favorite", fill: true para "Favorite", fill: true
toggle_button checked: Store.application_manager.favorite?(game.id), text_size: 18, padding_top: 3, padding_right: 3, padding_bottom: 3, padding_left: 3 do |btn| toggle_button checked: Store.application_manager.favorite?(game.id), text_size: 22, padding_top: 3, padding_right: 3, padding_bottom: 3, padding_left: 3 do |btn|
Store.application_manager.favorive(game.id, btn.value) Store.application_manager.favorive(game.id, btn.value)
Store.settings.save_settings Store.settings.save_settings
@@ -424,12 +424,12 @@ class W3DHub
stack(fill: true, height: 1.0, padding: 4, border_thickness_left: 1, border_color_left: lighten(Gosu::Color.new(game.color))) do stack(fill: true, height: 1.0, padding: 4, border_thickness_left: 1, border_color_left: lighten(Gosu::Color.new(game.color))) do
tagline "<b>#{item.title}</b>", width: 1.0 tagline "<b>#{item.title}</b>", width: 1.0
inscription item.blurb.gsub(/\n+/, "\n").strip[0..1024], fill: true para item.blurb.gsub(/\n+/, "\n").strip[0..1024], fill: true
flow(width: 1.0, height: 32, margin_top: 8) do flow(width: 1.0, height: 36, margin_top: 8) do
stack(fill: true, height: 1.0) do stack(fill: true, height: 1.0) do
flow(fill: true) flow(fill: true)
inscription "#{item.author}#{item.timestamp.strftime("%Y-%m-%d")}" para "#{item.author}#{item.timestamp.strftime("%Y-%m-%d")}"
end end
button I18n.t(:"games.read_more"), width: 1.0, max_width: 128, padding_top: 4, padding_bottom: 4, margin_left: 0, margin_top: 0, margin_bottom: 0, margin_right: 0 do button I18n.t(:"games.read_more"), width: 1.0, max_width: 128, padding_top: 4, padding_bottom: 4, margin_left: 0, margin_top: 0, margin_bottom: 0, margin_right: 0 do
@@ -472,7 +472,7 @@ class W3DHub
background 0x44_000000 background 0x44_000000
title event.title, width: 1.0, text_align: :center title event.title, width: 1.0, text_align: :center
tagline event.start_time.strftime("%A"), text_size: 36, width: 1.0, text_align: :center title event.start_time.strftime("%A"), width: 1.0, text_align: :center
caption event.start_time.strftime("%B %e, %Y %l:%M %p"), width: 1.0, text_align: :center caption event.start_time.strftime("%B %e, %Y %l:%M %p"), width: 1.0, text_align: :center
end end
end end
@@ -505,12 +505,12 @@ class W3DHub
stack(width: 0.75, height: 1.0) do stack(width: 0.75, height: 1.0) do
stack(width: 1.0, height: 128 - 28) do stack(width: 1.0, height: 128 - 28) do
link(mod[:name]) { W3DHub.url(mod[:url]) } link(mod[:name]) { W3DHub.url(mod[:url]) }
inscription "Author: #{mod[:author]} | #{mod[:type]} | #{mod[:subtype]}" para "Author: #{mod[:author]} | #{mod[:type]} | #{mod[:subtype]}"
para mod[:description][0..180] para mod[:description][0..180]
end end
flow(width: 1.0, height: 28, padding: 4) do flow(width: 1.0, height: 28, padding: 4) do
inscription "Version", width: 0.25, text_align: :center para "Version", width: 0.25, text_align: :center
list_box items: mod[:versions], width: 0.5, enabled: mod[:versions].size > 1, padding_top: 0, padding_bottom: 0 list_box items: mod[:versions], width: 0.5, enabled: mod[:versions].size > 1, padding_top: 0, padding_bottom: 0
button "Install", width: 0.25, padding_top: 0, padding_bottom: 0 button "Install", width: 0.25, padding_top: 0, padding_bottom: 0
end end

View File

@@ -92,19 +92,7 @@ class W3DHub
def populate_account_info def populate_account_info
@host.instance_variable_get(:"@account_container").clear do @host.instance_variable_get(:"@account_container").clear do
stack(width: 0.7, height: 1.0) do
tagline "<b>#{Store.account.username}</b>"
flow(width: 1.0) do
link(I18n.t(:"interface.log_out"), text_size: 16, width: 0.5) { depopulate_account_info }
link I18n.t(:"interface.profile"), text_size: 16, width: 0.49 do
W3DHub.url("https://secure.w3dhub.com/forum/index.php?showuser=#{Store.account.id}")
end
end
end
flow(fill: true, height: 1.0) do flow(fill: true, height: 1.0) do
flow(fill: true) # Fill empty space to push image over to container edge
avatar_image = get_image(Cache.path(Store.account.avatar_uri)) avatar_image = get_image(Cache.path(Store.account.avatar_uri))
mask_image = get_image("#{GAME_ROOT_PATH}/media/textures/circle_mask.png") mask_image = get_image("#{GAME_ROOT_PATH}/media/textures/circle_mask.png")
@@ -115,6 +103,16 @@ class W3DHub
image composite_image, width: 1.0 image composite_image, width: 1.0
end end
stack(width: 0.7, height: 1.0, margin_left: 8) do
link Store.account.username, text_size: 24, font: BOLD_FONT, tip: I18n.t(:"interface.profile"), width: 1.0, text_wrap: :none do
W3DHub.url("https://secure.w3dhub.com/forum/index.php?showuser=#{Store.account.id}")
end
flow(width: 1.0) do
link(I18n.t(:"interface.log_out"), text_size: 22, width: 0.5) { depopulate_account_info }
end
end
end end
end end
@@ -137,8 +135,8 @@ class W3DHub
tagline "<b>#{I18n.t(:"interface.not_logged_in")}</b>", text_wrap: :none tagline "<b>#{I18n.t(:"interface.not_logged_in")}</b>", text_wrap: :none
flow(width: 1.0) do flow(width: 1.0) do
link(I18n.t(:"interface.log_in"), text_size: 16, width: 0.5) { page(W3DHub::Pages::Login) } link(I18n.t(:"interface.log_in"), text_size: 22, width: 0.5) { page(W3DHub::Pages::Login) }
link I18n.t(:"interface.register"), text_size: 16, width: 0.49 do link I18n.t(:"interface.register"), text_size: 22, width: 0.49 do
W3DHub.url("https://secure.w3dhub.com/forum/index.php?app=core&module=global&section=register") W3DHub.url("https://secure.w3dhub.com/forum/index.php?app=core&module=global&section=register")
end end
end end

View File

@@ -8,7 +8,7 @@ class W3DHub
@selected_server ||= nil @selected_server ||= nil
@selected_server_container ||= nil @selected_server_container ||= nil
@selected_color = 0xff_666655 @selected_color = 0xaa_666655
@filters = Store.settings[:server_list_filters] || {} @filters = Store.settings[:server_list_filters] || {}
@filter_region = Store.settings[:server_list_region] || "Any" # "Any", "North America", "Europe" @filter_region = Store.settings[:server_list_region] || "Any" # "Any", "North America", "Europe"
@@ -22,14 +22,14 @@ class W3DHub
stack(width: 1.0, height: 1.0, padding: 8) do stack(width: 1.0, height: 1.0, padding: 8) do
background 0xaa_252525 background 0xaa_252525
stack(width: 1.0, height: 18) do stack(width: 1.0, height: 22) do
inscription "<b>#{I18n.t(:"server_browser.filters")}</b>" para "<b>#{I18n.t(:"server_browser.filters")}</b>", font: BOLD_FONT
end end
flow(width: 1.0, height: 32) do flow(width: 1.0, height: 36) do
flow(width: 128, height: 1.0) do flow(width: 128, height: 1.0) do
# para I18n.t(:"server_browser.region"), width: 0.5 # para I18n.t(:"server_browser.region"), width: 0.5
list_box items: ["Any", "North America", "Europe"], choose: Store.settings[:server_list_region], width: 1.0, height: 1.0, padding_top: 4, padding_bottom: 4 do |value| list_box items: ["Any", "North America", "Europe", "Asia"], choose: Store.settings[:server_list_region], width: 1.0, height: 1.0, padding_top: 4, padding_bottom: 4 do |value|
@filter_region = value @filter_region = value
Store.settings[:server_list_region] = @filter_region Store.settings[:server_list_region] = @filter_region
Store.settings.save_settings Store.settings.save_settings
@@ -78,8 +78,8 @@ class W3DHub
flow(min_width: 372, width: 0.38, max_width: 512, height: 1.0) do |container| flow(min_width: 372, width: 0.38, max_width: 512, height: 1.0) do |container|
flow(fill: true) flow(fill: true)
inscription "#{I18n.t(:"server_browser.nickname")}:" para "#{I18n.t(:"server_browser.nickname")}:"
@nickname_label = inscription "#{Store.settings[:server_list_username]}" @nickname_label = para "#{Store.settings[:server_list_username]}"
image "#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", height: 16, hover: { color: 0xaa_ffffff }, tip: I18n.t(:"server_browser.set_nickname") do image "#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", height: 16, hover: { color: 0xaa_ffffff }, tip: I18n.t(:"server_browser.set_nickname") do
# Prompt for player name # Prompt for player name
W3DHub.prompt_for_nickname( W3DHub.prompt_for_nickname(
@@ -105,23 +105,23 @@ class W3DHub
# Players # Players
# Ping # Ping
flow(width: 1.0, height: 24) do flow(width: 1.0, height: 24) do
stack(width: 48, padding: 4) do stack(width: 56, padding: 4) do
end end
stack(width: 0.45, height: 1.0) do stack(width: 0.45, height: 1.0) do
para "<b>#{I18n.t(:"server_browser.hostname")}</b>", text_wrap: :none, width: 1.0 para "<b>#{I18n.t(:"server_browser.hostname")}</b>", text_wrap: :none, width: 1.0, font: BOLD_FONT
end end
flow(fill: true, height: 1.0) do flow(fill: true, height: 1.0) do
para "<b>#{I18n.t(:"server_browser.current_map")}</b>", text_wrap: :none, width: 1.0 para "<b>#{I18n.t(:"server_browser.current_map")}</b>", text_wrap: :none, width: 1.0, font: BOLD_FONT
end end
flow(width: 0.11, height: 1.0) do flow(width: 0.11, height: 1.0) do
para "<b>#{I18n.t(:"server_browser.players")}</b>", text_wrap: :none, width: 1.0 para "<b>#{I18n.t(:"server_browser.players")}</b>", text_wrap: :none, width: 1.0, font: BOLD_FONT
end end
stack(width: 48) do stack(width: 56) do
para "<b>#{I18n.t(:"server_browser.ping")}</b>", text_wrap: :none, width: 1.0 para "<b>#{I18n.t(:"server_browser.ping")}</b>", text_wrap: :none, width: 1.0, font: BOLD_FONT
end end
end end
@@ -248,7 +248,7 @@ class W3DHub
server_ping = find_element_by_tag(server_container, :ping) server_ping = find_element_by_tag(server_container, :ping)
server_name.value = "<b>#{server&.status&.name}</b>" server_name.value = "<b>#{server&.status&.name}</b>"
server_channel.value = server.channel server_channel.value = Store.application_manager.channel_name(server.game, server.channel).to_s
server_region.value = server.region server_region.value = server.region
server_map.value = server&.status&.map server_map.value = server&.status&.map
player_count.value = "#{server&.status&.player_count}/#{server&.status&.max_players}" player_count.value = "#{server&.status&.player_count}/#{server&.status&.max_players}"
@@ -303,35 +303,35 @@ class W3DHub
Store.server_list.each do |server| Store.server_list.each do |server|
next unless @filters[server.game.to_sym] next unless @filters[server.game.to_sym]
next unless server.region == @filter_region || @filter_region == "Any" next unless server.region == @filter_region || @filter_region == "Any"
# next unless server.channel == "release" next unless Store.application_manager.channel_name(server.game, server.channel) # can user access required game and channel for this server?
i += 1 i += 1
server_container = flow(width: 1.0, height: 48, hover: { background: 0xff_555566 }, active: { background: 0xff_555588 }, tag: server.id, tip: ping_tip(server)) do server_container = flow(width: 1.0, height: 56, hover: { background: 0xaa_555566 }, active: { background: 0xaa_555588 }, tag: server.id, tip: ping_tip(server)) do
background 0xff_333333 if i.even? background 0x88_333333 if i.even?
flow(width: 48, height: 1.0, padding: 4) do flow(width: 56, height: 1.0, padding: 4) do
image game_icon(server), height: 1.0, tag: :game_icon image game_icon(server), height: 1.0, tag: :game_icon
end end
stack(width: 0.45, height: 1.0) do stack(width: 0.45, height: 1.0) do
inscription "<b>#{server&.status&.name}</b>", tag: :server_name para server&.status&.name, tag: :server_name, font: BOLD_FONT, text_wrap: :none
flow(width: 1.0, height: 1.0) do flow(width: 1.0, height: 1.0) do
inscription server.channel, margin_right: 64, text_size: 16, tag: :server_channel para Store.application_manager.channel_name(server.game, server.channel).to_s, width: 172, margin_right: 8, tag: :server_channel
inscription server.region, text_size: 16, tag: :server_region para server.region, tag: :server_region
end end
end end
flow(fill: true, height: 1.0) do flow(fill: true, height: 1.0) do
inscription "#{server&.status&.map}", tag: :server_map para "#{server&.status&.map}", tag: :server_map
end end
flow(width: 0.11, height: 1.0) do flow(width: 0.11, height: 1.0) do
inscription "#{server&.status&.player_count}/#{server&.status&.max_players}", tag: :player_count para "#{server&.status&.player_count}/#{server&.status&.max_players}", tag: :player_count
end end
flow(width: 48, height: 1.0, padding: 4) do flow(width: 56, height: 1.0, padding: 4) do
image ping_icon(server), height: 1.0, tag: :ping image ping_icon(server), height: 1.0, tag: :ping
end end
end end
@@ -368,17 +368,17 @@ class W3DHub
def populate_server_info(server) def populate_server_info(server)
@game_server_info_container.clear do @game_server_info_container.clear do
stack(width: 1.0, height: 1.0, padding: 8) do stack(width: 1.0, height: 1.0, padding: 8) do
stack(width: 1.0, height: 220) do stack(width: 1.0, height: 208) do
flow(width: 1.0, height: 0.2) do flow(width: 1.0, height: 34) do
flow(fill: true) flow(fill: true)
image game_icon(server), width: 0.05 image game_icon(server), height: 1.0
tagline server.status.name, text_wrap: :none title server.status.name, text_wrap: :none
flow(fill: true) flow(fill: true)
end end
flow(width: 1.0, height: 0.2) do flow(width: 1.0, height: 46, margin_top: 16, margin_bottom: 16) do
game_installed = Store.application_manager.installed?(server.game, server.channel) game_installed = Store.application_manager.installed?(server.game, server.channel)
game_updatable = Store.application_manager.updateable?(server.game, server.channel) game_updatable = Store.application_manager.updateable?(server.game, server.channel)
style = server.channel != "release" ? TESTING_BUTTON : {} style = server.channel != "release" ? TESTING_BUTTON : {}
@@ -422,8 +422,8 @@ class W3DHub
end end
end end
if Store.developer_mode if W3DHUB_DEVELOPER
list_box(items: (1..12).to_a.map(&:to_s), margin_left: 16, **TESTING_BUTTON) list_box(items: (1..12).to_a.map(&:to_s), margin_left: 16, width: 72, tip: "Number of game clients", **TESTING_BUTTON)
button "Multijoin", tip: "Launch multiple clients with configured username_\#{number}", **TESTING_BUTTON, enabled: true button "Multijoin", tip: "Launch multiple clients with configured username_\#{number}", **TESTING_BUTTON, enabled: true
end end
@@ -431,30 +431,25 @@ class W3DHub
end end
# Server Info # Server Info
stack(width: 1.0, fill: true, margin_top: 16) do stack(width: 1.0, fill: true, margin_bottom: 16) do
flow(width: 1.0) do flow(width: 1.0) do
inscription "<b>#{I18n.t(:"server_browser.game")}</b>", width: 0.28, text_wrap: :none para "<b>#{I18n.t(:"server_browser.game")}</b>", width: 0.12, text_wrap: :none, font: BOLD_FONT
inscription "#{game_name(server.game)} (#{server.channel})", width: 0.71, text_wrap: :none para "#{game_name(server.game)} (#{server.channel})", width: 0.71, text_wrap: :none
end end
flow(width: 1.0) do flow(width: 1.0) do
inscription "<b>#{I18n.t(:"server_browser.map")}</b>", width: 0.28, text_wrap: :none para "<b>#{I18n.t(:"server_browser.map")}</b>", width: 0.12, text_wrap: :none, font: BOLD_FONT
inscription server.status.map, width: 0.71, text_wrap: :none para server.status.map, width: 0.71, text_wrap: :none
end end
flow(width: 1.0) do flow(width: 1.0) do
inscription "<b>#{I18n.t(:"server_browser.max_players")}</b>", width: 0.28, text_wrap: :none para "<b>#{I18n.t(:"server_browser.time")}</b>", width: 0.12, text_wrap: :none, font: BOLD_FONT
inscription "#{server.status.max_players}", width: 0.71, text_wrap: :none para formatted_rentime(server.status.started), text_wrap: :none
end
flow(width: 1.0) do unless server.status.remaining =~ /00:00:00|00.00.00/
inscription "<b>#{I18n.t(:"server_browser.time")}</b>", width: 0.28, text_wrap: :none para "<b>#{I18n.t(:"server_browser.remaining")}</b>", margin_left: 16, margin_right: 8, text_wrap: :none, font: BOLD_FONT
inscription formatted_rentime(server.status.started), width: 0.71, text_wrap: :none para "#{server.status.remaining}", text_wrap: :none
end end
flow(width: 1.0) do
inscription "<b>#{I18n.t(:"server_browser.remaining")}</b>", width: 0.28, text_wrap: :none
inscription "#{server.status.remaining}", width: 0.71, text_wrap: :none
end end
end end
end end
@@ -462,9 +457,9 @@ class W3DHub
game_balance = server_game_balance(server) game_balance = server_game_balance(server)
# Game score and balance display # Game score and balance display
flow(width: 1.0, height: 48, border_thickness_bottom: 2, border_color_bottom: 0x44_ffffff) do flow(width: 1.0, height: 52, border_thickness_bottom: 2, border_color_bottom: 0x44_ffffff) do
stack(fill: true, height: 1.0) do stack(fill: true, height: 1.0) do
para "<b>#{server.status.teams[0].name} (#{server.status.players.select { |pl| pl.team == 0 }.count})</b>", width: 1.0, text_align: :center para "#{server.status.teams[0].name} (#{server.status.players.select { |pl| pl.team == 0 }.count})", width: 1.0, text_align: :center, font: BOLD_FONT
para formatted_score(game_balance[:team_0_score].to_i), width: 1.0, text_align: :center para formatted_score(game_balance[:team_0_score].to_i), width: 1.0, text_align: :center
end end
@@ -479,7 +474,7 @@ class W3DHub
end end
stack(fill: true, height: 1.0) do stack(fill: true, height: 1.0) do
para "<b>#{server.status.teams[1].name} (#{server.status.players.select { |pl| pl.team == 1 }.count})</b>", width: 1.0, text_align: :center para "#{server.status.teams[1].name} (#{server.status.players.select { |pl| pl.team == 1 }.count})", width: 1.0, text_align: :center, font: BOLD_FONT
para formatted_score(game_balance[:team_1_score].to_i), width: 1.0, text_align: :center para formatted_score(game_balance[:team_1_score].to_i), width: 1.0, text_align: :center
end end
end end
@@ -488,15 +483,15 @@ class W3DHub
flow(width: 1.0, fill: true, scroll: true) do flow(width: 1.0, fill: true, scroll: true) do
stack(width: 0.5) do stack(width: 0.5) do
server.status.players.select { |ply| ply.team == 0 }.sort_by { |ply| ply.score }.reverse.each_with_index do |player, i| server.status.players.select { |ply| ply.team == 0 }.sort_by { |ply| ply.score }.reverse.each_with_index do |player, i|
flow(width: 1.0, height: 18) do flow(width: 1.0, height: 26) do
background 0xff_333333 if i.even? background 0xaa_333333 if i.even?
stack(width: 0.6, height: 1.0) do stack(width: 0.6, height: 1.0) do
inscription player.nick, text_size: 16, text_wrap: :none para player.nick, text_wrap: :none
end end
stack(width: 0.4, height: 1.0) do stack(width: 0.4, height: 1.0) do
inscription formatted_score(player.score), text_size: 16, width: 1.0, text_align: :right, text_wrap: :none para formatted_score(player.score), width: 1.0, text_align: :right, text_wrap: :none
end end
end end
end end
@@ -504,15 +499,15 @@ class W3DHub
stack(width: 0.5, border_thickness_left: 2, border_color_left: 0xff_000000) do stack(width: 0.5, border_thickness_left: 2, border_color_left: 0xff_000000) do
server.status.players.select { |ply| ply.team == 1 }.sort_by { |ply| ply.score }.reverse.each_with_index do |player, i| server.status.players.select { |ply| ply.team == 1 }.sort_by { |ply| ply.score }.reverse.each_with_index do |player, i|
flow(width: 1.0, height: 18) do flow(width: 1.0, height: 26) do
background 0xff_333333 if i.even? background 0xaa_333333 if i.even?
stack(width: 0.6, height: 1.0) do stack(width: 0.6, height: 1.0) do
inscription player.nick, text_size: 16, text_wrap: :none para player.nick, text_wrap: :none
end end
stack(width: 0.4, height: 1.0) do stack(width: 0.4, height: 1.0) do
inscription formatted_score(player.score), text_size: 16, width: 1.0, text_align: :right, text_wrap: :none para formatted_score(player.score), width: 1.0, text_align: :right, text_wrap: :none
end end
end end
end end

View File

@@ -11,7 +11,7 @@ class W3DHub
para "<b>Launcher Language</b>", width: 0.249, margin_left: 32, margin_top: 12 para "<b>Launcher Language</b>", width: 0.249, margin_left: 32, margin_top: 12
stack(width: 0.75) do stack(width: 0.75) do
@language_menu = list_box items: I18n.available_locales.map { |l| expand_language_code(l.to_s) }, choose: expand_language_code(Store.settings[:language]), width: 1.0 @language_menu = list_box items: I18n.available_locales.map { |l| expand_language_code(l.to_s) }, choose: expand_language_code(Store.settings[:language]), width: 1.0
inscription "Select the UI language you'd like to use in the W3D Hub Launcher." para "Select the UI language you'd like to use in the W3D Hub Launcher."
end end
end end
@@ -22,7 +22,7 @@ class W3DHub
stack(width: 0.75) do stack(width: 0.75) do
@app_install_dir_input = edit_line Store.settings[:app_install_dir], width: 1.0 @app_install_dir_input = edit_line Store.settings[:app_install_dir], width: 1.0
inscription "The folder into which new games and apps will be installed by the launcher" para "The folder into which new games and apps will be installed by the launcher"
end end
end end
@@ -31,7 +31,7 @@ class W3DHub
stack(width: 0.75) do stack(width: 0.75) do
@package_cache_dir_input = edit_line Store.settings[:package_cache_dir], width: 1.0 @package_cache_dir_input = edit_line Store.settings[:package_cache_dir], width: 1.0
inscription "A folder which will be used to cache downloaded packages used to install games and apps" para "A folder which will be used to cache downloaded packages used to install games and apps"
end end
end end
end end
@@ -42,7 +42,7 @@ class W3DHub
para "<b>Wine Command</b>", width: 0.249, margin_left: 32, margin_top: 12 para "<b>Wine Command</b>", width: 0.249, margin_left: 32, margin_top: 12
stack(width: 0.75) do stack(width: 0.75) do
@wine_command_input = edit_line Store.settings[:wine_command], width: 1.0 @wine_command_input = edit_line Store.settings[:wine_command], width: 1.0
inscription "Command to use to for Windows compatiblity layer" para "Command to use to for Windows compatiblity layer"
end end
end end
@@ -50,7 +50,7 @@ class W3DHub
para "<b>Wine Prefix</b>", width: 0.249, margin_left: 32, margin_top: 12 para "<b>Wine Prefix</b>", width: 0.249, margin_left: 32, margin_top: 12
stack(width: 0.75) do stack(width: 0.75) do
@wine_prefix_toggle = toggle_button checked: Store.settings[:wine_prefix] @wine_prefix_toggle = toggle_button checked: Store.settings[:wine_prefix]
inscription "Whether each game gets its own prefix. Uses global/default prefix by default." para "Whether each game gets its own prefix. Uses global/default prefix by default."
end end
end end
end end

View File

@@ -34,7 +34,7 @@ class W3DHub
flow(width: 1.0, fill: true, padding_left: 16, padding_right: 16, padding_bottom: 8, padding_top: 8) do flow(width: 1.0, fill: true, padding_left: 16, padding_right: 16, padding_bottom: 8, padding_top: 8) do
@status_label = caption "Starting #{I18n.t(:app_name_simple)}...", width: 0.5 @status_label = caption "Starting #{I18n.t(:app_name_simple)}...", width: 0.5
inscription "#{I18n.t(:app_name)} #{W3DHub::VERSION}", width: 0.5, text_align: :right para "#{I18n.t(:app_name)} #{W3DHub::VERSION}", width: 0.5, text_align: :right
end end
end end
end end

View File

@@ -41,23 +41,23 @@ class W3DHub
flow(width: 1.0, fill: true) do flow(width: 1.0, fill: true) do
# background 0xff_666666 # background 0xff_666666
link I18n.t(:"interface.games").upcase, text_size: 34 do link I18n.t(:"interface.games").upcase, text_size: 34, font: BOLD_FONT do
page(W3DHub::Pages::Games) page(W3DHub::Pages::Games)
end end
link I18n.t(:"interface.servers").upcase, text_size: 34, margin_left: 12 do link I18n.t(:"interface.servers").upcase, text_size: 34, font: BOLD_FONT, margin_left: 12 do
page(W3DHub::Pages::ServerBrowser) page(W3DHub::Pages::ServerBrowser)
end end
link I18n.t(:"interface.community").upcase, text_size: 34, margin_left: 12 do link I18n.t(:"interface.community").upcase, text_size: 34, font: BOLD_FONT, margin_left: 12 do
page(W3DHub::Pages::Community) page(W3DHub::Pages::Community)
end end
link I18n.t(:"interface.downloads").upcase, text_size: 34, margin_left: 12 do link I18n.t(:"interface.downloads").upcase, text_size: 34, font: BOLD_FONT, margin_left: 12 do
page(W3DHub::Pages::DownloadManager) page(W3DHub::Pages::DownloadManager)
end end
link I18n.t(:"interface.settings").upcase, text_size: 34, margin_left: 12 do link I18n.t(:"interface.settings").upcase, text_size: 34, font: BOLD_FONT, margin_left: 12 do
page(W3DHub::Pages::Settings) page(W3DHub::Pages::Settings)
end end
end end
@@ -66,8 +66,8 @@ class W3DHub
flow(width: 1.0, height: 0.5) do flow(width: 1.0, height: 0.5) do
@application_taskbar_container = stack(width: 1.0, height: 1.0, margin_left: 16, margin_right: 16) do @application_taskbar_container = stack(width: 1.0, height: 1.0, margin_left: 16, margin_right: 16) do
flow(width: 1.0, height: 0.65) do flow(width: 1.0, height: 0.65) do
@application_taskbar_label = inscription "", width: 0.60, text_wrap: :none @application_taskbar_label = para "", width: 0.60, text_wrap: :none
@application_taskbar_status_label = inscription "", width: 0.40, text_align: :right, text_wrap: :none @application_taskbar_status_label = para "", width: 0.40, text_align: :right, text_wrap: :none
end end
@application_taskbar_progressbar = progress fraction: 0.0, height: 2, width: 1.0 @application_taskbar_progressbar = progress fraction: 0.0, height: 2, width: 1.0
@@ -89,8 +89,8 @@ class W3DHub
tagline "<b>#{I18n.t(:"interface.not_logged_in")}</b>", text_wrap: :none tagline "<b>#{I18n.t(:"interface.not_logged_in")}</b>", text_wrap: :none
flow(width: 1.0) do flow(width: 1.0) do
link(I18n.t(:"interface.log_in"), text_size: 16, width: 0.5) { page(W3DHub::Pages::Login) } link(I18n.t(:"interface.log_in"), text_size: 22, width: 0.5) { page(W3DHub::Pages::Login) }
link I18n.t(:"interface.register"), text_size: 16, width: 0.49 do link I18n.t(:"interface.register"), text_size: 22, width: 0.49 do
W3DHub.url("https://secure.w3dhub.com/forum/index.php?app=core&module=global&section=register") W3DHub.url("https://secure.w3dhub.com/forum/index.php?app=core&module=global&section=register")
end end
end end

View File

@@ -20,20 +20,47 @@ class W3DHub
THEME = { THEME = {
ToolTip: { ToolTip: {
background: 0xff_dedede, background: 0xff_222222,
color: 0xaa_000000, color: 0xff_f2f2f2,
text_size: 18, text_size: 22,
text_static: true,
text_border: false, text_border: false,
text_shadow: false text_shadow: false
}, },
TextBlock: { TextBlock: {
font: BOLD_FONT, font: REGULAR_FONT,
text_static: true,
text_color: 0xff_f2f2f2, text_color: 0xff_f2f2f2,
text_border: false, text_border: false,
text_shadow: true, text_shadow: true,
text_shadow_size: 1, text_shadow_size: 1,
text_shadow_color: 0x88_000000 text_shadow_color: 0x88_000000
}, },
Banner: { # < TextBlock
text_size: 48,
font: BOLD_FONT
},
Title: { # < TextBlock
text_size: 34,
font: BOLD_FONT
},
Subtitle: { # < TextBlock
text_size: 28,
font: BOLD_FONT
},
Tagline: { # < TextBlock
text_size: 26,
font: BOLD_FONT
},
Caption: { # < TextBlock
text_size: 24
},
Para: { # < TextBlock
text_size: 22
},
Inscription: { # < TextBlock
text_size: 18
},
EditLine: { EditLine: {
border_thickness: 2, border_thickness: 2,
border_color: Gosu::Color::WHITE, border_color: Gosu::Color::WHITE,
@@ -42,14 +69,15 @@ class W3DHub
Link: { Link: {
color: 0xff_cdcdcd, color: 0xff_cdcdcd,
hover: { hover: {
color: Gosu::Color::WHITE color: 0xff_f2f2f2
}, },
active: { active: {
color: 0xff_eeeeee color: 0xff_eeeeee
} }
}, },
Button: { Button: {
text_size: 18, font: BOLD_FONT,
text_size: 22,
padding_top: 8, padding_top: 8,
padding_left: 16, padding_left: 16,
padding_right: 16, padding_right: 16,
@@ -87,7 +115,7 @@ class W3DHub
border_color: 0xff_0074e0 border_color: 0xff_0074e0
}, },
Handle: { Handle: {
text_size: 18, text_size: 22,
padding_top: 8, padding_top: 8,
padding_left: 2, padding_left: 2,
padding_right: 2, padding_right: 2,