Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-10-2010, 03:27 AM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
Color dialog

Reading through Rufus' thread regarding body colors in the "Future Improvements" section reminded me of this script. It's about the only useful, independent thing I made in the past, so I thought I'd post it. I'm not sure if it's the code is the most efficient or done properly, but it worked on Classic when I made it.

This dialog allows you to truly obtain any (if it's functioning properly) of the 16777216 colors, unlike other scripts I've seen. I think I remember there being some slight inaccuracy, but I'm not sure. I don't have any means of testing it now, so I'm providing it as-is.

To use:
- Upload the image files attached to this post.
- Initialize the dialog once with ColorDialog_Init();. If another script has
already done this, the function will simply return, so you don't have to
worry about checking if it's necessary.
- Call ColorDialog.show(); to show the dialog. Upon closing, the
function "ColorDialog_Close" will be called with the first parameter set
to {r,g,b} (each ranging from 0-255) if "OK" was clicked, or 0 for "Cancel".

The custom colors are stored in client.customcolors as an array.

All functions and variables in this class are prefixed with "ClrDlg_", so
nothing will interfere with whatever script it's combined with. There is
also no timeout done, nor non-GUI-related events defined.
Attached Images
  
Attached Files
File Type: txt colordialog.txt (16.5 KB, 337 views)
__________________
Kat
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.