/ game settings dialog not setting skin setting until opened

This commit is contained in:
FajsiEx 2021-08-26 19:35:45 +02:00
parent 976edebe03
commit 201c920537
1 changed files with 15 additions and 6 deletions

View File

@ -63,12 +63,20 @@ local prevSettingStroke = {x=0, y=0}
local settingStroke = {x=0, y=0}
local prevVis = false
function processSkinSettings(settingName, settingValue)
if (settingName == 'Gauge') then
game.SetSkinSetting('_gaugeType', settingValue);
end
if (settingName == 'Backup Gauge') then
game.SetSkinSetting('_gaugeARS', settingValue and 1 or 0);
function processSkinSettings()
for ti, tab in ipairs(SettingsDiag.tabs) do
for si, setting in ipairs(tab.settings) do
if (tab.name == 'Game') then
if (setting.name == 'Gauge') then
game.SetSkinSetting('_gaugeType', setting.value);
end
if (setting.name == 'Backup Gauge') then
game.SetSkinSetting('_gaugeARS', setting.value and 1 or 0);
end
end
end
end
end
@ -78,6 +86,7 @@ function render(deltaTime, visible)
elseif not visible and prevVis then
yScale:restart(1, 0, 0.25)
end
processSkinSettings()
if not visible and yScale:tick(0) < 0.05 then return end