Quantcast
WoWInterface: SVN - Demonomicon - Path Comparison - / Rev 2 and / Rev 3

WoWInterface SVN Demonomicon

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

branches/WotLK/Demonomicon.xml New file
0,0 → 1,32
<Ui
xmlns="http://www.blizzard.com/wow/ui/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blizzard.com/wow/ui/
../UI.xsd">
 
 
<Button name="DemonomiconStyleTemplate" hidden="true" virtual="true">
<Size x="24" y="24" />
<Layers>
<Layer level="OVERLAY">
<Texture name="$parentBorder" file="Interface\Minimap\MiniMap-TrackingBorder">
<Size x="40" y="40" />
<Anchors>
<Anchor point="CENTER">
<Offset x="2" y="-2" />
</Anchor>
</Anchors>
<TexCoords left="0.0" top="0.0" right="0.625" bottom="0.625" />
</Texture>
</Layer>
<Layer level="BACKGROUND">
<Texture name="$parentIcon" file="Interface\Icons\Spell_Shadow_Metamorphosis" />
</Layer>
</Layers>
<Scripts>
<PreClick>
PlaySound("igMainMenuOptionCheckBoxOn");
</PreClick>
</Scripts>
</Button>
</Ui>
\ No newline at end of file
branches/WotLK/Demonomicon.lua New file
0,0 → 1,346
-- local function print(msg) ChatFrame1:AddMessage(msg); end
 
BINDING_HEADER_DEMONOMICON_PETHEADER = 'Demonomicon'
_G["BINDING_NAME_CLICK PetFrame:LeftButton"] = '"Click" Pet Button'
_G["BINDING_NAME_CLICK PetFrame:RightButton"] = '"Right-Click" Pet Button'
_G["BINDING_NAME_CLICK DemonomiconMenuButton:LeftButton"] = 'Open Demon Menu'
_G["BINDING_NAME_CLICK DemonomiconMenuButton:RightButton"] = 'Open Demon Menu for Fast Summon'
 
local Demonomicon = CreateFrame("Button", "Demonomicon", UIParent, "DemonomiconStyleTemplate SecureHandlerClickTemplate")
Demonomicon:SetPoint("TOPLEFT", PlayerFrame, "BOTTOMLEFT", 52, 12)
Demonomicon.Icon = DemonomiconIcon
Demonomicon.Icon:SetTexture( [[Interface\Icons\INV_Misc_Book_06]] )
Demonomicon:SetHeight(24); Demonomicon:SetWidth(24)
 
Demonomicon.Buttons = {}
Demonomicon.SummonTab = [[Interface\Icons\Spell_Shadow_Metamorphosis]]
Demonomicon.Textures = {
Imp = [[Interface\Icons\Spell_Shadow_SummonImp]],
Voidwalker = [[Interface\Icons\Spell_Shadow_SummonVoidWalker]],
Succubus = [[Interface\Icons\Spell_Shadow_SummonSuccubus]],
Felhunter = [[Interface\Icons\Spell_Shadow_SummonFelHunter]],
Felguard = [[Interface\Icons\Spell_Shadow_SummonFelGuard]]
}
 
Demonomicon[ [[Interface\Icons\Spell_Nature_RemoveCurse]] ] =
"FastCast"
Demonomicon[ [[Interface\Icons\Spell_Shadow_LifeDrain]] ] =
"HealPet"
Demonomicon[ [[Interface\Icons\Spell_Shadow_AntiShadow]] ] =
{pet="Blueberry", spell="HealTank" }
Demonomicon[ [[Interface\Icons\Spell_Shadow_SacrificialShield]] ] =
{pet="Blueberry", spell="PopBlueberry" }
Demonomicon[ [[Interface\Icons\Spell_Nature_Purge]] ] =
{pet="Puppy", spell="EatMagic" }
Demonomicon[ [[Interface\Icons\Ability_Rogue_Sprint]] ] =
{pet="Bruiser", spell="ChaseDown"}
Demonomicon[ [[Interface\Icons\Spell_Shadow_MindSteal]] ] =
{pet="Temptress", spell="Charm"}
Demonomicon[ [[Interface\Icons\Spell_Shadow_MindRot]] ] =
{pet="Puppy", spell="Silence"}
 
