- Added slash command /details profile <profile name>
This commit is contained in:
+11
-3
@@ -266,7 +266,7 @@
|
||||
},
|
||||
}
|
||||
|
||||
function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow)
|
||||
function _detalhes:CreateWeakAura (spellid, use_spellid, spellname, name, icon_texture, target, stacksize, sound, chat, icon_text, icon_glow, encounter_id)
|
||||
|
||||
--> check if wa is installed
|
||||
if (not WeakAuras or not WeakAurasSaved) then
|
||||
@@ -282,6 +282,11 @@
|
||||
--> create the icon table
|
||||
local icon = _detalhes.table.copy ({}, icon_prototype)
|
||||
|
||||
if (encounter_id) then
|
||||
icon.load.use_encounterid = true
|
||||
icon.load.encounterid = tostring (encounter_id)
|
||||
end
|
||||
|
||||
icon.id = name
|
||||
icon.displayIcon = icon_texture
|
||||
|
||||
@@ -432,7 +437,7 @@
|
||||
|
||||
end
|
||||
|
||||
function _detalhes:OpenAuraPanel (spellid, spellname, spellicon)
|
||||
function _detalhes:OpenAuraPanel (spellid, spellname, spellicon, encounterid)
|
||||
|
||||
spellname = select (1, GetSpellInfo (spellid))
|
||||
|
||||
@@ -627,9 +632,11 @@
|
||||
|
||||
local icon_text = f.AuraText.text
|
||||
local icon_glow = f.UseGlow.value
|
||||
|
||||
local eid = DetailsAuraPanel.encounterid
|
||||
|
||||
if (addon == "WA") then
|
||||
_detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow)
|
||||
_detalhes:CreateWeakAura (spellid, use_spellId, spellname, name, icon, target, stacksize, sound, chat, icon_text, icon_glow, eid)
|
||||
else
|
||||
_detalhes:Msg ("No Aura Addon selected. Addons currently supported: WeakAuras 2.")
|
||||
end
|
||||
@@ -671,6 +678,7 @@
|
||||
end
|
||||
|
||||
DetailsAuraPanel.spellid = spellid
|
||||
DetailsAuraPanel.encounterid = encounterid
|
||||
|
||||
DetailsAuraPanel.name.text = spellname .. " (d!)"
|
||||
DetailsAuraPanel.spellname.text = spellname
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
function _detalhes:GetCurrentProfileName()
|
||||
|
||||
--> check is have a profile name
|
||||
if (_detalhes_database.active_profile == "") then
|
||||
if (_detalhes_database.active_profile == "") then -- or not _detalhes_database.active_profile
|
||||
local character_key = UnitName ("player") .. "-" .. GetRealmName()
|
||||
_detalhes_database.active_profile = character_key
|
||||
end
|
||||
@@ -104,7 +104,7 @@ function _detalhes:GetProfile (name, create)
|
||||
end
|
||||
|
||||
local profile = _detalhes_global.__profiles [name]
|
||||
|
||||
|
||||
if (not profile and not create) then
|
||||
return false
|
||||
|
||||
|
||||
@@ -122,6 +122,27 @@ function SlashCmdList.DETAILS (msg, editbox)
|
||||
|
||||
elseif (command == "feedback") then
|
||||
_detalhes.OpenFeedbackWindow()
|
||||
|
||||
elseif (command == "profile") then
|
||||
if (rest and rest ~= "") then
|
||||
|
||||
local profile = _detalhes:GetProfile (rest)
|
||||
if (not profile) then
|
||||
return _detalhes:Msg ("Profile Not Found.")
|
||||
end
|
||||
|
||||
if (not _detalhes:ApplyProfile (rest)) then
|
||||
return
|
||||
end
|
||||
|
||||
_detalhes:Msg (Loc ["STRING_OPTIONS_PROFILE_LOADED"], rest)
|
||||
if (_G.DetailsOptionsWindow and _G.DetailsOptionsWindow:IsShown()) then
|
||||
_G.DetailsOptionsWindow:Hide()
|
||||
GameCooltip:Close()
|
||||
end
|
||||
else
|
||||
_detalhes:Msg ("/details profile <profile name>")
|
||||
end
|
||||
|
||||
-------- debug ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user