EMCO, the Embeddable Multi Console Object!

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

EMCO, the Embeddable Multi Console Object!

Post by demonnic »

Some of you may remember me from such hits as fText, anitimers, and iGauges. However, my best known work may very well be YATCO(Yet Another Tabbed Chat Option). And it's pretty useful, if I do say so myself. But there have always been some improvements needed.

For one thing, it was inherently limited to only one tabbed container. That never sat too well with me. I mean sure, if all you wanna use it for is chat, that's ok. But if you wanted to make any other tabbed collected of miniconsoles in addition to that one, you had to make a bunch of adjustments and a whole new table and it was just not worth it.

For another, trying to theme YATCO with CSS simply wasn't possible. When I originally coded it, CSS was more of a bother to use in Mudlet (no CSSMan available, nor Geyser for that matter) and so I just stuck with some pretty simple configuration options to make it easier on myself.

Thirdly, deriving the size based on fontSize, number of characters in a line and number of lines in the miniconsole only really made sense in the original version, before Geyser. It makes even less sense since Geyser got autoWrap, which YATCO never could take advantage of without modification

And finally, embedding YATCO as written into an existing UI was way more pain and effort than it should have been.

EMCO solves all of these problems by storing the values internally and following the Geyser patterns to keep it functionally similar to other Geyser items. It also should make it easier to use in things like the Drag and Drop framework.

I also included a script which will read your current YATCO configuration and give you the necessary constraints to duplicate it, assuming you've not made any modifications.
convertYATCO.png
You can download releases from: https://github.com/demonnic/EMCO/releases
Basic information is available at the wiki: https://github.com/demonnic/EMCO/wiki
LDoc for the functions available to EMCO objects is available as well: https://demonnic.github.io/EMCO/index.html

And here's an ugly test EMCO:
testEMCO.png
testEMCO.png (19.65 KiB) Viewed 18463 times

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

Re: EMCO, the Embeddable Multi Console Object!

Post by demonnic »

Release 1.1, adding scrollbars as well as an option to include an extra blank line between entries on the consoles.

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

Re: EMCO, the Embeddable Multi Console Object!

Post by demonnic »

Decided I could improve the convertYATCO() output, so 1.2 happened:
convertYATCO.png

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

Re: EMCO, the Embeddable Multi Console Object!

Post by demonnic »

1.3 has been put up, fixes a bug where the miniconsole widths were being initialized at 300px instead of 100% like they should.

dragonsmall
Posts: 4
Joined: Sat Oct 19, 2019 2:52 am

Re: EMCO, the Embeddable Multi Console Object!

Post by dragonsmall »

I import EMCO.mpackage (1.3),but not show, whether you still need to operate.
I have tried to disable or remove YATCO and still can't solve it.

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

Re: EMCO, the Embeddable Multi Console Object!

Post by demonnic »

I'm sorry, I've been out of commission due to surgery. I'm not sure I'm following the issue though. You have to run the EMCO:convertYATCO() function to have it give you the code to replace YATCO with.
If you still have more problems, try to explain a bit more what you are trying to do and I'll try to help. You can also come to our discord (link in the top right of the forums page) for a bit faster help loop.

Alyven
Posts: 33
Joined: Sat Oct 01, 2011 8:43 pm

Re: EMCO, the Embeddable Multi Console Object!

Post by Alyven »

Make Emco moveable by doubleclicking the first tab.
Works for the example on the EMCO wiki.
Change the values at emcos and container to make it work for your EMCO.

Code: Select all

local function getPosPercent()
  local wx, wy = getMainWindowSize()
  local mx, my = getMousePosition()
  perx = (mx / wx) * 100 -2
  pery = (my / wy) * 100 -2
  if pery < 0 then
    pery = 0
  end
  if perx < 0 then
    perx = 0
  end
  if pery > 100 then
    pery = 100
  end
  if perx > 100 then
    perx = 100
  end
  perx = perx .. "%"
  pery = pery .. "%"
  return perx, pery
end


-- Move your Emco container by doubleclicking first tab and hold the mouse down
local emcos = "testEMCO" -- Change it to the name of your EMCO as string
local container = testCon -- change it to the variable of the container your EMCO is in
local emco = _G[emcos]

emco.movecontainer = function() container:move(getPosPercent()) end
emco.movecontaineron = function () emco.tabs[emco.consoles[1]]:setMoveCallback(emcos..".movecontainer") end
emco.movecontaineroff = function () emco.tabs[emco.consoles[1]]:setMoveCallback("") end

emco.tabs[emco.consoles[1]]:setDoubleClickCallback(emcos..".movecontaineron")
emco.tabs[emco.consoles[1]]:setReleaseCallback(emcos..".movecontaineroff")


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

Re: EMCO, the Embeddable Multi Console Object!

Post by demonnic »

Mind if I take this and fold it into EMCO proper?

Alyven
Posts: 33
Joined: Sat Oct 01, 2011 8:43 pm

Re: EMCO, the Embeddable Multi Console Object!

Post by Alyven »

Not at all.
Would be very nice.
I still don't know how to save the position.

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

Re: EMCO, the Embeddable Multi Console Object!

Post by demonnic »

I'll take a look at it when I add this bit in. *adds it to his stack of stuff to do*

Post Reply