Demonomicon[ Demonomicon.Textures.Imp ] = 'Summon'
Demonomicon[ Demonomicon.Textures.Voidwalker ] = 'Summon'
Demonomicon[ Demonomicon.Textures.Succubus ] = 'Summon'
Demonomicon[ Demonomicon.Textures.Felhunter ] = 'Summon'
Demonomicon[ Demonomicon.Textures.Felguard ] = 'Summon'
 
Demonomicon["_childupdate-Close"] = [[
--self:ClearBindings()
self:Hide()
]]
Demonomicon["_childupdate-LeftButton"] = [[
--self:SetBindingClick(true, tostring(self:GetID()), self:GetName(), "LeftButton")
local localeBinding = tostring(self:GetAttribute('binding'))
if localeBinding then
--self:SetBindingClick(true, localeBinding, self:GetName(), "LeftButton")
end
self:SetAttribute('type', 'spell')
self:Show()
]]
Demonomicon["_childupdate-RightButton"] = [[
--self:SetBindingClick(true, tostring(self:GetID()), self:GetName(), "LeftButton")
local localeBinding = tostring(self:GetAttribute('binding'))
if localeBinding then
--self:SetBindingClick(true, localeBinding, self:GetName(), "LeftButton")
end
if self:GetAttribute('*type2') then
self:SetAttribute('type', 'macro')
end
self:Show()
]]
Demonomicon["_childclick"] = [[open = nil; return nil, true]]
 
function Demonomicon:SetUpButtons(event, ...)
if InCombatLockdown() then
self:RegisterEvent("PLAYER_REGEN_ENABLED")
else
local Locale, Placement, Buttons = self.Locale, self.Placement, self.Buttons
Locale.Spells = { Summons = {} }
local Spells = Locale.Spells
for tabIndex = 1,MAX_SKILLLINE_TABS do
local tabName, texture, startSpell, numSpells = GetSpellTabInfo(tabIndex)
if not tabName then break end
if texture == self.SummonTab then
for spellIndex = startSpell + 1, startSpell + numSpells do
local spellIcon = GetSpellTexture(spellIndex,BOOKTYPE_SPELL)
local spellSought = self[spellIcon]
if spellSought and type(spellSought) == 'string' then
if spellSought == 'Summon' then
Spells.Summons[spellIcon] = GetSpellName(spellIndex, BOOKTYPE_SPELL)
else
Spells[spellSought] = GetSpellName(spellIndex, BOOKTYPE_SPELL)
end
end
end
end
end
if next(Spells.Summons) then
self:Show()
else
self:Hide()
return
end
 
if Spells.HealPet then
PetFrame:SetAttribute('alt-type1', 'spell')
PetFrame:SetAttribute('spell', Spells.HealPet)
end
 
local state2, type2
if Spells.FastCast then
state2, type2 = "^rightclick", 'macro'
end
 
