mini consoles - comments and a potential bug

Post Reply
Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

mini consoles - comments and a potential bug

Post by Caled »

I like them a lot. I'm finding it a little tricky to resize them once created though.
I used the following to create a miniconsole:

Code: Select all

createMiniConsole("chancap",0,50,800,150)
setBackgroundColor("chancap",0,0,0,100);
setWindowWrap("chancap", 70);
setTextFormat("chancap",55,0,0,0,0,255,0,0,0);
Once created though, is there a way to move it around? I was positioning it with trial-and-error, but the only way I found to move it is to change the values in "createMiniConsole("chancap",0,50,800,150)" then restart mudlet.

Similarly for resizing it. Though I did find 'resizeWindow', it seemed to have no noticeable effect. But changing the values of createMiniConsole did, but that requires restarting mudlet.

If I attempted to close the window with closeUserWindow("chancap"), the window would close, but then upon removing that line and saving the script again, expecting the console to be recreated, mudlet would crash, showing a windows error.

Even if the solution were just a way to reload the profile without having to close mudlet?

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: mini consoles - comments and a potential bug

Post by Heiko »

A console or a label can only be created once per session. Any further calls to createConsole/label will return an error as the console already exists.
To hide the console -> hideUserWindow( name )
To show the console after it was hidden showUserWindow( name )
This is a very fast way of e.g. implementing notification pictures like those prompt status images i have in the demo on the right side. You create the labels once and then hide/show them when you want to.
Consoles/labels can overlap too -> you can make a 2 state notification icon for balance(green picture) no balance (red picture) and hide/show the correct state if it has been detected in the prompt filter chain. Check the last item in the prompt detector filter chain in the demo.

Move windows: moveUserWindow( name )
Resizing windows has been implemented, but i havent tested it yet, might have forgotten something.

closeUserWindow(name) is intended as a "real" close = permanent object removal. It's not really needed because of the more efficient hide/show functions. I'll fix the crash bug.

Caled
Posts: 403
Joined: Thu Apr 09, 2009 4:45 am

Re: mini consoles - comments and a potential bug

Post by Caled »

Thanks for the help. By the way:
mudletcreenshot.PNG
mudletcreenshot.PNG (186.07 KiB) Viewed 6408 times
Getting there, next one for me to figure out is the labels.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: mini consoles - comments and a potential bug

Post by Heiko »

hehe nice!

Made an error in the docs: it's resizeWindow( name, width, height )
It works. You can make gauges with it.

PS: I can see that i have wrapIndent set to 5 on mini consoles. Have to change the default to 0.

Post Reply