Mudlet 3.1

Like clockwork, a new Mudlet release is here with a ton of improvements across the board.

Enhancement to multiplaying

A feature that’ll come in quite handy where MUDs allow you to play multiple characters at once – you can now have one profile talk to other profiles in your code. A new function raiseGlobalEvent() allows you to raise events from one profile that will be received in all other open profiles.

Show Lua errors in main display

Mudlet now gained an option to display runtime Lua errors in the main display, previously available in the Errors view only:

This would be an option familiar to MUSHclient users. To enable it, enable “Echo Lua errors to main console” in the “Main display” preferences.

Show script name in error message

If you defined your function that you used elsewhere in a trigger/alias/etc, and it had an error, you’d be met with a rather unintuitive error message like this:

This has been fixed now, and the error message will include the original script where the error comes from:

Much better.

Timestamps in logging

A new option “Add timestamps at the beginning of log lines” allows you to log with timestamps:

Additionally, timestamps will also be copied if you have the timestamps view enabled in your main window and use copy or copy to HTML.

Ctrl+click selection

You can now ctrl+click on a line to select it entirely.

Ctrl+S in the trigger editor

Ctrl+S (Cmd+S on macOS) has now been enabled as a shortcut in the trigger editor – so you don’t have to hit that ‘Save Item’ button every time.

Similarly, Ctrl+Shift+S will now save your entire profile to disk.

Pink keys

Key folders have now gotten their own colour in the trigger editor: pink.

Better mapper defaults

The mapper now has anti-aliasing, better room, and exit sizes by default so new maps look a lot more like what they should:

GMCP on by default

Having been thoroughly tested on many MUDs, GMCP is now enabled by default on new profiles – if your game supports it, Mudlet will enable and make use of it.

raiseWindow() and lowerWindow()

You can now raise a label or a miniconsole above all others with raiseWindow(), or lower it below all others with lowerWindow(). This can come in pretty handy when creating your Mudlet GUIs. Remember that the default Z-order of elements is the order they are created in, with newer labels/miniconsoles coming on top.

getMousePosition() added

getMousePosition() has been added, allowing you to know the mouse position (within Mudlet only) – this’ll help enable make dragging UI elements much easier.

Try it out for yourself on Mudlet 3.1.0.

sysInstall and sysUninstall events added

These are two very useful events for script makers: sysInstall allows you to do post-install actions and sysUninstall allows you to do pre-uninstall actions.

Useful applications of this include showing a help or a welcome menu as soon as your package is installed or removing your UI and resetting the borders back to default for your GUI package.

In addition to this, more fine-grained events are also available: sysInstallPackage, sysInstallModule, sysSyncInstallModule, sysLuaInstallModule, sysUninstallPackage, sysUninstallModule, sysSyncUninstallModule, and sysLuaUninstallModule.

sysSoundFinished event added

You can now tell when a particular sound has finished playing with the sysSoundFinished event. In addition to this, the limit on playing maximum 4 sounds simultaneously has been removed.

Behind the scenes

Infrastructure

We’ve been modernising Mudlet heavily. The Linux continuous integration environment has been updated to Ubuntu 14.04 LTS and we’ve introduced automated macOS installer creation – this means anyone contributing to Mudlet can get a macOS Mudlet install for done for them automatically! This makes it much easier to code up a feature, submit it for inclusion to Mudlet, and get test versions of it in return for letting your friends test it.

Communi, the IRC library included with Mudlet, has also been upgraded to the latest 3.5.0 release.

Modern C++11 and Qt

We’ve put a lot of work into modernising Mudlets C++ codebase: the project is now using C++11, Qt 5.6, and clang-format automated code styling. This enables Mudlet to make use of really nice C++11 features like the auto keyword (letting the compiler deduce the type), ranged-based for statements (far more readable than iterators), and lambda functions (using a function inline – especially nice for small Qt slots). All of the code has been upgraded to use auto and range-based foralready, and most of it has been through the automated code styling – so if you’re curious about playing with Mudlets code using modern C++, have a look!

Start of automated testing

We’ve started on automated testing of Mudlet by robots – they’ll help raise the alarms should we break anything by accident. Teaching the robots doesn’t require any programming experience, so if you’re interested in helping us out, join us on Discord.

Pure Github development