local numButtons = 0
for _,summonKey in pairs(Placement.order) do
summon = Spells.Summons[summonKey]
if summon then
numButtons = numButtons + 1
local summonButton = Buttons[numButtons]
if not summonButton then
local newName = self:GetName().."Summon"..numButtons
summonButton = _G.CreateFrame('BUTTON', newName, self, "DemonomiconStyleTemplate SecureActionButtonTemplate")
summonButton.Icon = _G[newName.."Icon"]
summonButton:SetAttribute("_childupdate-Close", self["_childupdate-Close"])
summonButton:SetAttribute("_childupdate-LeftButton", self["_childupdate-LeftButton"])
summonButton:SetAttribute("_childupdate-RightButton", self["_childupdate-RightButton"])
summonButton:SetAttribute("_childclick", self["_childclick"])
Buttons[numButtons] = summonButton
self:SetAttribute("_adopt", summonButton)
end
summonButton:SetID(numButtons)
summonButton.Icon:SetTexture(summonKey)
summonButton:SetAttribute("binding", Locale.Bindings)
summonButton:SetAttribute('spell', summon)
summonButton:SetAttribute('macrotext', '/cast '..(Locale.Spells.FastCast or "").."\n/stopcasting\n/cast "..summon)
summonButton:SetAttribute('*type2', type2)
end
end
for index=numButtons+1,5 do
local extraButton = Buttons[index]
if extraButton then
extraButton:SetID(0)
extraButton:SetAttribute('*type2', type2)
extraButton:SetAttribute('binding', nil)
extraButton:Hide()
end
end
 
if numButtons > 1 then
local angle = Placement.startAngle
local slice = (Placement.endAngle - angle) / numButtons
local radius = 18 / math.sin(slice / 2)
for index=1,numButtons do
Buttons[index]:SetPoint("CENTER", self, "CENTER", radius * math.cos(angle), radius * math.sin(angle))
angle = angle + slice
end
elseif numButtons == 1 then
local oneButton = Buttons[1]
oneButton:SetPoint("CENTER", self, "CENTER")
oneButton:SetAttribute('hidestates', nil)
oneButton:Show()
end
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
end
end
 
function Demonomicon:SetUpPetFrame(event, ...)
local Locale = self.Locale
Locale.Pets = Locale.Pets or {}
local spellCount = HasPetSpells()
if spellCount and spellCount > 0 then
for index=1,spellCount do
soughtSpell = self[GetSpellTexture(index, BOOKTYPE_PET)]
if soughtSpell and type(soughtSpell) == 'table' then
Locale.Pets[soughtSpell.pet] = (UnitCreatureFamily("pet") or ""):lower()
Locale[soughtSpell.spell] = GetSpellName(index, BOOKTYPE_PET)
end
end
if InCombatLockdown() then
self:RegisterEvent("PLAYER_REGEN_ENABLED")
else
Locale.Macros = Locale.Macros or {}
local shiftMacro = {Populate = table.insert}
if Locale.PopBlueberry then
shiftMacro:Populate("[pet:"..Locale.Pets.Blueberry..",button:2] "..Locale.PopBlueberry)
end
if Locale.HealTank then
shiftMacro:Populate("[pet:"..Locale.Pets.Blueberry.."] "..Locale.HealTank)
end
if Locale.EatMagic then
shiftMacro:Populate("[pet:"..Locale.Pets.Puppy..",button:2,target=mouseover][pet:"..Locale.Pets.Puppy.."] "..locale.EatMagic)
end
if Locale.ChaseDown then
shiftMacro:Populate("[pet:"..Locale.Pets.Bruiser.."] "..Locale.ChaseDown)
end
shiftMacro.Populate = nil
if next(shiftMacro) then
Locale.Macros.shift = "/cast "..table.concat(shiftMacro, "; ")
end
local controlMacro = {Populate = table.insert}
if Locale.Charm then
controlMacro:Populate("[pet:"..Locale.Pets.Temptress..",button:2,target=focus][pet:"..Locale.Pets.Temptress.."] "..Locale.Charm)
end
if Locale.Silence then
controlMacro:Populate("[pet:"..Locale.Pets.Puppy..",button:2,target=focus][pet:"..Locale.Pets.Puppy.."] "..Locale.Silence)
end
controlMacro.Populate = nil
if next(controlMacro) then
Locale.Macros.ctrl = "/cast "..table.concat(controlMacro, "; ")
end
end
end
local actionType = Locale.Macros.shift and 'macro'
PetFrame:SetAttribute('shift-type1', actionType)
PetFrame:SetAttribute('shift-type2', Locale.Macros.shift and 'macro')
PetFrame:SetAttribute('shift-macrotext*', Locale.Macros.shift)
PetFrame:SetAttribute('ctrl-type1', Locale.Macros.ctrl and 'macro')
PetFrame:SetAttribute('ctrl-type2', Locale.Macros.ctrl and 'macro')
PetFrame:SetAttribute('ctrl-macrotext*', Locale.Macros.ctrl)
if Locale.PopBlueberry and Locale.HealTank and Locale.ChaseDown and Locale.EatMagic and Locale.Silence and Locale.Charm then
SetUpPetFrame = nil
self:UnregisterEvent('UNIT_MODEL_CHANGED')
end
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
end
PetFrame:SetAttribute("alt-type2", "assist")
 
