Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ ONEVENT ]]
- function CFM_OnEvent()
- if (event == "ADDON_LOADED") then
- if (arg1 == "CFM") then
- chat("CFM Loaded")
- -- check for saved vars or create new
- CFM_Profiles = CFM_Profiles or {};
- CFM_Profiles[realm] = CFM_Profiles[realm] or {};
- CFM_Profiles[realm][toon] = CFM_Profiles[realm][toon] or {};
- activeProfile = CFM_Profiles[realm][toon]
- end
- elseif (event == "VARIABLES_LOADED") then
- chat("Variables Loaded")
- CFM_VL = true
- elseif (event == "PLAYER_ENTERING_WORLD") then
- chat("Player Entering World")
- CFM_PEW = true
- if CFM_VL then
- chat("CFM_VL and CFM_PEW are true")
- CFM_Delay = true
- end
- elseif (event == "CURSOR_UPDATE") then
- --CFM_GetFrameName()
- end
- end
- --[[ ONUPDATE]]
- function CFM_OnUpdate(self, elapsed)
- if self.delay then
- self.delay = self.delay - elapsed
- if self.delay < 0 then
- self.delay = nil
- CFM_Loaded = true
- for k,_ in pairs(activeProfile) do
- CFM_ApplySettings(activeProfile[k])
- end
- end
- else
- if CFM_Delay and not CFM_Loaded then
- self.delay = 1
- end
- end
- end
- function CFM_ApplySettings(frame)
- -- apply frame's settings
- if activeProfile[frame] ~= nil then
- local parent, point, relativePoint, offsetX, offsetY, width, height, scale
- parent = activeProfile[frame].parent
- point = activeProfile[frame].point
- relativePoint = activeProfile[frame].relativePoint
- offsetX = activeProfile[frame].offsetX
- offsetY = activeProfile[frame].offsetY
- width = activeProfile[frame].width
- height = activeProfile[frame].height
- scale = activeProfile[frame].scale
- getglobal(frame):ClearAllPoints()
- CFM_SetScale(frame, scale)
- getglobal(frame):SetPoint(point, parent, relativePoint, offsetX, offsetY)
- CFM_Mover_YPos:SetText(offsetY)
- CFM_Mover_XPos:SetText(offsetX)
- end
- end
- ##Saved Variable trying to load
- CFM_Profiles = {
- ["Thunderlord"] = {
- ["Modtest"] = {
- ["Minimap"] = {
- ["point"] = "CENTER",
- ["parent"] = "MinimapCluster",
- ["width"] = 139.9999954201288,
- ["name"] = "Minimap",
- ["forceHide"] = false,
- ["relativePoint"] = "TOP",
- ["height"] = 139.9999954201288,
- ["offsetY"] = -500,
- ["scale"] = 1,
- ["offsetX"] = 0,
- },
- },
- },
- }
Add Comment
Please, Sign In to add comment