The demonnic MDK

Share your scripts and packages with other Mudlet users.
Post Reply
User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

The demonnic MDK

Post by demonnic »

In the last couple weeks, I decided that since a lot of my code is really meant to be used by other script authors as dependencies that I should come up with some way for each script author to be able to use whatever version of my libraries they wanted to use, without either requiring a specific version of my package, or potentially fighting with/overwriting a version of one of my libraries in use by another script developer.

And thus, the demonnic MDK was born!
Latest releas: https://github.com/demonnic/MDK/releases/latest
API documentation for the latest release: https://demonnic.github.io/mdk/current/index.html
Report issues: https://github.com/demonnic/MDK/issues
though a copy will also be kept for each version at https://demonnic.github.io/mdk/<version>/index.html , for instance 1.0.0 is https://demonnic.github.io/mdk/1.0.0/index.html

I have rewritten my existing tools and begun adding new ones to the project. It is packaged as a zip file, as it is intended that the .lua files be included in your own mpackage. You can then use lua's require() function to load the specific version of the library included with your package. For instance, if your package places files in getMudletHomeDir() .. "MyPackage" and you include the MDK's .lua files in that directory, then you could create a timer gauge via:
Code: [show] | [select all] lua
local TimerGauge = require("MyPackage.timergauge")
local baseCss = [[
  border-width: 4px;
  border-radius: 7;
]]
local myCss1 = baseCss .. [[
  border-color: red;
  background-color: green;
]]
local myCss2 = baseCss .. [[
  border-color: green;
  background-color: red;
]]
testGauge = TimerGauge:new({
  name = "testTimerGauge",
  x = 100,
  y = 100,
  height = 40,
  width = 200,
  time = 10,
  showTimer = true,
  timerCaption = "Test1",
  cssFront = myCss2,
  cssBack = myCss1,
  cssText = baseCss,
  active = true,
  autoHide = false,
  hook = function() echo("\nThis is testGauge's hook!\n") end,
})
This produces the following timer gauge:

Image

You may recognize this as being similar to my old anitimers package, but these are now an actual extension of Geyser.Gauge and are each independent of the rest, rather than being one intertangled mess like before.

Though the main goal of this shift is to support script writers with their own copies to include in their scripts, I'm also including a reference package which includes all of the tools. For instance, the reference package allows you to require emco using EMCO = require("MDK-1.EMCO"), fText as fText = require("MDK-1.ftext") etc.

The MDK combines the following works
fText, TextFormatter, TableMaker https://github.com/demonnic/fText/wiki
this is a set of text formatting tools for use with monospace ascii fonts (not yet ported to work with utf8)

EMCO https://github.com/EMCO/wiki
Embeddable Multi Console Object . This creates tabbed collections of miniconsoles with various options for placing formatted text inside of them, It is powered by the same logic as my original YATCO package, but is itself modeled more in line with other Geyser objects and is more flexible and stylable than YATCO was

TimerGauge https://github.com/demonnic/MDK/wiki/TimerGauge
Creates a visual timer which uses a gauge to represent the amount of time left as a percentage of the original time. Useful for cooldown timers and the like. Has several options for how to display text on the timergauge, can execute code the same as tempTimer(using both [[send("thing")]] and function() send("thing") end formats) using the hook property, and also hide/show and add/remove itself from its containers when you start or stop it.

SortBox https://github.com/demonnic/MDK/wiki/SortBox
This is like a combined HBox/VBox, in that you can choose which behaviour it has using a propertty. It also has the ability to sort the items within it based on various criteria, from how full a gauge is, to how many seconds are left on a timer gauge, to what the name of the geyser object is and more.
Image

TextGauge https://github.com/demonnic/TextGauges/wiki
Creates a text based gauge for use in the main or miniconsoles. Results with non-monospace fonts will be unpredictable

LuaUnit https://github.com/bluebird75/luauni
For writing unit tests for your packages. Modified slightly for use with Mudlet. I did a video on this at https://www.youtube.com/watch?v=16_aKITBU9g

luaschema https://github.com/sschoener/lua-schema
This is largely included for an upcoming project of mine, but allows for defining schema for tables, and validating that a table matches a particular schema. Useful for enforcing data types and the like.

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

1.0.1 out https://github.com/demonnic/MDK/releases/tag/1.0.1

small bugfix for hboxes or vboxes with a 0 height or width setting.

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

1.0.2 was released, adding margins to EMCO https://github.com/demonnic/MDK/releases/tag/1.0.2
Selection_045.png
Selection_045.png (10.32 KiB) Viewed 655 times
1.0.3 was released, adding elasticity to SortBoxes https://github.com/demonnic/MDK/releases/tag/1.0.3
elastic-sortbox.gif
elastic-sortbox.gif (292.43 KiB) Viewed 655 times
May need to click on this one, only wants to animate the first for me
elastic-hbox.gif
For more details, look at the release announcements above and as always I'm happy to answer questions here or over at Discord.

Quixote
Posts: 1
Joined: Mon Jun 22, 2020 5:45 pm
Location: United Kingdom
Discord: quixote#6987

Re: The demonnic MDK

Post by Quixote »

This is absolutely brilliant work, mate. Thank you so much for making this available.

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

I'm glad you like it :)

Probably have another small release today, doing some refactoring on the sortbox to make it easier to maintain/read.

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

1.0.4 was released, mostly a refactor. But now 1.0.5 is out, with gradientmaker!
https://github.com/demonnic/MDK/releases/tag/1.0.5

Yes, i know now butterfly is misspelled... but I'm too lazy to fix all the example pictures.
gmexample.png

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

MDK 1.0.6 released! Adds EMCO:save() and EMCO:load() to allow for easy saving and loading of EMCO options.
https://github.com/demonnic/MDK/releases/tag/1.0.6

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

MDK 1.0.7 released! Adds the new Chyron class.
https://github.com/demonnic/MDK/releases/tag/1.0.7

Creates a label with a scrolling text ticker:
chyrondemo.gif
chyrondemo.gif (171.33 KiB) Viewed 516 times

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

MDK 1.0.8 released! https://github.com/demonnic/MDK/releases/tag/1.0.8

Adds

EMCO:deploy(tabName, thingToDisplay) which works like display() but prints to an EMCO tab
EMCO:removeTab(tabName) which peels a tab out of an EMCO and yeets it unceremoniously into the abyss.

User avatar
demonnic
Posts: 663
Joined: Sat Dec 05, 2009 3:19 pm

Re: The demonnic MDK

Post by demonnic »

MDK 1.0.9 released! https://github.com/demonnic/MDK/releases/tag/1.0.9

Adds the Self Updating Gauge, which will monitor a pair of variables and update the gauge automatically on a timer.
SUG docs are here: https://demonnic.github.io/mdk/current/classes/SUG.html

Post Reply