Vyzor, UI Manager for Mudlet
Re: Vyzor, UI Manager for Mudlet [Beta?]
for my parry buttons, I just simply used a seperate duplicated image that was red instead of blue to show which limbs were being parried and which weren't. Clicking it removed the image, or in my case border since they scale better, and then immediately added the new border to it.
Re: Vyzor, UI Manager for Mudlet [Beta?]
I'm experimenting with a framework where I store the properties of my GUI in my own table, and build the GUI from that using Vyzor. I have reasons for wanting to do it this way, but I've hit a speedbump at step two of my plan (which is currently a lot longer than 2 steps hehe).
The above script sets the borders as intended (though I do need to call Vyzor.HUD:Draw() before it will update any changes I make when tweaking the sizes).
Then, it does colour each border frame a light grey colour as intended (the 'editcol' is there purely to make it easier to resize things that don't have borders yet). BUT...
After it sets the background once, I get this error:
Lua syntax error:[string "-------------------------------------------..."]:42: Vyzor: VyzorBottom
(Frame) already contains Component (Background).
It seems to be adding multiple frames, or multiple backgrounds to the one frame, as it gets darker and darker (note the transparency value of 150)
I've found hints of the answer in the wiki, but I can't figure it out; how do I:
1. Check if a background has already been set?
2. Change an existing background rather than attempting to add another over it?
Re: Vyzor, UI Manager for Mudlet [Beta?]
A frame can only have ONE instance of a component in it. Components are Images, Borders, Backgrounds etc... Meaning you CAN'T have two borders in a frame, but you CAN have one border, one image, and one background in a frame. To use only one frame, the frame:Remove() and frame:Add() functions are the only way to accomplish this that I know of. You could accomplish this with multiple frames using frame:Show() and frame:Hide() instead.
Re: Vyzor, UI Manager for Mudlet [Beta?]
I only want ONE background component.Delrayne wrote:A frame can only have ONE instance of a component in it. Components are Images, Borders, Backgrounds etc... Meaning you CAN'T have two borders in a frame, but you CAN have one border, one image, and one background in a frame. To use only one frame, the frame:Remove() and frame:Add() functions are the only way to accomplish this that I know of. You could accomplish this with multiple frames using frame:Show() and frame:Hide() instead.
But clearly, something I am doing is causing multiple background components, perhaps by creating multiple frames.
I can't work out how to not do it. If a component already exists, I want to simply change it rather than adding a new one to a new frame and layering it over the top.
I've been trying to get frame:Remove() to work, but in my above script, how do I use it? The API wiki page says:
But I don't understand how to use it. frame:Remove() isn't used in any of Oneymus's test aliases.frame:Remove( object )
object
The object to be removed. This will be a string or a Vyzor object.
You may remove Frames by name or Components by type by passing a string. This is probably the easiest method.
Otherwise, you can pass an object (Frame, Component, or Compound) and Vyzor will remove an object by name or type. Currently, it seems I messed up somewhere and Compounds can only be removed by passing an object. Will be fixed someday.
Re: Vyzor, UI Manager for Mudlet [Beta?]
Thanks to Vadi, I worked it out. The problem was me applying a component directly to the predefined border frames. The answer is to create frames the same size as each of those frames, and manipulate the newly created frames instead. 
Thanks all

Thanks all
Re: Vyzor, UI Manager for Mudlet [Beta?]
I have one last question before I call it a day. It's about syntax.
The API wiki talks about 'properties'. For example:
For example, if I could see a list of child frames with the 'frames' property, I could easily see instances where I have created a frame inside the wrong parent frame.
The API wiki talks about 'properties'. For example:
How do I use this to actually return a frame's name (or another property to return some more useful information). It seems that it will be really handy when searching for bugs in my scripting, to be able to access information on exactly what a frame is doing, and compare that to what I think I am telling it to do.Name
Returns the Frame's name.
For example, if I could see a list of child frames with the 'frames' property, I could easily see instances where I have created a frame inside the wrong parent frame.
Re: Vyzor, UI Manager for Mudlet [Beta?]
Adding Components to the Border Frames is fine. It isn't necessary to create a new Frame over them (though you can and that's perfectly okay). To see if a Frame has a Component, you would use its Components property.
Properties work here similar to C#'s Properties. Using metatables, they function as both getters and setters. To get, you would do something like...
As for Remove. Remove's one argument is either the name of a Frame, or the type of a Component. Says it right there in what you quoted.
I will eventually add a Replace function. For now, you have to check if a Component exists first.
Properties work here similar to C#'s Properties. Using metatables, they function as both getters and setters. To get, you would do something like...
To set (and this is dependent on the individual Property) you would do something like...
As for why you're getting the error with VyzorBottom, I'm not sure. Is that function being called multiple times? Did you first use any of the test Aliases? Vyzor doesn't preload any of the Frames with content.
As for Remove. Remove's one argument is either the name of a Frame, or the type of a Component. Says it right there in what you quoted.
I will eventually add a Replace function. For now, you have to check if a Component exists first.
And, finally, using your own table(s) to build your GUI is perfectly fine, and I might even recommend it.
Re: Vyzor, UI Manager for Mudlet [Beta?]
Thanks for the reply.Oneymus wrote: As for why you're getting the error with VyzorBottom, I'm not sure. Is that function being called multiple times? Did you first use any of the test Aliases? Vyzor doesn't preload any of the Frames with content.
...
And, finally, using your own table(s) to build your GUI is perfectly fine, and I might even recommend it.
Yes, the function was being called more than once, with the intention of doing so to change the background colour. Giving it a temporary, grey, translucent background allows me to resize things while I get them all to fit. Then when happy, it can go back to being black.
When I add the component to a frame I have created, I can run that function as many times as I want. When I add it to the predefined border frame, I get the error. Your explanation about how to check for and then remove a component (I was making a syntactical error when I tried, as it turns out) would let me work directly on the border frame, but for other reasons I think I will stick with the way I'm doing it now (it might be useful as some point to be able to :Hide() my entire gui, and that would make it easier to do so).
----------
Do you know why it takes so long for the gui to resize with the map window in the mix? I'm assuming it is a Mudlet thing, but I'm just wondering. It might be nice in the future to be able to hide/rearrange the gui dynamically for different tasks while playing, such as hunting vs crafting vs duelling vs warfare.
Re: Vyzor, UI Manager for Mudlet [Beta?]
The map slowdown is a Mudlet thing. No fix for it on our end.
Re: Vyzor, UI Manager for Mudlet [Beta?]
I almost managed to make it through an evening of Vyzoring without a question... almost.

On the top right, you can see me making a box compound in the grid style.
You'll also notice that of the six rectangles in the box, the bottom two are a different colour.
This is because they have been created outside of the boundary of the box itself - they should all be smaller and inside the boundary (which is width of 1 and height of 0.5, meaning it ought to take up the top 50% of the right hand border frame.)
I'm really struggling to debug this one, but I am wondering if it is the isBounding property. You can see my attempt to check this at the command line, and it does appear that isBounding is set to false but I suspect that it is actually just nil.
(lua if not lyr.skirmish.window.isBounding then echo("\nWOO") end)
Got any ideas?


On the top right, you can see me making a box compound in the grid style.
You'll also notice that of the six rectangles in the box, the bottom two are a different colour.
This is because they have been created outside of the boundary of the box itself - they should all be smaller and inside the boundary (which is width of 1 and height of 0.5, meaning it ought to take up the top 50% of the right hand border frame.)
I'm really struggling to debug this one, but I am wondering if it is the isBounding property. You can see my attempt to check this at the command line, and it does appear that isBounding is set to false but I suspect that it is actually just nil.
(lua if not lyr.skirmish.window.isBounding then echo("\nWOO") end)
Got any ideas?