- Second round of improvements on Aura Creation.

This commit is contained in:
Tercio
2015-04-03 18:40:31 -03:00
parent 88a107df2f
commit c5dab8e316
8 changed files with 128 additions and 408 deletions
+8 -3
View File
File diff suppressed because one or more lines are too long
+120 -18
View File
@@ -189,7 +189,7 @@
}
local debuff_prototype = {
["cooldown"] = true,
["cooldown"] = false,
["trigger"] = {
["spellId"] = "0",
["unit"] = "",
@@ -199,7 +199,7 @@
},
}
local buff_prototype = {
["cooldown"] = true,
["cooldown"] = false,
["trigger"] = {
["spellId"] = "0",
["unit"] = "",
@@ -249,7 +249,24 @@
},
}
function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat)
local text_prototype = {
["fontSize"] = 20,
["displayStacks"] = "",
["stacksPoint"] = "BOTTOM",
["stacksContainment"] = "OUTSIDE",
}
local glow_prototype = {
["actions"] = {
["start"] = {
["do_glow"] = true,
["glow_frame"] = "",
["glow_action"] = "show",
},
},
}
function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow)
--> check if wa is installed
if (not WeakAuras or not WeakAurasSaved) then
@@ -362,7 +379,7 @@
end
--> using sound
if (sound and sound ~= "" and sound ~= [[Interface\Quiet.ogg]]) then
if (sound and sound ~= "" and not sound:find ("Quiet.ogg")) then
local add = _detalhes.table.copy ({}, sound_prototype)
add.actions.start.sound = sound
_detalhes.table.deploy (icon, add)
@@ -370,11 +387,17 @@
--> chat message
if (chat and chat ~= "") then
local add = _detalhes.table.copy ({}, sound_prototype)
local add = _detalhes.table.copy ({}, chat_prototype)
add.actions.start.message = chat
_detalhes.table.deploy (icon, add)
end
if (icon_text and icon_text ~= "") then
local add = _detalhes.table.copy ({}, text_prototype)
add.displayStacks = icon_text
_detalhes.table.deploy (icon, add)
end
--> check if already exists a aura with this name
if (WeakAurasSaved.displays [icon.id]) then
for i = 2, 100 do
@@ -385,20 +408,38 @@
end
end
--> check is is using glow effect
if (icon_glow) then
local add = _detalhes.table.copy ({}, glow_prototype)
add.actions.start.glow_frame = "WeakAuras:" .. icon.id
_detalhes.table.deploy (icon, add)
end
--> add the aura on our group
tinsert (WeakAurasSaved.displays ["Details! Aura Group"].controlledChildren, icon.id)
--> add the aura
WeakAuras.Add (icon)
--> check if the options panel has loaded
local options_frame = WeakAuras.OptionsFrame and WeakAuras.OptionsFrame()
if (options_frame) then
if (options_frame and not options_frame:IsShown()) then
WeakAuras.ToggleOptions()
end
WeakAuras.NewDisplayButton (icon)
end
end
function _detalhes:OpenAuraPanel (spellid, spellname, spellicon)
spellname = select (1, GetSpellInfo (spellid))
if (not DetailsAuraPanel) then
local f = CreateFrame ("frame", "DetailsAuraPanel", UIParent, "ButtonFrameTemplate")
f:SetSize (300, 378)
f:SetSize (300, 420)
f:SetPoint ("center", UIParent, "center")
f:SetFrameStrata ("HIGH")
f:SetToplevel (true)
@@ -440,11 +481,14 @@
local spellname_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SpellName", "$parentSpellName")
spellname_textentry:SetPoint ("left", spellname_label, "right", 2, 0)
f.spellname = spellname_textentry
spellname_textentry.tooltip = "Spell/Debuff/Buff to be tracked."
--spellid
local auraid_label = fw:CreateLabel (f, "Spell Id: ", nil, nil, "GameFontNormal")
local auraid_textentry = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraSpellId", "$parentAuraSpellId")
auraid_textentry:Disable()
auraid_textentry:SetPoint ("left", auraid_label, "right", 2, 0)
--use spellid
local usespellid_label = fw:CreateLabel (f, "Use SpellId: ", nil, nil, "GameFontNormal")
local aura_use_spellid = fw:CreateSwitch (f, function(_, _, state) if (state) then auraid_textentry:Enable() else auraid_textentry:Disable() end end, false, nil, nil, nil, nil, "UseSpellId")
@@ -490,28 +534,71 @@
local stack_slider = fw:NewSlider (f, f, "$parentStackSlider", "StackSlider", 150, 20, 0, 30, 1, 0)
local stack_label = fw:CreateLabel (f, "Stack Size: ", nil, nil, "GameFontNormal")
stack_slider:SetPoint ("left", stack_label, "right", 2, 0)
stack_slider.tooltip = "Minimum amount of stacks to trigger the aura."
--sound effect
local play_sound = function (self, fixedParam, file)
print (file)
PlaySoundFile (file, "Master")
end
local sort = function (t1, t2)
return t1.name < t2.name
end
local titlecase = function (first, rest)
return first:upper()..rest:lower()
end
local iconsize = {14, 14}
local sound_options = function()
local t = {{label = "No Sound", value = "", icon = [[Interface\Buttons\UI-GuildButton-MOTD-Disabled]]}}
local t = {{label = "No Sound", value = "", icon = [[Interface\Buttons\UI-GuildButton-MOTD-Disabled]], iconsize = iconsize}}
local sounds = {}
for name, soundFile in pairs (LibStub:GetLibrary("LibSharedMedia-3.0"):HashTable ("sound")) do
tinsert (t, {label = name, value = soundFile, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound})
name = name:gsub ("(%a)([%w_']*)", titlecase)
sounds [#sounds+1] = {name = name, file = soundFile}
end
table.sort (sounds, sort)
for _, sound in ipairs (sounds) do
tinsert (t, {label = sound.name, value = sound.file, icon = [[Interface\Buttons\UI-GuildButton-MOTD-Up]], onclick = play_sound, iconsize = iconsize})
end
return t
end
local sound_effect = fw:CreateDropDown (f, sound_options, 1, 150, 20, "SoundEffectDropdown", "$parentSoundEffectDropdown")
local sound_effect_label = fw:CreateLabel (f, "Play Sound: ", nil, nil, "GameFontNormal")
sound_effect:SetPoint ("left", sound_effect_label, "right", 2, 0)
sound_effect.tooltip = "Sound played when the aura triggers."
--say something
local say_something_label = fw:CreateLabel (f, "/Say: ", nil, nil, "GameFontNormal")
local say_something = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "SaySomething", "$parentSaySomething")
say_something:SetPoint ("left", say_something_label, "right", 2, 0)
say_something.tooltip = "Your character /say this phrase when the aura triggers."
--aura text
local aura_text_label = fw:CreateLabel (f, "Icon Text: ", nil, nil, "GameFontNormal")
local aura_text = fw:CreateTextEntry (f, _detalhes.empty_function, 150, 20, "AuraText", "$parentAuraText")
aura_text:SetPoint ("left", aura_text_label, "right", 2, 0)
aura_text.tooltip = "Text shown at aura's icon right side."
--apply glow
local useglow_label = fw:CreateLabel (f, "Glow Effect: ", nil, nil, "GameFontNormal")
local useglow = fw:CreateSwitch (f, function(self, _, state)
if (state and self.glow_test) then
self.glow_test:Show()
self.glow_test.animOut:Stop()
self.glow_test.animIn:Play()
elseif (self.glow_test) then
self.glow_test.animIn:Stop()
self.glow_test.animOut:Play()
end
end, false, nil, nil, nil, nil, "UseGlow")
useglow:SetPoint ("left", useglow_label, "right", 2, 0)
useglow.tooltip = "Do not rename the aura on WeakAuras options panel or the glow effect may not work."
useglow.glow_test = CreateFrame ("frame", "DetailsAuraTextGlowTest", useglow.widget, "ActionBarButtonSpellActivationAlert")
useglow.glow_test:SetPoint ("topleft", useglow.widget, "topleft", -20, 2)
useglow.glow_test:SetPoint ("bottomright", useglow.widget, "bottomright", 20, -2)
useglow.glow_test:Hide()
--aura addon
local addon_options = function()
local t = {}
@@ -537,9 +624,12 @@
local sound = f.SoundEffectDropdown.value
local chat = f.SaySomething.text
local addon = f.AuraAddonDropdown.value
local icon_text = f.AuraText.text
local icon_glow = f.UseGlow.value
if (addon == "WA") then
_detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat)
_detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow)
else
_detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.")
end
@@ -560,21 +650,23 @@
local y_start = 21
name_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*1) + (50)) * -1)
aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (50)) * -1)
spellname_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*2) + (60)) * -1)
auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*3) + (60)) * -1)
usespellid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (60)) * -1)
spellname_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*3) + (60)) * -1)
auraid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*4) + (60)) * -1)
usespellid_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (60)) * -1)
icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*5) + (70)) * -1)
aura_on_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (70)) * -1)
icon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*6) + (70)) * -1)
stack_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*7) + (70)) * -1)
sound_effect_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*8) + (70)) * -1)
say_something_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*9) + (70)) * -1)
aura_text_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*10) + (70)) * -1)
useglow_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*11) + (70)) * -1)
aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*11) + (60)) * -1)
aura_addon_label:SetPoint ("topleft", f, "topleft", x_start, ((y_start*13) + (60)) * -1)
create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*13) + (60)) * -1)
cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*13) + (60)) * -1)
create_button:SetPoint ("topleft", f, "topleft", x_start, ((y_start*15) + (60)) * -1)
cancel_button:SetPoint ("topright", f, "topright", x_start*-1, ((y_start*15) + (60)) * -1)
end
@@ -584,6 +676,16 @@
DetailsAuraPanel.spellname.text = spellname
DetailsAuraPanel.AuraSpellId.text = tostring (spellid)
DetailsAuraPanel.icon.texture = spellicon
DetailsAuraPanel.UseGlow.glow_test.animIn:Stop()
DetailsAuraPanel.UseGlow.glow_test.animOut:Play()
DetailsAuraPanel.UseGlow:SetValue (false)
DetailsAuraPanel.AuraOnDropdown:Select (1, true)
DetailsAuraPanel.StackSlider:SetValue (0)
DetailsAuraPanel.SoundEffectDropdown:Select (1, true)
DetailsAuraPanel.AuraText:SetText ("")
DetailsAuraPanel.SaySomething:SetText ("")
DetailsAuraPanel:Show()
end
@@ -1,381 +0,0 @@
local MoguShanPalace = {
id = 994,
ej_id = 321,
name = "Mogu'Shan Palace",
boss_names = {
"Trial of the King",
"Gekkan",
"Xin the Weaponmaster",
},
boss_ids = {
--debug
--[61945] = 2,
[61445] = 1, --haiayn
[61442] = 1, --kuai
[61453] = 1, --mushiba
[61444] = 1, --ming
--[61337] = 2, --ironhide
--[61340] = 2, --hexxer
--[61339] = 2, --oracle
[61243] = 2, --gekkan
--[61338] = 2, --skulker
[61398] = 3, --xin
},
encounters = {
[1] = {
boss = "Trial of the King",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Ming the Cunning]],
},
[2] = {
boss = "Gekkan",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Gekkan]],
},
[3] = {
boss = "Xin the Weaponmaster",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Xin the Weaponmaster]],
},
},
}
_detalhes:InstallEncounter (MoguShanPalace)
local TempleOfJadeSerpent = {
id = 960,
ej_id = 313,
name = "Temple of the Jade Serpent",
boss_names = {
"Wise Mari",
"Lorewalker Stonestep",
"Liu Flameheart",
"Sha of Doubt",
},
boss_ids = {
[56448] = 1, --wise mary
[56843] = 2, --lorewalker stonestep
[59051] = 2, --strife
[59726] = 2, --peril
[56915] = 2, --sun
[58826] = 2, --zao sunseeker
[56872] = 2, --osong
[56732] = 3, --liu framehearth
[56762] = 3, --yulon
[56439] = 4, --sha of doubt
[56792] = 4, --add
},
encounters = {
[1] = {
boss = "Wise Mari",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Wise Mari]],
},
[2] = {
boss = "Lorewalker Stonestep",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Lorewalker Stonestep]],
},
[3] = {
boss = "Liu Flameheart",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Liu Flameheart]],
},
[4] = {
boss = "Sha of Doubt",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Sha of Doubt]],
},
},
}
_detalhes:InstallEncounter (TempleOfJadeSerpent)
local StormsStoutBrewery = {
id = 961,
ej_id = 302,
name = "Stormstout Brewery",
boss_names = {
"Ook-Ook",
"Hoptallus",
"Yan-Zhu the Uncasked",
},
boss_ids = {
[56637] = 1, --ook-ook
[56717] = 2, --hoptallus
[59479] = 3, --yan-zhu
},
encounters = {
[1] = {
boss = "Ook-Ook",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Ook Ook]],
},
[2] = {
boss = "Hoptallus",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Hoptallus]],
},
[3] = {
boss = "Yan-Zhu the Uncasked",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Yan Zhu the Uncasked]],
},
},
}
_detalhes:InstallEncounter (StormsStoutBrewery)
local ScarletHalls = {
id = 1001,
ej_id = 311,
name = "Scarlet Halls",
boss_names = {
"Houndmaster Braun",
"Armsmaster Harlan",
"Flameweaver Koegler",
},
boss_ids = {
[59303] = 1, --Houndmaster Braun
[58632] = 2, --Armsmaster Harlan
[59150] = 3, --Flameweaver Koegler
},
encounters = {
[1] = {
boss = "Houndmaster Braun",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Houndmaster Braun]],
},
[2] = {
boss = "Armsmaster Harlan",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Armsmaster Harlan]],
},
[3] = {
boss = "Flameweaver Koegler",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Flameweaver Koegler]],
},
},
}
_detalhes:InstallEncounter (ScarletHalls)
local ScarletMonastery = {
id = 1004,
ej_id = 316,
name = "Scarlet Monastery",
boss_names = {
"Thalnos the Soulrender",
"Brother Korloff",
"High Inquisitor Whitemane",
},
boss_ids = {
[59789] = 1, --Thalnos the Soulrender
[60040] = 2, --Commander Durand
[3977] = 2, --High Inquisitor Whitemane
},
encounters = {
[1] = {
boss = "Thalnos the Soulrender",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Thalnos the Soulrender]],
},
[2] = {
boss = "Brother Korloff",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Brother Korloff]],
},
[3] = {
boss = "High Inquisitor Whitemane",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-High Inquisitor Whitemane]],
},
},
}
_detalhes:InstallEncounter (ScarletMonastery)
local ShadoPanMonastery = {
id = 959,
ej_id = 312,
name = "Shado-Pan Monastery",
boss_names = {
"Gu Cloudstrike",
"Master Snowdrift",
"Sha of Violence",
"Taran Zhu",
},
boss_ids = {
[56747] = 1, --Gu Cloudstrike
[56541] = 2, --Master Snowdrift
[56719] = 3, --Sha of Violence
[56884] = 4, --Taran Zhu
},
encounters = {
[1] = {
boss = "Gu Cloudstrike",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Gu Cloudstrike]],
},
[2] = {
boss = "Master Snowdrift",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Master Snowdrift]],
},
[3] = {
boss = "Sha of Violence",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Sha of Violence]],
},
[4] = {
boss = "Taran Zhu",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Taran Zhu]],
},
},
}
_detalhes:InstallEncounter (ShadoPanMonastery)
local SiegeOfNiuzaoTemple = {
id = 1011,
ej_id = 324,
name = "Siege of Niuzao Temple",
boss_names = {
"Vizier Jin'bak",
"Commander Vo'jak",
"General Pa'valak",
"Wing Leader Ner'onok",
},
boss_ids = {
[61567] = 1, --Vizier Jin'Bak
[61634] = 2, --commander Vojak
[61485] = 3, --General Pa'valak
[62205] = 4, --Wing Leader Neronok
},
encounters = {
[1] = {
boss = "Vizier Jin'bak",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Vizier Jinbak]],
},
[2] = {
boss = "Commander Vo'jak",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Commander Vojak]],
},
[3] = {
boss = "General Pa'valak",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-General Pavalak]],
},
[4] = {
boss = "Wing Leader Ner'onok",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Wing Leader Neronok]],
},
},
}
_detalhes:InstallEncounter (SiegeOfNiuzaoTemple)
local GateOfSettingSun = {
id = 962,
ej_id = 303,
name = "Gate of the Setting Sun",
boss_names = {
"Saboteur Kip'tilak",
"Striker Ga'dok",
"Commander Ri'mok",
"Raigonn",
},
boss_ids = {
[56906] = 1, --Saboteur Kiptilak
[56589] = 2, --Striker Ga'dok
[56636] = 3, --Commander Rimok
[56877] = 4, --Raigonn
[56895] = 4, --Weak Spot (Raigonn)
},
encounters = {
[1] = {
boss = "Saboteur Kip'tilak",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Saboteur Kiptilak]],
},
[2] = {
boss = "Striker Ga'dok",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Striker Gadok]],
},
[3] = {
boss = "Commander Ri'mok",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Commander Rimok]],
},
[4] = {
boss = "Raigonn",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Raigonn]],
},
},
}
_detalhes:InstallEncounter (GateOfSettingSun)
local Scholomance = {
id = 1007,
ej_id = 246,
name = "Scholomance",
boss_names = {
"Instructor Chillheart",
"Jandice Barov",
"Rattlegore",
"Lilian Voss",
"Darkmaster Gandling",
},
boss_ids = {
[58633] = 1, --Instructor Chillheart
[58664] = 1, --Instructor Chillheart Phylactery
[59184] = 2, --Jandice Barov
[59153] = 3, --Rattlegore
[58722] = 4, --Lilian Voss
[59080] = 5, --Darkmaster Gandling
},
encounters = {
[1] = {
boss = "Instructor Chillheart",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Instructor Chillheart]],
},
[2] = {
boss = "Jandice Barov",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Jandice Barov]],
},
[3] = {
boss = "Rattlegore",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Rattlegore]],
},
[4] = {
boss = "Lilian Voss",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Lillian Voss]],
},
[5] = {
boss = "Darkmaster Gandling",
portrait = [[Interface\EncounterJournal\UI-EJ-BOSS-Darkmaster Gandling]],
},
},
}
_detalhes:InstallEncounter (Scholomance)
@@ -1,6 +0,0 @@
## Interface: 60100
## Title: Details: Mists of Pandaria Dungeons
## Notes: Plugin for Details
## RequiredDeps: Details
Details_DungeonInfo-Pandaria.lua
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.