From 0b9b5198480e66dce933e72b14bdce0b0332798d Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Wed, 28 Feb 2024 18:14:41 -0600 Subject: [PATCH] More styling changes --- lib/api/applications.rb | 4 +- lib/application_manager.rb | 7 +++ lib/pages/community.rb | 18 +++--- lib/pages/download_manager.rb | 10 +-- lib/pages/games.rb | 24 ++++---- lib/pages/login.rb | 26 ++++---- lib/pages/server_browser.rb | 111 ++++++++++++++++------------------ lib/pages/settings.rb | 10 +-- lib/states/boot.rb | 2 +- lib/states/interface.rb | 18 +++--- lib/theme.rb | 42 ++++++++++--- 11 files changed, 150 insertions(+), 122 deletions(-) diff --git a/lib/api/applications.rb b/lib/api/applications.rb index bc12f3e..ee07c0c 100644 --- a/lib/api/applications.rb +++ b/lib/api/applications.rb @@ -22,7 +22,7 @@ class W3DHub def initialize(hash) @data = hash - @id = @data[:id] + @id = @data[:id].to_s @name = @data[:name] @type = @data[:type] @category = @data[:category] @@ -44,7 +44,7 @@ class W3DHub def initialize(hash) @data = hash - @id = @data[:id] + @id = @data[:id].to_s @name = @data[:name] @user_level = @data[:"user-level"] @current_version = @data[:"current-version"] diff --git a/lib/application_manager.rb b/lib/application_manager.rb index 9dc8685..0f1ddd8 100644 --- a/lib/application_manager.rb +++ b/lib/application_manager.rb @@ -459,6 +459,13 @@ class W3DHub Store.applications.games.detect { |g| g.id == app_id }&.name 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 def idle? !busy? diff --git a/lib/pages/community.rb b/lib/pages/community.rb index 3553f9d..36e4987 100644 --- a/lib/pages/community.rb +++ b/lib/pages/community.rb @@ -45,10 +45,10 @@ class W3DHub tagline "Help & Support" flow(width: 1.0) do 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" 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" end end @@ -113,15 +113,15 @@ class W3DHub # stack(width: 0.6, height: 1.0) do # stack(width: 1.0, height: 112) do - # link "#{item.title}", text_size: 18 do + # link "#{item.title}", text_size: 22 do # W3DHub.url(item.uri) # end - # inscription item.blurb.gsub(/\n+/, "\n").strip[0..180] + # para item.blurb.gsub(/\n+/, "\n").strip[0..180] # end # flow(width: 1.0) do - # inscription 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 + # para item.timestamp.strftime("%Y-%m-%d"), width: 0.499 + # link I18n.t(:"games.read_more"), width: 0.5, text_align: :right, text_size: 22 do # W3DHub.url(item.uri) # 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 tagline "#{item.title}", 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 flow(fill: true) - inscription "#{item.author} • #{item.timestamp.strftime("%Y-%m-%d")}" + para "#{item.author} • #{item.timestamp.strftime("%Y-%m-%d")}" end button I18n.t(:"games.read_more"), width: 1.0, max_width: 128, padding_top: 4, padding_bottom: 4 do diff --git a/lib/pages/download_manager.rb b/lib/pages/download_manager.rb index b5ad9f1..702dc6a 100644 --- a/lib/pages/download_manager.rb +++ b/lib/pages/download_manager.rb @@ -39,19 +39,19 @@ class W3DHub stack(margin_left: 8, width: 0.75) do @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 flow(width: 0.30, height: 1.0) do stack(width: 0.499, height: 1.0) do 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 stack(width: 0.5, height: 1.0) do 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 @@ -68,8 +68,8 @@ class W3DHub background 0xff_333333 if i.odd? 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}_status"] = inscription operation.value, width: 0.3, text_align: :right, text_wrap: :none, tag: "#{key}_status" + @operation_info["#{key}_name"] = para operation.label, width: 0.7, text_wrap: :none, tag: "#{key}_name" + @operation_info["#{key}_status"] = para operation.value, width: 0.3, text_align: :right, text_wrap: :none, tag: "#{key}_status" end @operation_info["#{key}_progress"] = progress fraction: operation.progress, height: 2, width: 1.0, tag: "#{key}_progress" diff --git a/lib/pages/games.rb b/lib/pages/games.rb index a9d24d1..6db2cba 100644 --- a/lib/pages/games.rb +++ b/lib/pages/games.rb @@ -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) end - # inscription game.name, width: 1.0, text_align: :center, text_size: 16 + # para game.name, width: 1.0, text_align: :center end def game_button.hit_element?(x, y) @@ -128,7 +128,7 @@ class W3DHub 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 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 end end @@ -138,7 +138,7 @@ class W3DHub game.web_links.each do |item| flow(width: 1.0, height: 22, margin_bottom: 8) do 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) end end @@ -148,7 +148,7 @@ class W3DHub if game.channels.count > 1 # 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 # background 0xff_444411 @@ -225,7 +225,7 @@ class W3DHub # Height should match Game Banner container height stack(width: 1.0, padding: 16) do 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 @@ -325,7 +325,7 @@ class W3DHub 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 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.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 tagline "#{item.title}", 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 flow(fill: true) - inscription "#{item.author} • #{item.timestamp.strftime("%Y-%m-%d")}" + para "#{item.author} • #{item.timestamp.strftime("%Y-%m-%d")}" 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 @@ -472,7 +472,7 @@ class W3DHub background 0x44_000000 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 end end @@ -505,12 +505,12 @@ class W3DHub stack(width: 0.75, height: 1.0) do stack(width: 1.0, height: 128 - 28) do 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] end 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 button "Install", width: 0.25, padding_top: 0, padding_bottom: 0 end diff --git a/lib/pages/login.rb b/lib/pages/login.rb index 963b19d..81b8552 100644 --- a/lib/pages/login.rb +++ b/lib/pages/login.rb @@ -92,19 +92,7 @@ class W3DHub def populate_account_info @host.instance_variable_get(:"@account_container").clear do - stack(width: 0.7, height: 1.0) do - tagline "#{Store.account.username}" - - 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) # Fill empty space to push image over to container edge avatar_image = get_image(Cache.path(Store.account.avatar_uri)) mask_image = get_image("#{GAME_ROOT_PATH}/media/textures/circle_mask.png") @@ -115,6 +103,16 @@ class W3DHub image composite_image, width: 1.0 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 @@ -137,8 +135,8 @@ class W3DHub tagline "#{I18n.t(:"interface.not_logged_in")}", text_wrap: :none 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.register"), text_size: 16, width: 0.49 do + link(I18n.t(:"interface.log_in"), text_size: 22, width: 0.5) { page(W3DHub::Pages::Login) } + 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§ion=register") end end diff --git a/lib/pages/server_browser.rb b/lib/pages/server_browser.rb index 65f2791..2faed56 100644 --- a/lib/pages/server_browser.rb +++ b/lib/pages/server_browser.rb @@ -8,7 +8,7 @@ class W3DHub @selected_server ||= nil @selected_server_container ||= nil - @selected_color = 0xff_666655 + @selected_color = 0xaa_666655 @filters = Store.settings[:server_list_filters] || {} @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 background 0xaa_252525 - stack(width: 1.0, height: 18) do - inscription "#{I18n.t(:"server_browser.filters")}" + stack(width: 1.0, height: 22) do + para "#{I18n.t(:"server_browser.filters")}", font: BOLD_FONT end - flow(width: 1.0, height: 32) do + flow(width: 1.0, height: 36) do flow(width: 128, height: 1.0) do # 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 Store.settings[:server_list_region] = @filter_region 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(fill: true) - inscription "#{I18n.t(:"server_browser.nickname")}:" - @nickname_label = inscription "#{Store.settings[:server_list_username]}" + para "#{I18n.t(:"server_browser.nickname")}:" + @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 # Prompt for player name W3DHub.prompt_for_nickname( @@ -105,23 +105,23 @@ class W3DHub # Players # Ping flow(width: 1.0, height: 24) do - stack(width: 48, padding: 4) do + stack(width: 56, padding: 4) do end stack(width: 0.45, height: 1.0) do - para "#{I18n.t(:"server_browser.hostname")}", text_wrap: :none, width: 1.0 + para "#{I18n.t(:"server_browser.hostname")}", text_wrap: :none, width: 1.0, font: BOLD_FONT end flow(fill: true, height: 1.0) do - para "#{I18n.t(:"server_browser.current_map")}", text_wrap: :none, width: 1.0 + para "#{I18n.t(:"server_browser.current_map")}", text_wrap: :none, width: 1.0, font: BOLD_FONT end flow(width: 0.11, height: 1.0) do - para "#{I18n.t(:"server_browser.players")}", text_wrap: :none, width: 1.0 + para "#{I18n.t(:"server_browser.players")}", text_wrap: :none, width: 1.0, font: BOLD_FONT end - stack(width: 48) do - para "#{I18n.t(:"server_browser.ping")}", text_wrap: :none, width: 1.0 + stack(width: 56) do + para "#{I18n.t(:"server_browser.ping")}", text_wrap: :none, width: 1.0, font: BOLD_FONT end end @@ -248,7 +248,7 @@ class W3DHub server_ping = find_element_by_tag(server_container, :ping) server_name.value = "#{server&.status&.name}" - 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_map.value = server&.status&.map player_count.value = "#{server&.status&.player_count}/#{server&.status&.max_players}" @@ -303,35 +303,35 @@ class W3DHub Store.server_list.each do |server| next unless @filters[server.game.to_sym] 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 - server_container = flow(width: 1.0, height: 48, hover: { background: 0xff_555566 }, active: { background: 0xff_555588 }, tag: server.id, tip: ping_tip(server)) do - background 0xff_333333 if i.even? + 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 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 end stack(width: 0.45, height: 1.0) do - inscription "#{server&.status&.name}", tag: :server_name + para server&.status&.name, tag: :server_name, font: BOLD_FONT, text_wrap: :none flow(width: 1.0, height: 1.0) do - inscription server.channel, margin_right: 64, text_size: 16, tag: :server_channel - inscription server.region, text_size: 16, tag: :server_region + para Store.application_manager.channel_name(server.game, server.channel).to_s, width: 172, margin_right: 8, tag: :server_channel + para server.region, tag: :server_region end end flow(fill: true, height: 1.0) do - inscription "#{server&.status&.map}", tag: :server_map + para "#{server&.status&.map}", tag: :server_map end 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 - 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 end end @@ -368,17 +368,17 @@ class W3DHub def populate_server_info(server) @game_server_info_container.clear do stack(width: 1.0, height: 1.0, padding: 8) do - stack(width: 1.0, height: 220) do - flow(width: 1.0, height: 0.2) do + stack(width: 1.0, height: 208) do + flow(width: 1.0, height: 34) do flow(fill: true) - image game_icon(server), width: 0.05 - tagline server.status.name, text_wrap: :none + image game_icon(server), height: 1.0 + title server.status.name, text_wrap: :none flow(fill: true) 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_updatable = Store.application_manager.updateable?(server.game, server.channel) style = server.channel != "release" ? TESTING_BUTTON : {} @@ -422,8 +422,8 @@ class W3DHub end end - if Store.developer_mode - list_box(items: (1..12).to_a.map(&:to_s), margin_left: 16, **TESTING_BUTTON) + if W3DHUB_DEVELOPER + 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 end @@ -431,30 +431,25 @@ class W3DHub end # 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 - inscription "#{I18n.t(:"server_browser.game")}", width: 0.28, text_wrap: :none - inscription "#{game_name(server.game)} (#{server.channel})", width: 0.71, text_wrap: :none + para "#{I18n.t(:"server_browser.game")}", width: 0.12, text_wrap: :none, font: BOLD_FONT + para "#{game_name(server.game)} (#{server.channel})", width: 0.71, text_wrap: :none end flow(width: 1.0) do - inscription "#{I18n.t(:"server_browser.map")}", width: 0.28, text_wrap: :none - inscription server.status.map, width: 0.71, text_wrap: :none + para "#{I18n.t(:"server_browser.map")}", width: 0.12, text_wrap: :none, font: BOLD_FONT + para server.status.map, width: 0.71, text_wrap: :none end flow(width: 1.0) do - inscription "#{I18n.t(:"server_browser.max_players")}", width: 0.28, text_wrap: :none - inscription "#{server.status.max_players}", width: 0.71, text_wrap: :none - end + para "#{I18n.t(:"server_browser.time")}", width: 0.12, text_wrap: :none, font: BOLD_FONT + para formatted_rentime(server.status.started), text_wrap: :none - flow(width: 1.0) do - inscription "#{I18n.t(:"server_browser.time")}", width: 0.28, text_wrap: :none - inscription formatted_rentime(server.status.started), width: 0.71, text_wrap: :none - end - - flow(width: 1.0) do - inscription "#{I18n.t(:"server_browser.remaining")}", width: 0.28, text_wrap: :none - inscription "#{server.status.remaining}", width: 0.71, text_wrap: :none + unless server.status.remaining =~ /00:00:00|00.00.00/ + para "#{I18n.t(:"server_browser.remaining")}", margin_left: 16, margin_right: 8, text_wrap: :none, font: BOLD_FONT + para "#{server.status.remaining}", text_wrap: :none + end end end end @@ -462,9 +457,9 @@ class W3DHub game_balance = server_game_balance(server) # 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 - para "#{server.status.teams[0].name} (#{server.status.players.select { |pl| pl.team == 0 }.count})", 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 end @@ -479,7 +474,7 @@ class W3DHub end stack(fill: true, height: 1.0) do - para "#{server.status.teams[1].name} (#{server.status.players.select { |pl| pl.team == 1 }.count})", 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 end end @@ -488,15 +483,15 @@ class W3DHub flow(width: 1.0, fill: true, scroll: true) 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| - flow(width: 1.0, height: 18) do - background 0xff_333333 if i.even? + flow(width: 1.0, height: 26) do + background 0xaa_333333 if i.even? stack(width: 0.6, height: 1.0) do - inscription player.nick, text_size: 16, text_wrap: :none + para player.nick, text_wrap: :none end 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 @@ -504,15 +499,15 @@ class W3DHub 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| - flow(width: 1.0, height: 18) do - background 0xff_333333 if i.even? + flow(width: 1.0, height: 26) do + background 0xaa_333333 if i.even? stack(width: 0.6, height: 1.0) do - inscription player.nick, text_size: 16, text_wrap: :none + para player.nick, text_wrap: :none end 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 diff --git a/lib/pages/settings.rb b/lib/pages/settings.rb index 8ae2fd8..e9f20d9 100644 --- a/lib/pages/settings.rb +++ b/lib/pages/settings.rb @@ -11,7 +11,7 @@ class W3DHub para "Launcher Language", width: 0.249, margin_left: 32, margin_top: 12 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 - 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 @@ -22,7 +22,7 @@ class W3DHub stack(width: 0.75) do @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 @@ -31,7 +31,7 @@ class W3DHub stack(width: 0.75) do @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 @@ -42,7 +42,7 @@ class W3DHub para "Wine Command", width: 0.249, margin_left: 32, margin_top: 12 stack(width: 0.75) do @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 @@ -50,7 +50,7 @@ class W3DHub para "Wine Prefix", width: 0.249, margin_left: 32, margin_top: 12 stack(width: 0.75) do @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 diff --git a/lib/states/boot.rb b/lib/states/boot.rb index c7ba5cd..62667c3 100644 --- a/lib/states/boot.rb +++ b/lib/states/boot.rb @@ -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 @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 diff --git a/lib/states/interface.rb b/lib/states/interface.rb index 87e3aed..2d9745d 100644 --- a/lib/states/interface.rb +++ b/lib/states/interface.rb @@ -41,23 +41,23 @@ class W3DHub flow(width: 1.0, fill: true) do # 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) 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) 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) 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) 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) end end @@ -66,8 +66,8 @@ class W3DHub 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 flow(width: 1.0, height: 0.65) do - @application_taskbar_label = inscription "", width: 0.60, text_wrap: :none - @application_taskbar_status_label = inscription "", width: 0.40, text_align: :right, text_wrap: :none + @application_taskbar_label = para "", width: 0.60, text_wrap: :none + @application_taskbar_status_label = para "", width: 0.40, text_align: :right, text_wrap: :none end @application_taskbar_progressbar = progress fraction: 0.0, height: 2, width: 1.0 @@ -89,8 +89,8 @@ class W3DHub tagline "#{I18n.t(:"interface.not_logged_in")}", text_wrap: :none 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.register"), text_size: 16, width: 0.49 do + link(I18n.t(:"interface.log_in"), text_size: 22, width: 0.5) { page(W3DHub::Pages::Login) } + 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§ion=register") end end diff --git a/lib/theme.rb b/lib/theme.rb index 769214d..ff6e84e 100644 --- a/lib/theme.rb +++ b/lib/theme.rb @@ -20,20 +20,47 @@ class W3DHub THEME = { ToolTip: { - background: 0xff_dedede, - color: 0xaa_000000, - text_size: 18, + background: 0xff_222222, + color: 0xff_f2f2f2, + text_size: 22, + text_static: true, text_border: false, text_shadow: false }, TextBlock: { - font: BOLD_FONT, + font: REGULAR_FONT, + text_static: true, text_color: 0xff_f2f2f2, text_border: false, text_shadow: true, text_shadow_size: 1, 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: { border_thickness: 2, border_color: Gosu::Color::WHITE, @@ -42,14 +69,15 @@ class W3DHub Link: { color: 0xff_cdcdcd, hover: { - color: Gosu::Color::WHITE + color: 0xff_f2f2f2 }, active: { color: 0xff_eeeeee } }, Button: { - text_size: 18, + font: BOLD_FONT, + text_size: 22, padding_top: 8, padding_left: 16, padding_right: 16, @@ -87,7 +115,7 @@ class W3DHub border_color: 0xff_0074e0 }, Handle: { - text_size: 18, + text_size: 22, padding_top: 8, padding_left: 2, padding_right: 2,