Quantcast
WoWInterface - View Single Post - FauxScrollFrame Issues
View Single Post
05-25-20, 03:06 PM   #5
sylvanaar
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 92
So I would define

Lua Code:
  1. local NUM_DISPLAY_LINES = 16
  2. local NUM_TOTAL_LINES = 50


Then in OnLoad

Lua Code:
  1. for i = 1,NUM_DISPLAY_LINES do
  2.         self.ScrollFrame.List[i] = self:CreateFontString(nil,"OVERLAY","XrystalUI_ScrollingText")


And In update:


Lua Code:
  1. function XrystalUI_SplashScroll_Update(self)
  2.     local offset = FauxScrollFrame_GetOffset(self)
  3.     FauxScrollFrame_Update(self,NUM_TOTAL_LINES ,NUM_DISPLAY_LINES ,12)
  4.     self.List = self.List or {}
  5.     if #self.List == 0 then return end
  6.     if not addonData.versionHistory then return end
  7.     local versionHistory = addonData.versionHistory
  8.     if not versionHistory then return end
  9.     for i = 1,NUM_DISPLAY_LINES  do
  10.         local idx = offset + i
  11.         if idx <= NUM_TOTAL_LINES  and versionHistory[idx] then
  12.             self.List[i]:SetText(versionHistory[idx].Version .. " : " .. versionHistory[idx].Content)
  13.             self.List[i]:Show()
  14.         else
  15.             self.List[i]:SetText("")
  16.             self.List[i]:Hide()
  17.         end
  18.     end
  19. end
  Reply With Quote