Page 3 of 54

Re: Mudlet API requests

Posted: Wed Nov 18, 2009 11:04 am
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

Re: Mudlet API requests

Posted: Wed Nov 18, 2009 3:29 pm
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

Re: Mudlet API requests

Posted: Tue Nov 24, 2009 1:11 am
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 )

Re: Mudlet API requests

Posted: Tue Nov 24, 2009 11:06 am
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.

Re: Mudlet API requests

Posted: Tue Nov 24, 2009 12:52 pm
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.

Re: Mudlet API requests

Posted: Tue Nov 24, 2009 3:26 pm
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.

Re: Mudlet API requests

Posted: Tue Nov 24, 2009 4:58 pm
by Vadi
Also allow the scrollbar of the main window to be movable :|

Re: Mudlet API requests

Posted: Tue Nov 24, 2009 11:39 pm
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.

Re: Mudlet API requests

Posted: Thu Dec 03, 2009 4:08 pm
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.

Re: Mudlet API requests

Posted: Thu Dec 10, 2009 5:18 am
by Vadi
setCSS(css code), should work on any widget mudlet creates, because we have void setStyleSheet ( const QString & styleSheet ) that works on QWidget