Thread Tools Display Modes
10-25-10, 12:56 AM   #1
dreamcatcher
A Black Drake
 
dreamcatcher's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2010
Posts: 82
Exclamation Texture help

Code:
Message: Interface\AddOns\DreamBar\core.lua:144: attempt to index a nil value
Time: 10/24/10 23:41:29
Count: 1
Stack: Interface\AddOns\DreamBar\core.lua:144: in function `ManageTextures'
Interface\AddOns\DreamBar\core.lua:125: in function `ManageBarLayout'
Interface\AddOns\DreamBar\core.lua:302: in function `?'
Interface\AddOns\DreamBar\core.lua:296: in function <Interface\AddOns\DreamBar\core.lua:296>

Locals: self = DreamBar {
 0 = <userdata>
 ManageTextures = <function> defined @Interface\AddOns\DreamBar\core.lua:130
 ManageFrames = <function> defined @Interface\AddOns\DreamBar\core.lua:152
 VARIABLES_LOADED = <function> defined @Interface\AddOns\DreamBar\core.lua:298
 PLAYER_ENTERING_WORLD = <function> defined @Interface\AddOns\DreamBar\core.lua:306
 ManageBarPositions = <function> defined @Interface\AddOns\DreamBar\core.lua:170
 ManageMicroMenu = <function> defined @Interface\AddOns\DreamBar\core.lua:236
 ManageBarLayout = <function> defined @Interface\AddOns\DreamBar\core.lua:69
 ManageBags = <function> defined @Interface\AddOns\DreamBar\core.lua:247
}
(for generator) = <function> defined =[C]:-1
(for state) = <table> {
 MainMenuBarTexture2 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 ReputationWatchBarTexture3 = "Interface\PaperDollInfoFrame\UI-ReputationWatchBar"
 ReputationWatchBarTexture2 = "Interface\PaperDollInfoFrame\UI-ReputationWatchBar"
 MainMenuXPBarTexture3 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 MainMenuBarTexture3 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 ReputationXPBarTexture3 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 MainMenuMaxLevelBar0 = "InterfaceMainMenuBarUI-MainMenuBar-MaxLevel"
 ReputationXPBarTexture2 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 MainMenuMaxLevelBar3 = "InterfaceMainMenuBarUI-MainMenuBar-MaxLevel"
 MainMenuXPBarTexture0 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
}
(for control) = "MainMenuXPBarTexture3"
k = "MainMenuXPBarTexture3"
v = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index a nil value"
Textures = <table> {
 MainMenuBarTexture2 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 ReputationWatchBarTexture3 = "Interface\PaperDollInfoFrame\UI-ReputationWatchBar"
 ReputationWatchBarTexture2 = "Interface\PaperDollInfoFrame\UI-ReputationWatchBar"
 MainMenuXPBarTexture3 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 MainMenuBarTexture3 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 ReputationXPBarTexture3 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 MainMenuMaxLevelBar0 = "InterfaceMainMenuBarUI-MainMenuBar-MaxLevel"
 ReputationXPBarTexture2 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
 MainMenuMaxLevelBar3 = "InterfaceMainMenuBarUI-MainMenuBar-MaxLevel"
 MainMenuXPBarTexture0 = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
}
Code:
			for k, v in pairs(Textures) do
				getglobal(k):SetTexture(v);
			end;
I don't know what I'm doing wrong.
  Reply With Quote
10-25-10, 01:56 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by dreamcatcher View Post
Code:
Message: Interface\AddOns\DreamBar\core.lua:144: attempt to index a nil value
...
Locals:
...
k = "MainMenuXPBarTexture3"
v = "Interface\MainMenuBar\UI-MainMenuBar-Dwarf"
...
Code:
			for k, v in pairs(Textures) do
				getglobal(k):SetTexture(v);
			end;
It's saying MainMenuXPBarTexture3 doesn't exist.
The names may have changed in the last patch.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-25-10, 02:25 AM   #3
dreamcatcher
A Black Drake
 
dreamcatcher's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2010
Posts: 82
Ok I'm new to this. How do I find out the right names?
  Reply With Quote
10-25-10, 04:58 AM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
I'd suggest looking through the FrameXML files if you can manage to get a copy of them. The textures that are listed in your Textures table seem to come from MainMenuBar.xml and ReputationFrame.xml. I'm sure you can find a recent copy of these to look through somewhere online.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-25-10, 05:52 AM   #5
Duugu
Premium Member
 
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
I'd suggest looking through the FrameXML files if you can manage to get a copy of them.
They are available for download here.
  Reply With Quote
10-25-10, 06:27 PM   #6
Taroven
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 49
Might try using _G[k] instead of getglobal(k). Getglobal's been deprecated.
__________________
Former author of EventHorizon Continued and Other Releases.
  Reply With Quote
10-26-10, 02:55 AM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Taroven View Post
Might try using _G[k] instead of getglobal(k). Getglobal's been deprecated.
In this specific case, that wouldn't change anything. According to the same note from Blizzard, the Get/Set global functions removed from the WoW API were implemented in FrameXML as Lua functions.

If getglobal() was completely removed, the error would've been "attempt to call nil" instead of "attempt to index nil". Lua calls the function to get a return value before trying to index it.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Texture help


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