My Github Repository

All and any discussion and development of the Mudlet Mapper.
Post Reply
User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

My Github Repository

Post by chris »

I'm going to post here my tweaks to the mapper/Mudlet in general instead of creating a new thread for each change.
The repository:
https://github.com/Chris7/Mudlet

New changes:
Package Exporter


Still specific to my Repo:
added optional parameter to clearRoomUserData of the type of userdata you want to clear.
clearLabels method added to remove GUI elements
getSpecialExitsTable/SwapTable removed
mapper variable with setMapVar removed and replaced with lua functions (getMapCoords for mapper coords of room id, getMapLocation for room id, setMapLocation to set room id, getMapSize to get map width)
New options in profile preferences -- ability to have panning enabled by default or not, and ability to customize what keys to use for added functionality like selecting multiple rooms
I changed tempTrigger to have an optional boolean argument. If you want, you can use:
tempTrigger(pattern,command,true)
which will cause the trigger to automatically destruct after it fires.
New method:
openWebPage(path). This will take either a path to a website, or a string that is HTML and render that html in a webview. This is useful for people who have their own help setup.
addMapMenu, addMapEvent altered to support events when no rooms are selected.
addMapMenu(uniquename, parent, displayname) --only uniquename required
addMapEvent(uniquename, event, parent, displayname, args) -- only unqiuename/event required
new variable UI
variable hiding

Added the ability for users to have their own functions in the mapper right click menu. Here's an example:
new functions: addMapEvent(event display name, event script name, parent menu)
The parent menu name is optional, and if left blank it will appear in the main content. If it has a parent, it will appear under that menu item
removeMapEvent(display name)
getMapEvents()
addMapMenu(display name, parent)
This will create a dropdown menu you can add to. Menus can be nested if a parent if given, if no parent is given it will be on the main menu.
removeMapMenu(name) - removes menu and any children of that menu
getMapMenus()

For events created, any room that is selected or group or rooms selected will be returned as arguments to the event. This hopefully will allow people to extend their own merge functions, etc. with the GUI of the mapper. Here is an example of setting up a way to color rooms via right click.
Code: [show] | [select all] lua
addMapMenu("Color")
addMapEvent("Red", "colorEvent", "Color")
addMapEvent("Green", "colorEvent", "Color")
addMapEvent("Blue", "colorEvent", "Color")
setCustomEnvColor(1,255,0,0,255)
setCustomEnvColor(2,0,255,0,255)
setCustomEnvColor(3,0,0,255,255)
colorMap = {Red=1, Green=2, Blue=3}
function colorEvent(...)
	local color = arg[2]	
	local env = colorMap[color]
	for i = 3,arg['n'] do
		setRoomEnv(arg[i],env)
	end
end
Experimental variable GUI:
To add a table->Add group.
To add a variable -> Add Item.
Variables and tables can be nested under existing tables by selecting the table and clicking 'add group'.

Saving variables -> click the box to have a variable save/autoload. Tables/etc save just fine.


Fixed a bug where editting special exits was crashing (due to the new version of QT?)
Fixed centerview to update the area dropdown.

Existing changes in the latest Official Beta:
2D/3D Mapper pans with the mouse. Use control+click to use the old functionality of left clicking on the map (speedwalking still works the same)
searchRoomUserData(key, query) function to search the user data of all rooms
Zone list in the mapper is alphabetical
Labels respect the z axis and don't show up everywhere.
Area switching places the view field of the mapper in the first room of the area now.
tempComplexRegexTrigger added
Right-click menu to set player location on map
Fixed setCustomEnvColor to provide the alpha channel as well. New syntax: setCustomEnvColor(id, r, g, b, alpha), if alpha is omitted it will default to opaque. This was the reason there were inconsistencies in the color scheme from custom colors.
Incorporated Vadi's loadMap function
Added built-in exit stub and completion support to the map.
New functions for exit stubs:
direction in the following cases corresponds to their numerical mapping (ie 1=north)
setExitStub(roomid, direction, status) -status 1 or 0 to turn off/on
getExitStubs(roomid) - table with all exit stubs (value is stub direction, key is just iterator)
connetExitStub(roomid, direction) - searches for closest room in given direction, if it finds a matching exit stub on that room, automatically removes stubs and creates exit.
connectExitStub(roomid, toroom, direction) - will connect a stub from roomid to toroom in the given direction.
The mapper will show your stubs as incomplete links.
Central module system added.
Two new label callbacks: setOnEnter and setOnLeave to call a given function when a label is entered/left with the mouse.
example code for a label, labels[tab]
labels[tab]:setOnEnter("onEnter", tab)
function onEnter(tab)
display("entered!")
end
Priorities added to module system. Two new methods to set them from the command line (in addition to setting them from the module manager window), getModulePriority, and setModulePriority.
Bug fix: tempTrigger and a few other methods now return their trigger id instead of pattern, thus killTrigger can work.
Added a lua change within Geyser, you can nest labels much easier. One nuance: You cannot put a nested label within a container (it must be its own container).
Here's a trivial example:
Code: [show] | [select all] lua
b = Geyser.Label:new({name="testa", x=400,y=50,height=100,width=100,nestable=true, h_policy=Geyser.Fixed, v_policy=Geyser.Fixed, message="CLICK ME!"})
c = {}
for i=1,20 do
	c[i] = b:addChild({name="test"..tostring(i),height=30,width=60, layoutDir="BH", flyOut=true,h_policy=Geyser.Fixed, v_policy=Geyser.Fixed, message="test"..tostring(i)})