Demonomicon:SetAttribute("_onupdate", [[
if open then
if self:IsUnderMouse(true) then
open = 0
return nil, true
end
open = open + elapsed
if open <= 2.5 then
return nil, true
else
open = nil
end
end
--self:ClearBindings()
open = nil
return "Close"]]
)
Demonomicon:SetAttribute("_onclick", [[
if open then
--self:ClearBindings()
open = nil
return "Close"
else
--self:SetBindingClick(true, "ESCAPE", "Demonomicon", "LeftButton")
open = 0
return button, true
end]]
)
Demonomicon:RegisterForClicks("AnyUp")
 
Demonomicon:SetScript("OnEvent",
function (self, event, ...)
local Textures = self.Textures
if event ~= "ADDON_LOADED" or (...) ~= "Demonomicon" then return; end
local currentLocale = GetLocale()
Demonomicon_Locale = Demonomicon_Locale or {}
Demonomicon_Locale[currentLocale] = Demonomicon_Locale[currentLocale] or ({
["frFR"] = {
Bindings = {
[ Textures.Imp ] = "D",
[ Textures.Voidwalker ] = "M",
[ Textures.Succubus ] = "S",
[ Textures.Felhunter ] = "C",
[ Textures.Felguard ] = "G"
}
},
["deDE"] = {
Bindings = {
[ Textures.Imp ] = "W",
[ Textures.Voidwalker ] = "L",
[ Textures.Succubus ] = "S",
[ Textures.Felhunter ] = "J",
[ Textures.Felguard ] = "T"
}
},
["enUS"] = {
Bindings = {
[ Textures.Imp ] = "I",
[ Textures.Voidwalker ] = "V",
[ Textures.Succubus ] = "S",
[ Textures.Felhunter ] = "F",
[ Textures.Felguard ] = "G"
}
},
["enGB"] = {
Bindings = {
[ Textures.Imp ] = "I",
[ Textures.Voidwalker ] = "V",
[ Textures.Succubus ] = "S",
[ Textures.Felhunter ] = "F",
[ Textures.Felguard ] = "G"
}
}
})[currentLocale] or {}
self.Locale = Demonomicon_Locale[currentLocale]
Demonomicon_Placement = Demonomicon_Placement or {
startAngle = math.pi,
endAngle = 3 * math.pi,
order = {
Textures.Imp,
Textures.Voidwalker,
Textures.Succubus,
Textures.Felhunter,
Textures.Felguard
}
}
self.Placement = Demonomicon_Placement
self:SetScript('OnEvent',
function (self, event, ...)
self:SetUpButtons(event, ...)
if self.SetUpPetFrame and event ~= 'SPELLS_CHANGED' and (event ~= 'UNIT_MODEL_CHANGED' or (...) == 'pet') then
self:SetUpPetFrame(event, ...)
end
end
)
self:UnregisterAllEvents()
self:RegisterEvent('SPELLS_CHANGED')
end
)
Demonomicon:RegisterEvent('ADDON_LOADED')
 
Demonomicon:SetScript("OnShow",
function (self)
if self.SetUpPetFrame then
self:RegisterEvent('UNIT_MODEL_CHANGED')
end
end
)
 
