WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 541 to Rev 542
    Reverse comparison

Rev 541 → Rev 542

MyLittleButton/MyLittleButton.lua
1,7 → 1,7
BINDING_HEADER_MYLITTLEBUTTON = "MyLittleButton"
setglobal("BINDING_NAME_CLICK MyLittleButton:LeftButton", "Execute")
 
local frame = CreateFrame("Frame",nil,UIParent)
local frame = CreateFrame("Button",nil,UIParent)
frame:SetScript("OnEvent", function(self, event, ...)
if self[event] then return self[event](self, event, ...) end
end)
25,6 → 25,7
end
 
local function ChangeAction()
if InCombatLockdown() then return end
local type,itemID = GetCursorInfo()
if type == "spell" or "item" then
MyLittleButtonDB[GetActiveTalentGroup()]["type"] = type
91,17 → 92,20
center:SetTexCoord(0.0625, 0.9375, 0, 0.625)
 
editbox:SetPoint("LEFT",button,"RIGHT",9,0)
editbox:SetScript("OnEnterPressed", function(self)
editbox:SetScript("OnEnterPressed", function(self)
if InCombatLockdown() then return end
MyLittleButtonDB[GetActiveTalentGroup()]["target"] = self:GetText() ~= "" and self:GetText() or nil
ChangeButtonAttributes(MyLittleButtonDB[GetActiveTalentGroup()]["texture"],MyLittleButtonDB[GetActiveTalentGroup()]["type"],MyLittleButtonDB[GetActiveTalentGroup()]["spell"],MyLittleButtonDB[GetActiveTalentGroup()]["target"])
self:ClearFocus()
end)
editbox:SetScript("OnEscapePressed", function(self)
if InCombatLockdown() then return end
MyLittleButtonDB[GetActiveTalentGroup()]["target"] = self:GetText() ~= "" and self:GetText() or nil
ChangeButtonAttributes(MyLittleButtonDB[GetActiveTalentGroup()]["texture"],MyLittleButtonDB[GetActiveTalentGroup()]["type"],MyLittleButtonDB[GetActiveTalentGroup()]["spell"],MyLittleButtonDB[GetActiveTalentGroup()]["target"])
self:ClearFocus()
end)
editbox:SetScript("OnEditFocusGained", function(self)
editbox:SetScript("OnEditFocusGained", function(self)
if InCombatLockdown() then return end
if IsShiftKeyDown() and UnitExists("target") then
MyLittleButtonDB[GetActiveTalentGroup()]["target"] = UnitName("target")
ChangeButtonAttributes(MyLittleButtonDB[GetActiveTalentGroup()]["texture"],MyLittleButtonDB[GetActiveTalentGroup()]["type"],MyLittleButtonDB[GetActiveTalentGroup()]["spell"],MyLittleButtonDB[GetActiveTalentGroup()]["target"])
113,20 → 117,32
end)
 
frame:SetBackdrop(GameTooltip:GetBackdrop())
frame:SetBackdropColor(0,0,0,0.5)
frame:SetBackdropColor(1,0,0,0.5)
frame:SetBackdropBorderColor(0,0,0,1)
frame:RegisterForDrag("LeftButton")
frame:SetMovable(true)
frame:EnableMouse(true)
frame:SetUserPlaced(true)
frame:SetClampedToScreen(true)
frame:SetScript("OnDragStart",function(self)
self:StartMoving()
frame:SetScript("OnDragStart", function(self)
if not MyLittleButtonDB.lock then
self:StartMoving()
end
end)
frame:SetScript("OnDragStop",function(self)
frame:SetScript("OnDragStop", function(self)
self:StopMovingOrSizing()
MyLittleButtonDB.point, MyLittleButtonDB.x, MyLittleButtonDB.y = "BOTTOMLEFT", self:GetLeft(), self:GetBottom()
end)
frame:SetScript("OnDoubleClick", function(self)
if IsShiftKeyDown() then
MyLittleButtonDB.lock = not MyLittleButtonDB.lock
if MyLittleButtonDB.lock then
frame:SetBackdropColor(0,0,0,0.5)
else
frame:SetBackdropColor(1,0,0,0.5)
end
end
end)
 
local function onUpdate(self,elapsed)
if MyLittleButtonDB[GetActiveTalentGroup()]["spell"] and MyLittleButtonDB[GetActiveTalentGroup()]["target"] then