Vyzor, UI Manager for Mudlet

Share your scripts and packages with other Mudlet users.
User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

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

Post by Akaya »

How is the setLabelClickCallback() function handled with Vyzor?

I was under the impression that frame.Callback("my_function") worked but it' doesn't seem to.

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

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

Post by Oneymus »

Even though this was answered on the IRC, for reference I will replicate the answer here.

It would be frame.Callback = "my_function".

Unless something is listed as a function on the wiki, it's a property.

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

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

Post by Akaya »

When using Vyzor.Chat() I'm having troubles getting my channels to display in their respective tabs. Everything gets sent to the "All" tab and nothing else.
Code: [show] | [select all] lua
local chat_back = Vyzor.Frame( "chat_background", .3, .7, .45, .3 )

chat_back:Add( Vyzor.Border( 1, Vyzor.BorderStyle.Groove,
		Vyzor.Brush( Vyzor.Color( Vyzor.ColorMode.RGB, 0, 0, 0 ) ),
		5
	)
)

local tab_border = Vyzor.Border( 2, Vyzor.BorderStyle.Ridge,
	Vyzor.Brush( Vyzor.Image( imagePath .. "tabBack.png" ) ),
	1
)

chat = Vyzor.Chat( "test_chat", chat_back, {"All", "City", "House", "Misc"}, Vyzor.TabLocation.Bottom, 
	.1, nil, nil, {Vyzor.Color( Vyzor.ColorMode.Name, "white" ), tab_border}
)

Vyzor.Left:Add( chat )

Vyzor.HUD:Draw()
Trigger line (begin line of substring): (Shallam):
Code: [show] | [select all] lua
chat:Append( City )
deleteLine()

Delrayne
Posts: 159
Joined: Tue Jun 07, 2011 7:07 pm
Contact:

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

Post by Delrayne »

should be 'chat:Append( "City" )'

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

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

Post by Akaya »

thank you

User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

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

Post by Akaya »

Creating a status screen that will reflect gmcp.Char info. Currently I'm just echoing the gmcp data to a label. But it appears there's some issues with setting fonts on a label. Here's what the status screen looks like:
Image

I'd like to get the small numbers a bit bigger. Any alternate ideas of how to enlarge the font? I can use a miniConsole but that will leave a big black box as a background. Ick.

Dronus86
Posts: 4
Joined: Sat Nov 03, 2012 3:38 pm

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

Post by Dronus86 »

I was just wondering if there was an easy way to completely remove/destroy all components/frames already created. I'm trying to go through the process of setting up a UI and it gets kind of buggy because I keep trying to re-create things that already exist, but slightly changed.

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

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

Post by Oneymus »

If you try to recreate a Frame, it will give you the Frame with that name. So, the idea is not to recreate stuff. You can :Hide() and :Show() Frames, and you can :Remove() and :Add() Components to change their contents. Frames can also be :Move()'d and :Resize()'d.

What is it you're trying to do, specifically, that is giving you trouble?

Dronus86
Posts: 4
Joined: Sat Nov 03, 2012 3:38 pm

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

Post by Dronus86 »