Demonomicon:SetScript("OnHide",
function (self)
self:UnregisterEvent('UNIT_MODEL_CHANGED')
end
)
 
Demonomicon:SetScript("OnDragStart", Demonomicon.StartMoving)
Demonomicon:SetScript("OnDragStop", Demonomicon.StopMovingOrSizing)
Demonomicon:RegisterForDrag("LeftButton")
branches/WotLK/Demonomicon.toc New file
0,0 → 1,9
## Interface: 30000
## Title: Demonomicon
## Version: 1.5b
## Notes: Demon management interface for warlocks
## SavedVariables: Demonomicon_Locale, Demonomicon_Placement
## Author: Alestane
 
Demonomicon.xml
Demonomicon.lua
\ No newline at end of file Property changes : Added: svn:executable + *
branches/WotLK/ReadMe.txt New file
0,0 → 1,21
Demonomicon is a small, compact interface designed to assist in summoning and controlling a warlock's demons. Its interface elements and functions will not show or function for players of other classes.
 
Demonomicon has three principle components: the pet frame, the Demonomicon itself, and key bindings. While Demonomicon is active, your demon's portrait provides a number of additional functions when left- or right-clicked with the Shift, Control or Alt keys held down.
 
plain Left-Click: Target your demon (standard behavior)
plain Right-Click: Open menu to dismiss your demon (standard behavior)
Shift-Left-Click: (Voidwalker) Consume Shadows; (Felguard) Intercept target; (Felhunter) Devour Magic on current target.
Shift-Right-Click: (Voidwalker) Sacrifice; (Felhunter) Devour Magic on mouseover (key-binding needed)
Ctrl-Left-Click: (Succubus) Seduce target; (Felhunter) Spell Lock target.
Ctrl-Right-Click: (Succubus) Seduce focus; (Felhunter) Spell Lock focus.
Alt-Left-Click: Health Funnel
Alt-Right-Click: Assist your demon (target their target)
 
The Demonomicon is a small button that appears under your portrait, like a grimoire of demon spells. Click this button to bring up a menu of buttons of all the demon summon spells you know. While the circle of buttons is showing, the keys "1"-"5" and "I", "V", "S", "F", and "G" will be temporarily rebound to your summon buttons. If you know the spell Fel Domination, right-clicking a demon button will fast-summon that demon. If you right-click the menu button to open it, the key-bindings will fast-summon your demons as if you had right-clicked the individual buttons. If you don't like the button's location, drag it to your preferred location.
 
(Demonomicon has not been tested for locales other than English, but it should set itself up correctly any language...in French and German, the summon bindings change to "D", "M", "S", "C","G" and "W","L","S","J","T" respectively.)
 
Key-bindings are available to duplicate left- and right- clicks on your pet frame and the Demonomicon button. They are found in your Key Bindings menu under the heading "Demonomicon." You can bind modified keys to these functions, but keep in mind the addon will still use those modifiers to determine what action you take; that is, binding "CTRL-P" to your pet frame will always count as a ctrl-click.
 
Known bugs or unimplemented features:
Shift-right-clicking your pet frame while your felhunter is active was originally supposed to bring up a blue targeting cursor for Devour Magic. WoW's targeting behavior doesn't support this ATM.
\ No newline at end of file Property changes : Added: svn:executable + *
branches/WotLK/Bindings.xml New file
0,0 → 1,14
<Bindings>
<Binding name="CLICK PetFrame:LeftButton" header="DEMONOMICON_PETHEADER">
do end
</Binding>
<Binding name="CLICK PetFrame:RightButton">
do end
</Binding>
<Binding name="CLICK DemonomiconMenuButton:LeftButton">
do end
</Binding>
<Binding name="CLICK DemonomiconMenuButton:RightButton">
do end
</Binding>
</Bindings>
Property changes : Added: svn:executable + *