From 7e53835f3b9b5153fe3a81788810feadde9ac61d Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Tue, 10 Jan 2012 13:29:10 -0600 Subject: [PATCH] add ForceSave to ThemePrefs; will save the file even if it says it doesn't need saving. this is critical to actually getting the theme preferences to be created without having to make changes first. --- Themes/_fallback/Scripts/02 ThemePrefs.lua | 7 +++++++ Themes/default/BGAnimations/ScreenTitleMenu underlay.lua | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Themes/_fallback/Scripts/02 ThemePrefs.lua b/Themes/_fallback/Scripts/02 ThemePrefs.lua index 58236a2361..81e548335f 100644 --- a/Themes/_fallback/Scripts/02 ThemePrefs.lua +++ b/Themes/_fallback/Scripts/02 ThemePrefs.lua @@ -120,6 +120,13 @@ ThemePrefs = IniFile.WriteFile( ThemePrefsPath, PrefsTable ) end, + -- for when you absolutely have to save, no matter what NeedsSaved says. + ForceSave = function() + if not IniFile then return false end + NeedsSaved = false + IniFile.WriteFile( ThemePrefsPath, PrefsTable ) + end, + Get = function( name ) Trace( ("ThemePrefs.Get(%s)"):format(name) ) local tbl = ResolveTable(name) diff --git a/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua b/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua index c85a1039e5..f7a82ba2a7 100644 --- a/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua +++ b/Themes/default/BGAnimations/ScreenTitleMenu underlay.lua @@ -1,9 +1,7 @@ InitUserPrefs(); local t = Def.ActorFrame { - BeginCommand=function(self) - ThemePrefs.Save() - end; + BeginCommand=function(self) ThemePrefs.ForceSave() end; }; t[#t+1] = StandardDecorationFromFileOptional("Logo","Logo");