Mudlet features and API requests

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

Re: Mudlet API requests

Post by Heiko »

No, not anymore. Added a call back and functions to set the main window border. Our demo packages need to get updated though.

Quoting from the manual:

handleWindowResizeEvent()

The standard implementation of this function does nothing. However, this function gets called whenever the main window is being manually resized. You can overwrite this function in your own scripts to handle window resize events yourself and e. g. adjust the screen position and size of your mini console windows, labels or other relevant GUI elements in your scripts that depend on the size of the main Window. To override this function you can simply put a function with the same name in one of your scripts thus overwriting the original empty implementation of this function.

function handleWindowResizeEvent()
-- determine the size of your screen
WindowWidth=0;
WindowHeight=0;
WindowWidth, WindowHeight = getMainWindowSize();

-- move mini console "sys" to the far right side of the screen whenever the screen gets resized
moveWindow("sys",WindowWidth-300,0)
end

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

Re: Mudlet API requests

Post by Vadi »

Oki, will give it a try.

We do need sendQiuet() to send something without echoing - or a send that accepts a boolean for whenever it should echo or not.

EDIT HEIKO: implemented as send( text, false ) with the second arg defaulting to true=print if the user has chosen to show his commands

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

Re: Mudlet API requests

Post by Vadi »

moveWindowZ(window name, 0+ integer)

Move a window based on its Z order (or layer position). 0 would be the bottom, anything above that is higher and closer to the users eyes. Should also accept "main" as a window name.

(this way I can set nice background pictures to fully complement nexus :D )

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

Re: Mudlet API requests

Post by Heiko »

You can use transparent background pictures right now, but you have to create the background images first, to put them on the lowest z-plane. Right now for every newly created label or miniconsole z-plane = z-plane + 1.
B will be on top of A if A was created before B.

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

Re: Mudlet API requests

Post by Vadi »

Yes, I know. But I don't control the creation of the main output window, so I can't have anything below it without moving it.

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

Re: Mudlet API requests

Post by Vadi »

Allow an optional tiling argument to the 'setBackgroundImage' function as true/false. If it's true, then the image should tile to fill in all available space that the label is consuming.

example of what tiling is: http://www.awardsites.com/tutorials/gimp/smlsbkg01.htm

So something like you did for topFiller, except without so much work and works height-wise too.

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

Re: Mudlet API requests

Post by Vadi »

Also allow the scrollbar of the main window to be movable :|

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

Re: Mudlet API requests

Post by Vadi »

createLabel( "name", -10, -25, ...

Allow negative values for createLabel, so it's the same as:
width, height = getMainWindowSize()
createLabel( "name", width-10, width-25, ...

But much shotrer.

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

Re: Mudlet API requests

Post by Vadi »

and mxp() function which will wrap the text into the proper mxp tags for mudlet to display it.

so you can use for example:

replace(mxp("<send>hi</send>"))

(and not worry about types of locks and etc, function will use one)

EDIT HEIKO: added a bunch of link and popup functions like echoLink(), setPopup(), setLink() etc.

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

Re: Mudlet API requests

Post by Vadi »

setCSS(css code), should work on any widget mudlet creates, because we have void setStyleSheet ( const QString & styleSheet ) that works on QWidget

Post Reply