Vyzor, UI Manager for Mudlet

Share your scripts and packages with other Mudlet users.
User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by chris »

I can't find that post, but it looks as simple as this:
get label from the mHostLabelMap
label.destroy()
remove label reference from mHostLabelMap

then do the same for the Console's mLabelMap

Lua doesn't have any idea the label exists, as all that is returned is a boolean, not sure what Heiko was referring to about it being complex, maybe I'm missing something.

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

This has been a persistent issue with any serious work with Mudlet's GUI API. I have to regularly close and reopen the client for every iteration, no matter how minor.

It had been my understanding that resetProfile() was supposed to, well, reset the profile back to new, but it was never well explained, especially as concerns GUI objects.

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Vadi »

GUI objects are reset with resetProfile().

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by chris »

Some notes from looking at resetProfile():
it needs a datastream to fire, so no offline work
It uses a close() method, which hides a QLabel unless a given flag is set (this flag doesn't appear to be set).

That is probably how a reset should work, so the method is still needed. Fortunately this lets you pretty much copy/paste the resetProfile bit for labels and implement it with a destruct.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by chris »

This is now implemented in my repo using the method clearLabels(). I tested it for memory leaks and it appears solid.

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Mini Consoles included? Buttons? User windows?

I think that's everything...

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by chris »

Only labels are destroyed, hence the name :). From my testing, it was great for getting a Vyzor UI working (well somewhat).

Is there a way to just have a colored gauge without defining a bunch of color frames? It would be nice to have that work done behind the scenes for common colors.

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Passing the Frames to Gauges works as it does so you can completely customize those Frames (borders, padding, ...). Admittedly, this (like much of Vyzor) can be a little verbose.

It would be possible to allow users to simply pass in Color Components in addition to Gauges, but that would only move the Frame creation work to Vyzor since a Label is still required for each part of the Gauge. I'm also not 100% sure what you mean, in that every Frame must be unique. There can't be common color Frames, unless I make some sort of factory (which is possible, but unprecedented and uncharacteristic for Vyzor). If you're suggesting pre-defined Color Components, I'm not sure how this would be much more convenient than simply creating and saving those Components yourself. If this is a desired feature, however, it should be trivial to iterate through the Mudlet color table to create named Color Components (assuming Qt does, indeed, use all the same colors Mudlet defines).

You would still have to make your own Frames.

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

Updated Vyzor package. API update to follow post-day job.

This will be the last packaged release (pending potential bugfixes) of Vyzor before it's released with Mudlet itself.

Be warned, this does introduce some incompatibilities (Boxes and Gradients, specifically).

Chat Compound constructor:
Code: [show] | [select all] lua
some_chat = Vyzor.Chat( string name, 
                                     Frame init_back, 
                                     table strings init_channels, 
                                     TabLocation init_tabloc, 
                                     num init_size,
                                     num init_wrap, 
                                     num init_font,
                                     table Components init_components )

--[[
	Parameters:
		name - Name of the Chat Compound. Used to create unique event
							handler functions.
		init_back - The Background Frame for this Chat Compound.
		init_channels - The names of the channels managed by this Compound.
					Passed as a table.
		init_tabloc - Optional. A TabLocation Enum that determines on which
					side of the consoles the tabs sit. Default is top.
		init_size - Optional. This is the size of the unmanaged portion of the
					tabs. Must be between 0.0 and 1.0. Default is 0.05.
		init_wrap - Optional. This is the word wrap of the MiniConsole text.
					Default is "dynamic".
		init_font - Optional. This is the font size of the MiniConsole text.
					Default is 10. Can be "dynamic"
		init_components - Optional. A table of Components. These are used to decorate
					the tabs.
]]

User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

Re: Vyzor, UI Manager for Mudlet [Beta?]

Post by Oneymus »

I found some free time before work.

API reference updated. Let me know if anything seems wrong or missing.

I began fleshing out the Getting Started section. Obviously not complete.

Post Reply