Store game colour and uses_engine_cfg to settings config, use wwconfig when game doesn't use engine.cfg

This commit is contained in:
2024-03-04 18:17:32 -06:00
parent 655fc14557
commit 5c806852a5
4 changed files with 34 additions and 7 deletions

View File

@@ -36,6 +36,13 @@ class W3DHub
color = @data[:"extended-data"].find { |h| h[:name] == "colour" }[:value].sub("#", "")
@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`
end
def uses_engine_cfg?
@uses_engine_cfg
end
class Channel