Thread Tools Display Modes
05-09-10, 10:19 AM   #1
Enxo
A Murloc Raider
 
Enxo's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 7
Changes to BuffFrame.lua ?

Hi !


I just tryed my pre 3.3 Addon Proggy and ran into this Error:

Code:
Message: Interface\FrameXML\BuffFrame.lua:184: attempt to index field 'duration' (a nil value)
Time: 05/09/10 17:58:06
Count: 5
Stack: [C]: ?
Interface\FrameXML\BuffFrame.lua:184: in function `AuraButton_Update'
[string "*:OnShow"]:2: in function <[string "*:OnShow"]:1>
[C]: in function `Show'
Interface\AddOns\Progy\Progy.lua:136: in function `ProgyButton_Update'
Interface\AddOns\Progy\Progy.lua:73: in function `ProgyFrame_Update'
Interface\AddOns\Progy\Progy.lua:285: in function <Interface\AddOns\Progy\Progy.lua:281>

Locals: buttonName = "ProgyButton"
index = 1
filter = "HELPFUL"
unit = "player"
name = "Erneuerung"
rank = "Rang 7"
texture = "Interface\Icons\Spell_Holy_Renew"
count = 0
debuffType = "Magic"
duration = 15
expirationTime = 27130.03
_ = "player"
_ = nil
shouldConsolidate = nil
buffName = "ProgyButton1"
buff = ProgyButton1 {
 namePrefix = "ProgyButton"
 filter = "HELPFUL"
 0 = <userdata>
 timeLeft = 1793.4909999574
 unit = "player"
}
helpful = true
(*temporary) = nil
(*temporary) = nil
(*temporary) = <userdata>
(*temporary) = <userdata>
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index field 'duration' (a nil value)"
consolidatedBuffs = <table> {
}
It worked perfectly fine before but i didnt use it for some time.
It uses alot of the BuffFrame.lua code pre 3.3.

Anyone got a clue why the error is in the BuffFrame.lua, since i didnt edit it for shure

Enxo
  Reply With Quote
05-09-10, 11:59 AM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,928
how are you referencing duration ? If at all.

Looking at the buffframe.lua and xml files buff.duration refers to the fontstring holding the duration timer. Here are the two files with the relative segments highlighted. All I can think of is that there are some changes based on the consolidated buffs other than that I can't see anything that would make buff.duration not exist within buffframe.xml/lua.

Code:
	<Button name="AuraButtonTemplate" virtual="true">
		<Size x="30" y="30"/>
		<Layers>
			<Layer level="BACKGROUND">
				<Texture name="$parentIcon" nonBlocking="true"/>
				<FontString name="$parentCount" inherits="NumberFontNormal" parentKey="count">
					<Anchors>
						<Anchor point="BOTTOMRIGHT">
							<Offset>
								<AbsDimension x="-2" y="2"/>
							</Offset>
						</Anchor>
					</Anchors>
				</FontString>
				<FontString name="$parentDuration" inherits="GameFontNormalSmall" hidden="true" parentKey="duration">
					<Anchors>
						<Anchor point="TOP" relativePoint="BOTTOM" />
					</Anchors>
				</FontString>
			</Layer>
		</Layers>
		<Scripts>
			<OnEnter>
				GameTooltip:SetOwner(self, "ANCHOR_BOTTOMLEFT");
				GameTooltip:SetFrameLevel(self:GetFrameLevel() + 2);
				GameTooltip:SetUnitAura(PlayerFrame.unit, self:GetID(), self.filter);
			</OnEnter>
			<OnLeave>
				GameTooltip:Hide();
			</OnLeave>
		</Scripts>
	</Button>
Code:
		if ( duration > 0 and expirationTime ) then
			if ( SHOW_BUFF_DURATIONS == "1" ) then
				buff.duration:Show();
			else
				buff.duration:Hide();
			end

			if ( not buff.timeLeft ) then
				buff.timeLeft = expirationTime - GetTime();
				buff:SetScript("OnUpdate", AuraButton_OnUpdate);
			else
				buff.timeLeft = expirationTime - GetTime();
			end
		else
			buff.duration:Hide();
			if ( buff.timeLeft ) then
				buff:SetScript("OnUpdate", nil);
			end
			buff.timeLeft = nil;
		end
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
05-09-10, 03:03 PM   #3
Enxo
A Murloc Raider
 
Enxo's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 7
First of all thank you for your quick answer


The problem is that its been some time since i wrote it and I am still trying to get behind everything

The funny thing is that everythings working as intendet, besides that error. It looks like the error has no visual impact on anything.

It should also be mentioned that it only accours after the hiden Frame gets shown() again.

To answer your question, im using the buffFrame.lua code but without interfering with its variables (thats what i thougth )

Instead of "buff.duration" i am using a local called "buffduration". I am "stealing" the "buff.duration" data from buffFrame.lua by:
Code:
local buffduration = _G[buffName.."Duration"];
The term "buff.duration" does not exist anywhere in my code and is i said the addon works fine and the Blizz buffs als well.
Thats why im so confused

EDIT: Both lines refered in the error use Show() also:
Code:
Interface\FrameXML\BuffFrame.lua:184: in function `AuraButton_Update'
[string "*:OnShow"]:2: in function <[string "*:OnShow"]:1>
[C]: in function `Show'
Could the funktion Show() make any problems?

Last edited by Enxo : 05-09-10 at 03:24 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Changes to BuffFrame.lua ?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off