All pastes #96842 Raw Edit

Kaelten

public lua v1 · immutable
#96842 ·published 2006-07-23 07:02 UTC
rendered paste body
Hitman = AceLibrary("AceAddon-2.0"):new("AceEvent-2.0", "AceDB-2.0")function Hitman:OnInitialize()    Hitman:RegisterDB("HitmanDB")    Hitman:RegisterDefaults('profile', {fontSize = 16})endfunction Hitman:OnEnable()    self:RegisterEvent("PLAYER_ENTER_COMBAT")    self:RegisterEvent("PLAYER_LEAVE_COMBAT")endfunction Hitman:PLAYER_ENTER_COMBAT()    if not self.inCombat then        self.inCombat = true        self:Output("|cffff0000+Attack|r")    endend function Hitman:PLAYER_LEAVE_COMBAT()    if self.inCombat then        self.inCombat = false        self:Output("|cffffff00-Attack|r")    endendfunction Hitman:Output(text)    if MikSBT then        MikSBT.DisplayMessage(text, MikSBT.DISPLAYTYPE_NOTIFICATION, false)    elseif SCT_Display then        SCT_Display(text)    else        if not self.frame then            self:CreateFrame()        end        self.frame:AddMessage(text, 1, 0, 0)    endendfunction Hitman:CreateFrame()    if self.frame then return end        self.frame = CreateFrame("MessageFrame", nil, UIParent)    self.frame:SetFont(GameFontHighlightSmall:GetFont() , self.db.profile.fontSize)    self.frame:SetWidth(100)    self.frame:SetHeight(20)    self.frame:SetPoint("CENTER", UIParent, "CENTER")    self.frame:SetFrameStrata("LOW")    self.frame:SetTimeVisible(1)    self.frame:SetMovable(true)    self.frame:RegisterForDrag("LeftButton")    self.frame:EnableMouse(true)    self.frame:SetScript("OnDragStart",function()         if IsAltKeyDown() then            this:StartMoving()         end    end)    self.frame:SetScript("OnDragStop",function()         this:StopMovingOrSizing()     end)end