Thread: LibCoreAPI
View Single Post
01-27-10, 11:52 PM   #22
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
Originally Posted by Slakah View Post
nah I was being special :P. This would work.

Code:
if getmetatable(CreateFrame("Frame")).__index == getmetatable(CreateFrame("Frame")).__index then
	print("Frames share same metatable")
else
	print("Slakah fails and is special")
end
THAT works, FRAMES have shared metatables, but you seam to forget:
Code:
Animation
AnimationGroup
Button
CheckButton
ColorSelect
ControlPoint
Cooldown
DressUpModel
EditBox
Font
FontInstance
FontString
GameTooltip
LayeredRegion
MessageFrame
Minimap
Model
MovieFrame
ParentedObject
PlayerModel
QuestPOIFrame
ScriptObject
ScrollFrame
ScrollingMessageFrame
SimpleHTML
Slider
StatusBar
TabardModel
Texture
So:
Code:
local f = CreateFrame("Frame")
local tex = f:CreateTexture()
print(getmetatable(f).__index==getmetatable(tex).__index)

RESULT: False.
There is an other difference between this and OmniCC, OmniCC securehooks the "SetCooldown" function. Once they got their hands on the setcooldown function it works for ALL metatables, because metatables do have shared functions. But if you add a function to "Frame" it's not automaticly added to "texture".
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.

Last edited by nightcracker : 01-28-10 at 12:00 AM.
  Reply With Quote