Vyzor, UI Manager for Mudlet

Share your scripts and packages with other Mudlet users.
User avatar
Oneymus
Posts: 321
Joined: Thu Sep 17, 2009 5:24 am

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

Post by Oneymus »

Hrm... I'm not sure manipulating colors will work because Vyzor can handle colors in Hex, RGB, HSV, and name. Gauges can also be images.

It may be possible to allow for users to add overflow layers, which would be dynamically drawn if the gauge exceeds maximum values. I'll think on it some more, and see if I can come up with anything I think would fit. As always, though, open to suggestions.

As for clickable labels, Vyzor doesn't wrap the Mudlet API in the same way Geyser does. Instead of calling an OO version of setLabelClickCallback() on a Geyser object, you can just use the bare Mudlet function. The name you pass in the Frame constructor is the name of the label.
Code: [show] | [select all] lua
some_label = Vyzor.Frame( "some_label" )

function some_func ()
    ...
end

setLabelClickCallback( "some_label", some_func )

User avatar
Omni
Posts: 131
Joined: Fri Feb 12, 2010 10:26 am

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

Post by Omni »

Oneymus wrote:I guess I hadn't considered that possibility. Is it normal for a stat to go over its maximum? Is there enough of a need for this that I should develop a workaround?

And how would this look? Should the foreground just exceed the background? Should I automatically and temporarily increase the maximum so it fits? I'd need to know under what conditions stats exceed maximum.

I'm open to suggestions for how to handle this; it seems like something beyond the scope of any kind of gauge handler (i.e., should be handled by personal scripts), but I'm open-minded.
I regularly have my stats above the max in Lusternia from an ability and I know there are other things that allow such a thing.

User avatar
kevutian
Posts: 217
Joined: Fri Aug 20, 2010 8:18 pm
Location: United Kingdom
Contact:

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

Post by kevutian »

Yeah, same for Lusternia. I exceed my max mana a fair bit.

@ken Could you not just use setClickLabelCallback() for this?

User avatar
keneanung
Site Admin
Posts: 94
Joined: Mon Mar 21, 2011 9:36 am
Discord: keneanung#2803

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

Post by keneanung »

That's what Oneymus said (see 3 posts above). I just thought there'd be a (undocumented) function/field to set it. And I wasn't quite sure which of the classes was the label.

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

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

Post by Oneymus »

I apologize for that: I should have explicitly stated that the Frame is the Label. Vyzor handles resize, move, style sheet, and creation operations on labels. Echo and callback should be handled by the native API, using the name passed to the Frame constructor.

The two ideas I have so far are (an) overflow layer(s) for the gauge, or splitting the gauge into multiple sections (split it in two for 101%-200%, three for 201%-200%, etc.). Any other ideas? I am loathe to break the bounds of the gauge itself, for aesthetic reasons.

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

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

Post by chris »

I would suggest maybe changing the color hue and refilling the bar up (so from 100-200% you just refill the same bar in a different color, this will prevent the gauge from spilling into unwanted areas.)

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

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

Post by Vadi »

That's a great idea - I like it.

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

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

Post by Oneymus »

The problem with changing the color of the gauge is that I have no control over what the user inputs. A gauge could be a Color Component, with either a Hex, a string, RGB, or HSV values. Or it could be an image.

I can't just change the hue, because it's either prohibitively difficult for me to calculate appropriate values for all of the various methods of inputting color data, or downright impossible in the case of an image.

This is where the overflow layers would come into play; users can define a number of Frames, just as they do now, to be used in the event of overflow.

Is it agreed, then, that overlapping gauges is the preferred method of handling gauge overflow?

User avatar
keneanung
Site Admin
Posts: 94
Joined: Mon Mar 21, 2011 9:36 am
Discord: keneanung#2803

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

Post by keneanung »

That seems to be the most reasonable solution. But what would be default behavior?

On another note, are you planning to make OO wrapping of GUI specific Mudlet funtions? It would ease some things and finish the current class/object design of Vyzor. I mean, an object should encapsulate all methods of manipulating itself, right? I think using methods outside of its scope look a bit strange.

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

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

Post by Oneymus »

0%-100%, gauges will functions as normal. At 101%, if there are overflow layers supplied, it will draw those over the gauge until it runs out of overflow layers. Without any overflow layers, anything greater than 100% will only display as 100%.

And, yes, I can wrap the remaining relevant API calls.

Post Reply