We’ve now moved issue tracking to Github and setup a PR-based workflow. In addition to this, mudlet-lua – the Lua counterpart to C++ in Mudlet – has been merged back with the main repository. All of these changes reduce the overhead of developing Mudlet and make it a more pleasant experience.

Detailed changelog

A list of all the things changed in Mudlet 3.1.0 since 3.0.1, sans API changes which are detailed down below.

added a new option “Echo Lua errors to main console” to “Main display” preferences, enabling you to see any runtime errors with your script right in the main window

enabled MUDLET_VERSION_BUILD environment variable to set to set the build version information

fixed a crash if you tried to copy a map to a profile that didn’t have one before

fixed a small memory leak that would happen when you edited the regex of a trigger/alias

fixed hideWindow() & showWindow() to work with userwindows

fixed logs breaking if you changed from HTML to plain text or back while it was on

fixed main toolbar buttons getting enabled if you clicked ‘Cancel’ in the connection dialog

fixed many ‘chose’ instead of ‘choose’ typos

fixed memory leak when copying maps between profiles

fixed scrpt packages typo in settings

fixed userwindows not being openable again after you’ve closed them with X

fixed xml import/export getting map room/exit sizes wrong sometimes

function parameters accepting QStrings have been tightened to QString constant references

improved a lot of commented-out code and cruft has been cleaned in core code

improved default mapper room size is now 5, exits 10

improved errors defined in a script that’s called by an alias/trigger/etc will now also report the scipt name

improved log button now has an X over it when logging is enabled to disable buttons

improved QString handling to be more efficient with introduction of QLatin1String and QStringLiteral

API changelog

added closeMudlet() to save profiles and close Mudlet

added getCmdLine() to return the text that’s currently in the command line

added getMousePosition() to return the current mouse position on the main display

added getProfileName() to return the profile’s name

added raiseGlobalEvent() to raise an event in all other open profiles

added raiseWindow() and lowerWindow() functions to raise a label/miniconsole above all others or lower below all others

added saveProfile() to save the profile

added setHexFgColor(), setHexBgColor() which allows hexadecimal equivalents of the RGB setFgColor() and setBgColor()

added setLabelReleaseCallback() which allows you to run a function when the mouse was pressed and then released on a label

added sysInstall and sysUninstall events for when packages or modules are installed or uninstalled. In addition to this, more fine-grained events are also available: sysInstallPackage, sysInstallModule, sysSyncInstallModule, sysLuaInstallModule, sysUninstallPackage, sysUninstallModule, sysSyncUninstallModule, and sysLuaUninstallModule

added sysSoundFinished which is raised whenever a sound stops playing

fixed [c|d|d]echoLink() echoing to a specific window losing the format argument

fixed crash using centerview() while not map is open

fixed hideWindow() to close userwindows

fixed showColors() text luminosity being incorrect in certain cases.

fixed sysDisconnectionEvent from getting raised twice in certain cases

Geyser flyout labels have been improved and are now nestable

Geyser.Label:setReleaseCallback() has been added

improved db:create() to be more resilient – now re-opens the db connection if needed

improved echo(), feedTriggers(), startLogging(), setLabelClickCallback(), setLabelOnEnter(), setLabelOnLeave(), deselect(), resetFormat() to explain what the bad argument is and what it should be, instead of giving an “wrong argument type” error message or none at all

improved echo(), setLabelClickCallback(), setLabelOnEnter(), setLabelOnLeave(), deselect(), resetFormat(), to return true on success or nil+error otherwise (error message just if one is available)

improved permGroup() to allow creating a folder within a folder

As part of the on-going process toward Mudlet 4.0 becoming more International and supporting languages other than English: Lua commands that accept user supplied text as arguments are gradually being reworked to gain the ability to process UTF-8 text. This and related steps are only at a preliminary stage at present but form a major component of the mile-stones on the way to the next major Mudlet release version.

improved startLogging() to return the log filename and the logging status

Credits

Big thanks to Ahmed Charles, Florian Scheel, Ian Adkins, Jor’Mox, Kae, Nyyrazzilyss, Pavol Gono, Stephen Lyons, and Vadim Peretokin who collectively put in 980 commits to Mudlet’s foundations. Shoutout to all the helpers in our Discord channels and and everyone who’s helped improve our wiki!