Hi all
I want to have a scrolling frame that displays frames.
I have other scrolling lists of buttons and they work fine so I just thought I could repurpose it yet have not been able to get them working.
Here is the frame layout I want to build, it has 1 texture and 3 strings;
Here are the parent and child scroll frames;
Lua Code:
local IronManInterfaceScrollParent =
CreateFrame("Frame", "IronManInterfaceScrollParent", IronManInterfaceFrame, "HelpFrameContainerFrameTemplate")
IronManInterfaceScrollParent:SetSize(NumberList.achievementFrameWidth, 300)
IronManInterfaceScrollParent:SetPoint("CENTER")
local IronManInterfaceScrollFrame = CreateFrame("ScrollFrame", "IronManInterfaceScrollFrame", IronManInterfaceScrollParent, "FauxScrollFrameTemplate")
IronManInterfaceScrollFrame:SetPoint("TOPLEFT", 0, -8)
IronManInterfaceScrollFrame:SetPoint("BOTTOMRIGHT", -30, 8)
IronManInterfaceScrollFrame:SetScript(
"OnVerticalScroll",
function(self, offset)
FauxScrollFrame_OnVerticalScroll(self, offset, NumberList.scrollFrameNumber, updateAchievementList)
end
)
Here is my update function;
Lua Code:
local function updateAchievementList()
FauxScrollFrame_Update(
IronManInterfaceScrollFrame,
#IronManCompleatedAchievements,
NumberList.scrollButtonNumber,
NumberList.scrollButtonHeight
)
for index = 1, NumberList.scrollButtonNumber do
local offset = index + FauxScrollFrame_GetOffset(IronManInterfaceScrollFrame)
local frame = IronManInterfaceScrollFrame.frames[index]
frame.index = offset
if offset <= #IronManCompleatedAchievements then
frametexture:SetTexture(IronManCompleatedAchievements[offset].icon)
frametitleTextBoxtext:SetText(IronManCompleatedAchievements[offset].title)
frameNameTextBoxtext:SetText(IronManCompleatedAchievements[offset].char)
frameDateTextBoxtext:SetText(IronManCompleatedAchievements[offset].date)
frame:Show()
else
frame:Hide()
end
end
end
Here is my list of scroll list of frame builders;
Lua Code:
IronManInterfaceScrollFrame.frames = {}
for index = 1, NumberList.scrollFrameNumber do
IronManInterfaceScrollFrame.frames[index] =
CreateFrame("Frame", "IMISF" .. index, IronManInterfaceScrollParent, "HelpFrameContainerFrameTemplate")
local frame = IronManInterfaceScrollFrame.frames[index]
frame:SetSize(NumberList.scrollframeWidth, NumberList.scrollFrameHeight)
frame:SetPoint("TOPLEFT", 8, -(index - 1) * NumberList.scrollFrameHeight - 8)
frame.texture = frame:CreateTexture("frametexture")
frametexture:SetScale(NumberList.iconAchievementTextureScale)
frametexture:SetPoint("LEFT")
frame.titleTextBox = CreateFrame("Frame", "frametitleTextBox", frame)
frametitleTextBox:SetSize(350, 30) -- debug --
frametitleTextBox:SetPoint("TOPRIGHT")
frametitleTextBox.text = frametitleTextBox:CreateFontString("frametitleTextBoxtext")
frametitleTextBoxtext:SetAllPoints(frametitleTextBox)
frametitleTextBoxtext:SetFontObject(FontList.rulesFont)
frameNameTextBox = CreateFrame("Frame", "frameNameTextBox", frame)
frameNameTextBox:SetSize(350, 30) -- debug --
frameNameTextBox:SetPoint("CENTER")
frameNameTextBox.text = frameNameTextBox:CreateFontString("frameNameTextBoxtext")
frameNameTextBoxtext:SetAllPoints(frameNameTextBox)
frameNameTextBoxtext:SetFontObject(FontList.rulesFont)
frameDateTextBox = CreateFrame("Frame", "frameDateTextBox", frame)
frameDateTextBox:SetSize(350, 30) -- debug --
frameDateTextBox:SetPoint("CENTER")
frameDateTextBox.text = frameDateTextBox:CreateFontString("frameDateTextBoxtext")
frameDateTextBoxtext:SetAllPoints(frameDateTextBox)
frameDateTextBoxtext:SetFontObject(FontList.rulesFont)
end
I am really at a loss here and I wonder if I am at the point of being just too close to the code that I can't see obvious errors.