mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 17:22:35 +00:00
Fix handling of extended-data in offline mode
This commit is contained in:
@@ -35,10 +35,11 @@ class W3DHub
|
|||||||
|
|
||||||
color = @data[:"extended-data"].find { |h| h[:name] == "colour" }[:value].sub("#", "")
|
color = @data[:"extended-data"].find { |h| h[:name] == "colour" }[:value].sub("#", "")
|
||||||
|
|
||||||
|
color = color.sub("ff", "") if color.length == 8
|
||||||
@color = "ff#{color}".to_i(16)
|
@color = "ff#{color}".to_i(16)
|
||||||
|
|
||||||
cfg = @data[:"extended-data"].find { |h| h[:name] == "usesEngineCfg" }
|
cfg = @data[:"extended-data"].find { |h| h[:name] == "usesEngineCfg" }
|
||||||
@uses_engine_cfg = (cfg && cfg[:value].downcase.strip == "true") == true # explicit truthy compare to prevent return `nil`
|
@uses_engine_cfg = (cfg && cfg[:value].to_s.downcase.strip == "true") == true # explicit truthy compare to prevent return `nil`
|
||||||
end
|
end
|
||||||
|
|
||||||
def uses_engine_cfg?
|
def uses_engine_cfg?
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class W3DHub
|
|||||||
application = Store.applications.games.find { |g| g.id == key.to_s.split("_", 2).first }
|
application = Store.applications.games.find { |g| g.id == key.to_s.split("_", 2).first }
|
||||||
next unless application
|
next unless application
|
||||||
|
|
||||||
game[:colour] = application.color
|
game[:colour] = "##{application.color.to_s(16)}"
|
||||||
game[:uses_engine_cfg] = application.uses_engine_cfg?
|
game[:uses_engine_cfg] = application.uses_engine_cfg?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user