Basically I'm just trying to layout the visuals I want, and that requires regular tweaking until it's the way I like it. So I have something like this in a function:
Code: [show] | [select all] lua
affliction_box_back = Vyzor.Frame("aff_frame", 0.02, .43, .43, .5)
enemy_box_back = Vyzor.Frame("enemy_frame", .55, .43, .43, .5)
enemy_box_name = Vyzor.Frame("enemy_name", .55, .95, .43, .03)
leader_box_name = Vyzor.Frame("leader_name", 0.02, .95, .43, .03)
affliction_box = Vyzor.MiniConsole( "aff_box", 0, 0, 1.0, 1.0, "dynamic", 12 )
enemy_box = Vyzor.MiniConsole( "en_box", 0, 0, 1.0, 1.0, "dynamic", 12 )
enemy_box_name_text = Vyzor.MiniConsole( "en_box_name", 0, 0, 1.0, 1.0, "dynamic", 12 )
leader_box_name_text = Vyzor.MiniConsole( "le_box_name", 0, 0, 1.0, 1.0, "dynamic", 12 )
Vyzor.Options.Borders = {Top = 0, Bottom = 0, Left = 0, Right = .25}
Vyzor.Right:Add(Vyzor.Background(Vyzor.Brush(Vyzor.Color( Vyzor.ColorMode.RGBA, 10, 10, 65, 100 ))))
affliction_box_back:Add(Vyzor.Border( 5, Vyzor.BorderStyle.Groove,Vyzor.Brush( Vyzor.Color( Vyzor.ColorMode.RGB, 10, 45, 10 ) ),5))
enemy_box_back:Add(Vyzor.Border( 5, Vyzor.BorderStyle.Groove,Vyzor.Brush( Vyzor.Color( Vyzor.ColorMode.RGB, 45, 10, 10 ) ),5))
enemy_box_name:Add(Vyzor.Border( 5, Vyzor.BorderStyle.Groove,Vyzor.Brush( Vyzor.Color( Vyzor.ColorMode.RGB, 45, 10, 10 ) ),5))
leader_box_name:Add(Vyzor.Border( 5, Vyzor.BorderStyle.Groove,Vyzor.Brush( Vyzor.Color( Vyzor.ColorMode.RGB, 10, 45, 10 ) ),5))
Vyzor.Right:Add( affliction_box_back )
Vyzor.Right:Add( enemy_box_back )
Vyzor.Right:Add( enemy_box_name )
Vyzor.Right:Add( leader_box_name )
enemy_box_name:Add( enemy_box_name_text )
enemy_box_back:Add( enemy_box )
leader_box_name:Add( leader_box_name_text )
affliction_box_back:Add( affliction_box )
current_afflictions = {}
affliction_box:Clear()
Vyzor.HUD:Clear()
Vyzor.HUD:Draw()
In a perfect world, I could just re-call the function and it would entirely re-create/re-draw the whole HUD, but that doesn't seem to work.

Another few small problems/ideas I've encountered, and I'm not sure why this is the case, but I've created a Vyzor.Map and added it to a frame. It displays fine, it's pretty close to where I initially created it, but it's not following my movement. Am I missing some step? Do I need to manually update it? If so, should I be using GMCP and could I get an example?

I'm also wondering if there's a better way to do something I'm currently doing: In the affliction_box I'd like to keep a running list of afflictions, kind of like a persistent diagnose. I've managed to make it happen using a MiniConsole and Clear() then re-printing every affliction when the list changes, but I'm just curious if there's a more appropriate way to do this.

Lastly, not a big deal, but is there a way to center text horizontally or vertically in a MiniConsole? Once again, not a big deal if not.

Thanks in advance for any help you can lend!

EDIT: To clarify, I'm still trying to decide of the affliction_box MiniConsole is the way I want it, so I'm trying to resize regularly. I was just hoping there was a way to nullify all previous components created so I can re-create them the size I want just by editing the size above and re-running the function.

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

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

Post by Oneymus »

So, a couple things. Only one of your issues is specifically Vyzor, and that has to do with recalling the Frames. Unfortunately, if the Frame already exists, Vyzor will just send it back to you. In order to do what you'd like, you'll need to call Move() and Resize() on the Frames until you get what you like, then pop those values back into the constructor call.

Now, as for your other problems. The mapper is a complex topic. All Vyzor does it allow you to draw it to screen; you'll want to look at mapper sub-forum in order to get more help there.

There is a way to center and align text in a mini-console. It's not native to Mudlet; Demonnic has written a script for text align somewhere here on the forums.

And as for your affliction_box, that's probably the most straightforward way to do it. You could get fancy like Akaya, and making a dynamic tower and whatnot. But clearing the MiniConsole and rewriting it is the simplest method.

Post Reply