So I would define
Lua Code:
local NUM_DISPLAY_LINES = 16
local NUM_TOTAL_LINES = 50
Then in OnLoad
Lua Code:
for i = 1,NUM_DISPLAY_LINES do
self.ScrollFrame.List[i] = self:CreateFontString(nil,"OVERLAY","XrystalUI_ScrollingText")
And In update:
Lua Code:
function XrystalUI_SplashScroll_Update(self)
local offset = FauxScrollFrame_GetOffset(self)
FauxScrollFrame_Update(self,NUM_TOTAL_LINES ,NUM_DISPLAY_LINES ,12)
self.List = self.List or {}
if #self.List == 0 then return end
if not addonData.versionHistory then return end
local versionHistory = addonData.versionHistory
if not versionHistory then return end
for i = 1,NUM_DISPLAY_LINES do
local idx = offset + i
if idx <= NUM_TOTAL_LINES and versionHistory[idx] then
self.List[i]:SetText(versionHistory[idx].Version .. " : " .. versionHistory[idx].Content)
self.List[i]:Show()
else
self.List[i]:SetText("")
self.List[i]:Hide()
end
end
end