Updated LibOpenRaid and DetailsFramework
This commit is contained in:
+88
-88
@@ -28,7 +28,7 @@ function Details:CreateAPI2Frame()
|
||||
local Api2Frame = _G.DetailsAPI2Frame
|
||||
|
||||
Api2Frame:SetFrameStrata ("FULLSCREEN")
|
||||
Api2Frame:SetPoint ("center")
|
||||
Api2Frame:SetPoint("center")
|
||||
DetailsFramework:ApplyStandardBackdrop (Api2Frame, false, 1.2)
|
||||
|
||||
--store
|
||||
@@ -43,14 +43,14 @@ function Details:CreateAPI2Frame()
|
||||
local onSelectAPI = function(self)
|
||||
local apiName = apiFunctionNames [self.index]
|
||||
if (not apiName) then
|
||||
Details:Msg ("API name not found:", apiName)
|
||||
Details:Msg("API name not found:", apiName)
|
||||
return
|
||||
end
|
||||
|
||||
--fill the box in the right with information about the API
|
||||
local apiInfo = api [self.index]
|
||||
if (not apiInfo) then
|
||||
Details:Msg ("API information for api not found", apiName)
|
||||
Details:Msg("API information for api not found", apiName)
|
||||
return
|
||||
end
|
||||
|
||||
@@ -62,7 +62,7 @@ function Details:CreateAPI2Frame()
|
||||
|
||||
--update the copy line text box
|
||||
local parameters = ""
|
||||
for parameterIndex, parameterInfo in ipairs (apiInfo.parameters) do
|
||||
for parameterIndex, parameterInfo in ipairs(apiInfo.parameters) do
|
||||
if (parameterInfo.required) then
|
||||
parameters = parameters .. parameterInfo.name .. ", "
|
||||
end
|
||||
@@ -70,7 +70,7 @@ function Details:CreateAPI2Frame()
|
||||
parameters = parameters:gsub (", $", "")
|
||||
|
||||
local returnValues = "local "
|
||||
for returnIndex, returnInfo in ipairs (apiInfo.returnValues) do
|
||||
for returnIndex, returnInfo in ipairs(apiInfo.returnValues) do
|
||||
returnValues = returnValues .. returnInfo.name .. ", "
|
||||
end
|
||||
returnValues = returnValues:gsub (", $", "")
|
||||
@@ -130,29 +130,29 @@ function Details:CreateAPI2Frame()
|
||||
local apiName = data [index]
|
||||
if (apiName) then
|
||||
local line = self:GetLine (i)
|
||||
line.text:SetText (apiName)
|
||||
line.text:SetText(apiName)
|
||||
line.index = index
|
||||
|
||||
if (currentSelected == index) then
|
||||
line:SetBackdropColor (unpack (backdropColorSelected))
|
||||
line:SetBackdropColor(unpack (backdropColorSelected))
|
||||
else
|
||||
line:SetBackdropColor (unpack (backdropColor))
|
||||
line:SetBackdropColor(unpack (backdropColor))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for apiIndex, apiDesc in ipairs (api) do
|
||||
for apiIndex, apiDesc in ipairs(api) do
|
||||
tinsert (apiFunctionNames, apiDesc.name)
|
||||
end
|
||||
|
||||
local api2ScrollMenu = DetailsFramework:CreateScrollBox (Api2Frame, "$parentApi2MenuScroll", apiMenuScrollRefresh, apiFunctionNames, scrollWidth, scrollHeight, lineAmount, lineHeight)
|
||||
DetailsFramework:ReskinSlider(api2ScrollMenu)
|
||||
api2ScrollMenu:SetPoint ("topleft", Api2Frame, "topleft", 10, yStart)
|
||||
api2ScrollMenu:SetPoint("topleft", Api2Frame, "topleft", 10, yStart)
|
||||
Api2Frame.scrollMenu = api2ScrollMenu
|
||||
|
||||
local lineOnEnter = function(self)
|
||||
self:SetBackdropColor (unpack (backdropColorOnEnter))
|
||||
self:SetBackdropColor(unpack (backdropColorOnEnter))
|
||||
|
||||
local apiName = apiFunctionNames [self.index]
|
||||
if (not apiName) then
|
||||
@@ -173,9 +173,9 @@ function Details:CreateAPI2Frame()
|
||||
|
||||
local lineOnLeave = function(self)
|
||||
if (currentSelected == self.index) then
|
||||
self:SetBackdropColor (unpack (backdropColorSelected))
|
||||
self:SetBackdropColor(unpack (backdropColorSelected))
|
||||
else
|
||||
self:SetBackdropColor (unpack (backdropColor))
|
||||
self:SetBackdropColor(unpack (backdropColor))
|
||||
end
|
||||
|
||||
GameCooltip2:Hide()
|
||||
@@ -184,21 +184,21 @@ function Details:CreateAPI2Frame()
|
||||
--create lines
|
||||
for i = 1, lineAmount do
|
||||
api2ScrollMenu:CreateLine (function(self, index)
|
||||
local line = CreateFrame ("button", "$parentLine" .. index, self, "BackdropTemplate")
|
||||
line:SetPoint ("topleft", self, "topleft", 1, -((index-1)*(lineHeight+1)) - 1)
|
||||
line:SetSize (scrollWidth - 2, lineHeight)
|
||||
local line = CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate")
|
||||
line:SetPoint("topleft", self, "topleft", 1, -((index-1)*(lineHeight+1)) - 1)
|
||||
line:SetSize(scrollWidth - 2, lineHeight)
|
||||
line.index = index
|
||||
|
||||
line:SetScript ("OnEnter", lineOnEnter)
|
||||
line:SetScript ("OnLeave", lineOnLeave)
|
||||
line:SetScript("OnEnter", lineOnEnter)
|
||||
line:SetScript("OnLeave", lineOnLeave)
|
||||
|
||||
line:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
line:SetBackdropColor (unpack (backdropColor))
|
||||
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
line:SetBackdropColor(unpack (backdropColor))
|
||||
|
||||
line.text = DetailsFramework:CreateLabel (line)
|
||||
line.text:SetPoint ("left", line, "left", 2, 0)
|
||||
line.text = DetailsFramework:CreateLabel(line)
|
||||
line.text:SetPoint("left", line, "left", 2, 0)
|
||||
|
||||
line:SetScript ("OnMouseDown", onSelectAPI)
|
||||
line:SetScript("OnMouseDown", onSelectAPI)
|
||||
|
||||
return line
|
||||
end)
|
||||
@@ -207,43 +207,43 @@ function Details:CreateAPI2Frame()
|
||||
--info box
|
||||
local infoWidth = panelWidth - xAnchorPoint - 10
|
||||
--api name
|
||||
Api2Frame.ApiFunctionName = DetailsFramework:CreateLabel (Api2Frame, "", 14, "orange")
|
||||
Api2Frame.ApiFunctionName:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, yStart)
|
||||
Api2Frame.ApiFunctionName = DetailsFramework:CreateLabel(Api2Frame, "", 14, "orange")
|
||||
Api2Frame.ApiFunctionName:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, yStart)
|
||||
--api desc
|
||||
Api2Frame.ApiFunctionDesc = DetailsFramework:CreateLabel (Api2Frame)
|
||||
Api2Frame.ApiFunctionDesc:SetPoint ("topleft", Api2Frame.ApiFunctionName, "bottomleft", 0, -2)
|
||||
Api2Frame.ApiFunctionDesc = DetailsFramework:CreateLabel(Api2Frame)
|
||||
Api2Frame.ApiFunctionDesc:SetPoint("topleft", Api2Frame.ApiFunctionName, "bottomleft", 0, -2)
|
||||
Api2Frame.ApiFunctionDesc.width = infoWidth
|
||||
Api2Frame.ApiFunctionDesc.height = 22
|
||||
Api2Frame.ApiFunctionDesc.valign = "top"
|
||||
|
||||
--api func to copy
|
||||
local apiCopyString = DetailsFramework:CreateLabel (Api2Frame, "Copy String", 12, "orange")
|
||||
apiCopyString:SetPoint ("topleft", Api2Frame.ApiFunctionDesc, "bottomleft", 0, -20)
|
||||
local apiCopyString = DetailsFramework:CreateLabel(Api2Frame, "Copy String", 12, "orange")
|
||||
apiCopyString:SetPoint("topleft", Api2Frame.ApiFunctionDesc, "bottomleft", 0, -20)
|
||||
Api2Frame.ApiCopy = DetailsFramework:CreateTextEntry (Api2Frame, function() end, infoWidth, 20)
|
||||
Api2Frame.ApiCopy:SetPoint ("topleft", apiCopyString, "bottomleft", 0, -2)
|
||||
Api2Frame.ApiCopy:SetPoint("topleft", apiCopyString, "bottomleft", 0, -2)
|
||||
Api2Frame.ApiCopy:SetTemplate (DetailsFramework:GetTemplate ("button", "DETAILS_CUSTOMDISPLAY_CODE_BOX"))
|
||||
|
||||
--parameters
|
||||
local parametersYStart = yStart - 110
|
||||
local parametersString = DetailsFramework:CreateLabel (Api2Frame, "Parameters", 12, "orange")
|
||||
parametersString:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart)
|
||||
local parametersString = DetailsFramework:CreateLabel(Api2Frame, "Parameters", 12, "orange")
|
||||
parametersString:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart)
|
||||
|
||||
parametersYStart = parametersYStart - 20
|
||||
|
||||
local space1, space2, space3 = 150, 300, 450
|
||||
local parametersHeader = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
parametersHeader:SetSize (infoWidth, 20)
|
||||
parametersHeader:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart)
|
||||
parametersHeader:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
parametersHeader:SetBackdropColor (unpack (backdropColor))
|
||||
parametersHeader.name = DetailsFramework:CreateLabel (parametersHeader, "Name", 12, "yellow")
|
||||
parametersHeader.typeData = DetailsFramework:CreateLabel (parametersHeader, "Type", 12, "yellow")
|
||||
parametersHeader.required = DetailsFramework:CreateLabel (parametersHeader, "Is Required", 12, "yellow")
|
||||
parametersHeader.default = DetailsFramework:CreateLabel (parametersHeader, "Default Value", 12, "yellow")
|
||||
parametersHeader.name:SetPoint ("left", parametersHeader, "left", 2, 0)
|
||||
parametersHeader.typeData:SetPoint ("left", parametersHeader, "left", space1, 0)
|
||||
parametersHeader.required:SetPoint ("left", parametersHeader, "left", space2, 0)
|
||||
parametersHeader.default:SetPoint ("left", parametersHeader, "left", space3, 0)
|
||||
local parametersHeader = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
parametersHeader:SetSize(infoWidth, 20)
|
||||
parametersHeader:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart)
|
||||
parametersHeader:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
parametersHeader:SetBackdropColor(unpack (backdropColor))
|
||||
parametersHeader.name = DetailsFramework:CreateLabel(parametersHeader, "Name", 12, "yellow")
|
||||
parametersHeader.typeData = DetailsFramework:CreateLabel(parametersHeader, "Type", 12, "yellow")
|
||||
parametersHeader.required = DetailsFramework:CreateLabel(parametersHeader, "Is Required", 12, "yellow")
|
||||
parametersHeader.default = DetailsFramework:CreateLabel(parametersHeader, "Default Value", 12, "yellow")
|
||||
parametersHeader.name:SetPoint("left", parametersHeader, "left", 2, 0)
|
||||
parametersHeader.typeData:SetPoint("left", parametersHeader, "left", space1, 0)
|
||||
parametersHeader.required:SetPoint("left", parametersHeader, "left", space2, 0)
|
||||
parametersHeader.default:SetPoint("left", parametersHeader, "left", space3, 0)
|
||||
|
||||
local parameterOnEnter = function(self)
|
||||
GameCooltip2:Preset(2)
|
||||
@@ -257,87 +257,87 @@ function Details:CreateAPI2Frame()
|
||||
GameCooltip2:AddLine (apiInfo.parameters [self.index].desc)
|
||||
GameCooltip2:ShowCooltip()
|
||||
|
||||
self:SetBackdropColor (unpack (backdropColorOnEnter))
|
||||
self:SetBackdropColor(unpack (backdropColorOnEnter))
|
||||
end
|
||||
local parameterOnLeave = function(self)
|
||||
GameCooltip2:Hide()
|
||||
self:SetBackdropColor (unpack (backdropColor))
|
||||
self:SetBackdropColor(unpack (backdropColor))
|
||||
end
|
||||
|
||||
for i = 1, parametersAmount do
|
||||
local parameterLine = {}
|
||||
local f = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
f:SetSize (infoWidth, 20)
|
||||
f:SetScript ("OnEnter", parameterOnEnter)
|
||||
f:SetScript ("OnLeave", parameterOnLeave)
|
||||
f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
f:SetBackdropColor (unpack (backdropColor))
|
||||
local f = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
f:SetSize(infoWidth, 20)
|
||||
f:SetScript("OnEnter", parameterOnEnter)
|
||||
f:SetScript("OnLeave", parameterOnLeave)
|
||||
f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
f:SetBackdropColor(unpack (backdropColor))
|
||||
f:Hide()
|
||||
|
||||
f.name = DetailsFramework:CreateLabel (f)
|
||||
f.typeData = DetailsFramework:CreateLabel (f)
|
||||
f.required = DetailsFramework:CreateLabel (f)
|
||||
f.default = DetailsFramework:CreateLabel (f)
|
||||
f.name = DetailsFramework:CreateLabel(f)
|
||||
f.typeData = DetailsFramework:CreateLabel(f)
|
||||
f.required = DetailsFramework:CreateLabel(f)
|
||||
f.default = DetailsFramework:CreateLabel(f)
|
||||
|
||||
f:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart + (-i * 20))
|
||||
f:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, parametersYStart + (-i * 20))
|
||||
|
||||
f.name:SetPoint ("left", f, "left", 2, 0)
|
||||
f.typeData:SetPoint ("left", f, "left", space1, 0)
|
||||
f.required:SetPoint ("left", f, "left", space2, 0)
|
||||
f.default:SetPoint ("left", f, "left", space3, 0)
|
||||
f.name:SetPoint("left", f, "left", 2, 0)
|
||||
f.typeData:SetPoint("left", f, "left", space1, 0)
|
||||
f.required:SetPoint("left", f, "left", space2, 0)
|
||||
f.default:SetPoint("left", f, "left", space3, 0)
|
||||
|
||||
tinsert (parametersLines, f)
|
||||
end
|
||||
|
||||
--return value box
|
||||
local returnYStart = yStart - 260
|
||||
local returnString = DetailsFramework:CreateLabel (Api2Frame, "Return Values", 12, "orange")
|
||||
returnString:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart)
|
||||
local returnString = DetailsFramework:CreateLabel(Api2Frame, "Return Values", 12, "orange")
|
||||
returnString:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart)
|
||||
|
||||
returnYStart = returnYStart - 20
|
||||
|
||||
local space1 = 200
|
||||
local returnHeader = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
returnHeader:SetSize (infoWidth, 20)
|
||||
returnHeader:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart)
|
||||
returnHeader:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
returnHeader:SetBackdropColor (unpack (backdropColor))
|
||||
returnHeader.name = DetailsFramework:CreateLabel (returnHeader, "Name", 12, "yellow")
|
||||
returnHeader.typeData = DetailsFramework:CreateLabel (returnHeader, "Type", 12, "yellow")
|
||||
returnHeader.name:SetPoint ("left", returnHeader, "left", 2, 0)
|
||||
returnHeader.typeData:SetPoint ("left", returnHeader, "left", space1, 0)
|
||||
local returnHeader = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
returnHeader:SetSize(infoWidth, 20)
|
||||
returnHeader:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart)
|
||||
returnHeader:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
returnHeader:SetBackdropColor(unpack (backdropColor))
|
||||
returnHeader.name = DetailsFramework:CreateLabel(returnHeader, "Name", 12, "yellow")
|
||||
returnHeader.typeData = DetailsFramework:CreateLabel(returnHeader, "Type", 12, "yellow")
|
||||
returnHeader.name:SetPoint("left", returnHeader, "left", 2, 0)
|
||||
returnHeader.typeData:SetPoint("left", returnHeader, "left", space1, 0)
|
||||
|
||||
local returnOnEnter = function(self)
|
||||
self:SetBackdropColor (unpack (backdropColorOnEnter))
|
||||
self:SetBackdropColor(unpack (backdropColorOnEnter))
|
||||
end
|
||||
local returnOnLeave = function(self)
|
||||
self:SetBackdropColor (unpack (backdropColor))
|
||||
self:SetBackdropColor(unpack (backdropColor))
|
||||
end
|
||||
|
||||
for i = 1, returnAmount do
|
||||
local parameterLine = {}
|
||||
local f = CreateFrame ("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
f:SetSize (infoWidth, 20)
|
||||
f:SetScript ("OnEnter", returnOnEnter)
|
||||
f:SetScript ("OnLeave", returnOnLeave)
|
||||
f:SetBackdrop ({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
f:SetBackdropColor (unpack (backdropColor))
|
||||
local f = CreateFrame("frame", nil, Api2Frame, "BackdropTemplate")
|
||||
f:SetSize(infoWidth, 20)
|
||||
f:SetScript("OnEnter", returnOnEnter)
|
||||
f:SetScript("OnLeave", returnOnLeave)
|
||||
f:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true})
|
||||
f:SetBackdropColor(unpack (backdropColor))
|
||||
f:Hide()
|
||||
|
||||
f.name = DetailsFramework:CreateLabel (f)
|
||||
f.typeData = DetailsFramework:CreateLabel (f)
|
||||
f.name = DetailsFramework:CreateLabel(f)
|
||||
f.typeData = DetailsFramework:CreateLabel(f)
|
||||
|
||||
f.desc = DetailsFramework:CreateLabel (f, "", 10, "gray")
|
||||
f.desc = DetailsFramework:CreateLabel(f, "", 10, "gray")
|
||||
f.desc.width = infoWidth
|
||||
f.desc.height = 60
|
||||
f.desc.valign = "top"
|
||||
|
||||
f:SetPoint ("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart + (-i * 20))
|
||||
f:SetPoint("topleft", Api2Frame, "topleft", xAnchorPoint, returnYStart + (-i * 20))
|
||||
|
||||
f.name:SetPoint ("left", f, "left", 2, 0)
|
||||
f.typeData:SetPoint ("left", f, "left", space1, 0)
|
||||
f.name:SetPoint("left", f, "left", 2, 0)
|
||||
f.typeData:SetPoint("left", f, "left", space1, 0)
|
||||
|
||||
f.desc:SetPoint ("topleft", f.name, "bottomleft", 0, -5)
|
||||
f.desc:SetPoint("topleft", f.name, "bottomleft", 0, -5)
|
||||
|
||||
tinsert (returnLines, f)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user