mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Enabled updater, TODO: make updater do less work than installer
This commit is contained in:
@@ -26,6 +26,16 @@ class W3DHub
|
|||||||
@tasks.push(installer)
|
@tasks.push(installer)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update(app_id, channel)
|
||||||
|
puts "Update Request: #{app_id}-#{channel}"
|
||||||
|
|
||||||
|
return false unless installed?(app_id, channel)
|
||||||
|
|
||||||
|
updater = Updater.new(app_id, channel)
|
||||||
|
|
||||||
|
@tasks.push(updater)
|
||||||
|
end
|
||||||
|
|
||||||
def import(app_id, channel, path)
|
def import(app_id, channel, path)
|
||||||
puts "Import Request: #{app_id}-#{channel} -> #{path}"
|
puts "Import Request: #{app_id}-#{channel} -> #{path}"
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,9 @@
|
|||||||
class W3DHub
|
class W3DHub
|
||||||
class ApplicationManager
|
class ApplicationManager
|
||||||
class Updater < Task
|
class Updater < Installer
|
||||||
def type
|
def type
|
||||||
:updater
|
:updater
|
||||||
end
|
end
|
||||||
|
|
||||||
def exec_task
|
|
||||||
# Fetch manifests
|
|
||||||
# Load manifests
|
|
||||||
# build file list
|
|
||||||
# find new packages
|
|
||||||
# unpack new packages
|
|
||||||
# TODO: detect patch files and handle them
|
|
||||||
# update installed game version
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -79,14 +79,6 @@ class W3DHub
|
|||||||
stack(width: 0.25, height: 1.0, padding: 8) do
|
stack(width: 0.25, height: 1.0, padding: 8) do
|
||||||
# background 0xff_550055
|
# background 0xff_550055
|
||||||
|
|
||||||
# TODO: Show links for managing game install
|
|
||||||
# game.menu_items.each do |item|
|
|
||||||
# flow(width: 1.0, height: 22, margin_bottom: 8) do
|
|
||||||
# image item.image, width: 0.11
|
|
||||||
# link item.label, text_size: 18
|
|
||||||
# end
|
|
||||||
# end
|
|
||||||
|
|
||||||
if Store.application_manager.installed?(game.id, channel.id)
|
if Store.application_manager.installed?(game.id, channel.id)
|
||||||
Hash.new.tap { |hash|
|
Hash.new.tap { |hash|
|
||||||
hash[I18n.t(:"games.game_settings")] = { icon: "gear", block: proc { Store.application_manager.settings(game.id, channel.id) } }
|
hash[I18n.t(:"games.game_settings")] = { icon: "gear", block: proc { Store.application_manager.settings(game.id, channel.id) } }
|
||||||
@@ -132,7 +124,7 @@ class W3DHub
|
|||||||
if Store.application_manager.installed?(game.id, channel.id)
|
if Store.application_manager.installed?(game.id, channel.id)
|
||||||
if Store.application_manager.updateable?(game.id, channel.id)
|
if Store.application_manager.updateable?(game.id, channel.id)
|
||||||
button "<b>#{I18n.t(:"interface.update_now")}</b>", margin_left: 24, background: 0xff_ffac00 do
|
button "<b>#{I18n.t(:"interface.update_now")}</b>", margin_left: 24, background: 0xff_ffac00 do
|
||||||
# Store.application_manager.update(game.id, channel.id)
|
Store.application_manager.update(game.id, channel.id)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
button "<b>#{I18n.t(:"interface.play_now")}</b>", margin_left: 24 do
|
button "<b>#{I18n.t(:"interface.play_now")}</b>", margin_left: 24 do
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ require_relative "lib/application_manager/manifest"
|
|||||||
require_relative "lib/application_manager/status"
|
require_relative "lib/application_manager/status"
|
||||||
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/updater"
|
||||||
require_relative "lib/application_manager/tasks/uninstaller"
|
require_relative "lib/application_manager/tasks/uninstaller"
|
||||||
require_relative "lib/application_manager/tasks/repairer"
|
require_relative "lib/application_manager/tasks/repairer"
|
||||||
require_relative "lib/application_manager/tasks/importer"
|
require_relative "lib/application_manager/tasks/importer"
|
||||||
|
|||||||
Reference in New Issue
Block a user