[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  ColourPicker and scripting: how about some improvements?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

ColourPicker and scripting: how about some improvements?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Fri 20 Apr 2012 10:06 AM (UTC)
Message
I _love_ the MUSHclient colour picker. It's awesome.

And yet I'm sad I can't really do much with it from a script. Sure, I can do this:

world.DoCommand("ColourPicker")

but I'd love to do so much more with it, as that doesn't help me much. Let me explain.

Basically, I want to use it to configure colours for one of my plugins. I've got a listing with settings, and for the colour settings I show the colour in its hex notation. Now I want to add a 'modify' link, have the picker pop up, let the use select a color and hit OK.. and then have my script update its setting in response.

There's several ways this could be implemented, but if it is easiest for you, something like utils.inputbox would be fine despite the lack of support for other scripting engines. And rather than copying the contents, all 'OK'-like exits from the dialog should not copy to the clipboard, but simply return the value.

Parameters like initial_color, title and sort direction (including 'whatever it was last time') are a must. Maybe a flag that lets the function return the value closest to the kind the user clicked on (e.g. MXP, MUSHclient colour name, Lua, etc.) would be nice as well, but a simple int color return value is just fine by me.

The exact details I'd leave to you. Personally, I feel that if I can select a colour and use it the dialog in my script without confusing my users, I'll be more than happy enough! :)
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Sat 21 Apr 2012 09:18 AM (UTC)
Message
Template:function=PickColour PickColour

The documentation for the PickColour script function is available online. It is also in the MUSHclient help file.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #2 on Sat 21 Apr 2012 03:30 PM (UTC)
Message
... This is embarrasing! I even searched the documentation before I posted, and all I came up with was the DoCommand() variety.

Apologies!
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


3,076 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]