/* ChgAv Editor - DMS - sept 99 - by Sylvain HUET */ /* rev December 99 - by Sebastien DENEUX */ typeof bannerll = ObjText;; typeof ll=ObjList;; typeof addll = ObjButton;; typeof delll = ObjButton;; typeof links=[S r1];; typeof editWin=ObjWin;; fun updatel2(s,b)= _ADDlist ll 1000 s;; fun updatel()= _RSTlist ll; apply_on_list links @updatel2 0;; fun _OpenPlug (d,b,s)= let getInfo strextr _getpack s "name" -> n in if n==nil then nil else (set links=listcat links n::nil; updatel);; fun _add(a,b)= _DLGrflopen (_DLGOpenFile _channel editWin nil nil "plugins\0*.plug\0\0") @_OpenPlug b;; fun _rem(x,b)= let _GETlist ll ->[i _] in let nth_list links i -> a in if a==nil then nil else (set links=remove_from_list links a; updatel);; fun fdlink(a,b)= if strcmp hd a "action" then 0 else (set links=listcat links (hd tl a)::nil; 0);; /* SCS editor */ fun suppevent(l)= if l==nil then nil else let l->[a n] in ("action"::a::nil)::suppevent n;; fun save (filename, n)= ("event"::"changed"::nil):: suppevent links;; fun load (l)= set links=nil; apply_on_list l @fdlink 0; updatel;; fun rflSizeEditWin (wn, blurp, w, h)= _SIZEtext bannerll w-10 15 5 10; _SIZElist ll w-10 h-60 5 30; _SIZEbutton addll 45 20 5 h-25; _SIZEbutton delll 45 20 70 h-25;; fun IniEditor (filename)= let [315 250] -> [w h] in let startEditor _channel nil nil nil 315 250 WN_NORMAL EDITOR_NORMAL filename "dms/avatar/chgav/chgav.dmc" nil nil @load @save nil -> ed in ( set editWin = getEditWin ed; _CBwinSize editWin @rflSizeEditWin 0; /* set bannerll = _CRtext _channel editWin 5 10 w-10 15 ET_ALIGN_CENTER "Avatars classes :";*/ set bannerll = _CRtext _channel editWin 5 10 w-10 15 ET_ALIGN_CENTER (_locEditor "730-CHGAV-avatars" nil); set ll=_CRlist _channel ed.EditorEditWin 5 30 w-10 h-60 LB_DOWN+LB_VSCROLL; /* set addll = _CBbutton _CRbutton _channel editWin 5 h-25 45 20 0 "Add" @_add 0;*/ set addll = _CBbutton _CRbutton _channel editWin 5 h-25 45 20 0 (_locEditor "760-CHGAV-add" nil) @_add 0; /* set delll = _CBbutton _CRbutton _channel editWin 70 h-25 45 20 0 "Remove" @_rem 0;*/ set delll = _CBbutton _CRbutton _channel editWin 70 h-25 45 20 0 (_locEditor "780-CHGAV-remove" nil) @_rem 0; if filename==nil then nil else openDMI ed ); 0;;