mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 01:02:34 +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 = color.sub("ff", "") if color.length == 8
|
||||
@color = "ff#{color}".to_i(16)
|
||||
|
||||
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
|
||||
|
||||
def uses_engine_cfg?
|
||||
|
||||
@@ -65,7 +65,7 @@ class W3DHub
|
||||
application = Store.applications.games.find { |g| g.id == key.to_s.split("_", 2).first }
|
||||
next unless application
|
||||
|
||||
game[:colour] = application.color
|
||||
game[:colour] = "##{application.color.to_s(16)}"
|
||||
game[:uses_engine_cfg] = application.uses_engine_cfg?
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user