Oooh
Managed to separate the infopanel system from the addon along with its own customizable data and a couple of extra custom functions.
Added InfoPanel.setMovable(isMovable) to handle the ability to move the frame out of the panel if you so choose ( such as for big healbots and grids etc ).
Added InfoPanel.setBackGround() to handle setting up the background with a customizable background or our normal nil and alpha'd dependant on user or programmers choice.
And in the main addon file all I had to do was the following ( well, as well as the functionality behind the frame itself - rofl ):
Code:
if ( addonTable["nUI"].IsLoaded() and addonTable["nUI"].UseInfoPanel() ) then
-- We don't want nUI to play with the WatchFrame, no offense, honest
nUI_ResetWatchFrame = function() end;
-- Create the Frame that the InfoPanel will be parenting
SWF_WatchFrame = CreateScrollFrame();
-- If this was successful ( and it darn well should be ) then Create the InfoPanel
if ( SWF_WatchFrame ) then
SWF_InfoPanel = addonTable["nUI"].CreateInfoPanel(SWF_WatchFrame, 23, "SWF_InfoPanel");
end
end
local function onEvent()
if event == "PLAYER_ENTERING_WORLD" then
-- Just in case we aren't building an InfoPanel version
-- We don't want nUI to play with the WatchFrame, no offense, honest
if ( addonTable["nUI"].IsLoaded() ) then
nUI_ResetWatchFrame = function() end;
end
-- Same again here, as there is no need to repeat the code
-- if we are using the info panel system, well it might error out if you do
-- Create the Frame that the InfoPanel will be parenting
if ( not SWF_InfoPanel ) then
SWF_WatchFrame = CreateScrollFrame();
end
SWF_EventFrame:UnregisterEvent( "PLAYER_ENTERING_WORLD" );
end
end
SWF_EventFrame = CreateFrame( "Frame", "SWF_EventFrame", UIParent );
SWF_EventFrame:SetScript( "OnEvent", onEvent );
SWF_EventFrame:RegisterEvent( "PLAYER_ENTERING_WORLD" );
Anyways, another step completed and with the server down I probably won't get down to doing any more today.
Next tasks....
1. Refine the addon wide data storage system
2. Introduce the use of the saved variables system
3. Allow the overriding of some or all of the saved variables and others