home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 December / VPR9712A.ISO / Ffilly / sksk20 / sk_helps.tfy < prev    next >
Text File  |  1996-06-23  |  3KB  |  146 lines

  1. // さくさくくんヘルプ関係
  2.  
  3. // 呼び出すのは rproc1() と rproc3()
  4. //  rproc1() はそれぞれで作ってやること
  5. // 呼び出す前に 変数を初期化すること
  6. //  helpflag = 0
  7. //  helpcast = 0
  8. //  mousex = 0
  9. //  mousey = 0
  10.  
  11. int    mousex;
  12. int    mousey;
  13. int    helpflag;
  14. int    helpcast;
  15.  
  16. /*
  17. rproc1()
  18. {
  19.     int    i;
  20.     int    cast2;
  21.  
  22.     mes( RBDOWN ) {
  23.         cast2 = HitCast( base_pic, MesP2, MesP3 );
  24.         if( cast2 != helpcast ) {
  25.             if( helpflag == 1 ) {
  26.                 PostMes( USER, 20 );
  27.             }
  28.             helpcast = cast2;
  29.             for( i = 0; i <= 25; i = i + 1 ) {
  30.                 if( cast2 == but_cast[i] ) {
  31.                     del_us;
  32.                     rproc2( i, MesP2, MesP3 );
  33.                     del_me;
  34.                 }
  35.             }
  36.         }
  37.     }
  38.     mes( MOUSEMOVE ) {
  39. //        del_us;
  40.         mousex = MesP2;
  41.         mousey = MesP3;
  42. //        rproc1();
  43. //        del_me;
  44.     }
  45. }
  46. */
  47.  
  48.  
  49. rproc3()
  50. {
  51.     mes( TIME ) {
  52.         step( 20 ) {
  53.             ,
  54.             if( seal_cast != 0 && helpcast != seal_cast ) {
  55.                 helpcast = seal_cast;
  56.                 rproc2( 151, mousex, mousey );
  57.             } else {
  58.                 PostMes( RBDOWN, 100, mousex, mousey );
  59.             }
  60.             reset_step;
  61.         }
  62.     }
  63.     mes( MOUSEMOVE ) {
  64.         del_us;
  65.         mousex = MesP2;
  66.         mousey = MesP3;
  67.         rproc3();
  68.         del_me;
  69.     }
  70.     mes( LBDOWN ) {
  71.         del_us;
  72.         rproc3();
  73.         del_me;
  74.     }
  75. }
  76.  
  77.  
  78. rproc2( int num, int xoff, int yoff )
  79. {
  80.     int    pic;
  81.     str    s, s2;
  82.     int    cast;
  83.  
  84.     s = GetIniStr( "Help", StrPrint( "str%ld", num ), "", "sk_help.ini" );
  85.     if( s != "" ) {
  86.         helpflag = 1;
  87.         mes( USER ) {
  88.             if( MesP1 == 21 ) {
  89.                 pic = CreatePic( base_pic, StrLen( s ) * 8 + 4, 20 );
  90.                 SetPaintColor( 0xffffff );
  91.                 DrawRect( pic, 0, 0, PicWidth( pic ), PicHeight( pic ) );
  92.                 SetPaintColor( 0x0 );
  93.                 DrawLine( pic, 0, 0, PicWidth( pic ), 0 );
  94.                 DrawLine( pic, 0, 0, 0, PicHeight( pic ) );
  95.                 DrawLine( pic, PicWidth( pic ) - 1, 0, PicWidth( pic ) - 1, PicHeight( pic ) );
  96.                 DrawLine( pic, 0, PicHeight( pic ) - 1, PicWidth( pic ), PicHeight( pic ) - 1 );
  97.                 SetFont( 16, "MS ゴシック", 128, 8, 0, 0, 600 );
  98.                 BackMode( 1 );
  99.                 TextColor( 0, 0, 0 );
  100.                 TextWrite( s, pic, 2, 2 );
  101.                 TextColor( 0, 100, 200 );
  102.                 TextWrite( s, pic, 1, 1 );
  103.                 if( xoff + 8 + PicWidth( pic ) > PicWidth( base_pic ) ) {
  104.                     xoff = PicWidth( base_pic ) - PicWidth( pic ) - 8;
  105.                 }
  106.                 if( yoff + 16 + PicHeight( pic ) > PicHeight( base_pic ) ) {
  107.                     yoff = PicHeight( base_pic ) - PicHeight( pic ) - 16;
  108.                 }
  109.                 cast = PutCast( pic, base_pic, xoff + 8, yoff + 16, 0x80000000, 0, 150 );
  110.                 s2 = GetIniStr( "Directory", "sakusaku", ".", "inst.ini" ) + "\" + GetIniStr( "Help", StrPrint( "wav%ld", num ), "", "sk_help.ini" );
  111. //TextWrite( s2, base_pic, 0, deby ); deby = deby + 20;
  112.                 if( s2 != "" && IsExist( s2 ) == 1 ) {
  113.                     if( StrMCI( "status sound mode" ) != "playing" &&
  114.                         StrMCI( "status sound mode" ) != "recording" ) {
  115. //TextWrite( "ok", base_pic, 0, deby ); deby = deby + 20;
  116.                         PlayWAVE( s2 );
  117.                     } else {
  118. //TextWrite( "ng", base_pic, 0, deby ); deby = deby + 20;
  119.                     }
  120.                 }
  121.                 mes( USER ) {
  122.                     if( MesP1 == 20 ) {
  123.                         del_us;
  124.                         helpflag = 0;
  125.                         DelCast( cast );
  126.                         DelPic( pic );
  127.                         del_me;
  128.                     }
  129.                 }
  130.                 mes( MOUSEMOVE ) {
  131.                     mousex = MesP2;
  132.                     mousey = MesP3;
  133. //                    PostMes( RBDOWN, 100, mousex, mousey );
  134.                     PostMes( USER, 20 );
  135.                 }
  136.                 mes( LBDOWN ) {
  137.                     PostMes( USER, 20 );
  138.                 }
  139.                 del_me;
  140.             }
  141.         }
  142.         PostMes( USER, 21 );
  143.     }
  144.     rproc1();
  145. }
  146.