View Single Post
05-25-20, 03:06 PM   #4
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,917
Unfortunately, changing the loop counter to 16 and the FauxScrollFrame_Update parameters to 50,16,12 didn't make a blind bit of difference.


The Splash screen is still showing it's 6 items as before, no difference whatsoever. And the profile screen is still showing nother except the scrollbar and the scroll frame border. None of the individual text lines on the profile are showing at all.


This is now the changed blocks of code:
Lua Code:
  1. ------------------------------------------------------------------------------
  2. -- Scroll Frame Update Routine
  3. ------------------------------------------------------------------------------
  4. function XrystalUI_ProfileList_Update(self)
  5.     local offset = FauxScrollFrame_GetOffset(self)
  6.     FauxScrollFrame_Update(self,50,16,12)
  7.     self.List = self.List or {}
  8.     if #self.List == 0 then return end
  9.     if not addonData.profileManager then return end
  10.     local profiles = addonData.profileManager:ListProfiles()
  11.     if not profiles then return end
  12.     for i = 1,16 do
  13.         local idx = offset + i
  14.         if idx < 50 + 1 and profiles[idx] then
  15.             self.List[i]:SetText("Content " .. idx)--(profiles[idx])
  16.             self.List[i]:Show()
  17.         else
  18.             self.List[i]:SetText("Empty " .. idx)--("")
  19.             self.List[i]:Show()
  20.         end
  21.         print(self.List[i]:GetText()) -- This display's "Content 1" and then several lines of "Empty x"
  22.     end
  23. end
  24.  
  25. ------------------------------------------------------------------------------
  26. -- Scroll Frame OnLoad Routine
  27. ------------------------------------------------------------------------------
  28. function XrystalUI_ProfileList_OnLoad(self)
  29.     self.ScrollFrame.List = {}
  30.     self.ScrollBar = self.ScrollFrame.ScrollBar
  31.     for i = 1,16 do
  32.         self.ScrollFrame.List[i] = self:CreateFontString(nil,"OVERLAY","XrystalUI_ScrollingText")
  33.         self.ScrollFrame.List[i]:SetWidth(self.ScrollFrame:GetWidth() - 25)
  34.         self.ScrollFrame.List[i]:SetHeight(12)
  35.         if i == 1 then
  36.             self.ScrollFrame.List[i]:SetPoint("TOPLEFT",self.ScrollFrame,"TOPLEFT",5,-5)
  37.         else
  38.             self.ScrollFrame.List[i]:SetPoint("TOPLEFT",self.ScrollFrame.List[i - 1],"BOTTOMLEFT",0,0)
  39.         end
  40.         self.ScrollFrame.List[i]:SetJustifyV("TOP")
  41.         self.ScrollFrame.List[i]:SetJustifyH("LEFT")
  42.     end
  43.     self.ScrollBar:SetValue(0) -- go to top
  44.     XrystalUI_ProfileList_Update(self.ScrollFrame) -- update list
  45. end

Lua Code:
  1. ------------------------------------------------------------------------------
  2. -- Fill the font strings with information to display in the scroll frame
  3. ------------------------------------------------------------------------------
  4. function XrystalUI_SplashScroll_Update(self)
  5.     local offset = FauxScrollFrame_GetOffset(self)
  6.     FauxScrollFrame_Update(self,50,16,12)
  7.     self.List = self.List or {}
  8.     if #self.List == 0 then return end
  9.     if not addonData.versionHistory then return end
  10.     local versionHistory = addonData.versionHistory
  11.     if not versionHistory then return end
  12.     for i = 1,16 do
  13.         local idx = offset + i
  14.         if idx < 50 + 1 and versionHistory[idx] then
  15.             self.List[i]:SetText(versionHistory[idx].Version .. " : " .. versionHistory[idx].Content)
  16.             self.List[i]:Show()
  17.         else
  18.             self.List[i]:SetText("")
  19.             self.List[i]:Hide()
  20.         end
  21.     end
  22. end
  23.  
  24. ------------------------------------------------------------------------------
  25. -- Create Font Strings
  26. ------------------------------------------------------------------------------
  27. function XrystalUI_SplashUpdates_OnLoad(self)
  28.     self.ScrollFrame.List = {}
  29.     self.ScrollBar = self.ScrollFrame.ScrollBar
  30.     for i = 1,16 do
  31.         self.ScrollFrame.List[i] = self:CreateFontString(nil,"OVERLAY","XrystalUI_ScrollingText")
  32.         self.ScrollFrame.List[i]:SetWidth(self.ScrollFrame:GetWidth() - 25)
  33.         self.ScrollFrame.List[i]:SetHeight(12)
  34.         if i == 1 then
  35.             self.ScrollFrame.List[i]:SetPoint("TOPLEFT",self.ScrollFrame,"TOPLEFT",5,-5)
  36.         else
  37.             self.ScrollFrame.List[i]:SetPoint("TOPLEFT",self.ScrollFrame.List[i - 1],"BOTTOMLEFT",0,0)
  38.         end
  39.         self.ScrollFrame.List[i]:SetJustifyV("TOP")
  40.         self.ScrollFrame.List[i]:SetJustifyH("LEFT")
  41.     end
  42.     self.ScrollBar:SetValue(0) -- go to top
  43.     XrystalUI_SplashScroll_Update(self.ScrollFrame) -- update list
  44. end

As you can see they are almost identical. So, should work in an almost identical manner but it doesn't.

Could this be caused by how the Options screen works with those special config panel functions ?

Lua Code:
  1. ------------------------------------------------------------------------------
  2. -- Define the config frame
  3. ------------------------------------------------------------------------------
  4. function XrystalUI_Config_ProfileManager_OnLoad(panel)
  5.  
  6.     -- Set the name for the Category for the Panel
  7.     panel.name = addonData.Translate("Profile Manager")
  8.  
  9.     -- the panel.name value of the parent configuration panel, used to display a hierarchical category tree.
  10.     -- If the parent panel is not specified or does not exist, the panel is displayed as a top-level panel
  11.     panel.parent = XrystalUI_Options.name
  12.    
  13.     -- called when the player presses the Okay button, indicating that settings should be saved.
  14.     panel.okay = function(self) ClosePanel(self) end
  15.  
  16.     -- called when the player presses the Cancel button, indicating that changes made should be discarded
  17.     panel.cancel = function(self)  CancelOrLoadPanel(self)  end
  18.  
  19.     -- called when the frame is initially displayed, and after requesting the default values to be restored
  20.     panel.refresh = function(self) RefreshPanel(self) end
  21.    
  22.     -- called when the player presses the Defaults button, indicating that default settings for the addon should be restored
  23.     panel.default = function(self) DefaultPanel(self) end
  24.    
  25.     -- Add the panel to the Interface Options
  26.     InterfaceOptions_AddCategory(panel)
  27.    
  28. end

Panel Functions - At present only the title is updated .. I tried updating the Scroll Frame here but it didn't make a difference either.
Lua Code:
  1. local function ClosePanel(panel)
  2.     UpdateVariables(panel)
  3. end
  4.  
  5. local function CancelOrLoadPanel(panel)
  6. end
  7.  
  8. local function RefreshPanel(panel)
  9.     panel.Title:SetText(addonData.Translate("Profile Manager"))
  10. end
  11.  
  12. local function DefaultPanel(panel)
  13. end
__________________
  Reply With Quote