/* SnapAv Avatar - DMS2 - September 99 - by Sylvain HUET */ /* rev. June 00 - by Sebastien DENEUX*/ typeof class=S;; var defaultRadius=2000;; fun broadCircle(o,z)= let z->[[aa bb cc] d ui sign] in let ObPos o ->[a b c] in let (abs aa-a)+(abs bb-b)+(abs cc-c) -> dd in if ((dd!=nil && dd[o cur sign file d] in if s!=nil then (mutate z<-[_ if cur!=nil && (strlen cur)>40000 then cur else strcat cur s _ _ _]; 0) else let munzip cur -> fs in let _getlongname fs "face" "#" -> sign in ( _RSunregister this file; _RSregister this file RScontrol fs; mutate z<-[_ nil sign _ _]; apply_on_list ObList @broadCircle [(ObPos o) d ui sign]; nil);; fun cbcomm(ui,cli,action,param,z)= let z->[o _ sign file _] in if !strcmp action "addPhoto" then addbitmap ui z param else if !strcmp action "Name?" then UsendCli this cli ui "setName" file else if !strcmp action "Photo?" then UsendCli this cli ui "PhotoChg" sign else nil;; fun cbdel(ui,file)= _RSunregister this file; 0;; fun newOb(o)= let hd Obgetglobalress strcat class ".radius" -> tmp in let if tmp==nil then defaultRadius else atoi tmp -> d in let strcat "tmp/snap/" substr _getlongname strcatn DMSname::(itoa UgetId UgetUser ObUi o)::nil "" "#" 1 8 -> file in ( UcbComm this ObUi o mkfun5 @cbcomm [o nil nil file d]; UcbDel this ObUi o mkfun2 @cbdel file; 0 );; fun IniPlug(file)= set class=getInfo strextr _getpack _checkpack file "name"; PlugRegister class @newOb nil; 0;;