I think Vyzor.Map() is bugged now. It keeps returning the following error:
vyzor\component\map.lua:166: attempt to compare number with string.
Vyzor, UI Manager for Mudlet
Re: Vyzor, UI Manager for Mudlet [Beta?]
Line 166 is...
Failing that, I could have inadvertently changed (I haven't touched map.lua in 10 months) something important somewhere. This is unlikely, since I've only made minor changes to unrelated files recently, but you never know.
Let me know if double-checking the arguments doesn't solve your problem, and I'll do some more extensive research.
x, in this case, is passed to .Map() as the first argument. If you're getting that error, the most likely problem is that a string is being passed. I would suggest taking a close look at what you've got there.
Failing that, I could have inadvertently changed (I haven't touched map.lua in 10 months) something important somewhere. This is unlikely, since I've only made minor changes to unrelated files recently, but you never know.
Let me know if double-checking the arguments doesn't solve your problem, and I'll do some more extensive research.
Re: Vyzor, UI Manager for Mudlet [Beta?]
Gah! You're right. I overlooked something. I had:
The correct way:
There's no argument for the map name. I'm guessing this is because only one map can be added at a time. Frames and most Components have the name as the first argument. This isn't the first time I've fallen victim to this error.
The correct way:
So this isn't a bug! My apologies!
Re: Vyzor, UI Manager for Mudlet [Beta?]
No worries. I did, indeed, leave out a name argument because you can only have one map. Truth be told, it's gotten me a couple times.
Re: Vyzor, UI Manager for Mudlet [Beta?]
Is it possible to name a frame from a variable? So if I have a variable named FrameName set to Apple, would it be possible to FrameName = Vyzor.Frame(FrameName) and have it be named Apple? So if I want to create/manipulate another Frame, I could set the FrameName variable to something else, like Banana and create/manipulate the Banana Frame? Been toying with the idea for a bit now but haven't gotten any decent results.
Re: Vyzor, UI Manager for Mudlet [Beta?]
I this would do (going off Lua only, nothing Vyzor specific), if you wanted the resulting FrameName to be global:
Re: Vyzor, UI Manager for Mudlet [Beta?]
Unless I'm misunderstanding your question, I would do pretty much exactly what Vadi suggests. In fact, I do that in a couple places (especially for the Chat Compound) to set some global, variable-named functions so that I can use them in Events.
Re: Vyzor, UI Manager for Mudlet [Beta?]
I'm writing a script that will create Frames for you. In order to create a Frame with the Vyzor.Frame() function you must first assign it to a variable so it can be used much easier later down the line when you add things to it, like backgrounds, borders and such.
So here's my alias that *should* create a frame with the name given in the alias pattern.
So here's my alias that *should* create a frame with the name given in the alias pattern.
Now though this will create a new Frame, it doesn't create a unique frame each time. Users are going to want to create multiple Frames and I need a way to reference to them for I don't know what they're going to name each one. The above example creates a frame called NameFrame and not whatever was stored in matches[2].
Re: Vyzor, UI Manager for Mudlet [Beta?]
I haven't ran it, but some guesses at what may help:
1) use a local variable for matches[2], not named NameFrame
2) I'm not sure what object Vyzor.Frame is, and whether lua allows it as a table key, keys usually need to be hashable - I doubt a Vyzor object is. Try Config[local_var], to point at the NameFrame, so something like:
Config[local_var] = Vyzor.Frame(.....) and just init everything in there. Keep all your attributes, etc. attached to the object instead of having to do multiple mappings.
1) use a local variable for matches[2], not named NameFrame
2) I'm not sure what object Vyzor.Frame is, and whether lua allows it as a table key, keys usually need to be hashable - I doubt a Vyzor object is. Try Config[local_var], to point at the NameFrame, so something like:
Config[local_var] = Vyzor.Frame(.....) and just init everything in there. Keep all your attributes, etc. attached to the object instead of having to do multiple mappings.
Re: Vyzor, UI Manager for Mudlet [Beta?]
It may be a little odd, but you could so something like this:
Vyzor.Frame will return a table and, while the address of a table (tostring()) can be used as a table key, it's not pretty. As I illustrate above, if you're not going to place them directly in _G, you should maintain your own table of Frames indexed by name. That's the easiest way, and the method I use for my GUIs.