mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 17:22:35 +00:00
Removed settings and download manager icon buttons and moved to proper navigation 'links', Cache.install_path checks settings for games install path before defaulting
This commit is contained in:
13
lib/cache.rb
13
lib/cache.rb
@@ -38,9 +38,11 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.install_path(application, channel)
|
def self.install_path(application, channel)
|
||||||
app_install_dir = Store.settings[:app_install_dir]
|
game_data = Store.settings[:games]&.dig(:"#{application.id}_#{channel.id}")
|
||||||
|
|
||||||
"#{app_install_dir}/#{application.category}/#{application.id}/#{channel.id}"
|
return game_data[:install_directory] if game_data && game_data[:install_directory]
|
||||||
|
|
||||||
|
"#{Store.settings[:app_install_dir]}/#{application.category}/#{application.id}/#{channel.id}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Download a W3D Hub package
|
# Download a W3D Hub package
|
||||||
@@ -83,7 +85,14 @@ class W3DHub
|
|||||||
|
|
||||||
if response.success?
|
if response.success?
|
||||||
chunk = response.read
|
chunk = response.read
|
||||||
|
written = 0
|
||||||
|
if W3DHub.unix?
|
||||||
written = file.pwrite(chunk, part.min)
|
written = file.pwrite(chunk, part.min)
|
||||||
|
else
|
||||||
|
# probably not "thread safe"
|
||||||
|
file.pos = part.min
|
||||||
|
written = file.write(chunk)
|
||||||
|
end
|
||||||
|
|
||||||
amount_written += written
|
amount_written += written
|
||||||
remaining_bytes = package.size - amount_written
|
remaining_bytes = package.size - amount_written
|
||||||
|
|||||||
@@ -37,38 +37,10 @@ class W3DHub
|
|||||||
stack(width: 0.75, height: 1.0) do
|
stack(width: 0.75, height: 1.0) do
|
||||||
title "<b>#{I18n.t(:"app_name")}</b>", height: 0.5
|
title "<b>#{I18n.t(:"app_name")}</b>", height: 0.5
|
||||||
flow(width: 1.0, height: 0.5) do
|
flow(width: 1.0, height: 0.5) do
|
||||||
flow(width: 0.18, height: 1.0) do
|
@application_taskbar_container = stack(width: 1.0, height: 1.0, margin_left: 16) do
|
||||||
button(
|
|
||||||
get_image("#{GAME_ROOT_PATH}/media/ui_icons/gear.png"),
|
|
||||||
tip: I18n.t(:"interface.app_settings_tip"),
|
|
||||||
image_height: 1.0,
|
|
||||||
padding_left: 4,
|
|
||||||
padding_top: 4,
|
|
||||||
padding_right: 4,
|
|
||||||
padding_bottom: 4,
|
|
||||||
margin_left: 32
|
|
||||||
) do
|
|
||||||
page(W3DHub::Pages::Settings)
|
|
||||||
end
|
|
||||||
|
|
||||||
button(
|
|
||||||
get_image("#{GAME_ROOT_PATH}/media/ui_icons/import.png"),
|
|
||||||
tip: I18n.t(:"interface.download_manager"),
|
|
||||||
image_height: 1.0,
|
|
||||||
padding_left: 4,
|
|
||||||
padding_top: 4,
|
|
||||||
padding_right: 4,
|
|
||||||
padding_bottom: 4,
|
|
||||||
margin_left: 4
|
|
||||||
) do
|
|
||||||
page(W3DHub::Pages::DownloadManager)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
@application_taskbar_container = stack(width: 0.77, height: 1.0, margin_left: 16) do
|
|
||||||
flow(width: 1.0, height: 0.65) do
|
flow(width: 1.0, height: 0.65) do
|
||||||
@application_taskbar_label = inscription "", width: 0.65, text_wrap: :none
|
@application_taskbar_label = inscription "", width: 0.60, text_wrap: :none
|
||||||
@application_taskbar_status_label = inscription "", width: 0.35, text_align: :right, text_wrap: :none
|
@application_taskbar_status_label = inscription "", 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
|
||||||
@@ -93,11 +65,7 @@ class W3DHub
|
|||||||
|
|
||||||
@navigation_container = flow(width: 1.0, height: 0.35) do
|
@navigation_container = flow(width: 1.0, height: 0.35) do
|
||||||
# background 0xff_666666
|
# background 0xff_666666
|
||||||
|
flow(width: 1.0, height: 1.0, padding_left: 75) do
|
||||||
flow(width: 0.20, height: 1.0) do
|
|
||||||
end
|
|
||||||
|
|
||||||
flow(width: 0.55, height: 1.0) do
|
|
||||||
link I18n.t(:"interface.games") do
|
link I18n.t(:"interface.games") do
|
||||||
page(W3DHub::Pages::Games)
|
page(W3DHub::Pages::Games)
|
||||||
end
|
end
|
||||||
@@ -109,9 +77,14 @@ class W3DHub
|
|||||||
link I18n.t(:"interface.community"), margin_left: 18 do
|
link I18n.t(:"interface.community"), margin_left: 18 do
|
||||||
page(W3DHub::Pages::Community)
|
page(W3DHub::Pages::Community)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
link I18n.t(:"interface.downloads"), margin_left: 18 do
|
||||||
|
page(W3DHub::Pages::DownloadManager)
|
||||||
end
|
end
|
||||||
|
|
||||||
flow(width: 0.20, height: 1.0) do
|
link I18n.t(:"interface.settings"), margin_left: 18 do
|
||||||
|
page(W3DHub::Pages::Settings)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ en:
|
|||||||
server_browser: Server Browser
|
server_browser: Server Browser
|
||||||
community: Community
|
community: Community
|
||||||
download_manager: Download Manager
|
download_manager: Download Manager
|
||||||
|
downloads: Downloads
|
||||||
play_now: Play Now
|
play_now: Play Now
|
||||||
install_update: Install Update
|
install_update: Install Update
|
||||||
single_player: Single Player
|
single_player: Single Player
|
||||||
import: Import
|
import: Import
|
||||||
install: Install
|
install: Install
|
||||||
app_settings_tip: W3D Hub Launcher Settings
|
app_settings_tip: W3D Hub Launcher Settings
|
||||||
|
settings: Settings
|
||||||
games:
|
games:
|
||||||
game_settings: Game Settings
|
game_settings: Game Settings
|
||||||
wine_configuration: Wine Configuration
|
wine_configuration: Wine Configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user