Requests/Bugs

Geyser is an object oriented framework for creating, updating and organizing GUI elements within Mudlet.
guy
Posts: 26
Joined: Wed Mar 03, 2010 5:41 am
Location: Seattle

Requests/Bugs

Post by guy »

This topic created to get those rough edges smoothed out.

So far there are:
  • Wrap all the other window related functions.
  • Enhance the Label type such that if an image is given to it during creation, it'll automatically make a shadow label with the image and the real one on top - so you can use echos in the label while still having a background fine.
Items will be added as they are presented and moved below as they're implemented.

Completed:
  • Get the colorized echo functions work for labels too
    • This is sort of done. a label's echo now has extra parameters. Say you have a label L, then L:echo("someText", "green", "cb14") will display a green 'someText' centered and bold in size 14 font. The format and font color will be remembered for next time, which may or may not be the behaviour always wanted =). Note that setting an echo format font size doesn't affect the font size as defined for sizing the label and stored in the fontSize field. These extra parameters can also be set at creation time, like any other parameter.
    • Also added are the convenience functions setFormat(format) and setFgColor(color)
  • Consistent and useful color support where colors can be given by name, hex or decimal
    • Colors can be specified as decimal ("<160,0,64>"), html hex ("#a00040"), hecho hex ("|ca00040"), by name ("red"), or in an explicit table ({r=160,g=0,b=0x40, a=128}). The decimal html and hecho hex forms also accept a fourth number for alpha. If it is missing, the default is 255.
    • e.g. l = Geyser.Label:new({xyhw..., fgColor = "red", color = "#30303040"}) creates a label with red text and a transparent background of some dark shade of gray.
Last edited by guy on Sat Mar 20, 2010 11:25 pm, edited 2 times in total.

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

Re: Requests/Bugs

Post by Vadi »

Enhance the Label type such that if an image is given to it during creation, it'll automatically make a shadow label with the image and the real one on top - so you can use echos in the label while still having a background fine.

guy
Posts: 26
Joined: Wed Mar 03, 2010 5:41 am
Location: Seattle

Re: Requests/Bugs

Post by guy »

Vadi wrote:Enhance the Label type such that if an image is given to it during creation, it'll automatically make a shadow label with the image and the real one on top - so you can use echos in the label while still having a background fine.
Is that something that can be fixed in the underlying Qt code? It would be easy enough to do in Geyser, but sounds like a feature better implemented on the backend. Your gradient labels look pretty cool btw. It would be nice if we had more access to Qt's data etc, would eliminate the need for Geyser altogether =)

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

Re: Requests/Bugs

Post by Vadi »

It's not a mudlet function bug, it's how qt's QLabel works.

guy
Posts: 26
Joined: Wed Mar 03, 2010 5:41 am
Location: Seattle

Re: Requests/Bugs

Post by guy »

Made some updates. Check main thread for new download.

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

Re: Requests/Bugs

Post by Vadi »

Something broke; this call gives me a grey label instead of transparent now:
Code: [show] | [select all] lua
ofn_ui_target = Geyser.Label:new({
  name = "ofn_ui_target",
  x = 0, y = 0,
  width = "100%", height = "100%",
  backgroundColor={r=0, b=0, g=0},
  backgroundAlpha=0},
  ofn_ui_target_pic)

guy
Posts: 26
Joined: Wed Mar 03, 2010 5:41 am
Location: Seattle

Re: Requests/Bugs

Post by guy »

Vadi wrote:Something broke; this call gives me a grey label instead of transparent now:
Sorry, I should have explained a little more about the color changes. All color information for the background of a label or miniconsole is now just in the 'color' field, including alpha. So your example should be changed to
Code: [show] | [select all] lua
ofn_ui_target = Geyser.Label:new({
  name = "ofn_ui_target",
  x = 0, y = 0,
  width = "100%", height = "100%",
  color="#00000000"},
  ofn_ui_target_pic)
[/quote]

The following are equivalent as far as colors are concerned:
  • color = "#00000000"
  • color = "0x00000000"
  • color = "|c00000000"
  • color = "<0,0,0,0>"
  • color = {r = 0, b = 0, g = 0, a = 0}
The reasoning for this change was to simplify color assignment and give maximum flexibility for situations where the same color string could be used for a *echo() function or html format string etc. Also, backgroundColor/Alpha seemed a long thing to type and confusing in the context of an object where we also have bgColor.

There are conversion functions too in Geyser.Color to return an appropriate string given another color. So Geyser.Color.hhex("red") returns "|cFF0000" and Geyser.Color.hdeca("#00000000") returns "<0,0,0,0>". The conversion functions are just wrappers around Geyser.Color.parse, which takes in any acceptable format and returns 4 component values in the order r,g,b,a.

Please redownload Geyser.xml, because there was a small bug where the last format style in list above didn't work (but now does).

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

Re: Requests/Bugs

Post by Vadi »

Request - option to tile images if the label is too big for the area. Had to write some methods in the achaea & lusternia ui's for that.

Request - label lists. Major downside labels have is that we can't make parts of them clickable (yet. maybe when we'll be able to hook up url links to lua functions we will, if that's even possible). So if you want to make a list where elements have their own callbacks, you'd... either have to smartly reuse a small amount of labels, to keep creating new ones (I think I do that in my MkO IH list).

An easy way to go about this business would be appreciated :)

guy
Posts: 26
Joined: Wed Mar 03, 2010 5:41 am
Location: Seattle

Re: Requests/Bugs

Post by guy »

Vadi wrote:Request - option to tile images if the label is too big for the area. Had to write some methods in the achaea & lusternia ui's for that.
Don't entirely understand this one - could you post an example?
Vadi wrote:Request - label lists. Major downside labels have is that we can't make parts of them clickable (yet. maybe when we'll be able to hook up url links to lua functions we will, if that's even possible). So if you want to make a list where elements have their own callbacks, you'd... either have to smartly reuse a small amount of labels, to keep creating new ones (I think I do that in my MkO IH list).
I'd like to add a container type that will pack in windows added to it either vertically or horizontally. So for example, adding 5 labels to it will automatically adjust those labels to all be the same size. Adding a sixth will adjust the first 5, etc. and same for removal. Sounds like that could be extended easily to what you want, though I'd originally envisioned it for layout of gauges.

In the meantime, is it worthwhile for you to get the same functionality using MXP and echoLink in a miniconsole?

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

Re: Requests/Bugs

Post by Vadi »

tiling - repeating images with the same pattern. For examples, see my lusternia or achaea ui's - certain parts of it like bottom or top bars are tiled.

Yep, mxp links in a miniconsole would do the same thing, but I'm happy with my label setup as it is. It's just one label instead of many atm and I'd rather not re-do the groundwork for dealing with them like I did in my MkO IH list.

Post Reply