Ok below is the code i am trying to save the location of and for the life of me cannot get it to work I get no errors and the dam thing keeps saving to layout-local.txt. All my other options save fine i just cannot get the location of this frame to save in the saved variables.
Code:
local RTMainFrame = CreateFrame("Frame", "RTMainFrame", UIParent)
RTMainFrame:RegisterEvent("ADDON_LOADED")
RTMainFrame:SetScript("OnEvent", function(self, event, addon)
if addon == "NuttyRecruit" then
RTMainFrame.BackDrop = {bgFile = "Interface\\TutorialFrame\\TutorialFrameBackground",
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
insets = {
left = 4,
right = 4,
top = 4,
bottom = 4
}
}
RTMainFrame:SetBackdrop(RTMainFrame.BackDrop)
RTMainFrame:SetBackdropColor(0, 0, 0, 1)
RTMainFrame:SetHeight(216)
RTMainFrame:SetWidth(180)
NuttyRecruit.db.profile.rtframe.posistion = NuttyRecruit.db.profile.rtframe.posistion or {p="CENTER",r="CENTER",x=0,y=0}
RTMainFrame:SetPoint(NuttyRecruit.db.profile.rtframe.posistion.p, UIParent, NuttyRecruit.db.profile.rtframe.posistion.r, NuttyRecruit.db.profile.rtframe.posistion.x, NuttyRecruit.db.profile.rtframe.posistion.y)
RTMainFrame:SetFrameStrata("HIGH")
RTMainFrame:SetClampedToScreen(true)
RTMainFrame:SetMovable(true)
end
end)
--ROLL TRACKER TEXT AT TOP OF BOX----
Fontstring1 = RTMainFrame:CreateFontString("Fontstring1","OVERLAY",RTMainFrame)
Fontstring1:SetFont("Fonts\\FRIZQT__.TTF",10)
Fontstring1:SetPoint("TOPLEFT", 15, -15)
Fontstring1:SetText(L["Roll Tracker"])
Fontstring1:SetJustifyH("LEFT")
--frame mover--
function NuttyRecruit:MoveFrame()
RTMainFrame:EnableMouse(NuttyRecruit.db.profile.lock)
RTMainFrame:RegisterForDrag("LeftButton")
RTMainFrame:SetScript("OnDragStart", RTMainFrame.StartMoving)
RTMainFrame:SetScript("OnDragStop", RTMainFrame.StopMovingOrSizing)
NuttyRecruit.db.profile.rtframe.posistion.p, NuttyRecruit.db.profile.rtframe.posistion.rt,NuttyRecruit.db.profile.rtframe.posistion.rp,NuttyRecruit.db.profile.rtframe.posistion.x, NuttyRecruit.db.profile.rtframe.posistion.y = RTMainFrame:GetPoint()
if NuttyRecruit.db.profile.lock then
Fontstring1:SetText(L["Roll Tracker UNLOCKED"])
else
Fontstring1:SetText(L["Roll Tracker"])
end
end