- Added slash command /details profile <profile name>

This commit is contained in:
Tercio
2015-04-09 21:14:59 -03:00
parent 08fec09ea9
commit 3358c483be
7 changed files with 75 additions and 51 deletions
+7 -14
View File
File diff suppressed because one or more lines are too long
+5 -7
View File
@@ -147,13 +147,13 @@ function DetailsCreateCoolTip()
--> Create Frames
--> main frame
local frame1 = CreateFrame ("Frame", "CoolTipFrame1", UIParent, "CooltipMainFrameTemplate")
tinsert (UISpecialFrames, "CoolTipFrame1")
local frame1 = CreateFrame ("Frame", "GameCoolTipFrame1", UIParent, "CooltipMainFrameTemplate")
tinsert (UISpecialFrames, "GameCoolTipFrame1")
gump:CreateFlashAnimation (frame1)
--> secondary frame
local frame2 = CreateFrame ("Frame", "CoolTipFrame2", UIParent, "CooltipMainFrameTemplate")
tinsert (UISpecialFrames, "CoolTipFrame2")
local frame2 = CreateFrame ("Frame", "GameCoolTipFrame2", UIParent, "CooltipMainFrameTemplate")
tinsert (UISpecialFrames, "GameCoolTipFrame2")
gump:CreateFlashAnimation (frame2)
frame2:SetClampedToScreen (true)
@@ -1082,9 +1082,7 @@ function DetailsCreateCoolTip()
for i = 1, CoolTip.IndexesSub [index] do
local menuButton = frame2.Lines [i]
-- CoolTipFrame2.Lines [2].divbar
if (menuButton.leftText:GetText() == "$div") then
--> height
+24 -22
View File
@@ -1225,6 +1225,29 @@ function gump:IconPick (callback, close_when_select)
end
local simple_panel_counter = 1
local simple_panel_mouse_down = function (self, button)
if (button == "RightButton") then
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
end
self:Hide()
return
end
self.IsMoving = true
self:StartMoving()
end
local simple_panel_mouse_up = function (self, button)
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
end
end
local simple_panel_settitle = function (self, title)
self.title:SetText (title)
end
function gump:CreateSimplePanel (parent, w, h, title, name)
if (not name) then
@@ -1937,26 +1960,5 @@ function gump:CreateChartPanel (parent, w, h, name)
return f
end
local simple_panel_counter = 1
local simple_panel_mouse_down = function (self, button)
if (button == "RightButton") then
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
end
self:Hide()
return
end
self.IsMoving = true
self:StartMoving()
end
local simple_panel_mouse_up = function (self, button)
if (self.IsMoving) then
self.IsMoving = false
self:StopMovingOrSizing()
end
end
local simple_panel_settitle = function (self, title)
self.title:SetText (title)
end
+11 -3
View File
@@ -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
+2 -2
View File
@@ -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
+21
View File
@@ -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 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+5 -3
View File
@@ -1661,9 +1661,9 @@ do
GameTooltip:Hide()
end
local create_aura_func = function (spellid, _, self)
local create_aura_func = function (spellid, encounter_id, self)
local name, _, icon = EncounterDetails.getspellinfo (spellid)
EncounterDetails:OpenAuraPanel (spellid, name, self and self.MyObject._icon.texture)
EncounterDetails:OpenAuraPanel (spellid, name, self and self.MyObject._icon.texture, encounter_id)
end
for i = 1, 10 do
@@ -1745,6 +1745,7 @@ do
end
EncounterDetails_SpellAurasScroll.spell_pool = spell_list
EncounterDetails_SpellAurasScroll.encounter_id = combat.is_boss and combat.is_boss.id
EncounterDetails_SpellAurasScroll:Update()
end
end
@@ -1752,6 +1753,7 @@ do
local refresh_spellauras = function (self)
local pool = EncounterDetails_SpellAurasScroll.spell_pool
local encounter_id = EncounterDetails_SpellAurasScroll.encounter_id
local offset = FauxScrollFrame_GetOffset (self)
for bar_index = 1, 10 do
@@ -1777,7 +1779,7 @@ do
bar.spellname:SetBackdropBorderColor (1, 1, 1)
end
bar.aurabutton:SetClickFunction (create_aura_func, data [1])
bar.aurabutton:SetClickFunction (create_aura_func, data [1], encounter_id)
else
bar:Hide()