lightIRC supports emoticons since release 1.0.
A default set of emoticons is shipped with the chat client, but you can customize or add emoticons yourself if you want.
The parameter emoticonList is able to change the list of emoticons. As stated in the list of Customization parameters, the default value is ":)->smile.gif,;)->wink.gif,:D->biggrin.gif,:P->tongue.gif,:(->sad.gif,:$->blushing.gif,:O->ohmy.gif,(H)->cool.gif,:|->mellow.gif,Oo->blink.gif,:'(->crying.gif,:S->unsure.gif,:[->mad.gif".
That means you need to put this in your config.js to have the default setting, but with your own parameter:
params.emoticonList = ":)->smile.gif,;)->wink.gif,:D->biggrin.gif,:P->tongue.gif,:(->sad.gif,:$->blushing.gif,:O->ohmy.gif,(H)->cool.gif,:|->mellow.gif,Oo->blink.gif,:'(->crying.gif,:S->unsure.gif,:[->mad.gif";
You can start fine from there. The syntax is as follows: code->path,code->path
Just add your own emoticons to the list.
Use animated emoticons¶
Flash does not support animated GIFs. That's unfortunate, but we cannot change it.
However, Flash does support animated SWF images, so you only need to convert your animated GIF files to the Flash format. You can use this converter or just google for "gif to swf converter".
Please set the animation framerate to 24 FPS to avoid that SWF animations are played back too fast when embedded in lightIRC.
This could result in a parameter value like this:
params.emoticonList = ":)smile.gif,;)->wink.swf,:D->biggrin.png";
Alternative way to create animated emoticons¶
The author of these instructions is Jeroen Wierda (#197).
Animated gif converters often make incorrect conversions of animated GIFs. This results in the SWF files being played too fast in lightIRC. Most converters allow you to modify the frame rate, but for a lot of GIFs, 24 FPS is just too fast, and dropping it to a lower rate (like 7) will still result in too fast playback in lightIRC.
The solution that works is importing the GIF files in Adobe Flash Professional. This will import the files and set them to a correct 24 FPS rate. The problem with Adobe Flash Professional is that somehow it imports a lot of corrupt frames (pixels missing, pixels in the wrong place, etc). To solve that, open up Adobe Photoshop and import the affected GIF there as well. Photoshop will show every frame as a separate layer with the same name/number as the corresponding frames in Flash, without any corruptions.
Click on the bad frame in Flash and click <Edit>. This will open the frame in Photoshop for editing. Look at the name/number of the opened frame, and close that one (in Photoshop). Look up the layer with the same name as the frame and make sure that one is the only one selected. Click <file/save as>, move to the directory the Flash frame was opened in and overwrite the frame file. This will update the frame in Flash. Continue doing this until all frames are correct.
Now the canvas on which the imported GIF is located, is most likely oversized. Right click on the canvas and select <document properties> and select "match: contents". This will shrink the canvas to the size of the imported GIF. Next, go to <file/export> and click on <export movie>. This will save your imported GIF into a SWF file.
The above description may look like a lot of work, and it is if you have to do this for a lot of smilies, but i managed to correct corrupted frames in about 30 seconds per frame. The reward is that you end up with 100% perfect animated GIF imports.
Change the location of your emoticon files¶
lightIRC looks for your emoticons by default in the folder emoticons/. You can change this value with the parameter emoticonPath.
params.emoticonPath = "http://www.example.com/lightIRC/emoticons/";
This could cause problems if your lightIRC.swf is hosted on another domain, e.g. www.exampletwo.com/lightIRC/lightIRC.swf
As Flash has several security restrictions, you need to put a so called crossdomain file to the webserver where you want to load the emoticons from.
In our example you need to create the file http://www.example.com/crossdomain.xml with the following contents:
<?xml version="1.0"?> <!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd"> <cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="*" /> </cross-domain-policy>