Derma dmenuoption errors

Hello,

I’ve been developing an interface for a vendor. However after I use the menu, anything that uses the dmenuoption spits out this error when you click on it:


[ERROR] lua/vgui/dmenuoption.lua:192: attempt to call field 'PerformLayout' (a nil value)
  1. unknown - lua/vgui/dmenuoption.lua:192

If you need parts of the code, just ask.

Thanks in advance, derma gods.

Can you post lines 180-200 of your code?

Sure thing, cappn.



			AttachRef={}  
			AttachRef[1]=attach1
			AttachRef[2]=attach2
			AttachRef[3]=attach3
			AttachRef[4]=attach4
			AttachRef[5]=attach5
			AttachRef[6]=attach6
			AttachRef[7]=attach7
			AttachRef[8]=attach8
			AttachRef[9]=attach9
			AttachRef[10]=attach10			
			AttachRef[11]=attach11

			PartRef={}  
			PartRef[1]=part1
			PartRef[2]=part2
			PartRef[3]=part3
			PartRef[4]=part4
			PartRef[5]=part5
			PartRef[6]=part6


Are you sure those are the correct lines? The line where the error is coming from isn’t there.

Yes, 100%, the error refrenced


lua/vgui/dmenuoption.lua

as where the error was. That is the “PerformLayout” function.

Show how you create the menu, from DermaMenu() to menu:Open().




function ENT:AcceptInput( name, activator, caller )
	if ( name == "Use" && IsValid( activator ) && activator:IsPlayer() ) then
		net.Start( "GUI" )
		net.Send( activator )
		net.Start( "Index" )
		net.WriteFloat( activator:EntIndex() )
		net.Send( activator )
	end
end

net.Receive( "GUI", function()
	if ( IsValid( LeftFrame ) ) then
		LeftFrame:SetVisible( false )
		LeftFrame:Close()
	end

//otherstuff


I don’t see the code I asked for. I asked for code you use to create the menu.

Erm, what do you mean by menu? I used two DFrames and a bunch of buttons.

By menu I meant the interface when you press USE on the entity.

Can you provide the whole error, instead of two lines of it.

The steps that cause the issue are:

  • Open the vendor interface
  • Close the vendor interface
  • Open the ULX menu and try to ban someone
    OR
  • Open the SWEP creator and try to select a bone



[ERROR] lua/vgui/dmenuoption.lua:192: attempt to call field 'PerformLayout' (a nil value)
  1. PerformLayout - lua/vgui/dmenuoption.lua:192
   2. PerformLayout - lua/vgui/dmenu.lua:206
    3. Open - lua/vgui/dmenu.lua:255
     4. OpenMenu - addons/ulx/lua/ulx/modules/cl/xlib.lua:374
      5. DoClick - lua/vgui/dcombobox.lua:204
       6. unknown - lua/vgui/dlabel.lua:206

[ERROR] lua/vgui/dmenuoption.lua:192: attempt to call field 'PerformLayout' (a nil value)
  1. PerformLayout - lua/vgui/dmenuoption.lua:192
   2. unknown - lua/vgui/dmenu.lua:206

[ERROR] lua/vgui/dmenuoption.lua:192: attempt to call field 'PerformLayout' (a nil value)
  1. PerformLayout - lua/vgui/dmenuoption.lua:192
   2. PerformLayout - lua/vgui/dmenu.lua:206
    3. unknown - lua/vgui/dscrollpanel.lua:24



After that, this repeats:



[ERROR] lua/vgui/dmenuoption.lua:192: attempt to call field 'PerformLayout' (a nil value)
  1. unknown - lua/vgui/dmenuoption.lua:192


My apologies about the misunderstanding.

Hopeful bump.

Did you override DMenuOption.PerformLayout in your code?

Unfortunately, no. Thanks for the response though.