/******************************************************************************* Module Teleport Editor part Version: 1.0 Authors: Sylvain HUET & sebastien DENEUX Last update: 20/06/2001 *******************************************************************************/ typeof editWin = ObjWin;; typeof nb = ObjText;; typeof backColor = I;; var backColorDefault = 10395294;; /* COULEUR PAR DEFAULT */ fun getsupp(n) = if n == nil || n <= 0 then nil else ("action"::(strcat "define." itoa n)::nil):: ("event"::(strcat "goto." itoa n)::nil)::getsupp n-1 ;; fun cbLoad (l) = _SETtext nb getInfo l "number"; set backColor = if (atoi getInfo l "backColor")==nil then backColorDefault else (atoi getInfo l "backColor"); 0 ;; fun cbSave (filename, n) = let atoi _GETtext nb -> p in ("action"::"start"::nil):: ("action"::"destroy"::nil):: /*add seb*/ ("eventC"::"in"::nil):: /*add seb*/ ("event"::"out"::nil):: /*add seb*/ ("action"::"getpositions"::nil):: ("action"::"teleport"::nil):: ("action"::"enter"::nil):: ("action"::"show.user"::nil):: /*add seb*/ ("action"::"show.teleport"::nil):: /*add seb*/ ("action"::"show.admin"::nil):: /*add seb*/ ("actionC"::"hide"::nil):: /* add seb */ ("eventC"::"shown"::nil):: /*add seb*/ ("eventC"::"hidden"::nil):: /*add seb*/ ("event"::"teleport"::nil):: /*add seb*/ ("zoneC"::"view"::nil):: ("number"::(itoa p)::nil):: ("backColor"::(if backColor==nil then itoa 10395294 else itoa backColor)::nil):: getsupp p ;; fun _paintE(a, b) = _PAINTrectangle editWin 160 35 20 20 DRAW_SOLID 1 0 DRAW_SOLID backColor ;; fun is_in_box(x, y, bx, by, bw, bh) = (x>=bx) && (x<=(bx+bw)) && (y>=by) && (y<=(by+bh)) ;; fun _endColor1(a) = if a!=nil then ( set backColor = a; /*_DLGMessageBox _channel nil "editeur couleur" itoa backColor 0;*/ 0 ) else nil ;; fun _clickE(a, b, x, y, button) = if button==1 then ( if is_in_box x y 160 35 20 20 then _CRcolorMap _channel editWin 100 100 (_locEditor "330-TELEPO-chooseback" nil) @_endColor1 backColor else nil; 0 ) else 0 ;; fun IniEditor(s) = let [350 60] -> [w h] in let _StartEditor _channel nil nil nil w h WN_NORMAL EDITOR_NORMAL @cbLoad @cbSave nil -> ed in ( set editWin = getEditWin ed; _CRtext _channel editWin 5 5 150 20 ET_ALIGN_RIGHT (_locEditor "330-TELEPO-numberofro" nil); set nb = _CReditLine _channel editWin 160 5 w-115 20 ET_NUMBER|ET_DOWN ""; _CRtext _channel editWin 5 35 150 20 ET_ALIGN_RIGHT (_locEditor "330-TELEPO-background" nil); _CBwinPaint editWin @_paintE nil; _CBwinClick editWin @_clickE nil; if s == nil then nil else openDMI ed ); 0 ;;