mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2026-05-06 09:28:18 +00:00
Compare commits
2 Commits
451b08bb9e
...
5c3926e203
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c3926e203 | |||
| 7d6fce2969 |
13
lib/dialogs/about.rb
Normal file
13
lib/dialogs/about.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
module W3DHubLauncher
|
||||
module Dialogs
|
||||
class About < CyberarmEngine::GuiState # Dialog
|
||||
def setup
|
||||
# application name and version
|
||||
# authorship
|
||||
# special thanks
|
||||
# used gems and libraries
|
||||
# useful links
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
15
lib/gui_ext.rb
Normal file
15
lib/gui_ext.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
module W3DHubLauncher
|
||||
module GuiExt
|
||||
BLACK_IMAGE = Gosu.render(64, 64, retro: true) { Gosu.draw_rect(0, 0, 32, 32, Gosu::Color::BLACK) }
|
||||
WHITE_IMAGE = Gosu.render(64, 64, retro: true) { Gosu.draw_rect(0, 0, 32, 32, Gosu::Color::WHITE) }
|
||||
|
||||
def safe_get_image(path, retro: false)
|
||||
return get_image(path, retro: retro) if File.exist?(path)
|
||||
|
||||
path = "./media/default.png"
|
||||
return get_image(path, retro: retro) if File.exist?(path)
|
||||
|
||||
WHITE_IMAGE
|
||||
end
|
||||
end
|
||||
end
|
||||
0
lib/pages/games.rb
Normal file
0
lib/pages/games.rb
Normal file
0
lib/pages/server_browser.rb
Normal file
0
lib/pages/server_browser.rb
Normal file
0
lib/states/boot.rb
Normal file
0
lib/states/boot.rb
Normal file
0
lib/states/interface.rb
Normal file
0
lib/states/interface.rb
Normal file
76
lib/theme.rb
Normal file
76
lib/theme.rb
Normal file
@@ -0,0 +1,76 @@
|
||||
module W3DHubLauncher
|
||||
LARGE_PADDING = 40
|
||||
PADDING = 20
|
||||
HALF_PADDING = 10
|
||||
ALPHA_BLACK = 0x88_000000
|
||||
|
||||
FONT_LIGHT = "./media/fonts/NotoSans-Light.ttf"
|
||||
FONT_REGULAR = "./media/fonts/NotoSans-Regular.ttf"
|
||||
FONT_BOLD = "./media/fonts/NotoSans-Bold.ttf"
|
||||
FONT_BLACK = "./media/fonts/NotoSans-Black.ttf"
|
||||
|
||||
FONT_MONO = "./media/fonts/NotoSansMono-Regular.ttf"
|
||||
|
||||
CTA_BUTTON_THEME = {
|
||||
background: 0xff_1a5fb4
|
||||
}
|
||||
|
||||
THEME = {
|
||||
TextBlock: {
|
||||
text_static: true,
|
||||
font: FONT_REGULAR,
|
||||
text_shadow: true,
|
||||
text_shadow_color: 0x44_000000
|
||||
},
|
||||
Link: {
|
||||
font: FONT_REGULAR,
|
||||
color: 0xff_bbbbbb,
|
||||
hover: {
|
||||
color: 0xff_ffffff
|
||||
},
|
||||
active: {
|
||||
color: 0xff_888888
|
||||
}
|
||||
},
|
||||
Button: {
|
||||
font: FONT_BOLD,
|
||||
text_shadow: false,
|
||||
background: 0x88_5e5c64,
|
||||
border_thickness: 1,
|
||||
border_color: 0xff_000000
|
||||
},
|
||||
EditLine: {
|
||||
font: FONT_REGULAR
|
||||
},
|
||||
ListBox: {
|
||||
text_align: :left,
|
||||
text_size: 24,
|
||||
font: FONT_REGULAR,
|
||||
# background: 0xaa_000000,
|
||||
# border_color: 0xff_000000,
|
||||
# hover: {
|
||||
# background: 0xaa_222222
|
||||
# },
|
||||
# active: {
|
||||
# background: 0xaa_444444
|
||||
# }
|
||||
},
|
||||
Menu: {
|
||||
border_thickness: 1,
|
||||
border_color: 0xff_000000
|
||||
},
|
||||
MenuItem: {
|
||||
text_size: 24,
|
||||
text_align: :left,
|
||||
font: FONT_REGULAR,
|
||||
background: 0xee_000000,
|
||||
border_color: 0xaa_000000,
|
||||
hover: {
|
||||
background: 0xee_222222
|
||||
},
|
||||
active: {
|
||||
background: 0xee_444444
|
||||
}
|
||||
}
|
||||
}
|
||||
end
|
||||
5
lib/version.rb
Normal file
5
lib/version.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module W3DHubLauncher
|
||||
NAME = "Cyberarm's W3D Hub linux Launcher".freeze
|
||||
VERSION = "2.0.0".freeze
|
||||
VERSION_NAME = "alpha".freeze # TODO: Come up with a short, fun, release name
|
||||
end
|
||||
125
lib/window.rb
125
lib/window.rb
@@ -2,93 +2,20 @@ module W3DHubLauncher
|
||||
class Window < CyberarmEngine::Window
|
||||
def setup
|
||||
self.show_cursor = true
|
||||
self.caption = "Cyberarm's W3D Hub Linux Launcher | v2.0.0 alpha"
|
||||
self.caption = format("%s | v%s (%s)", NAME, VERSION, VERSION_NAME) # "Cyberarm's W3D Hub Linux Launcher | v2.0.0 alpha"
|
||||
|
||||
push_state(Interface)
|
||||
end
|
||||
end
|
||||
|
||||
class Interface < CyberarmEngine::GuiState
|
||||
LARGE_PADDING = 40
|
||||
PADDING = 20
|
||||
HALF_PADDING = 10
|
||||
ALPHA_BLACK = 0x88_000000
|
||||
|
||||
FONT_LIGHT = "./media/fonts/NotoSans-Light.ttf"
|
||||
FONT_REGULAR = "./media/fonts/NotoSans-Regular.ttf"
|
||||
FONT_BOLD = "./media/fonts/NotoSans-Bold.ttf"
|
||||
FONT_BLACK = "./media/fonts/NotoSans-Black.ttf"
|
||||
|
||||
FONT_MONO = "./media/fonts/NotoSansMono-Regular.ttf"
|
||||
|
||||
CTA_BUTTON_THEME = {
|
||||
background: 0xff_1a5fb4
|
||||
}
|
||||
|
||||
THEME = {
|
||||
TextBlock: {
|
||||
text_static: true,
|
||||
font: FONT_REGULAR,
|
||||
text_shadow: true,
|
||||
text_shadow_color: 0x44_000000
|
||||
},
|
||||
Link: {
|
||||
font: FONT_REGULAR,
|
||||
color: 0xff_bbbbbb,
|
||||
hover: {
|
||||
color: 0xff_ffffff
|
||||
},
|
||||
active: {
|
||||
color: 0xff_888888
|
||||
}
|
||||
},
|
||||
Button: {
|
||||
font: FONT_BOLD,
|
||||
text_shadow: false,
|
||||
background: 0x88_5e5c64,
|
||||
border_thickness: 1,
|
||||
border_color: 0xff_000000
|
||||
},
|
||||
EditLine: {
|
||||
font: FONT_REGULAR
|
||||
},
|
||||
ListBox: {
|
||||
text_align: :left,
|
||||
text_size: 24,
|
||||
font: FONT_REGULAR,
|
||||
# background: 0xaa_000000,
|
||||
# border_color: 0xff_000000,
|
||||
# hover: {
|
||||
# background: 0xaa_222222
|
||||
# },
|
||||
# active: {
|
||||
# background: 0xaa_444444
|
||||
# }
|
||||
},
|
||||
Menu: {
|
||||
border_thickness: 1,
|
||||
border_color: 0xff_000000
|
||||
},
|
||||
MenuItem: {
|
||||
text_size: 24,
|
||||
text_align: :left,
|
||||
font: FONT_REGULAR,
|
||||
background: 0xee_000000,
|
||||
border_color: 0xaa_000000,
|
||||
hover: {
|
||||
background: 0xee_222222
|
||||
},
|
||||
active: {
|
||||
background: 0xee_444444
|
||||
}
|
||||
}
|
||||
}
|
||||
include W3DHubLauncher::GuiExt
|
||||
|
||||
def setup
|
||||
theme(THEME)
|
||||
|
||||
# root container - background image
|
||||
stack(width: 1.0, height: 1.0, background_image: get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/background.png.package"), background_image_mode: :fill) do
|
||||
stack(width: 1.0, height: 1.0, background_image: safe_get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/background.png.package"), background_image_mode: :fill) do
|
||||
# root container - background image tint
|
||||
flow(width: 1.0, height: 1.0, background: ALPHA_BLACK) do
|
||||
# content container
|
||||
@@ -96,7 +23,7 @@ module W3DHubLauncher
|
||||
# header bar container
|
||||
flow(width: 1.0, height: 80, margin_bottom: PADDING) do |c|
|
||||
# logo + menu button
|
||||
button(get_image("./media/logo.png"), image_height: 1.0, background: 0, border_color: 0, hover: { background: 0 }, active: { background: 0, color: 0xff_ffffff }) do |btn|
|
||||
button(safe_get_image("./media/logo.png"), image_height: 1.0, background: 0, border_color: 0, hover: { background: 0 }, active: { background: 0, color: 0xff_ffffff }) do |btn|
|
||||
menu(parent: btn) do
|
||||
menu_item("Settings")
|
||||
menu_item("About")
|
||||
@@ -112,8 +39,8 @@ module W3DHubLauncher
|
||||
link "GAMES", text_v_align: :center, font: FONT_BLACK, margin_left: PADDING
|
||||
link "SERVERS", text_v_align: :center, font: FONT_BLACK, margin_left: PADDING
|
||||
stack(fill: true)
|
||||
image get_image("./media/icons/import.png"), height: 40, color: 0xff_bbbbbb
|
||||
image get_image("./media/icons/information.png"), height: 40, color: 0xff_bbbbbb
|
||||
image safe_get_image("./media/icons/import.png"), height: 40, color: 0xff_bbbbbb
|
||||
image safe_get_image("./media/icons/information.png"), height: 40, color: 0xff_bbbbbb
|
||||
end
|
||||
stack(fill: true)
|
||||
end
|
||||
@@ -125,25 +52,25 @@ module W3DHubLauncher
|
||||
flow(width: 1.0, height: 60) do
|
||||
flow(width: 220, height: 1.0, background: ALPHA_BLACK) do
|
||||
flow(width: 1.0, height: 40, margin_left: PADDING, v_align: :center, h_align: :center) do
|
||||
image get_image("./media/icons/menuGrid.png"), height: 40, color: 0xff_bbbbbb
|
||||
image safe_get_image("./media/icons/menuGrid.png"), height: 40, color: 0xff_bbbbbb
|
||||
link "ALL GAMES", text_size: 24, font: FONT_BLACK, height: 1.0, text_v_align: :center
|
||||
end
|
||||
end
|
||||
|
||||
flow(fill: true, height: 1.0, background: ALPHA_BLACK, margin_left: PADDING) do
|
||||
image get_image("./data/cache/apb.png"), height: 1.0, padding: HALF_PADDING, background:0x88_5e5c64, border_thickness_bottom: 3, border_color_bottom: 0xff_3584e4, tip: "Red Alert: A Path Beyond"
|
||||
image get_image("./data/cache/ren.png"), height: 1.0, padding: HALF_PADDING, tip: "Command & Conquer: Renegade"
|
||||
image get_image("./data/cache/tsr.png"), height: 1.0, padding: HALF_PADDING, tip: "Tiberian Sun: Reborn"
|
||||
image get_image("./data/cache/woa.png"), height: 1.0, padding: HALF_PADDING, tip: "Battle for Dune: War of Assassins"
|
||||
image safe_get_image("./data/cache/apb.png"), height: 1.0, padding: HALF_PADDING, background:0x88_5e5c64, border_thickness_bottom: 3, border_color_bottom: 0xff_3584e4, tip: "Red Alert: A Path Beyond"
|
||||
image safe_get_image("./data/cache/ren.png"), height: 1.0, padding: HALF_PADDING, tip: "Command & Conquer: Renegade"
|
||||
image safe_get_image("./data/cache/tsr.png"), height: 1.0, padding: HALF_PADDING, tip: "Tiberian Sun: Reborn"
|
||||
image safe_get_image("./data/cache/woa.png"), height: 1.0, padding: HALF_PADDING, tip: "Battle for Dune: War of Assassins"
|
||||
end
|
||||
end
|
||||
|
||||
# game content container
|
||||
flow(width: 1.0, fill: true, margin_top: PADDING) do
|
||||
flow(width: 1.0, fill: true, margin_top: LARGE_PADDING) do
|
||||
# game info container
|
||||
stack(width: 340, height: 1.0) do
|
||||
# logo
|
||||
image get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/logo.png.package"), width: 1.0, max_height: 124
|
||||
image safe_get_image("/run/media/cyberarm/Storage/W3DHub/Launcher/package-cache/games/apb/logo.png.package"), width: 1.0, max_height: 124
|
||||
|
||||
# web links
|
||||
stack(width: 1.0, fill: true, padding: 0, padding_top: LARGE_PADDING) do
|
||||
@@ -157,8 +84,8 @@ module W3DHubLauncher
|
||||
list_box items: [ "Release", "Open Testing" ], width: 1.0, margin_bottom: PADDING
|
||||
flow(width: 1.0, height: 60) do
|
||||
button "PLAY", fill: true, height: 1.0, **CTA_BUTTON_THEME
|
||||
button get_image("./media/icons/singleplayer.png"), image_height: 1.0, **CTA_BUTTON_THEME
|
||||
button get_image("./media/icons/gear.png"), image_height: 1.0, **CTA_BUTTON_THEME
|
||||
button safe_get_image("./media/icons/singleplayer.png"), image_height: 1.0, **CTA_BUTTON_THEME
|
||||
button safe_get_image("./media/icons/gear.png"), image_height: 1.0, **CTA_BUTTON_THEME
|
||||
end
|
||||
inscription "Version: 3.9.2.15", margin_top: PADDING
|
||||
end
|
||||
@@ -166,7 +93,7 @@ module W3DHubLauncher
|
||||
# game events and news container
|
||||
stack(fill: true, height: 1.0, margin_left: LARGE_PADDING, scroll: true) do
|
||||
flow(width: 1.0, height: 1.0, max_height: 380, background: ALPHA_BLACK, border_thickness: 1, border_color: Gosu::Color::BLACK) do
|
||||
image get_image("./media/background.png"), fill: true, aspect_ratio: 16.0 / 9.0
|
||||
image safe_get_image("./media/background.png"), fill: true, aspect_ratio: 16.0 / 9.0
|
||||
|
||||
stack(fill: true, height: 1.0, margin_left: PADDING) do
|
||||
caption "Upcoming Event", color: 0xff_22aa11, font: FONT_BOLD
|
||||
@@ -182,7 +109,7 @@ module W3DHubLauncher
|
||||
# news container
|
||||
flow(width: 1.0, margin_top: PADDING) do
|
||||
9.times do
|
||||
stack(width: 1.0 / 3, height: 345, aspect_ratio: 1, margin_left: HALF_PADDING, margin_right: HALF_PADDING, margin_bottom: PADDING, background: ALPHA_BLACK, background_image: get_image("./media/background.png"), background_image_mode: :fill, border_thickness: 1, border_color: Gosu::Color::BLACK) do
|
||||
stack(width: 1.0 / 3, height: 345, aspect_ratio: 1, margin_left: HALF_PADDING, margin_right: HALF_PADDING, margin_bottom: PADDING, background: ALPHA_BLACK, background_image: safe_get_image("./media/background.png"), background_image_mode: :fill, border_thickness: 1, border_color: Gosu::Color::BLACK) do
|
||||
stack(width: 1.0, height: 1.0 / 3, padding: PADDING, v_align: :bottom, background: 0xdd_000000, border_thickness_top: 1, border_color_top: Gosu::Color::BLACK) do
|
||||
caption "NEWS", color: 0x88_ffffff, font: FONT_BOLD
|
||||
tagline "A News Item Post A News Item Post", font: FONT_BOLD
|
||||
@@ -200,9 +127,9 @@ module W3DHubLauncher
|
||||
# self account container
|
||||
flow(width: 1.0, height: 80) do
|
||||
# self avatar container
|
||||
stack(width: 80, height: 1.0, background_image: get_image("./media/default.png")) do
|
||||
stack(width: 80, height: 1.0, background_image: safe_get_image("./media/default.png")) do
|
||||
# self online state container
|
||||
stack(width: 20, height: 20, v_align: :bottom, h_align: :right, background_image: get_image("./media/icons/contrast.png"), background_image_color: 0xff_26a269)
|
||||
stack(width: 20, height: 20, v_align: :bottom, h_align: :right, background_image: safe_get_image("./media/icons/contrast.png"), background_image_color: 0xff_26a269)
|
||||
end
|
||||
|
||||
stack(fill: true, height: 1.0, margin_left: HALF_PADDING) do
|
||||
@@ -226,30 +153,30 @@ module W3DHubLauncher
|
||||
# friend management container
|
||||
flow(width: 1.0, height: 60, margin_top: PADDING) do
|
||||
flow(width: 1.0) do # FIXME: , v_align: :center
|
||||
button get_image("./media/icons/singleplayer.png"), image_height: 1.0
|
||||
button get_image("./media/icons/gear.png"), image_height: 1.0, margin_left: HALF_PADDING
|
||||
button safe_get_image("./media/icons/singleplayer.png"), image_height: 1.0
|
||||
button safe_get_image("./media/icons/gear.png"), image_height: 1.0, margin_left: HALF_PADDING
|
||||
edit_line "", margin_left: HALF_PADDING, fill: true, height: 1.0
|
||||
end
|
||||
end
|
||||
|
||||
# Q
|
||||
# friends/clanmates list container
|
||||
stack(width: 1.0, fill: true, margin_top: PADDING, scroll: true) do
|
||||
50.times do |i|
|
||||
# friend container
|
||||
flow(width: 1.0, height: 48, margin_bottom: HALF_PADDING, hover: { background: 0x44_000000 }) do
|
||||
# friend avatar container
|
||||
stack(width: 48, height: 1.0, background_image: get_image("./media/default.png")) do
|
||||
stack(width: 12, height: 12, v_align: :bottom, h_align: :right, background_image: get_image("./media/icons/contrast.png"), background_image_color: 0xff_26a269)
|
||||
stack(width: 48, height: 1.0, background_image: safe_get_image("./media/default.png")) do
|
||||
stack(width: 12, height: 12, v_align: :bottom, h_align: :right, background_image: safe_get_image("./media/icons/contrast.png"), background_image_color: 0xff_26a269)
|
||||
end
|
||||
# friend name and status container
|
||||
stack(fill: true, height: 1.0, margin_left: HALF_PADDING, margin_right: HALF_PADDING) do
|
||||
stack(v_align: :center) do
|
||||
caption "moonsense#{715 * i % 1000 }test", font: FONT_BOLD, text_wrap: :none, text_size: 20
|
||||
caption "moonsense#{715 * (i + 1) % 1000}test", font: FONT_BOLD, text_wrap: :none, text_size: 20
|
||||
inscription "RA_Under • 13:52", text_wrap: :none, text_size: 14, margin_top: -HALF_PADDING
|
||||
end
|
||||
end
|
||||
# friend active application container
|
||||
stack(width: 48, height: 1.0, background_image: get_image("./media/logo.png"))
|
||||
stack(width: 48, height: 1.0, background_image: safe_get_image("./media/logo.png"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
31
lib/worker.rb
Normal file
31
lib/worker.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
module W3DHubLauncher
|
||||
class Worker
|
||||
def initialize
|
||||
@threads = []
|
||||
|
||||
# listen for requests from frontend
|
||||
listener = Thread.new { listen }
|
||||
# connect to and monitor GSH web service
|
||||
@threads << Thread.new { game_server_hub_websocket }
|
||||
# connect to and monitor Backend web service
|
||||
@threads << Thread.new { backend_websocket }
|
||||
|
||||
Ractor.main.send({ message: "3 o'clock 'nd all's well!" })
|
||||
|
||||
listener.join
|
||||
end
|
||||
|
||||
def listen
|
||||
loop do
|
||||
request = Ractor.receive
|
||||
pp request
|
||||
end
|
||||
end
|
||||
|
||||
def game_server_hub_websocket
|
||||
end
|
||||
|
||||
def backend_websocket
|
||||
end
|
||||
end
|
||||
end
|
||||
79
lib/worker/api.rb
Normal file
79
lib/worker/api.rb
Normal file
@@ -0,0 +1,79 @@
|
||||
# Helper for launcher frontend to safely communicate with ractor (prevent deadlocks and concurrent access errors)
|
||||
|
||||
module W3DHubLauncher
|
||||
class Worker
|
||||
class Api
|
||||
Request = Data.define(:coming_soon)
|
||||
|
||||
def initialize
|
||||
@requests = []
|
||||
end
|
||||
|
||||
# downloads requested resource, returns raw string
|
||||
def fetch_url
|
||||
end
|
||||
|
||||
# downloads requested resource, periodically reporting progress until completion, returning path for file on disk
|
||||
def download_url
|
||||
end
|
||||
|
||||
# returns user account data
|
||||
#
|
||||
# automatically handles signing in / refreshing token (DOES NOT remove account data if failed to refresh token due to network timeout)
|
||||
def account
|
||||
end
|
||||
|
||||
# returns launcher settings
|
||||
def settings
|
||||
end
|
||||
|
||||
# write updated launcher settings
|
||||
def update_settings
|
||||
end
|
||||
|
||||
# returns list of available applications
|
||||
#
|
||||
# if updated list is requested, return cached version immediately and then the updated list later.
|
||||
def applications
|
||||
end
|
||||
|
||||
# returns current list of servers as reported from GSH / cache
|
||||
def servers
|
||||
end
|
||||
|
||||
# returns news for application
|
||||
def news
|
||||
end
|
||||
|
||||
# request installation of application
|
||||
#
|
||||
# periodically reports progress until completion
|
||||
def install_application
|
||||
end
|
||||
|
||||
# request update of application
|
||||
#
|
||||
# periodically reports progress until completion
|
||||
def update_application
|
||||
end
|
||||
|
||||
# request repair of application
|
||||
#
|
||||
# periodically reports progress until completion
|
||||
def repair_application
|
||||
end
|
||||
|
||||
# request relocation of application
|
||||
#
|
||||
# periodically reports progress until completion
|
||||
def move_application
|
||||
end
|
||||
|
||||
# request removal of application
|
||||
#
|
||||
# periodically reports progress until completion
|
||||
def uninstall_application
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
4
lib/worker/task.rb
Normal file
4
lib/worker/task.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
module W3DHubLauncher
|
||||
class Task
|
||||
end
|
||||
end
|
||||
0
lib/worker/tasks/install_application.rb
Normal file
0
lib/worker/tasks/install_application.rb
Normal file
0
lib/worker/tasks/repair_application.rb
Normal file
0
lib/worker/tasks/repair_application.rb
Normal file
0
lib/worker/tasks/uninstall_application.rb
Normal file
0
lib/worker/tasks/uninstall_application.rb
Normal file
0
lib/worker/tasks/update_application.rb
Normal file
0
lib/worker/tasks/update_application.rb
Normal file
0
lib/worker/w3dhub_api.rb
Normal file
0
lib/worker/w3dhub_api.rb
Normal file
@@ -4,8 +4,32 @@ rescue LoadError
|
||||
require "cyberarm_engine"
|
||||
end
|
||||
|
||||
require_relative "lib/version"
|
||||
require_relative "lib/gui_ext"
|
||||
require_relative "lib/theme"
|
||||
require_relative "lib/window"
|
||||
|
||||
# window = W3DHubLauncher::Window.new(width: 1280, height: 800, resizable: true)
|
||||
window = W3DHubLauncher::Window.new(width: 1920, height: 1080, resizable: true)
|
||||
require_relative "lib/worker"
|
||||
require_relative "lib/worker/api"
|
||||
|
||||
module W3DHubLauncher
|
||||
WORKER = Ractor.new(name: "Parallel Worker") { W3DHubLauncher::Worker.new }
|
||||
end
|
||||
|
||||
# Hello, I exist because there presently exists no way to ask if there are pending
|
||||
# messages in our ractors mailbox without making a blocking call which is a big no no
|
||||
# for a GUI application. :|
|
||||
#
|
||||
# Keep an eye on: https://bugs.ruby-lang.org/issues/21930: "Add Ractor#empty? method to check for pending messages without blocking"
|
||||
#
|
||||
# NOTE: May need to mangle Window#update to do ruby-land sleep so thread gets time to process :(
|
||||
Thread.new do
|
||||
loop do
|
||||
message = Ractor.receive
|
||||
pp message
|
||||
end
|
||||
end
|
||||
|
||||
window = W3DHubLauncher::Window.new(width: 1280, height: 800, resizable: true)
|
||||
# window = W3DHubLauncher::Window.new(width: 1920, height: 1080, resizable: true)
|
||||
window.show
|
||||
|
||||
Reference in New Issue
Block a user