View Single Post
12-29-08, 01:19 PM   #1
Felankor
A Fallenroot Satyr
AddOn Author - Click to view addons
Join Date: May 2007
Posts: 26
Question FauxScrollFrame_OnVerticalScroll Problem

Hi,

I added FauxScrollFrame's to my addon back in interface 20400 (Which at the time worked fine). I then quit WoW for a while and now Im comming back...

All of a sudden im getting an error when i try to scroll the frames vertically. I haven't changed nothing in my code... and i can't figure out what the problem is.

The error message is:
Interface\FrameXML\UIPanelTemplates.lua:230: attempt to index local 'self' (a number value)
NOTE: Im using the trial client until 2morro. Don't know if that affects anything. Don't see why it should but you never know...

I tried to install the FrameXML interface code from blizzard but it just creates an empty folder (Im guessing its something to do with me using the trial client) so I couldn't look for line 230 in UIPanelTemplates.lua.

Here's my code:

XML:
Code:
<!-- Start of FFSlashScrollBar ScrollFrame -->
            <ScrollFrame name="FFSlashScrollBar" inherits="FauxScrollFrameTemplate" hidden="false">
                <Size>
                    <AbsDimension x="163" y="138" />
                </Size>
                <Anchors>
                    <Anchor point="TOPLEFT">
                        <Offset>
                            <AbsDimension x="23" y="-64" />
                        </Offset>
                    </Anchor>
                </Anchors>
                <Scripts>
                    <OnVerticalScroll>
                        FauxScrollFrame_OnVerticalScroll(16, FFSlashScrollBar_Update);
                    </OnVerticalScroll>
                    <OnShow>
                        FFSlashScrollBar_Update();
                    </OnShow>
                </Scripts>
            </ScrollFrame>
<!-- End of FFSlashScrollBar ScrollFrame -->
LUA:
Code:
function FFSlashScrollBar_Update()
  local SlashLine = nil; -- 1 through 8 of our window to scroll
  local SlashLinePlusOffset = nil; -- an index into our data calculated from the scroll offset
  local FFSlashHighlighted = false;
    
    FauxScrollFrame_Update(FFSlashScrollBar,table.getn(FFSLASH_HELP_LIST_COMMANDS_TABLE),8,16);
    
    for SlashLine=1,8 do
        SlashLinePlusOffset = SlashLine + FauxScrollFrame_GetOffset(FFSlashScrollBar);
        
        if SlashLinePlusOffset <= table.getn(FFSLASH_HELP_LIST_COMMANDS_TABLE) then
            getglobal("FFSlashEntry"..SlashLine.."ButtonTextName"):SetText(FF_ColourText(FFSLASH_HELP_LIST_COMMANDS_TABLE[SlashLinePlusOffset], "blue", 0, 0));
            
            if (FFSlashHelpSelected == SlashLinePlusOffset) then
                --Show selection highlight
                FFHelp_ShowHighlight("FFSlashEntry"..SlashLine);
                FFSlashHighlighted = true;
            elseif (FFSlashHighlighted == false) then
                --Hide selection highlight
                FFHelp_HideSlashHighlight();
            end
            
            getglobal("FFSlashEntry"..SlashLine):Show();
        else
            getglobal("FFSlashEntry"..SlashLine):Hide();
        end
        
    end
  
end
Thanks in advance

Felankor
  Reply With Quote