Place frames via addon #17
1 changed files with 23 additions and 1 deletions
24
MyAddon.lua
24
MyAddon.lua
|
@ -21,6 +21,8 @@ StaticPopupDialogs["GOLIATH_MISSING"] = {
|
||||||
preferredIndex = 3
|
preferredIndex = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SLASH_MYADDON1 = "/ta"
|
||||||
|
|
||||||
MyAddon.keyItemID = 180653
|
MyAddon.keyItemID = 180653
|
||||||
MyAddon.taunts = {
|
MyAddon.taunts = {
|
||||||
[56222] = true, -- Dark Command
|
[56222] = true, -- Dark Command
|
||||||
|
@ -41,6 +43,12 @@ MyAddon.slots = {
|
||||||
inspectInitialized = false
|
inspectInitialized = false
|
||||||
local InspectFontStrings = {}
|
local InspectFontStrings = {}
|
||||||
|
|
||||||
|
function MyAddon.SlashHandler(cmd)
|
||||||
|
if cmd == "frames" then
|
||||||
|
MyAddon.moveFrames()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function MyAddon.OnEvent(self, event, ...)
|
function MyAddon.OnEvent(self, event, ...)
|
||||||
events[event](self, ...)
|
events[event](self, ...)
|
||||||
end
|
end
|
||||||
|
@ -70,7 +78,7 @@ function events:INSPECT_READY(guid)
|
||||||
|
|
||||||
|
|
||||||
unit = GetUnitFromGuid(guid)
|
unit = GetUnitFromGuid(guid)
|
||||||
if unit and CanInspect(unit) then
|
if unit and CanInspect(unit) and inspectInitialized then
|
||||||
local itemLevel = C_PaperDollInfo.GetInspectItemLevel(unit)
|
local itemLevel = C_PaperDollInfo.GetInspectItemLevel(unit)
|
||||||
InspectFontStrings["itemLevel"]:SetText(itemLevel)
|
InspectFontStrings["itemLevel"]:SetText(itemLevel)
|
||||||
end
|
end
|
||||||
|
@ -124,6 +132,18 @@ function events:PLAYER_UPDATE_RESTING(...)
|
||||||
if MyAddon.needsRepair() then StaticPopup_Show("REPAIR_ALERT") end
|
if MyAddon.needsRepair() then StaticPopup_Show("REPAIR_ALERT") end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function MyAddon.moveFrames()
|
||||||
|
print("Moving frames to MyAddon default locations")
|
||||||
|
PlayerFrame:ClearAllPoints()
|
||||||
|
PlayerFrame:SetPoint("CENTER",UIParent,-350,-225)PlayerFrame:SetUserPlaced(true)
|
||||||
|
|
||||||
|
TargetFrame:ClearAllPoints()
|
||||||
|
TargetFrame:SetPoint("CENTER",UIParent,350,-225)TargetFrame:SetUserPlaced(true)
|
||||||
|
|
||||||
|
FocusFrame:ClearAllPoints()
|
||||||
|
FocusFrame:SetPoint("CENTER",UIParent,-350,150)TargetFrame:SetUserPlaced(true)
|
||||||
|
end
|
||||||
|
|
||||||
function MyAddon.announceKey()
|
function MyAddon.announceKey()
|
||||||
for bag = 0, NUM_BAG_SLOTS do
|
for bag = 0, NUM_BAG_SLOTS do
|
||||||
for slot = 1, GetContainerNumSlots(bag)do
|
for slot = 1, GetContainerNumSlots(bag)do
|
||||||
|
@ -250,3 +270,5 @@ for i = 1, 7 do
|
||||||
chat:SetShadowOffset(0, 0)
|
chat:SetShadowOffset(0, 0)
|
||||||
chat:SetShadowColor(0, 0, 0, 0)
|
chat:SetShadowColor(0, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
SlashCmdList["MYADDON"] = MyAddon.SlashHandler
|
||||||
|
|
Loading…
Reference in a new issue