Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
Fixed preset autoloading.
Browse files Browse the repository at this point in the history
  • Loading branch information
JT8D-17 committed Jul 3, 2021
1 parent f5bfe2d commit fa31815
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Modules/EC_Controller/Lua/ECC_Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,12 @@ function ECC_PresetFileRead(filename)
end
--[[ Preset load handler ]]
function ECC_LoadPresetVals(filename)
ECC_Log_Write("ECC PRESET: Started loading values from file")
ECC_Log_Write("ECC PRESET: Started loading values from "..filename)
ECC_PresetFileRead(filename) -- Read preset file
ECC_AccessDref(ECC_DatarefTable,"write") -- Write values to datarefs
ECC_SubPageBuilder() -- Build subpage indexes
ECC_Cld_Subpage = #ECC_SubPageAssignments -- Limit page selection to avoid landing on a blank page
ECC_Log_Write("ECC PRESET: Finished loading values from file")
ECC_Log_Write("ECC PRESET: Finished loading values from "..filename)
end
--[[
Expand All @@ -282,7 +282,7 @@ function ECC_ModuleInit_Main()
if #PresetList >= 1 then ECC_PresetLastSelected = PresetList[1] end
if ECC_SettingsValGet("AutoLoad") == 1 then
ECC_LastPresetFileRead()
if ECC_PresetLastSelected ~= PresetList[1] then ECC_LoadPresetVals(ECC_PresetLastSelected) ECC_Log_Write("ECC PRESET: Triggered loading values from file") end
if ECC_PresetLastSelected ~= PresetList[1] then ECC_LoadPresetVals(ECC_PresetLastSelected..".cfg") ECC_Log_Write("ECC PRESET: Triggered loading values from "..ECC_PresetLastSelected..".cfg") end
end
end
end
Expand Down

0 comments on commit fa31815

Please sign in to comment.