View Single Post
11-02-10, 07:48 AM   #11
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
GMoveableFrames and addon.settings.blahblah are BOTH saved variables in the toc file. The addon.settings.blahblah's are defined all through out the addon that is the general settings variable data.

addon.settings.blahblah stands for GrimUISettings in the toc file.
your getting lost in the rest of the code... there is only two parts important to what is going on here...

forget about the addon.settings variables they work just fine. its the GMoveableFrames and the moveableframes are the two things that are not working proper. moveableframes represents a table, and GMoveableFrames is supposed to represent your saved vars. On load the saved vars from GMoveableFrames should be loaded to table moveableframes. then on logout it should dump the table to the saved variables again to save any frames added or removed. I have tried doing this as just saved variables and ditching the table but i get the same result. no mater how i go about working this the max number of table entrys i can get to dump to the savedvariable is 8. even if i ditch ALL the code and just put GMoveableFrames = {list of entrys more then 8} it still only puts 8 of them in the saved var file.

this little chunk
Code:
function addon:DefaultMoveableFrames()
GMoveableFrames = {
	['MiniMapLFGFrame'] = false,
	['MiniMapBattlefieldFrame'] = false,
	['ShardBarFrame'] = false,
	['BNToastFrame'] = false,
	['RuneFrame'] = false,
	['SpellBookFrame'] = false,
	['QuestLogFrame'] = false,
	['FriendsFrame'] = false,
	['LFGParentFrame'] = false,
	['KnowledgeBaseFrame'] = true,
	['MerchantFrame'] = false,
	['MailFrame'] = false,
	['DressUpFrame'] = false,
	['TaxiFrame'] = false,
	['QuestLogFrame'] = false,
	['PaperDollFrame'] = true,
	['PVPFrame'] = false,
	['WatchFrameHeader'] = true,
	['VehicleMenuBar'] = false,
	['InspectFrame'] = false,
	['PlayerTalentFrame'] = false,
	['AchievementFrame'] = false,
	['AchievementFrameHeader'] = true,
	['AchievementFrameCategoriesContainer'] = 'AchievementFrame',
	['GlyphFrame'] = 'PlayerTalentFrame',
	['CalendarFrame'] = false,
	['GrimUIPlayerFrame'] = false,
	['GrimUIPartyFrame1'] = false,
	['GrimUIPartyFrame2'] = false,
	['GrimUIPartyFrame3'] = false,
	['GrimUIPartyFrame4'] = false,
	['GrimExpBar'] = false,
	['GrimRepBar'] = false,
	['GDevBar'] = false,
}


for id = 1, NUM_CONTAINER_FRAMES do
	GMoveableFrames['ContainerFrame' .. id] = false
end

end

addon:DefaultMoveableFrames()
and this chunk

Code:
--[[-----------------------------------------------------------------------------
Initialize
-------------------------------------------------------------------------------]]
local moveableframes = {}
addon.RegisterEvent("MoveFrames-Initialize", 'PLAYER_LOGIN', function(self, event)
	addon.UnregisterEvent(self, event)

	movedFrames = addon.settings.movedFrames
	if type(movedFrames) ~= 'table' then
		movedFrames = { }
		addon.settings.movedFrames = movedFrames
	end
	addon:RegisterDefaultSetting("movedFrames", true)										-- Prevent it from being removed on PLAYER_LOGOUT
	

	local function HookFrames(self, event)
	moveableframes = GMoveableFrames
	if type(moveableframes) ~= 'table' then
		moveableframes = { }
		GMoveableFrames = moveableframes
	end
		
		for name, parent in pairs(moveableframes) do
			if HookFrame(name, parent) then
				moveableframes[name] = nil
			end
		end
		if next(moveableframes) then return end
		addon.UnregisterEvent(self, event)
	end

	addon.RegisterEvent("MoveFrames-Hook", 'ADDON_LOADED', HookFrames)
	HookFrames("MoveFrames-Hook", 'ADDON_LOADED')
	
end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 11-02-10 at 08:07 AM.
  Reply With Quote