Trigger one of the button's events, and watch the event log- The event will be triggered for both buttons. You can trigger an event by just hovering it or clicking it or whatever.
But you can tell the class system is working to some extent; they are keeping their local positions and stuff.
So making a variable point to a table actualy makes it point instead of cloning the table? THAT explains SO much... I've been hitting problems like this for months and months in so many different situations... I'll rebuild my class system for tables.
Trappingnoobs wrote:Would I need to make it recursive for tables inside the table?
Depends.
Note that for classes, it would be better to make new tables in the constructor than to clone them.
Yes but some are identical throughout classes, and, as you've probably seen, take up like 70 lines of space in every class, I'd rather inherit.
After some testing I needed to make it recursive, and it works (But there are large amounts of ugly hax involved T.t), so I'm just hoping it'll start inheriting events properly now too.
I came up with this. To be honest; it's got to the point I've forgotten what most of it's there for/what it does, but it works, so I hopefully won't need to ever again edit it.
local function CloneTable(tab)
local rT = {} --returnTable
for key,val in pairs(tab) do
if type(val) == "table" then
rT[key] = CloneTable(val)
else
rT[key] = val
end
end
return rT
end
Trappingnoobs wrote:Yes but some are identical throughout classes, and, as you've probably seen, take up like 70 lines of space in every class, I'd rather inherit.
Dude. Subclassing.
Trappingnoobs wrote:I came up with this. To be honest; it's got to the point I've forgotten what most of it's there for/what it does, but it works, so I hopefully won't need to ever again edit it.
Trappingnoobs wrote:Yes but some are identical throughout classes, and, as you've probably seen, take up like 70 lines of space in every class, I'd rather inherit.
Dude. Subclassing.
That's what I'm doing... Inheriting is the same as subclassing; everything from class A is put into class B if class B asks for it.
Robin wrote:
Trappingnoobs wrote:I came up with this. To be honest; it's got to the point I've forgotten what most of it's there for/what it does, but it works, so I hopefully won't need to ever again edit it.
Be careful with that attitude. That never works.
Yeah; it's failed me a lot. If necessary I'll just force myself to repeatedly read it over and over until I find out why x problem is occuring. Hopefully it won't get to that.
if val ~= args then
clone logic
else
args.key = args
end
That'd work.. I think..
Edit:
Wait, they can't do that; anyway; the class doesn't exist until it's finished processing all the properties, so unless they did some wierd stuff and PURPOUSEFULLY did some stuff like, I don't know, making it the return value, I don't think it's possible.. I don't know; I'm probably wrong.
Pics are still a good idea. Also, you should probably update the first post as it clearly states that there is no .love file. In red letters.
That's red? I thought it was brown. T.t
No, there isn't meant to be. I'm not officialy releasing it yet, I only put that one because of my epic fail that kinda messed everything up.
I'm working on frames which hold other GUI element right now. Then bubble selections, then sliders, then release.
I added some new events
"captionStartedShowing"
"captionStoppedShowing"
You might think "Why captionStoppedShowing- why not just use mouseExited"- It's because if you set "hasCaption" to false while it's showing, it'll unshow and call that event. It'll call when the mouse exits too.
EDIT:
About the pics; I'm going to have to set up an awesome setup otherwise it doesn't advertise how adjustable everything is. I need lots of different colors and borderwidths, so it might take a while to set up.
Trappingnoobs wrote:That's what I'm doing... Inheriting is the same as subclassing; everything from class A is put into class B if class B asks for it.[/quote
Not what I meant. You could make a class called Object which implements the event system. Then you let all the other classes subclass Object and voilà: one free event system.
Trappingnoobs wrote:Any way I can protect against that? Although, if somone did that, wouldn't they have purpousefully wanted something bad to happen?
No. There are a lot of legitimate reasons for doing things like that. It would be better to not need to copy anything, by calling the constructors of the superclasses.