LS: Glass

LS: Glass

57.5k Downloads

Options not sticking

glassleo opened this issue ยท 9 comments

commented

This addon is amazing, but I can't get any of my options to stick at all. Every time I reload they reset to default values.

I can see the options have written correctly to the SV but once you open the options panel everything resets.

commented

Hmmm, I just tested it on beta, ptr, and retail, and I couldn't reproduce it.

["profiles"] = {
	["Default"] = {
		["version"] = 10000004,
		["font"] = "Noto Sans SemiCondensedSemiBold",
	},
	["testing 13"] = {
		["font"] = "Arial Narrow",
		["version"] = 10000004,
		["chat"] = {
			["x_padding"] = 20,
			["font"] = {
				["outline"] = true,
				["shadow"] = false,
				["size"] = 13,
			},
			["y_padding"] = 10,
			["tooltips"] = false,
		},
	},
},

I did what you said you're doing, and both profiles worked just fine after a bunch of /reloads, /lsgs, and profile switching. Are you sure it's not some issue with writing access on files in the WTF folder?

commented

Just now I did the following:

  1. /lsglass and set font size to 16
  2. /reload

After this my ls_Glass.lua file in SavedVariables looks like this, so it has clearly been able to write to disk:

LS_GLASS_GLOBAL_CONFIG = {
	["profileKeys"] = {
		["Gruff - Moonglade"] = "Default",
	},
	["profiles"] = {
		["Default"] = {
			["chat"] = {
				["font"] = {
					["size"] = 16,
				},
			},
			["version"] = 10000004,
		},
	},
}
  1. Type /lsglass in-game, and now font size is set to 12 again (which is default)

I think the entire LS_GLASS_GLOBAL_CONFIG variable is just being overwritten by the default settings on load for some reason.

I am running Prat as well (which is also attempting to set font size, although LS: Glass's setting are the ones that seem to apply), maybe there is some conflict there. I don't see how that would erase the entire SV variable though.

commented

I did what you said you're doing, and both profiles worked just fine after a bunch of /reloads, /lsgs, and profile switching. Are you sure it's not some issue with writing access on files in the WTF folder?

That's what I thought first too but it was writing to my SavedVariables properly. It's just that every time I relogged or reloaded and opened the options with /lsglass it would reset to default settings (Font, Font Size, Edit Box Font Size, Fade Out Delay).

commented

Type /lsglass in-game, and now font size is set to 12 again (which is default

Did all that again, but this is not the case for me, all settings load just fine. Hmm, did you try deleting ls_Glasss.lua and ls_Glass.bak from the SavedVariables folder? Also, change this block like so

if not DisplayTableInspectorWindow then
	LoadAddOn("Blizzard_DebugTools")
end

if LS_GLASS_GLOBAL_CONFIG then
	if LS_GLASS_GLOBAL_CONFIG.profiles then
		for profile, data in next, LS_GLASS_GLOBAL_CONFIG.profiles do
			self:Modernize(data, profile, "profile")
		end

		print("dumping LS_GLASS_GLOBAL_CONFIG")
		DevTools_Dump(LS_GLASS_GLOBAL_CONFIG)
	end
else
	print("it's not here?")
end

C.db = LibStub("AceDB-3.0"):New("LS_GLASS_GLOBAL_CONFIG", D, true)
C.db:RegisterCallback("OnProfileChanged", updateCallback)
C.db:RegisterCallback("OnProfileCopied", updateCallback)
C.db:RegisterCallback("OnProfileReset", updateCallback)
C.db:RegisterCallback("OnProfileShutdown", shutdownCallback)
C.db:RegisterCallback("OnDatabaseShutdown", shutdownCallback)

print("dumping LS_GLASS_GLOBAL_CONFIG again")
DevTools_Dump(LS_GLASS_GLOBAL_CONFIG)

I don't see how that would erase the entire SV variable though.

I'll also ask around, but iirc, I heard that some people experienced issues with SVs not saving/loading properly...

-- edit

Also, how does it work without prat? Technically, they aren't compatible, like, there's no effort on my end to make them compatible.

commented

So far I got this from other addon devs

Eltreum โ€” Today at 12:16
i've had this issue reported multiple times, and everytime it was bc the WTF folder (or a file there) was set to read only
idk whats causing the files to become read only for some but not others
i assume its some kind of addon backup setting or maybe even another software backing up files
could be because they installed in program files (no idea where they had installed) where its possible external softwares are backing up/syncing files

commented

If it was a read only issue then the addon wouldn't save any data, right? The addon settings save to file just fine. I also tried deleting the files, and I've triple checked nothing is read only in my SV folder.

The variables are just not loaded for me and is being overwritten by defaults every time.

Either way, I guess it could be some weird me issue. All my other addons save and load fine. I've edited the default profile as a workaround for now.

commented

This file/folder attribute stuff can be pretty damn weird... And I'm not sure how to quickly test ior fix it ๐Ÿ˜ญ It's def not the addon doing it because it works just fine for most people, including myself ๐Ÿ˜ฅ

commented

Ok, after deleting the files and restarting the game a fourth time it's randomly working. I guess you can close this.

I've had similar issues with read-only being flagged by the game randomly but those times it has always been issues with saving, not loading.

Sorry to have wasted your time!

commented

๐Ÿฅณ๐ŸŽ‰