mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Can now join a server and launch installed games (Play Now does nothing special yet)
This commit is contained in:
@@ -5,54 +5,40 @@ class W3DHub
|
||||
body.clear do
|
||||
stack(width: 1.0, height: 1.0, padding: 8) do
|
||||
stack(width: 1.0, height: 0.15) do
|
||||
tagline "<b>Welcome to the W3D Hub Launcher</b>"
|
||||
para "The W3D Hub launcher is a one-stop shop for your W3D gamings needs, providing game downloads and automatic updating, an intregrated server browser, centralized management of in-game options and many other features."
|
||||
tagline "<b>Welcome to the #{W3DHub::NAME}</b>"
|
||||
para "The #{W3DHub::NAME} is a one-stop shop for your W3D gaming needs, providing game downloads, automatic updating, an integrated server browser, and centralized management of in-game options."
|
||||
end
|
||||
|
||||
flow(width: 1.0, height: 0.1, margin_top: 24) do
|
||||
flow(width: 0.375, height: 1.0) do
|
||||
flow(width: 1.0, height: 0.15, margin_bottom: 24) do
|
||||
flow(width: (1.0 - 0.27) / 2, height: 1.0) do
|
||||
end
|
||||
|
||||
flow(width: 0.25, height: 1.0) do
|
||||
image "#{GAME_ROOT_PATH}/media/icons/apb.png", height: 1.0
|
||||
image "#{GAME_ROOT_PATH}/media/icons/ren.png", height: 1.0, margin_left: 32
|
||||
image "#{GAME_ROOT_PATH}/media/icons/tsr.png", height: 1.0, margin_left: 32
|
||||
image "#{GAME_ROOT_PATH}/media/icons/w3dhub.png", height: 1.0, margin_left: 32
|
||||
end
|
||||
|
||||
flow(width: 0.375, height: 1.0) do
|
||||
flow(width: 0.27, height: 1.0) do
|
||||
image "#{GAME_ROOT_PATH}/media/icons/w3dhub.png", height: 1.0, hover: { color: 0xaa_ffffff }, tip: "W3D Hub Forums" do
|
||||
Launchy.open("https://w3dhub.com/forum/")
|
||||
end
|
||||
image "#{GAME_ROOT_PATH}/media/social_media_icons/discord.png", hover: { color: 0xaa_ffffff }, height: 1.0, margin_left: 32, tip: "W3D Hub Discord Server" do
|
||||
Launchy.open("https://discord.com/invite/GYhW7eV")
|
||||
end
|
||||
image "#{GAME_ROOT_PATH}/media/social_media_icons/facebook.png", hover: { color: 0xaa_ffffff }, height: 1.0, margin_left: 32, tip: "W3D Hub Facebook Page" do
|
||||
Launchy.open("https://www.facebook.com/w3dhub")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
stack(width: 1.0, height: 0.6, scroll: true) do
|
||||
stack(width: 1.0, height: 0.55, scroll: true) do
|
||||
tagline "<b>Latest Updates</b>"
|
||||
para "<b>Beta 12</b>", margin_left: 16
|
||||
para "- Server Browser: Added detailed information for selection server", margin_left: 32
|
||||
|
||||
para "<b>Beta 11.6</b>", margin_left: 16, margin_top: 16
|
||||
para "- Localisation: Added Korean translations (unknown author)", margin_left: 32
|
||||
para "- Localisation: Added Spanish translations (thanks to Silverlight and URKA)", margin_left: 32
|
||||
para "- Localisation: Added Spanish translations (thanks to darkyuri-cz)", margin_left: 32
|
||||
|
||||
para "<b>Beta 11.0</b>", margin_left: 16, margin_top: 16
|
||||
para "- Localisation: Added partial Chinese (Simplified) translations and Polish (thanks to DoDoCat and TrollekPL on the W3D Hub forums for providing translations)", margin_left: 32
|
||||
para "- Performance: Reduced CPU and GPU usage during game installs and updates", margin_left: 32
|
||||
para "- Settings: Added new setting menu for the launcher - click on the [gear] icon in the titlebar. Incluudes:", margin_left: 32
|
||||
para "- Manually choose language, rather than using default based on OS", margin_left: 48
|
||||
para "- Choose package cache folder location", margin_left: 48
|
||||
para "- Choose default folder into which games are installed", margin_left: 48
|
||||
para "- Server Browser: Now receives push notifications so it shows changes to maps, player counts, etc. as soon as they are available", margin_left: 32
|
||||
para "- Server Browser: Now lists servers with players in above empty ones", margin_left: 32
|
||||
para "- Server Browser: Game filter options are now saved", margin_left: 32
|
||||
para "Hello World " * 100
|
||||
end
|
||||
|
||||
stack(width: 1.0, height: 0.15) do
|
||||
stack(width: 1.0, height: 0.15, margin_top: 16) do
|
||||
tagline "<b>Help & Support</b>"
|
||||
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) { Launchy.open("https://w3dhub.com/forum/") }
|
||||
para "or join us in"
|
||||
link("[discord]#tech-support", text_size: 16) { Launchy.open("https://w3dhub.com/forum/") }
|
||||
image "#{GAME_ROOT_PATH}/media/social_media_icons/discord.png", height: 16, padding_top: 4
|
||||
link("#tech-support", text_size: 16) { Launchy.open("https://discord.com/invite/GYhW7eV") }
|
||||
para "on the W3D Hub Discord server"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -47,9 +47,18 @@ class W3DHub
|
||||
end
|
||||
|
||||
flow(width: 0.249, height: 1.0) do
|
||||
inscription "Nickname:"
|
||||
inscription "Cyberarm"
|
||||
image "#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", height: 16
|
||||
inscription "Nickname:", width: 0.32
|
||||
@nickname_label = inscription "#{window.settings[:server_list_username]}", width: 0.6
|
||||
image "#{GAME_ROOT_PATH}/media/ui_icons/wrench.png", height: 16, hover: { color: 0xaa_ffffff }, tip: "Set nickname" do
|
||||
# Prompt for player name
|
||||
prompt_for_nickname(
|
||||
accept_callback: proc do |entry|
|
||||
@nickname_label.value = entry
|
||||
window.settings[:server_list_username] = entry
|
||||
window.settings.save_settings
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -180,7 +189,33 @@ class W3DHub
|
||||
end
|
||||
|
||||
stack(width: 1.0, height: 0.25) do
|
||||
button "<b>Join Server</b>", enabled: window.application_manager.installed?(server.game, window.applications.games.find { |g| g.id == server.game }.channels.first)
|
||||
game_installed = window.application_manager.installed?(server.game, window.applications.games.find { |g| g.id == server.game }.channels.first.id)
|
||||
|
||||
button "<b>Join Server</b>", enabled: !game_installed.nil? do
|
||||
# Check for nickname
|
||||
# prompt for nickname
|
||||
# !abort unless nickname set
|
||||
# Launch game
|
||||
if window.settings[:server_list_username].to_s.length.zero?
|
||||
prompt_for_nickname(
|
||||
accept_callback: proc do |entry|
|
||||
@nickname_label.value = entry
|
||||
window.settings[:server_list_username] = entry
|
||||
window.settings.save_settings
|
||||
|
||||
window.application_manager.join_server(
|
||||
server.game,
|
||||
window.applications.games.find { |g| g.id == server.game }.channels.first.id, server
|
||||
)
|
||||
end
|
||||
)
|
||||
else
|
||||
window.application_manager.join_server(
|
||||
server.game,
|
||||
window.applications.games.find { |g| g.id == server.game }.channels.first.id, server
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
stack(width: 1.0, height: 0.55, margin_top: 16) do
|
||||
@@ -281,6 +316,18 @@ class W3DHub
|
||||
"C&C Renegade"
|
||||
end
|
||||
end
|
||||
|
||||
def prompt_for_nickname(accept_callback: nil, cancel_callback: nil)
|
||||
push_state(
|
||||
W3DHub::States::PromptDialog,
|
||||
title: "Set Nickname",
|
||||
message: "Set a nickname that will be used when joining a server:",
|
||||
prefill: window.settings[:server_list_username],
|
||||
accept_callback: accept_callback,
|
||||
cancel_callback: cancel_callback,
|
||||
valid_callback: proc { |entry| entry.length.positive? }
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user