ok so first question:
In the course of setting up the basic gui i found i needed to add tabbed windows, so i went in search of the best way to impliment this into the given XML/lua architecture and found (as another thread in this forum points out) an advanced tutorial on wow wiki which glasses over a bit of the syntax and implimentation of the WoW tabbing system. I attempted just to add non-functional tabs to my gui as a first round test and after a couple days of fiddlign with it i kept hitting this road block where i would attempt to load the mod in WoW and it would give me the following error:
"Interface/FrameXML/UIPanelTemplates.lua:111: attempt to index a null value"
i tried tracing it back to the Templates.lua file and i found the function where the error was being created:
Code:
function PanelTemplates_SelectTab(tab)
local name = tab:GetName();
getglobal(name.."Left"):Hide();
getglobal(name.."Middle"):Hide();
getglobal(name.."Right"):Hide();
--tab:LockHighlight();
tab:Disable();
getglobal(name.."LeftDisabled"):Show();
getglobal(name.."MiddleDisabled"):Show();
getglobal(name.."RightDisabled"):Show();
if ( GameTooltip:IsOwned(tab) ) then
GameTooltip:Hide();
end
end
local name = tab:GetName(); is the offending line (i think)
here is my current toc,xml,lua code
Code:
## Interface: 1800
## Title: Forgotten Empire Raid UI
## Notes: This UI will assist GM's with raids
## OptionalDeps:
## Dependencies:
## SavedVariables:
## SavedVariablesPerCharacter:
fe_raid.xml
Code:
<Ui>
<Script file="fe_raid.lua"/>
<!-- Frame to handle all core events -->
<Frame name="fe_raid_core">
<Scripts>
<OnLoad>
this:RegisterEvent("VARIABLES_LOADED");
</OnLoad>
<OnEvent>
if (event == "VARIABLES_LOADED") then
fe_raid_initialize();
end
</OnEvent>
</Scripts>
</Frame>
<Frame name="feRaidMain" frameStrata="LOW" toplevel="true" enableMouse="true" movable="true" hidden="true" parent="UIParent">
<Size>
<AbsDimension x="700" y="700" />
</Size>
<Anchors>
<Anchor point="CENTER" />
</Anchors>
<TitleRegion setAllPoints="true"/>
<Backdrop bgFile="Interface\TutorialFrame\TutorialFrameBackground" edgeFile="Interface\DialogFrame\UI-DialogBox-Border" ile="true">
<EdgeSize>
<AbsValue val="50"/>
</EdgeSize>
<TileSize>
<AbsValue val="50"/>
</TileSize>
<BackgroundInsets>
<AbsInset left="5" right="5" top="5" bottom="5"/>
</BackgroundInsets>
</Backdrop>
<Scripts>
</Scripts>
<Layers>
<Layer level="BACKGROUND">
<FontString name="$parentText" inherits="GameFontNormal" text="Forgotten Empire Raid Managment">
<Anchors>
<Anchor point="TOP" relativePoint="TOP" relativeTo="$parent">
<Offset>
<AbsDimension x="0" y="-20" />
</Offset>
</Anchor>
</Anchors>
</FontString>
</Layer>
</Layers>
<Frames>
<Button name="feRaidMainTabTemplate" inherits="CharacterFrameTabButtonTemplate" virtual="true">
<Scripts>
<OnClick>
PanelTemplates_Tab_OnClick(feRaidMain);
</OnClick>
</Scripts>
</Button>
<Button name="feRaidMainTab1" inherits="feRaidMainTabTemplate" id="1" text="Tab #1">
<Anchors>
<Anchor point="BOTTOM"/>
</Anchors>
</Button>
<Button name="feRaidMainTab2" inherits="feRaidMainTabTemplate" id="2" text="Tab #2">
<Anchors>
<Anchor point="BOTTOM" relativePoint="RIGHT" relativeTo="feRaidMainTab1"/>
</Anchors>
</Button>
</Frames>
</Frame>
</Ui>
Code:
-------------------------------------------------------------------------------
-- and the printing functions
-------------------------------------------------------------------------------
function fer_debug( Message)
DEFAULT_CHAT_FRAME:AddMessage(Message, 0.1, 0.1, 1);
end
function fer_println( Message)
DEFAULT_CHAT_FRAME:AddMessage(Message, 1, 1, 1);
end
function fer_errln( Message)
DEFAULT_CHAT_FRAME:AddMessage(Message, 1, 0.1, 0.1);
end
-------------------------------------------------------------------------------
function fe_raid_initialize()
fer_println("Forgotten Empire Raid UI version: 0.1 has initialized.");
SlashCmdList["feraid"] = fe_raid_command;
SLASH_feraid1 = "/fer";
SLASH_feraid2 = "/feraid";
PanelTemplates_SetNumTabs(feRaidMain, 2);
feRaidMain.selectedTab=1;
PanelTemplates_UpdateTabs(feRaidMain);
end
function fe_raid_command(msg)
-- this function handles our chat command
if (msg == "show") then
feRaidMain:Show();
else
feRaidMain:Hide();
end
end
im kind of at a loss as to what it could be, ive attempted to fiddle around with the xml and lua a bit to see what woudl happen but it only made it worse as i made changes. As it stands now the UI loads and i can bring up the main frame but it doesnt have tabs on it.
any help would be much appreciated!
thank you