/* move configure graphic interface by macfly august 2001 */ struct MoveConfAsso = [ MOVECONFcodeEvent : S, MOVECONFwin : ObjWin ]mkMoveConfAsso;; struct MoveConfiguration = [ MOVECONFfont : ObjFont, MOVECONFslider : ObjSlider, MOVECONFassos : [MoveConfAsso r1] ]mkMoveConfiguration;; typeof MoveConf = MoveConfiguration;; fun MOVECONF_CompareCodeEvent (elt, code) = !strcmpi elt.MOVECONFcodeEvent code;; proto MOVECONF_UpdateKeyboardConf = fun [] I;; proto MOVE_RemoveMoveAction = fun [I S] I;; proto MOVE_AddAction = fun [I S] I;; proto MOVE_GetMoveActionFromCode = fun [S] MoveAction;; fun MOVECONF_ReplaceMoveAction (scan, prevscan, code) = if prevscan == nil then nil else MOVE_RemoveMoveAction prevscan code; if scan == nil then nil else MOVE_AddAction scan code; MOVECONF_UpdateKeyboardConf ;; proto MOVE_SetUserKeyboard = fun [I] I;; proto MOVE_GetUserKeyboard = fun [] I;; fun MOVECONF_UpdateKeyboardConfAction (elt, param) = let MOVE_GetMoveActionFromCode elt.MOVECONFcodeEvent -> moveaction in _DRAWeventBox elt.MOVECONFwin if moveaction == nil then nil else MoveConf.MOVECONFfont if moveaction == nil then nil else (MOVEACTION_GetScan moveaction) if moveaction == nil then nil else (MOVEACTION_GetKeyId moveaction MOVE_GetUserKeyboard) elt.MOVECONFcodeEvent @MOVECONF_ReplaceMoveAction ;; fun MOVECONF_UpdateKeyboardConf () = apply_on_list MoveConf.MOVECONFassos @MOVECONF_UpdateKeyboardConfAction nil; 0 ;; fun MOVECONF_SelectKeyboard (combo, param, pos, text) = if pos != nil then _SELcombo combo pos else nil; let _GETcombo combo -> [_ selection] in ( MOVE_SetUserKeyboard pos; MOVECONF_UpdateKeyboardConf ) ;; proto MOVE_GetEvents = fun [] [MoveEvent r1];; /* fun MOVECONF_HelpEvent (butt, code) = _DLGMessageBox _channel nil code MOVEEVENT_GetHelp (search_in_list MOVE_GetEvents @MOVEEVENT_CompareCode code) 0; 0 ;; */ fun MOVECONF_ShowKeyboardConfEvent (chan, win, x, y, moveevents, moveactions, combo) = if moveevents == nil then nil else let moveevents -> [cur next] in let MOVEEVENT_GetCode cur -> code in ( /*_CBbutton (_CRbutton chan win x+10 y 15 20 0 "?") @MOVECONF_HelpEvent code;*/ _CRtext chan win x+0 y 120 20 ET_ALIGN_LEFT _loc this strcat "PAINTBALL_" code nil; (mkMoveConfAsso [code (_CReventBox chan win x+160/*-50*/ y 100 20 code)]):: /* modif */ (MOVECONF_ShowKeyboardConfEvent chan win x y+20 next moveactions combo) ) ;; fun MOVECONF_FillKeyboardType (combo, kbdlist) = if kbdlist == nil then MOVECONF_SelectKeyboard combo nil MOVE_GetUserKeyboard nil else ( _ADDcombo combo 255 hd kbdlist; MOVECONF_FillKeyboardType combo tl kbdlist ) ;; proto MOVE_SetReverseMouse = fun [I] I;; proto MOVE_GetReverseMouse = fun [] I;; proto MOVE_SetSensitivity = fun [I] I;; proto MOVE_GetSensitivity = fun [] I;; fun MOVECONF_ReverseMouse (check, param, state) = MOVE_SetReverseMouse state;; fun MOVECONF_Sensitivity (slider, value1, value2) = MOVE_SetSensitivity ftoi value1;; fun MOVECONF_Close (zonename) = if MoveConf == nil then nil else ( _DSslider MoveConf.MOVECONFslider; _DSfont MoveConf.MOVECONFfont; set MoveConf = nil; ); 0 ;; fun MOVECONF_Open (chan, fatherwin, x, y, w, h, moveevents, moveactions) = if MoveConf != nil then nil else let _CRwindow chan fatherwin x y w h WN_CHILDINSIDE _loc this "PAINTBALL_CONFIGURE" nil -> win in ( set MoveConf = mkMoveConfiguration [(_CRfont chan 12 0 0 "Arial") nil nil]; _CRtext chan win 10 10 200 20 ET_ALIGN_LEFT _loc this "PAINTBALL_CONFIGURE" nil; _SETcheck _CBcheck _CRcheck chan win 10 30 200 20 0 _loc this "PAINTBALL_REVERSE_MOUSE" nil @MOVECONF_ReverseMouse nil if MOVE_GetReverseMouse then 1 else 0; _CRtext chan win 10 60 200 20 ET_ALIGN_LEFT _loc this "PAINTBALL_MOUSE_SENSITIVITY" nil; set MoveConf.MOVECONFslider = _CRslider chan win nil 10 80 200 20 0xff0000 (itof 1) (itof 30) (itof MOVE_GetSensitivity) (itof MOVE_GetSensitivity) @MOVECONF_Sensitivity SLIDER_INTER_FIXED; /* MAC ICI : ack car semble manquer un paintwindow ??? */ _SETsliderFlags MoveConf.MOVECONFslider SLIDER_INTER_FIXED; _CRtext chan win 10 110 100 20 ET_ALIGN_LEFT _loc this "PAINTBALL_KEYBOARD_TYPE" nil; let _CRcombo chan win /*120*/ 170 110 100 60 CB_NOEDIT|CB_AHSCROLL nil -> combo in ( _CBcombo combo @MOVECONF_SelectKeyboard nil; set MoveConf.MOVECONFassos = MOVECONF_ShowKeyboardConfEvent chan win 10 160 moveevents moveactions combo; MOVECONF_FillKeyboardType combo MOVEKBD_GetKbdList; ); ) ;;