Skip to content

Commit

Permalink
Update graphics properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Beherith committed Feb 1, 2025
1 parent 97385d8 commit 2971339
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions LuaMenu/widgets/api_analytics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -617,15 +617,20 @@ local function IsTesselationShaderSupported()
end

local function SendGraphicsSettings()
for i = 1, #settings do
local value = Spring.GetConfigInt(settings[i], -1)
Analytics.SendOnetimeEvent("settings:" .. settings[i], value)
local settingsTable = {}
for i, settingkey in ipairs(settings) do
settingsTable[settingkey] = Spring.GetConfigInt(settingkey, -1)
end
-- Convert it to json:
local settingsJson = Spring.Utilities.json.encode(settingsTable)
-- check if it matches the previously uploaded client property:

Analytics.SendOnetimeEvent("graphics:settings", settingsJson)
end

function widget:ActivateGame()
-- Give time for the settings that the player will use to be applied properly.
WG.Delay(SendGraphicsSettings, 30)
WG.Delay(SendGraphicsSettings, 60)
end

--------------------------------------------------------------------------------
Expand Down Expand Up @@ -718,8 +723,6 @@ function DelayedInitialize()
WG.Delay(LateHWInfo,15)
WG.Delay(GetInfologs,17)
WG.Delay(GetDesyncGameStates, 25)


end

--------------------------------------------------------------------------------
Expand Down

0 comments on commit 2971339

Please sign in to comment.