Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Hamham
- Hamar = {Frames = {}, Inputs = {}}
- local Options = {
- x = 30,
- width = 300,
- height = 250,
- anchor = { "CENTER", UIParent, "CENTER", -100, -200},
- colors = {0.69, 0.31, 0.31, 1},
- }
- local Frame = CreateFrame("Frame", "sHamar", UIParent)
- Frame:SetMovable(true)
- Frame:EnableMouse(true)
- Frame:RegisterForDrag("LeftButton")
- Frame:SetScript("OnDragStart", Frame.StartMoving)
- Frame:SetScript("OnDragStop", Frame.StopMovingOrSizing)
- Frame:SetScript("OnHide", Frame.StopMovingOrSizing)
- Frame:SetSize(Options.width, Options.height)
- Frame:SetPoint("CENTER")
- Frame:SetBackdrop({
- bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", tile = true, tileSize = 16,
- edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", edgeSize = 16,
- insets = { left = 4, right = 4, top = 4, bottom = 4 },
- })
- Hamar.Frame = Frame
- local name = "Hamar BattleGround"
- local NameFrame = CreateFrame("Frame", "sHamar_Name", Frame)
- NameFrame:SetHeight(16)
- NameFrame:SetWidth(Options.width-16)
- NameFrame.text = NameFrame:CreateFontString()
- NameFrame.text:SetFont("Fonts\\MORPHEUS.ttf", 14)
- NameFrame.text:SetTextColor(0.8, 0.2, 0.2)
- NameFrame.text:SetJustifyH("LEFT")
- NameFrame.text:SetAllPoints()
- NameFrame.text:SetText(name:gsub("_", " "))
- NameFrame:SetPoint("TOPLEFT", Frame, "TOPLEFT", 8, -8)
- NameFrame:Show()
- Frame.NameFrame = NameFrame
- local Btn = CreateFrame("Button", "sHamar_Button", Frame)
- Btn:SetSize(25, 25)
- Btn:SetSize(25, 25)
- Btn:SetNormalTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Up")
- Btn:SetPushedTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Down")
- Btn:SetHighlightTexture("Interface\\Buttons\\UI-Panel-MinimizeButton-Highlight")
- Btn:SetPoint("TOPRIGHT", Frame, "TOPRIGHT", 0, 0)
- Btn:SetScript("OnClick", function() Frame:Hide() end)
- Btn:Show()
- function Hamar:SendMessage(text)
- SendAddonMessage( "hamar", text, "WHISPER", UnitName("player"))
- print("|cffCE9000Sending message|r")
- end
- local SendBtn = CreateFrame("Button", "sHamar_SendButton", Frame, "UIPanelButtonTemplate")
- SendBtn:SetSize(150, 50)
- SendBtn:SetText("Send Message")
- SendBtn:SetPoint("CENTER", Frame, "CENTER", 0, 0)
- SendBtn:SetScript("OnClick", function() Hamar:SendMessage("moi") end)
- SendBtn:Show()
Advertisement
Add Comment
Please, Sign In to add comment