mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Removed idea to have Tasks have a seperate step class; needless abstraction at this point, added manifest parser
This commit is contained in:
20
lib/api.rb
20
lib/api.rb
@@ -143,14 +143,28 @@ class W3DHub
|
|||||||
|
|
||||||
# /apis/launcher/1/get-package-details
|
# /apis/launcher/1/get-package-details
|
||||||
# client requests package details: data={"packages":[{"category":"games","name":"apb.ico","subcategory":"apb","version":""}]}
|
# client requests package details: data={"packages":[{"category":"games","name":"apb.ico","subcategory":"apb","version":""}]}
|
||||||
def self.package_details()
|
def self.package_details(packages)
|
||||||
|
response = W3DHUB_API_CONNECTION.post(
|
||||||
|
path: "apis/launcher/1/get-package-details",
|
||||||
|
headers: DEFAULT_HEADERS.merge({"Content-Type": "application/x-www-form-urlencoded"}),
|
||||||
|
body: "data=#{JSON.dump({ packages: packages })}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if response.status == 200
|
||||||
|
hash = JSON.parse(response.body, symbolize_names: true)
|
||||||
|
packages = hash[:packages].map { |pkg| Package.new(pkg) }
|
||||||
|
packages.first if packages.size == 1
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# /apis/launcher/1/get-package
|
# /apis/launcher/1/get-package
|
||||||
# client requests package: data={"category":"games","name":"ECW_Asteroids.zip","subcategory":"ecw","version":"1.0.0.0"}
|
# client requests package: data={"category":"games","name":"ECW_Asteroids.zip","subcategory":"ecw","version":"1.0.0.0"}
|
||||||
#
|
#
|
||||||
# server responds with download bytes
|
# server responds with download bytes, probably supports chunked download and resume
|
||||||
def self.package(category, name, subcategory, version, &block)
|
def self.package(category, subcategory, name, version, &block)
|
||||||
|
Cache.fetch_package(W3DHUB_API_CONNECTION, category, subcategory, name, version, block)
|
||||||
end
|
end
|
||||||
|
|
||||||
#! === Server List API === !#
|
#! === Server List API === !#
|
||||||
|
|||||||
32
lib/api/package.rb
Normal file
32
lib/api/package.rb
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
class W3DHub
|
||||||
|
class Api
|
||||||
|
class Package
|
||||||
|
attr_reader :category, :subcategory, :name, :version, :size, :checksum, :checksum_chunk_size, :checksum_chunks
|
||||||
|
|
||||||
|
def initialize(hash)
|
||||||
|
@data = hash
|
||||||
|
|
||||||
|
@category = @data[:category]
|
||||||
|
@subcategory = @data[:subcategory]
|
||||||
|
@name = @data[:name]
|
||||||
|
@version = @data[:version]
|
||||||
|
|
||||||
|
@size = @data[:size]
|
||||||
|
@checksum = @data[:checksum]
|
||||||
|
@checksum_chunk_size = @data[:"checksum-chunk-size"]
|
||||||
|
@checksum_chunks = @data[:"checksum-chunks"]&.map { |c| Chunk.new(c) }
|
||||||
|
end
|
||||||
|
|
||||||
|
class Chunk
|
||||||
|
attr_reader :chunk, :checksum
|
||||||
|
|
||||||
|
def initialize(array)
|
||||||
|
@data = array
|
||||||
|
|
||||||
|
@chunk = @data[0]
|
||||||
|
@checksum = @data[1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -19,7 +19,10 @@ class W3DHub
|
|||||||
# unpack packages
|
# unpack packages
|
||||||
# install dependencies (e.g. visual C runtime)
|
# install dependencies (e.g. visual C runtime)
|
||||||
|
|
||||||
@tasks.push(Installer.new(app_id, channel))
|
installer = Installer.new(app_id, channel)
|
||||||
|
|
||||||
|
@tasks.push(installer)
|
||||||
|
installer.start
|
||||||
end
|
end
|
||||||
|
|
||||||
def import(app_id, channel, path)
|
def import(app_id, channel, path)
|
||||||
|
|||||||
72
lib/application_manager/manifest.rb
Normal file
72
lib/application_manager/manifest.rb
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
class W3DHub
|
||||||
|
class ApplicationManager
|
||||||
|
class Manifest
|
||||||
|
attr_reader :game, :type, :version, :base_version, :files, :dependencies
|
||||||
|
|
||||||
|
def initialize(category, subcategory, name, version)
|
||||||
|
manifest = File.read(Cache.package_path(category, subcategory, name, version))
|
||||||
|
@document = REXML::Document.new(manifest)
|
||||||
|
root = @document.root
|
||||||
|
|
||||||
|
@game = root["game"]
|
||||||
|
@type = root["type"]
|
||||||
|
@version = root["version"]
|
||||||
|
@base_version = root["baseVersion"]
|
||||||
|
|
||||||
|
@files = []
|
||||||
|
@dependencies = []
|
||||||
|
|
||||||
|
parse_files
|
||||||
|
parse_dependencies
|
||||||
|
end
|
||||||
|
|
||||||
|
def patch?
|
||||||
|
@type == "Patch"
|
||||||
|
end
|
||||||
|
|
||||||
|
def full?
|
||||||
|
@type == "Full"
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_files
|
||||||
|
@document.root.elements.each("//File") do |element|
|
||||||
|
@files.push(ManifestFile.new(element))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def parse_dependencies
|
||||||
|
@document.root.elements.each("//Dependency") do |element|
|
||||||
|
@files.push(Dependency.new(element))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# TODO: Support patches? Are they still a thing>
|
||||||
|
class ManifestFile
|
||||||
|
attr_reader :name, :checksum, :package, :removed_since
|
||||||
|
|
||||||
|
def initialize(xml)
|
||||||
|
@data = xml
|
||||||
|
|
||||||
|
@name = @data["name"]
|
||||||
|
@checksum = @data["checksum"]
|
||||||
|
@package = @data["package"]
|
||||||
|
@removed_since = @data["removedsince"]
|
||||||
|
end
|
||||||
|
|
||||||
|
def removed?
|
||||||
|
@removed_since
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
class Dependency
|
||||||
|
attr_reader :name
|
||||||
|
|
||||||
|
def initialize(xml)
|
||||||
|
@data = xml
|
||||||
|
|
||||||
|
@name = @data["name"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -10,8 +10,6 @@ class W3DHub
|
|||||||
@release_channel = release_channel
|
@release_channel = release_channel
|
||||||
|
|
||||||
@task_state = :not_started # :not_started, :running, :paused, :halted, :complete, :failed
|
@task_state = :not_started # :not_started, :running, :paused, :halted, :complete, :failed
|
||||||
@task_steps = []
|
|
||||||
@task_step_index = 0
|
|
||||||
|
|
||||||
@application = window.applications.games.find { |g| g.id == app_id }
|
@application = window.applications.games.find { |g| g.id == app_id }
|
||||||
@channel = @application.channels.find { |c| c.name == release_channel }
|
@channel = @application.channels.find { |c| c.name == release_channel }
|
||||||
@@ -31,21 +29,14 @@ class W3DHub
|
|||||||
@task_state = :running
|
@task_state = :running
|
||||||
|
|
||||||
Thread.new do
|
Thread.new do
|
||||||
@task_steps.each_with_index do |step, i|
|
execute_task
|
||||||
break if @task_state == :halted
|
|
||||||
|
|
||||||
@task_step_index = i
|
|
||||||
|
|
||||||
success = step.start
|
|
||||||
|
|
||||||
failure!(step) unless success
|
|
||||||
break unless success
|
|
||||||
end
|
|
||||||
|
|
||||||
@task_state = :complete unless @task_state == :failed
|
@task_state = :complete unless @task_state == :failed
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def execute_task; end
|
||||||
|
|
||||||
# Suspend operation, if possible
|
# Suspend operation, if possible
|
||||||
def pause
|
def pause
|
||||||
@task_state = :paused if pauseable?
|
@task_state = :paused if pauseable?
|
||||||
@@ -76,69 +67,66 @@ class W3DHub
|
|||||||
@task_failure_reason || ""
|
@task_failure_reason || ""
|
||||||
end
|
end
|
||||||
|
|
||||||
def failure!(step)
|
def fail!(reason = "")
|
||||||
@task_state = :failed
|
@task_state = :failed
|
||||||
@task_failure_reason = "Failed to complete: \"#{step.name}\" due to an error: #{step.error}"
|
@task_failure_reason = "Failed: #{reason}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_on_main_thread(block)
|
def run_on_main_thread(block)
|
||||||
window.main_thread_queue << block
|
window.main_thread_queue << block
|
||||||
end
|
end
|
||||||
|
|
||||||
def add_step(name, method, *args)
|
|
||||||
@task_steps << Step.new(name, method, args)
|
|
||||||
end
|
|
||||||
|
|
||||||
def fetch_manifests
|
def fetch_manifests
|
||||||
# Do stuff
|
manifests = []
|
||||||
|
|
||||||
package_fetch("games", app_id, "manifest.xml", @channel.version)
|
if fetch_manifest("games", app_id, "manifest.xml", @channel.current_version)
|
||||||
|
manifest = load_manifest("games", app_id, "manifest.xml", @channel.current_version)
|
||||||
|
manifests << manifest
|
||||||
|
|
||||||
|
until(manifest.full?)
|
||||||
|
fetch_manifest("games", app_id, "manifest.xml", manifest.base_version)
|
||||||
|
manifest = load_manifest("games", app_id, "manifest.xml", manifest.base_version)
|
||||||
|
manifests << manifest
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
manifests
|
||||||
end
|
end
|
||||||
|
|
||||||
def package_fetch(category, subcategory, package, version)
|
def fetch_manifest(category, subcategory, name, version)
|
||||||
|
# Check for and integrity of local manifest
|
||||||
|
if File.exist?(Cache.package_path(category, subcategory, name, version))
|
||||||
|
package = Api.package_details([{ category: category, subcategory: subcategory, name: name, version: version }])
|
||||||
|
verified = verify_package(package, category, subcategory, name, version)
|
||||||
|
|
||||||
|
# download manifest if not valid
|
||||||
|
package_fetch(category, subcategory, name, version) unless verified
|
||||||
|
true if verified
|
||||||
|
else
|
||||||
|
# download manifest if not cached
|
||||||
|
package_fetch(category, subcategory, name, version)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Step
|
def package_fetch(category, subcategory, name, version)
|
||||||
attr_reader :name
|
Api.package(category, subcategory, name, version) do |chunk, remaining_bytes, total_bytes|
|
||||||
|
# Store progress somewhere
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def initialize(name, method, args)
|
def verify_package(package, category, subcategory, name, version)
|
||||||
@name = name
|
digest = Digest::SHA256.new
|
||||||
@method = method
|
File.open(Cache.package_path(category, subcategory, name, version)) do |f|
|
||||||
@args = args
|
while (chunk = f.read(1_000_000))
|
||||||
|
digest.update(chunk)
|
||||||
@step_state = :not_started # :not_started, :running, :paused, :halted, :complete, :failed
|
end
|
||||||
@success = false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def start
|
digest.hexdigest.upcase == package.checksum.upcase
|
||||||
# do work
|
end
|
||||||
# ensure that a boolean value is returned
|
|
||||||
ensure
|
|
||||||
@success
|
|
||||||
end
|
|
||||||
|
|
||||||
def pause
|
def load_manifest(category, subcategory, name, version)
|
||||||
end
|
Manifest.new(category, subcategory, name, version)
|
||||||
|
|
||||||
def stop
|
|
||||||
end
|
|
||||||
|
|
||||||
def status
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
|
|
||||||
def progress
|
|
||||||
0.0
|
|
||||||
end
|
|
||||||
|
|
||||||
def total_work
|
|
||||||
1.0
|
|
||||||
end
|
|
||||||
|
|
||||||
# data to pass on to next step(s)
|
|
||||||
def result
|
|
||||||
nil
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,19 +1,32 @@
|
|||||||
class W3DHub
|
class W3DHub
|
||||||
class ApplicationManager
|
class ApplicationManager
|
||||||
class Installer < Task
|
class Installer < Task
|
||||||
def setup
|
def execute_task
|
||||||
add_step("Fetching manifests...", :fetch_manifests)
|
manifests = fetch_manifests
|
||||||
add_step("Building package list...", :build_package_list)
|
return false if failed?
|
||||||
|
|
||||||
add_step("Downloading packages...", :fetch_packages)
|
packages = build_package_list(manifests)
|
||||||
add_step("Verifying packages...", :verify_packages)
|
return false if failed?
|
||||||
add_step("Unpacking packages...", :unpack_packages)
|
|
||||||
|
|
||||||
add_step("Crushing grapes...", :create_wine_prefix)
|
fetch_packages(packages)
|
||||||
|
return false if failed?
|
||||||
|
|
||||||
add_step("Installing dependencies...", :install_dependencies)
|
verify_packages(packages)
|
||||||
|
return false if failed?
|
||||||
|
|
||||||
add_step("Completed.", :mark_application_installed)
|
unpack_packages(packages)
|
||||||
|
return false if failed?
|
||||||
|
|
||||||
|
create_wine_prefix
|
||||||
|
return false if failed?
|
||||||
|
|
||||||
|
install_dependencies(packages)
|
||||||
|
return false if failed?
|
||||||
|
|
||||||
|
mark_application_installed
|
||||||
|
return false if failed?
|
||||||
|
|
||||||
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
39
lib/cache.rb
39
lib/cache.rb
@@ -6,6 +6,7 @@ class W3DHub
|
|||||||
"#{CACHE_PATH}/#{Digest::SHA2.hexdigest(uri)}.#{ext}"
|
"#{CACHE_PATH}/#{Digest::SHA2.hexdigest(uri)}.#{ext}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Fetch a generic uri
|
||||||
def self.fetch(uri)
|
def self.fetch(uri)
|
||||||
path = path(uri)
|
path = path(uri)
|
||||||
|
|
||||||
@@ -26,7 +27,43 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.fetch_package(*args)
|
def self.create_directories(path)
|
||||||
|
target_directory = File.dirname(path)
|
||||||
|
|
||||||
|
FileUtils.mkdir_p(target_directory) unless Dir.exist?(target_directory)
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.package_path(category, subcategory, name, version)
|
||||||
|
package_cache_dir = $window.settings[:package_cache_dir]
|
||||||
|
|
||||||
|
"#{package_cache_dir}/#{category}/#{subcategory}/#{version}/#{name}.package"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Download a W3D Hub package
|
||||||
|
def self.fetch_package(socket, category, subcategory, name, version, block)
|
||||||
|
path = package_path(category, subcategory, name, version)
|
||||||
|
|
||||||
|
create_directories(path)
|
||||||
|
|
||||||
|
file = File.open(path, "wb")
|
||||||
|
|
||||||
|
streamer = lambda do |chunk, remaining_bytes, total_bytes|
|
||||||
|
file.write(chunk)
|
||||||
|
|
||||||
|
block.call(chunk, remaining_bytes, total_bytes)
|
||||||
|
# puts "Remaining: #{remaining_bytes.to_f / total_bytes}%"
|
||||||
|
end
|
||||||
|
|
||||||
|
response = socket.post(
|
||||||
|
path: "apis/launcher/1/get-package",
|
||||||
|
headers: Api::DEFAULT_HEADERS.merge({"Content-Type": "application/x-www-form-urlencoded"}),
|
||||||
|
body: "data=#{JSON.dump({ category: category, subcategory: subcategory, name: name, version: version })}",
|
||||||
|
response_block: streamer
|
||||||
|
)
|
||||||
|
|
||||||
|
file.close
|
||||||
|
|
||||||
|
response.status == 200
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ class W3DHub
|
|||||||
# Configure
|
# Configure
|
||||||
# Disable install
|
# Disable install
|
||||||
# Enable Uninstall
|
# Enable Uninstall
|
||||||
|
|
||||||
get
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -60,10 +60,10 @@ class W3DHub
|
|||||||
flow(width: 1.0, height: 0.03) do
|
flow(width: 1.0, height: 0.03) do
|
||||||
# background 0xff_444411
|
# background 0xff_444411
|
||||||
|
|
||||||
puts "Generating..."
|
|
||||||
|
|
||||||
inscription "Channel"
|
inscription "Channel"
|
||||||
list_box items: game.channels.map { |c| c.name }, selected: channel, enabled: game.channels.count > 1, width: 128, padding_left: 4, padding_top: 2, padding_right: 4, padding_bottom: 2, text_size: 16 do |value|
|
list_box(items: game.channels.map { |c| c.name }, choose: channel.name, enabled: game.channels.count > 1,
|
||||||
|
margin_top: 0, margin_bottom: 0,
|
||||||
|
width: 128, padding_left: 1, padding_top: 1, padding_right: 1, padding_bottom: 1, text_size: 14) do |value|
|
||||||
populate_game_page(game, game.channels.find{ |c| c.name == value })
|
populate_game_page(game, game.channels.find{ |c| c.name == value })
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class W3DHub
|
|||||||
account = Api.user_login(@username.value, @password.value)
|
account = Api.user_login(@username.value, @password.value)
|
||||||
|
|
||||||
if account
|
if account
|
||||||
@host.account = account
|
window.account = account
|
||||||
window.settings[:account][:refresh_token] = account.refresh_token
|
window.settings[:account][:refresh_token] = account.refresh_token
|
||||||
window.settings.save_settings
|
window.settings.save_settings
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if @host.account
|
if window.account
|
||||||
populate_account_info
|
populate_account_info
|
||||||
page(W3DHub::Pages::Games)
|
page(W3DHub::Pages::Games)
|
||||||
end
|
end
|
||||||
@@ -77,17 +77,17 @@ class W3DHub
|
|||||||
@host.instance_variable_get(:"@account_container").clear do
|
@host.instance_variable_get(:"@account_container").clear do
|
||||||
stack(width: 0.7, height: 1.0) do
|
stack(width: 0.7, height: 1.0) do
|
||||||
# background 0xff_222222
|
# background 0xff_222222
|
||||||
tagline "<b>#{@host.account.username}</b>"
|
tagline "<b>#{window.account.username}</b>"
|
||||||
|
|
||||||
flow(width: 1.0) do
|
flow(width: 1.0) do
|
||||||
link("Logout", text_size: 16) { depopulate_account_info }
|
link("Logout", text_size: 16) { depopulate_account_info }
|
||||||
link "Profile", text_size: 16 do
|
link "Profile", text_size: 16 do
|
||||||
Launchy.open("https://secure.w3dhub.com/forum/index.php?showuser=#{@host.account.id}")
|
Launchy.open("https://secure.w3dhub.com/forum/index.php?showuser=#{window.account.id}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
image Cache.path(@host.account.avatar_uri), height: 1.0
|
image Cache.path(window.account.avatar_uri), height: 1.0
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
|
|
||||||
stack(width: 1.0, height: 0.25) do
|
stack(width: 1.0, height: 0.25) do
|
||||||
button "<b>Join Server</b>", enabled: window.application_manager.installed?(server.game)
|
button "<b>Join Server</b>", enabled: window.application_manager.installed?(server.game, window.applications.games.find { |g| g.id == server.game }.channels.first)
|
||||||
end
|
end
|
||||||
|
|
||||||
stack(width: 1.0, height: 0.55, margin_top: 16) do
|
stack(width: 1.0, height: 0.55, margin_top: 16) do
|
||||||
|
|||||||
@@ -80,36 +80,45 @@ class W3DHub
|
|||||||
@app_info_container = flow(width: 1.0, height: 0.65) do
|
@app_info_container = flow(width: 1.0, height: 0.65) do
|
||||||
# background 0xff_8855ff
|
# background 0xff_8855ff
|
||||||
|
|
||||||
stack(width: 0.6749, height: 1.0) do
|
stack(width: 0.75, height: 1.0) do
|
||||||
title "<b>W3D Hub Launcher</b>", height: 0.5
|
title "<b>W3D Hub Launcher</b>", height: 0.5
|
||||||
flow(width: 1.0, height: 0.5) do
|
flow(width: 1.0, height: 0.5) do
|
||||||
button(
|
flow(width: 0.18, height: 1.0) do
|
||||||
get_image("#{GAME_ROOT_PATH}/media/ui_icons/gear.png"),
|
button(
|
||||||
tip: "W3D Hub Launcher Settings",
|
get_image("#{GAME_ROOT_PATH}/media/ui_icons/gear.png"),
|
||||||
image_height: 1.0,
|
tip: "W3D Hub Launcher Settings",
|
||||||
padding_left: 4,
|
image_height: 1.0,
|
||||||
padding_top: 4,
|
padding_left: 4,
|
||||||
padding_right: 4,
|
padding_top: 4,
|
||||||
padding_bottom: 4,
|
padding_right: 4,
|
||||||
margin_left: 32
|
padding_bottom: 4,
|
||||||
) do
|
margin_left: 32
|
||||||
page(W3DHub::Pages::Settings)
|
) do
|
||||||
|
page(W3DHub::Pages::Settings)
|
||||||
|
end
|
||||||
|
|
||||||
|
button(
|
||||||
|
get_image("#{GAME_ROOT_PATH}/media/ui_icons/import.png"),
|
||||||
|
tip: "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
|
end
|
||||||
|
|
||||||
button(
|
stack(width: 0.77, height: 1.0, margin_left: 16) do
|
||||||
get_image("#{GAME_ROOT_PATH}/media/ui_icons/import.png"),
|
flow(width: 1.0, height: 0.65) do
|
||||||
tip: "Download Manager",
|
inscription "Downloading Expansive Civilian Warfare...", width: 0.7, text_wrap: :none
|
||||||
image_height: 1.0,
|
inscription "460.2 MB / 254.5 GB", width: 0.3, text_align: :right, text_wrap: :none
|
||||||
padding_left: 4,
|
end
|
||||||
padding_top: 4,
|
|
||||||
padding_right: 4,
|
|
||||||
padding_bottom: 4,
|
|
||||||
margin_left: 4
|
|
||||||
) do
|
|
||||||
page(W3DHub::Pages::DownloadManager)
|
|
||||||
end
|
|
||||||
|
|
||||||
inscription "Version #{W3DHub::VERSION}", margin_left: 16
|
progress fraction: 0.4, height: 2, width: 1.0, fraction_background: 0xff_00acff, border_thickness: 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -126,39 +135,6 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
flow(width: 0.075, height: 1.0) do
|
|
||||||
button(
|
|
||||||
get_image("#{GAME_ROOT_PATH}/media/ui_icons/minus.png"),
|
|
||||||
image_width: 16,
|
|
||||||
padding_left: 4,
|
|
||||||
padding_top: 4,
|
|
||||||
padding_right: 4,
|
|
||||||
padding_bottom: 4,
|
|
||||||
margin_left: 4
|
|
||||||
) do
|
|
||||||
# window.minimize
|
|
||||||
end
|
|
||||||
|
|
||||||
button(
|
|
||||||
get_image("#{GAME_ROOT_PATH}/media/ui_icons/cross.png"),
|
|
||||||
image_width: 16,
|
|
||||||
padding_left: 4,
|
|
||||||
padding_top: 4,
|
|
||||||
padding_right: 4,
|
|
||||||
padding_bottom: 4,
|
|
||||||
margin_left: 4,
|
|
||||||
background: 0xff_800000,
|
|
||||||
hover: {
|
|
||||||
background: 0xff_a00000
|
|
||||||
},
|
|
||||||
active: {
|
|
||||||
background: 0xff_600000
|
|
||||||
}
|
|
||||||
) do
|
|
||||||
window.close
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@navigation_container = flow(width: 1.0, height: 0.35) do
|
@navigation_container = flow(width: 1.0, height: 0.35) do
|
||||||
@@ -191,7 +167,7 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if @account
|
if window.account
|
||||||
page(W3DHub::Pages::Login)
|
page(W3DHub::Pages::Login)
|
||||||
else
|
else
|
||||||
page(W3DHub::Pages::Games)
|
page(W3DHub::Pages::Games)
|
||||||
|
|||||||
@@ -19,11 +19,5 @@ class W3DHub
|
|||||||
|
|
||||||
super if @application_manager.idle?
|
super if @application_manager.idle?
|
||||||
end
|
end
|
||||||
|
|
||||||
def button_down(id)
|
|
||||||
super
|
|
||||||
|
|
||||||
self.borderless = !self.borderless? if id == Gosu::KB_F7
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -6,7 +6,9 @@ rescue LoadError => e
|
|||||||
|
|
||||||
require "cyberarm_engine"
|
require "cyberarm_engine"
|
||||||
end
|
end
|
||||||
|
require "fileutils"
|
||||||
require "digest"
|
require "digest"
|
||||||
|
require "rexml"
|
||||||
require "zlib"
|
require "zlib"
|
||||||
require "launchy"
|
require "launchy"
|
||||||
|
|
||||||
@@ -24,6 +26,7 @@ require_relative "lib/window"
|
|||||||
require_relative "lib/cache"
|
require_relative "lib/cache"
|
||||||
require_relative "lib/settings"
|
require_relative "lib/settings"
|
||||||
require_relative "lib/application_manager"
|
require_relative "lib/application_manager"
|
||||||
|
require_relative "lib/application_manager/manifest"
|
||||||
require_relative "lib/application_manager/task"
|
require_relative "lib/application_manager/task"
|
||||||
require_relative "lib/application_manager/tasks/installer"
|
require_relative "lib/application_manager/tasks/installer"
|
||||||
require_relative "lib/application_manager/tasks/uninstaller"
|
require_relative "lib/application_manager/tasks/uninstaller"
|
||||||
@@ -38,6 +41,7 @@ require_relative "lib/api/applications"
|
|||||||
require_relative "lib/api/news"
|
require_relative "lib/api/news"
|
||||||
require_relative "lib/api/server_list_server"
|
require_relative "lib/api/server_list_server"
|
||||||
require_relative "lib/api/account"
|
require_relative "lib/api/account"
|
||||||
|
require_relative "lib/api/package"
|
||||||
|
|
||||||
require_relative "lib/page"
|
require_relative "lib/page"
|
||||||
require_relative "lib/pages/games"
|
require_relative "lib/pages/games"
|
||||||
|
|||||||
Reference in New Issue
Block a user