Vanas KoS

24 - Save warnFrame to db

What is the enhancement in mind? How should it look and feel?
Just save warnFrame points to the db please, I have different sets of addons disable/enable depending on the user's needs, like doing a dungeon, load little wigs, big wigs, recount, disable vanaskos, capping, etc.

Please provide any additional information below.

Added setpoint() check for db options, if nil set it to center
Added db values for getpoint to OnDragStop

if VanasKoSWarnFrame.db.profile.WARN_FRAME_POINT then
		warnFrame:SetPoint(VanasKoSWarnFrame.db.profile.WARN_FRAME_POINT, 
		nill, 
		VanasKoSWarnFrame.db.profile.WARN_FRAME_ANCHOR, 
		VanasKoSWarnFrame.db.profile.WARN_FRAME_XOFF, 
		VanasKoSWarnFrame.db.profile.WARN_FRAME_YOFF)
	else
		warnFrame:SetPoint("CENTER");	
	end
	
	warnFrame:SetToplevel(true);
	warnFrame:SetMovable(true);
	warnFrame:SetFrameStrata("LOW");
	if(VanasKoSWarnFrame.db.profile.WarnFrameBorder) then
		VanasKoS_WarnFrame:SetBackdrop( {
			bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
			edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 16, edgeSize = 16,
					insets = { left = 5, right = 4, top = 5, bottom = 5 },
		});
		warnFrame:EnableMouse(true);
	else
		VanasKoS_WarnFrame:SetBackdrop({bgfile = nil, edgeFile = nil});
		warnFrame:EnableMouse(false);
	end
	-- set the default backdrop color
	local r, g, b, a = GetColor("DefaultBGColor");
	warnFrame:SetBackdropColor(r, g, b, a);

	-- allow dragging or the window
	warnFrame:RegisterForDrag("LeftButton");
	warnFrame:SetScript("OnDragStart",
							function()
								if(VanasKoSWarnFrame.db.profile.Locked) then
									return;
								end
								warnFrame:StartMoving();
							end);
	warnFrame:SetScript("OnDragStop",
							function()
								warnFrame:StopMovingOrSizing();
								local point, _, anchor, xOff, yOff = warnFrame:GetPoint()
								VanasKoSWarnFrame.db.profile.WARN_FRAME_POINT = point
								VanasKoSWarnFrame.db.profile.WARN_FRAME_ANCHOR = anchor
								VanasKoSWarnFrame.db.profile.WARN_FRAME_XOFF = xOff
								VanasKoSWarnFrame.db.profile.WARN_FRAME_YOFF = yOff
							end);

Thanks in advance if you add this :)

User When Change
fyrye Tue, 01 Sep 2009 05:52:16 Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Reported on
01 Sep 2009
Status
New - Issue has not had initial review yet.
Type
Enhancement - A change which is intended to better the project in some way
Priority
Medium - Normal priority.

Reported by

Possible assignees

  • Avatar of Vana
    • Manager
    • Author
    • Maintainer

  • Avatar of xilcoy
    • Author
    • Maintainer