Page 1 of 3

Achaea: Vadi Mapper capture window

Posted: Tue May 12, 2009 11:35 pm
by Ramiel
Hi folks,

To create the window, I use the following in my init() function that is run whenever I connect.

Code: Select all

--Put your screen resolution in here
resolutionX = 1440
resolutionY = 900

createMiniConsole("mapcap", resolutionX-440, 0, 400, 350)
setBackgroundColor("mapcap", 20, 0, 0, 0 ) -- gives the background of the window a -slight- noticable color
This creates the window, and sets it to hug the right top corner of your buffer screen. The codes for setBackgroundColor go red, green, blue, opacity if you want to set a custom background color..

Next I have some triggers that detect the map, and then call this function:

Code: Select all

function cutMap()
	selectString(line, 1)
	cut()
	appendBuffer("mapcap")
end
Which then neatly cut and pastes it across into the mini console.

This ends up looking like the following:

Preview <-- clicky

I'm tidying this up into a package, will post it momentarily.

Re: Achaea: Vadi Mapper capture window

Posted: Wed May 13, 2009 4:16 pm
by Vadi
I think the top line which says the room name and number is cut off a bit. Otherwise, great stuff!

Re: Achaea: Vadi Mapper capture window

Posted: Wed May 13, 2009 6:26 pm
by Heiko
What about making the map clickable by forwarding click events and relative mouse positions as Lua events or to the mapper? Can the mapper do anything with this information e.g. show sub maps, overview maps etc? Does it have any other functions we could use?

Re: Achaea: Vadi Mapper capture window

Posted: Wed May 13, 2009 9:03 pm
by Vadi
Clickable? It's already clickable for clients that support MXP - it makes rooms as an MXP link to have the client send a "goto #" command (along with a right-click menu on each room).

So adding MXP would be much more beneficial as I've added support for it in the mapper, rather than having Ramiel do a custom solution for Mudlet.

Re: Achaea: Vadi Mapper capture window

Posted: Wed May 13, 2009 11:36 pm
by Ramiel
Yep, what he said.

MXP would be very handy.

Re: Achaea: Vadi Mapper capture window

Posted: Thu May 14, 2009 9:03 am
by Heiko
I'll be adding a really nice graphical mapper after 1.0 is out. That will be a much better solution.

Re: Achaea: Vadi Mapper capture window

Posted: Thu May 14, 2009 1:20 pm
by Vadi
For mapping, maybe, lack of MXP, not really.

Re: Achaea: Vadi Mapper capture window

Posted: Thu Jul 09, 2009 5:07 am
by Veldrin
mine just looks weird, the link between rooms are either messed up or completely gone
vmap.png

Re: Achaea: Vadi Mapper capture window

Posted: Thu Jul 09, 2009 11:06 am
by Vadi
Yeah that does look quite weird. Not sure whats up with that. For better fonts though, enable "anti-aliasing" in main window settings.

Re: Achaea: Vadi Mapper capture window

Posted: Thu Jul 09, 2009 11:17 am
by Heiko
Ramiel's map plugin uses cut() and doesn't set a proper font size which may lead to proportinal fonts.
The cut() function has been depricated and is no longer supported.

From what I see this needs to be changed:
Note: the mini console font needs to be set to a size to suit the size of the map window. 10 may be too large.

Code: Select all

function init()
	resolutionX, resolutionY = getMainWindowSize()
	setMiniConsoleFontSize("mapcap", 10);
	createMiniConsole("mapcap", resolutionX-440, 0, 400, 350)
	setBackgroundColor("mapcap", 20, 0, 0, 0 )
end
and

Code: Select all

function cutMap()
	selectCurrentLine();
	copy()
	appendBuffer("mapcap")
	deleteLine();
end
I don't have this mapper/bot so I can't test this myself, but this should work.
Maybe you can repackage a working plugin and replace the original one. Also the modules should have a common name e.g. Ramiels vmap plugin. This way people can better uninstall or upgrade the plugin later.