end
d = {}
for i=21,40 do
	d[i]=c[5]:addChild({name="test"..tostring(i),height=30,width=60, layoutDir="RV", flyOut=true,h_policy=Geyser.Fixed, v_policy=Geyser.Fixed, message="test"..tostring(i)})
end
new method: updateMap() to cause the map view to update
new method: getMapLabel(area #, label or id #). Returns a table with x,y,z,height,width, and text of label. If multiple labels exist with same text, returns them all.
change: searchRoom returns room id as key
Merge: Vadi's profile settings change
Added versioning system for automatically backing up modules and a new info box for the module manager to provide some information on modules, syncing, and backing up
Last edited by chris on Tue Sep 20, 2011 5:07 am, edited 11 times in total.

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

Re: My Github Repository

Post by Vadi »

+1 :) Heiko is away at the moment, but once he's back we'll look into integrating these changes. I'm also following this repository now as well.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: My Github Repository

Post by chris »

Fixed the z-label problem with saving. Also fixed the bug with multiple highlights selecting rooms in all z rooms. To regain this behavior, control+shift while dragging your mouse to get all z rooms (so you can move up/down exits in line).

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: My Github Repository

Post by chris »

I rewrote how the mouse clicks were being handled. It was a mess (it still is more or less) but at least it makes a bit more sense now of where different actions occur (well, to me). I changed a few things to work on the mouse click release instead of on an initial press and moved some routines around.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: My Github Repository

Post by chris »

Switching areas now transfer the view to the first room in the new area (which for most every case will be the entrance).

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: My Github Repository

Post by chris »

Added a fully featured command line temporary trigger maker. This is to help with package loading from dofile.
Syntax:
tempComplexRegexTrigger('name', regex, code to execute, multiline, Foreground color, bg color, filter, match all, highlight foreground color, highlgiht background color, play sound file, fire length, line delta)

For the multiline and so on options, use a 0 if you don't want those options. Otherwise enter the value you want to use. For things like color, you need to provide both fg and bg. For making multiline triggers, here's an example:

tempComplexRegexTrigger("testTrigger", "test", "echo("it went")", 1, 0, 0....)
tempComplexRegexTrigger("testTrigger", "blah", "echo("it went")", 1, 0, 0....)

That will make 1 trigger with both regex patterns. Note only one script will ever be used (the last one set)

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

Re: My Github Repository

Post by Vadi »

I made loadMap back in May with this commit: https://github.com/vadi2/Mudlet/commit/ ... a1e2bc30b3 it is unfortunately polluted with some other changes, but you could pick it from there and merge.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: My Github Repository

Post by chris »

loadMap is meant for keeping the player's location and selecting a map file to use?

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

Re: My Github Repository

Post by Vadi »

Well it should do that, yes. The use was meant as a cheap undo system that you could use with save+load - plus it's also necessary for auto-map updates from elsewhere, like a server (downloadFile+loadMap).

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: My Github Repository

Post by chris »

I'll look into it. I just added setting the player location via right clicking on a room. You need to left click to select what room, then right click and do the select. It also calls a mudlet function, doRoomSet so you can update any internal stuff. The variable you can use for the set room id is mRoomSet

Post Reply