- Full rewrite on custom displays.
- Fixed the report bug on healing, energy and misc attributes.
- Fixed a bug where the player pet wasn't being tracked after logon in the game.
- NewAPI: instance:IsGroupMode() return if a instance is in group mode.
- NewAPI: instance:GetCustomObject() return the custom object current used by the isntance.
- NewAPI: _detalhes:GetEncounterActorsName (EJ_EncounterID) return a hash table with [bossname] -> {[model] [displayInfo]}
- NewAPI: actor:GetDisplayName() actor:Class() return the formated name; return the class.
- NewAPI: _detalhes:GetClassIcon (class) return the icon path and texcoords.
This commit is contained in:
@@ -502,8 +502,10 @@ local ButtonMetaFunctions = {}
|
||||
end
|
||||
end
|
||||
|
||||
if (button.MyObject.have_tooltip) then
|
||||
_detalhes.popup:ShowMe (false)
|
||||
if (button.MyObject.have_tooltip) then
|
||||
if (GameCooltip:GetText (1) == button.MyObject.have_tooltip) then
|
||||
GameCooltip:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
local parent = button:GetParent().MyObject
|
||||
|
||||
@@ -805,7 +805,7 @@ function DetailsCreateCoolTip()
|
||||
end
|
||||
|
||||
function CoolTip:StatusBar (menuButton, StatusBar)
|
||||
|
||||
|
||||
if (StatusBar) then
|
||||
|
||||
menuButton.statusbar:SetValue (StatusBar [1])
|
||||
@@ -899,7 +899,8 @@ function DetailsCreateCoolTip()
|
||||
CoolTip.LeftIconTableSub [mainMenuIndex] and CoolTip.LeftIconTableSub [mainMenuIndex] [index],
|
||||
CoolTip.RightIconTableSub [mainMenuIndex] and CoolTip.RightIconTableSub [mainMenuIndex] [index], true)
|
||||
--> setup statusbar
|
||||
CoolTip:StatusBar (menuButton, CoolTip.StatusBarTable [mainMenuIndex] and CoolTip.StatusBarTable [mainMenuIndex] [index])
|
||||
CoolTip:StatusBar (menuButton, CoolTip.StatusBarTableSub [mainMenuIndex] and CoolTip.StatusBarTableSub [mainMenuIndex] [index])
|
||||
|
||||
|
||||
--> click
|
||||
menuButton:RegisterForClicks ("LeftButtonDown")
|
||||
@@ -1493,7 +1494,7 @@ function DetailsCreateCoolTip()
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
function CoolTip:GetText (buttonIndex)
|
||||
local button1 = frame1.Lines [buttonIndex]
|
||||
|
||||
+105
-20
@@ -875,22 +875,26 @@ function gump:ColorPick (frame, r, g, b, alpha, callback)
|
||||
end
|
||||
|
||||
------------icon pick
|
||||
function gump:IconPick (callback)
|
||||
function gump:IconPick (callback, close_when_select)
|
||||
|
||||
if (not gump.IconPickFrame) then
|
||||
|
||||
local string_lower = string.lower
|
||||
|
||||
gump.IconPickFrame = CreateFrame ("frame", "DetailsIconPickFrame", UIParent)
|
||||
tinsert (UISpecialFrames, "DetailsIconPickFrame")
|
||||
gump.IconPickFrame:SetFrameStrata ("DIALOG")
|
||||
|
||||
gump.IconPickFrame:SetPoint ("center", UIParent, "center")
|
||||
gump.IconPickFrame:SetWidth (350)
|
||||
gump.IconPickFrame:SetHeight (200)
|
||||
gump.IconPickFrame:SetHeight (227)
|
||||
gump.IconPickFrame:EnableMouse (true)
|
||||
gump.IconPickFrame:SetMovable (true)
|
||||
gump.IconPickFrame:SetBackdrop ({bgFile = "Interface\\AddOns\\Details\\images\\background", edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
|
||||
tile = true, tileSize = 32, edgeSize = 32, insets = {left = 5, right = 5, top = 5, bottom = 5}})
|
||||
|
||||
--local title = gump.IconPickFrame:CreateTitleRegion()
|
||||
|
||||
gump.IconPickFrame:SetBackdropBorderColor (170/255, 170/255, 170/255)
|
||||
gump.IconPickFrame:SetBackdropColor (24/255, 24/255, 24/255, .8)
|
||||
gump.IconPickFrame:SetFrameLevel (1)
|
||||
@@ -898,11 +902,29 @@ function gump:IconPick (callback)
|
||||
gump.IconPickFrame.emptyFunction = function() end
|
||||
gump.IconPickFrame.callback = gump.IconPickFrame.emptyFunction
|
||||
|
||||
gump.IconPickFrame.preview = gump:NewImage (gump.IconPickFrame, nil, 76, 76)
|
||||
|
||||
gump.IconPickFrame.searchLabel = gump:NewLabel (gump.IconPickFrame, nil, "$parentSearchBoxLabel", nil, "search:", font, size, color)
|
||||
gump.IconPickFrame.searchLabel:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12, -20)
|
||||
gump.IconPickFrame.search = gump:NewTextEntry (gump.IconPickFrame, nil, "$parentSearchBox", nil, 140, 20)
|
||||
gump.IconPickFrame.search:SetPoint ("left", gump.IconPickFrame.searchLabel, "right", 2, 0)
|
||||
gump.IconPickFrame.search:SetHook ("OnTextChanged", function()
|
||||
gump.IconPickFrame.searching = gump.IconPickFrame.search:GetText()
|
||||
if (gump.IconPickFrame.searching == "") then
|
||||
gump.IconPickFrameScroll:Show()
|
||||
gump.IconPickFrame.searching = nil
|
||||
gump.IconPickFrame.updateFunc()
|
||||
else
|
||||
gump.IconPickFrameScroll:Hide()
|
||||
gump.IconPickFrame.updateFunc()
|
||||
end
|
||||
end)
|
||||
|
||||
--> close button
|
||||
local close_button = CreateFrame ("button", nil, gump.IconPickFrame, "UIPanelCloseButton")
|
||||
close_button:SetWidth (32)
|
||||
close_button:SetHeight (32)
|
||||
close_button:SetPoint ("TOPRIGHT", gump.IconPickFrame, "TOPRIGHT", -3, 20)
|
||||
close_button:SetPoint ("TOPRIGHT", gump.IconPickFrame, "TOPRIGHT", -8, -7)
|
||||
close_button:SetFrameLevel (close_button:GetFrameLevel()+2)
|
||||
|
||||
local MACRO_ICON_FILENAMES = {}
|
||||
@@ -911,7 +933,6 @@ function gump:IconPick (callback)
|
||||
MACRO_ICON_FILENAMES = {};
|
||||
MACRO_ICON_FILENAMES[1] = "INV_MISC_QUESTIONMARK";
|
||||
local index = 2;
|
||||
local numFlyouts = 0;
|
||||
|
||||
for i = 1, GetNumSpellTabs() do
|
||||
local tab, tabTex, offset, numSpells, _ = GetSpellTabInfo(i);
|
||||
@@ -957,44 +978,69 @@ function gump:IconPick (callback)
|
||||
local OnClickFunction = function (index)
|
||||
local button = gump.IconPickFrame.buttons [index]
|
||||
local texture = button:GetNormalTexture()
|
||||
gump.IconPickFrame.callback ("INTERFACE\\ICONS\\"..MACRO_ICON_FILENAMES [button.IconID])
|
||||
gump.IconPickFrame.callback (button.icon_texture)
|
||||
if (gump.IconPickFrame.click_close) then
|
||||
close_button:Click()
|
||||
end
|
||||
end
|
||||
|
||||
local onenter = function (self)
|
||||
gump.IconPickFrame.preview:SetPoint ("bottom", self, "top", 0, 2)
|
||||
gump.IconPickFrame.preview:SetTexture (self.icon_texture)
|
||||
gump.IconPickFrame.preview:SetParent (self)
|
||||
gump.IconPickFrame.preview:Show()
|
||||
end
|
||||
local onleave = function (self)
|
||||
gump.IconPickFrame.preview:Hide()
|
||||
end
|
||||
|
||||
for i = 0, 9 do
|
||||
local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i+1, i+1, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..(i+1))
|
||||
newcheck:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12+(i*30), -13)
|
||||
newcheck:SetPoint ("topleft", gump.IconPickFrame, "topleft", 12 + (i*30), -40)
|
||||
newcheck:SetID (i+1)
|
||||
gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
|
||||
newcheck.MouseOnEnterHook = onenter
|
||||
newcheck.MouseOnLeaveHook = onleave
|
||||
end
|
||||
for i = 11, 20 do
|
||||
local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i)
|
||||
newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
|
||||
newcheck:SetID (i)
|
||||
gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
|
||||
newcheck.MouseOnEnterHook = onenter
|
||||
newcheck.MouseOnLeaveHook = onleave
|
||||
end
|
||||
for i = 21, 30 do
|
||||
local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i)
|
||||
newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
|
||||
newcheck:SetID (i)
|
||||
gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
|
||||
newcheck.MouseOnEnterHook = onenter
|
||||
newcheck.MouseOnLeaveHook = onleave
|
||||
end
|
||||
for i = 31, 40 do
|
||||
local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i)
|
||||
newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
|
||||
newcheck:SetID (i)
|
||||
gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
|
||||
newcheck.MouseOnEnterHook = onenter
|
||||
newcheck.MouseOnLeaveHook = onleave
|
||||
end
|
||||
for i = 41, 50 do
|
||||
local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i)
|
||||
newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
|
||||
newcheck:SetID (i)
|
||||
gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
|
||||
newcheck.MouseOnEnterHook = onenter
|
||||
newcheck.MouseOnLeaveHook = onleave
|
||||
end
|
||||
for i = 51, 60 do
|
||||
local newcheck = gump:NewDetailsButton (gump.IconPickFrame, gump.IconPickFrame, _, OnClickFunction, i, i, 30, 28, "", "", "", "", _, "DetailsIconPickFrameButton"..i)
|
||||
newcheck:SetPoint ("topleft", "DetailsIconPickFrameButton"..(i-10), "bottomleft", 0, -1)
|
||||
newcheck:SetID (i)
|
||||
gump.IconPickFrame.buttons [#gump.IconPickFrame.buttons+1] = newcheck
|
||||
newcheck.MouseOnEnterHook = onenter
|
||||
newcheck.MouseOnLeaveHook = onleave
|
||||
end
|
||||
|
||||
local scroll = CreateFrame ("ScrollFrame", "DetailsIconPickFrameScroll", gump.IconPickFrame, "ListScrollFrameTemplate")
|
||||
@@ -1008,27 +1054,65 @@ function gump:IconPick (callback)
|
||||
|
||||
-- Icon list
|
||||
local texture;
|
||||
for i = 1, 60 do
|
||||
macroPopupIcon = _G["DetailsIconPickFrameButton"..i];
|
||||
macroPopupButton = _G["DetailsIconPickFrameButton"..i];
|
||||
index = (macroPopupOffset * 10) + i;
|
||||
texture = MACRO_ICON_FILENAMES [index]
|
||||
if ( index <= numMacroIcons and texture ) then
|
||||
macroPopupButton:ChangeIcon ("INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture)
|
||||
macroPopupButton.IconID = index
|
||||
macroPopupButton:Show();
|
||||
else
|
||||
macroPopupButton:Hide();
|
||||
|
||||
local filter
|
||||
if (gump.IconPickFrame.searching) then
|
||||
filter = string_lower (gump.IconPickFrame.searching)
|
||||
end
|
||||
|
||||
if (filter and filter ~= "") then
|
||||
local i = 1
|
||||
for o = 1, numMacroIcons do
|
||||
local text = string_lower (MACRO_ICON_FILENAMES [o])
|
||||
if (text:find (filter)) then
|
||||
macroPopupIcon = _G ["DetailsIconPickFrameButton"..i]
|
||||
macroPopupButton = _G ["DetailsIconPickFrameButton"..i]
|
||||
local texture = MACRO_ICON_FILENAMES [o]
|
||||
macroPopupButton:ChangeIcon ("INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture)
|
||||
macroPopupButton.IconID = index
|
||||
macroPopupButton.icon_texture = "INTERFACE\\ICONS\\"..texture
|
||||
macroPopupButton:Show();
|
||||
|
||||
i = i + 1
|
||||
if (i > 60) then
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if (i == 1) then --no resutls
|
||||
macroPopupButton = _G ["DetailsIconPickFrameButton"..i]
|
||||
macroPopupButton:Hide()
|
||||
end
|
||||
|
||||
for o = i+1, 60 do
|
||||
macroPopupButton = _G ["DetailsIconPickFrameButton"..o]
|
||||
macroPopupButton:Hide()
|
||||
end
|
||||
else
|
||||
for i = 1, 60 do
|
||||
macroPopupIcon = _G ["DetailsIconPickFrameButton"..i]
|
||||
macroPopupButton = _G ["DetailsIconPickFrameButton"..i]
|
||||
index = (macroPopupOffset * 10) + i;
|
||||
texture = MACRO_ICON_FILENAMES [index]
|
||||
if ( index <= numMacroIcons and texture ) then
|
||||
macroPopupButton:ChangeIcon ("INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture, "INTERFACE\\ICONS\\"..texture)
|
||||
macroPopupButton.IconID = index
|
||||
macroPopupButton.icon_texture = "INTERFACE\\ICONS\\"..texture
|
||||
macroPopupButton:Show()
|
||||
else
|
||||
macroPopupButton:Hide()
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Scrollbar stuff
|
||||
FauxScrollFrame_Update (scroll, ceil (numMacroIcons / 10) , 5, 20 );
|
||||
end
|
||||
|
||||
gump.IconPickFrame.updateFunc = ChecksFrame_Update
|
||||
|
||||
|
||||
scroll:SetPoint ("topleft", gump.IconPickFrame, "topleft", -18, -10)
|
||||
scroll:SetPoint ("topleft", gump.IconPickFrame, "topleft", -18, -37)
|
||||
scroll:SetWidth (330)
|
||||
scroll:SetHeight (178)
|
||||
scroll:SetScript ("OnVerticalScroll", function (self, offset) FauxScrollFrame_OnVerticalScroll (scroll, offset, 20, ChecksFrame_Update) end)
|
||||
@@ -1041,5 +1125,6 @@ function gump:IconPick (callback)
|
||||
gump.IconPickFrame:Show()
|
||||
gump.IconPickFrameScroll.update (gump.IconPickFrameScroll)
|
||||
gump.IconPickFrame.callback = callback or gump.IconPickFrame.emptyFunction
|
||||
gump.IconPickFrame.click_close = close_when_select
|
||||
|
||||
end
|
||||
|
||||
+31
-9
@@ -248,6 +248,29 @@ local TextEntryMetaFunctions = {}
|
||||
end
|
||||
end
|
||||
|
||||
function TextEntryMetaFunctions:Enable()
|
||||
if (not self.editbox:IsEnabled()) then
|
||||
self.editbox:Enable()
|
||||
self.editbox:SetBackdropBorderColor (unpack (self.enabled_border_color))
|
||||
self.editbox:SetBackdropColor (unpack (self.enabled_backdrop_color))
|
||||
self.editbox:SetTextColor (unpack (self.enabled_text_color))
|
||||
end
|
||||
end
|
||||
|
||||
function TextEntryMetaFunctions:Disable()
|
||||
if (self.editbox:IsEnabled()) then
|
||||
self.enabled_border_color = {self.editbox:GetBackdropBorderColor()}
|
||||
self.enabled_backdrop_color = {self.editbox:GetBackdropColor()}
|
||||
self.enabled_text_color = {self.editbox:GetTextColor()}
|
||||
|
||||
self.editbox:Disable()
|
||||
|
||||
self.editbox:SetBackdropBorderColor (.5, .5, .5, .5)
|
||||
self.editbox:SetBackdropColor (.5, .5, .5, .5)
|
||||
self.editbox:SetTextColor (.5, .5, .5, .5)
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
--> scripts
|
||||
local OnEnter = function (textentry)
|
||||
@@ -269,7 +292,7 @@ local TextEntryMetaFunctions = {}
|
||||
|
||||
if (textentry:IsEnabled()) then
|
||||
textentry.current_bordercolor = textentry.current_bordercolor or {textentry:GetBackdropBorderColor()}
|
||||
textentry:SetBackdropBorderColor (0.5, 0.5, 0.5, 1)
|
||||
textentry:SetBackdropBorderColor (1, 1, 1, 1)
|
||||
end
|
||||
|
||||
local parent = textentry:GetParent().MyObject
|
||||
@@ -527,16 +550,15 @@ function gump:NewTextEntry (parent, container, name, member, w, h, func, param1,
|
||||
TextEntryObject.editbox:SetJustifyH ("center")
|
||||
TextEntryObject.editbox:EnableMouse (true)
|
||||
TextEntryObject.editbox:SetText ("")
|
||||
|
||||
--TextEntryObject.editbox:SetBackdrop ({bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
|
||||
--edgeFile = "Interface\\ChatFrame\\ChatFrameBackground",
|
||||
--tile = true, edgeSize = 1, tileSize = 5})
|
||||
|
||||
--TextEntryObject.editbox:SetBackdropColor (0, 0, 0, 0.5)
|
||||
--TextEntryObject.editbox:SetBackdropBorderColor (0.3, 0.3, 0.30, 0.80)
|
||||
TextEntryObject.editbox.current_bordercolor = {1, 1, 1, 1}
|
||||
|
||||
TextEntryObject.editbox:SetAutoFocus (false)
|
||||
TextEntryObject.editbox:SetFontObject ("GameFontHighlightSmall")
|
||||
|
||||
TextEntryObject.editbox.current_bordercolor = {1, 1, 1, 0.7}
|
||||
TextEntryObject.editbox:SetBackdropBorderColor (1, 1, 1, 0.7)
|
||||
TextEntryObject.enabled_border_color = {TextEntryObject.editbox:GetBackdropBorderColor()}
|
||||
TextEntryObject.enabled_backdrop_color = {TextEntryObject.editbox:GetBackdropColor()}
|
||||
TextEntryObject.enabled_text_color = {TextEntryObject.editbox:GetTextColor()}
|
||||
|
||||
TextEntryObject.func = func
|
||||
TextEntryObject.param1 = param1
|
||||
|
||||
Reference in New Issue
Block a user