local _, KeyMaster = ...
local MainInterface = KeyMaster.MainInterface

function MainInterface:CreateMainFrame()
    local mainFrame = CreateFrame("Frame", "KeyMaster_MainFrame", UIParent, "MainFrameTemplate");
    mainFrame:SetClampedToScreen( true )
    mainFrame:ClearAllPoints(); -- Fixes SetPoint bug thus far.
    mainFrame:SetPoint("CENTER", "UIParent", "CENTER", 0, 0)
    mainFrame:SetBackdrop({bgFile="", 
        edgeFile="Interface\\AddOns\\KeyMaster\\Assets\\Images\\UI-Border", 
        tile = false, 
        tileSize = 0, 
        edgeSize = 16, 
        insets = {left = 4, right = 4, top = 4, bottom = 4}})


    mainFrame.closeBtn = CreateFrame("Button", "CloseButton", mainFrame, "UIPanelCloseButton")
    mainFrame.closeBtn:SetPoint("TOPRIGHT")
    mainFrame.closeBtn:SetSize(20, 20)
    mainFrame.closeBtn:SetNormalFontObject("GameFontNormalLarge")
    mainFrame.closeBtn:SetHighlightFontObject("GameFontHighlightLarge")
    mainFrame:Hide()

    return mainFrame
end