mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-15 16:52:34 +00:00
Improved avatar handling, fixed import/install button text sizes, fixed typo ERRNO-> Errno, ocra[n] packaging adjustments
This commit is contained in:
6
Gemfile
6
Gemfile
@@ -12,7 +12,11 @@ gem "websocket-client-simple"
|
|||||||
gem "win32-process", platforms: [:x64_mingw, :mingw]
|
gem "win32-process", platforms: [:x64_mingw, :mingw]
|
||||||
gem "win32-security", platforms: [:x64_mingw, :mingw]
|
gem "win32-security", platforms: [:x64_mingw, :mingw]
|
||||||
|
|
||||||
|
# Packaging on 3.3.0 is... painful. Using 3.2.0 for now.
|
||||||
|
# bundler 2.5.x doesn't seem to play nice with ocra[n]
|
||||||
|
# use `bundle _x.y.z_ COMMAND` to use this one...
|
||||||
# group :windows_packaging do
|
# group :windows_packaging do
|
||||||
|
# gem "bundler", "~>2.4.3"
|
||||||
# gem "rake"
|
# gem "rake"
|
||||||
# gem "releasy"
|
# gem "releasy", github: "cyberarm/releasy"
|
||||||
# end
|
# end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ GEM
|
|||||||
rake (>= 12.0.0, < 14.0.0)
|
rake (>= 12.0.0, < 14.0.0)
|
||||||
event_emitter (0.2.6)
|
event_emitter (0.2.6)
|
||||||
excon (0.109.0)
|
excon (0.109.0)
|
||||||
ffi (1.16.3)
|
ffi (1.16.3-x64-mingw-ucrt)
|
||||||
ffi-win32-extensions (1.0.4)
|
ffi-win32-extensions (1.0.4)
|
||||||
ffi
|
ffi
|
||||||
gosu (1.4.6)
|
gosu (1.4.6)
|
||||||
@@ -36,8 +36,6 @@ GEM
|
|||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
x64-mingw-ucrt
|
x64-mingw-ucrt
|
||||||
x64-mingw32
|
|
||||||
x86_64-linux
|
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
base64
|
base64
|
||||||
@@ -53,4 +51,4 @@ DEPENDENCIES
|
|||||||
win32-security
|
win32-security
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.5.3
|
2.4.3
|
||||||
|
|||||||
6
Rakefile
6
Rakefile
@@ -11,13 +11,13 @@ Releasy::Project.new do
|
|||||||
version W3DHub::VERSION
|
version W3DHub::VERSION
|
||||||
|
|
||||||
executable "w3d_hub_linux_launcher.rb"
|
executable "w3d_hub_linux_launcher.rb"
|
||||||
files ["lib/**/*.*", "locales/*", "media/**/**", "data/.gitkeep", "data/cache/.gitkeep"]
|
files ["lib/**/*.*", "locales/*", "media/**/**", "data/.gitkeep", "data/cache/.gitkeep", "data/logs/.gitkeep"]
|
||||||
exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
|
# exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
|
||||||
verbose
|
verbose
|
||||||
|
|
||||||
add_build :windows_folder do
|
add_build :windows_folder do
|
||||||
icon "media/icons/app.ico"
|
icon "media/icons/app.ico"
|
||||||
executable_type :console # Assuming you don't want it to run with a console window.
|
executable_type :windows # :console # Assuming you don't want it to run with a console window.
|
||||||
add_package :exe # Windows self-extracting archive.
|
add_package :exe # Windows self-extracting archive.
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -61,7 +61,7 @@ class W3DHub
|
|||||||
status = execute_task
|
status = execute_task
|
||||||
rescue FailFast
|
rescue FailFast
|
||||||
# no-op
|
# no-op
|
||||||
rescue StandardError, ERRNO::EACCES => e
|
rescue StandardError, Errno::EACCES => e
|
||||||
status = false
|
status = false
|
||||||
@task_failure_reason = e.message[0..512]
|
@task_failure_reason = e.message[0..512]
|
||||||
|
|
||||||
|
|||||||
@@ -205,14 +205,14 @@ class W3DHub
|
|||||||
installing = Store.application_manager.task?(:installer, game.id, channel.id)
|
installing = Store.application_manager.task?(:installer, game.id, channel.id)
|
||||||
|
|
||||||
unless game.id == "ren"
|
unless game.id == "ren"
|
||||||
button "<b>#{I18n.t(:"interface.install")}</b>", fill: true, margin_right: 8, text_size: 32, enabled: !installing do |button|
|
button "<b>#{I18n.t(:"interface.install")}</b>", fill: true, margin_right: 8, text_size: 30, enabled: !installing do |button|
|
||||||
button.enabled = false
|
button.enabled = false
|
||||||
@import_button.enabled = false
|
@import_button.enabled = false
|
||||||
Store.application_manager.install(game.id, channel.id)
|
Store.application_manager.install(game.id, channel.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@import_button = button "<b>#{I18n.t(:"interface.import")}</b>", fill: true, margin_left: 8, text_size: 32, enabled: !installing do
|
@import_button = button "<b>#{I18n.t(:"interface.import")}</b>", fill: true, margin_left: 8, text_size: 30, enabled: !installing do
|
||||||
Store.application_manager.import(game.id, channel.id)
|
Store.application_manager.import(game.id, channel.id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -108,7 +108,22 @@ class W3DHub
|
|||||||
mask_image = get_image("#{GAME_ROOT_PATH}/media/textures/circle_mask.png")
|
mask_image = get_image("#{GAME_ROOT_PATH}/media/textures/circle_mask.png")
|
||||||
|
|
||||||
composite_image = Gosu.render(256, 256) do
|
composite_image = Gosu.render(256, 256) do
|
||||||
avatar_image.draw(0, 0, 0)
|
scale = 1.0
|
||||||
|
|
||||||
|
if avatar_image.width > avatar_image.height
|
||||||
|
# avatar image is wider than tall, use `height` for scaling to ensure we fill the canvas
|
||||||
|
scale = 256.0 / avatar_image.height
|
||||||
|
elsif avatar_image.width < avatar_image.height
|
||||||
|
# avatar image is taller than wide, use `width` for scaling to ensure we fill the canvas
|
||||||
|
scale = 256.0 / avatar_image.width
|
||||||
|
else
|
||||||
|
# avatar image is square, use width for scale to ensure we fit to the canvas
|
||||||
|
scale = 256.0 / avatar_image.width
|
||||||
|
end
|
||||||
|
|
||||||
|
# Position image center in middle of composite
|
||||||
|
avatar_image.draw_rot(128, 128, 0, 0, 0.5, 0.5, scale, scale)
|
||||||
|
# Render mask image with mode :multiply so we get a clean circle cutout of the scaled avatar image
|
||||||
mask_image.draw(0, 0, 1, 1, 1, 0xff_ffffff, :multiply)
|
mask_image.draw(0, 0, 1, 1, 1, 0xff_ffffff, :multiply)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user