WoWInterface - View Single Post - FauxScrollFrame Issues
View Single Post
05-26-20, 09:14 AM   #14
nUI Maintainer
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,492
Originally Posted by sylvanaar View Post
Could be that XrystalUI_Splash has a size and an anchor point, while XrystalUI_Config_ProfileManager does not. This could lead to the 0 width problem you observed.

Lua Code:
  1. <Frame name="XrystalUI_Splash" hidden = "false">
  2.         <Size x = "500" y = "300" />
  3.         <Anchors>
  4.             <Anchor point = "CENTER" />
  5.         </Anchors>

XrystalUI_Splash plugs into UIParent and is the equivalent of XrystalUI_Config_ProfileManager which plugs into Blizzards Config system. As far as I know you don't specify any anchors or sizes as Blizzard does the work for you as soon as you tell it to add it to the Config system.

It does appear that the problem is due to how the two systems work. The example from Blizzard doesn't include anchors etc on their guide to using it on the beta code ..
https://github.com/tomrus88/Blizzard...tionsFrame.lua Which would confuse things.

However, https://wow.gamepedia.com/Using_the_...s_Addons_panel does specify that FrameXML will reposition it and not resize it, which is what I assume it did, resize it to fit into their main panel.

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

Oh well, it works now, and at least I can walk away knowing that the mystery is solved. I may end up hitting it again down the line so hopefully I will come across this post which will remind me why following the examples didn't work rofl. But seeing as I usually copy from an existing addon of mine that I know does what I want rofl .. it shouldn't be a problem anymore rofl.

Anyway thanks again.
  Reply With Quote