Geyser UI Template

Share your scripts and packages with other Mudlet users.
User avatar
Vadi
Posts: 4902
Joined: Sat Mar 14, 2009 3:13 pm

Re: Geyser UI Template

Post by Vadi »

The scripts name being the same as the functions name is so Mudlet knows which function to call whent those events fire. Your script can define many functions, Mudlet wouldn't know which one to call within them. Or none - it can be defined elsewhere with the current mechanism as well. The scripts name is just being re-used well to connect events with a function to call.

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Geyser UI Template

Post by Jor'Mox »

I know. Which I why I only ever use the registerAnonymousEventHandler function. It provides flexibility and control that is needed for what I'm doing. It would be fine for scripts that were only for me, but once I share something, the name sharing restriction is too problematic. If there were an option to list the handling function at the top, just like you list events, I think it would be much better.

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

Re: Geyser UI Template

Post by Vadi »

What is the naming sharing restriction happening here? Do you mean on the particular script?

You can create one script that defines all functions, and then more scripts that are blank and just link them, if you want to use this and not the function.

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Geyser UI Template

Post by Jor'Mox »

Yes, I mean that the function name must match the script name, which, among other things, limits possible script names, but also creates a major problem if someone decides to name a script something different for some reason. But, it is fine. Also, I would really hate to put all 6000+ lines of code in the script package I have distributed into one script. It would be a nightmare to debug and/or modify. But, it is fine, there is the alternate strategy that works just fine. I was just pointing out that it was really weird to me how it was set up.

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

Re: Geyser UI Template

Post by Vadi »

It doens't have to limit the script name. You could create a sub-script with the right name that does it:

Image

You can also split things across scripts as you'd like, you aren't forced to use a single one for everything.

I think there's a misunderstanding on your part here, so I'm trying to fix it. This setup has worked well in practice and this complaint is new.

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Geyser UI Template

Post by Jor'Mox »

Honest, I get it. And as I said, it would be fine if it were just for me. But it isn't, and the people that end up using my scripts like to fiddle with things. A lot. I already jump through some substantial hoops to try to accommodate all the stuff people have done while I try to fix whatever someone broke. I even went so far as to build a whole system to have a section where people could configure things to their liking without having to edit my scripts directly, and they still do it anyway, despite regular advice to the contrary. It is FAR easier, for me, to have a block of text like this to specify what events to handle and how:
Code: [show] | [select all] lua
registerAnonymousEventHandler("onTick", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("onToggle", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("onAffect", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("onConfig", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("onDisplay", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("onReveal", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("onTrackAffect", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("affectAdd", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("affectRemove", "dslpnp.affects.eventHandler")
registerAnonymousEventHandler("displayWindow", "dslpnp.affects.eventHandler")
Than it is to hope that they don't click the wrong button and remove an event, or decide they should rename a script to something else because it would look better that way. Also, this way I can have the full contents of a script posted in a forum posting or on a wiki, that only needs to be copy and pasted and it will work right away. Honestly, the real problems that I have to deal with are much more irritating, but hopefully some of them are getting fixed. Like triggers made in scripts not getting named correctly, and not being able to set a trigger to be a multi-line trigger and things of that nature. Also, permGroup is frustrating since it doesn't make actual folders, and instead makes blank aliases and triggers. Or, say, not being able to use color codes with the replace function (yes, I know I can set foreground and background colors, but those affect the whole selection, and so aren't as flexible). And then there is the whole memory leak issue with tempTriggers that we talked about before. Or whatever it is that makes my script that resizes GUI objects slow down the more it is used. All in all, having to use registerAnonymousEventHandler is pretty minor, and has noted benefits to boot.

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

Re: Geyser UI Template

Post by Vadi »

So the issue was that people rename scripts and break the event handlers then? Okay. That's... what you get by fiddling with things. I run into that as well. The woes of making code available; people break it and then whinge.

Jor'Mox
Posts: 1101
Joined: Wed Apr 03, 2013 2:19 am

Re: Geyser UI Template

Post by Jor'Mox »

Indeed. Conveniently no one thinks to mess with a mess of long function calls at the bottom of a script.

fetaera
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm

Re: Geyser UI Template

Post by fetaera »

@vadi: Hehe.

icesteruk
Posts: 287
Joined: Sun Jan 20, 2013 9:16 pm

Re: Geyser UI Template

Post by icesteruk »

Back on topic, I think I made a booboo somewhere as when my 'command' bar goes onto a second line, I get the 9th icon doing this... (see below)
Code: [show] | [select all] lua
for i=1,9 do
 GUI["Icon"..i] = Geyser.Label:new({
   name = "GUI.Icon"..i,
 },GUI.Header)
 GUI["Icon"..i]:setStyleSheet(GUI.IconCSS:getCSS())
end
Basically whats in the template anyway.. NONE OF the other buttons change..

I also posted what the other buttons look like.. or how its suppose to look .. :/
Attachments
newlook.png
newlook.png (18.37 KiB) Viewed 4047 times
HELPME.png

Post Reply