|
- TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1
- SET ::WM_LBUTTONDOWN=0x0201
- CALL @FROM
- _SUB FROM,W500H555,中國象棋,,#2,#,*%CurDir%\MiniBoard.bmp
- ENVI @this.HitTest=500
- ENVI ZZF=R //为了可以轮流走子
- ENVI YZF= //用于判断是否走子完成
- ENVI BCD=
- ENVI @FROM.MSG=0x0201: CALL ZZJS %CheckButton%
- LABE LabelR01,L45T45W40H40,車,*,0x0000ff#0x00ffff,30
- ENVI @LabelR01.MSG=0x0201: FIND $%ZZF%=R,TEAM ENVI CheckButton=LabelR01| ENVI YZF=R| CALL ZZFF ! FIND $%YZF%=B,TEAM ENVI BCD=LabelB25| CALL ZZJS %CheckButton%
- LABE LabelR25,L405T180W40H40,兵,*,0x0000ff#0x00ffff,30
- ENVI @LabelR25.MSG=0x0201: FIND $%ZZF%=R,TEAM ENVI CheckButton=LabelR25| ENVI YZF=R| CALL ZZFF ! FIND $%YZF%=B,TEAM ENVI BCD=LabelR25| CALL ZZJS %CheckButton%
- LABE LabelB01,L405T450W40H40,車,*,0x000000#0x00ffff,30
- ENVI @LabelB01.MSG=0x0201: FIND $%ZZF%=B,TEAM ENVI CheckButton=LabelB01| ENVI YZF=B| CALL ZZFF ! FIND $%YZF%=R,TEAM ENVI BCD=LabelB01| CALL ZZJS %CheckButton%
- LABE LabelB25,L45T315W40H40,卒,*,0x000000#0x00ffff,30
- ENVI @LabelB25.MSG=0x0201: FIND $%ZZF%=B,TEAM ENVI CheckButton=LabelB25| ENVI YZF=B| CALL ZZFF ! FIND $%YZF%=R,TEAM ENVI BCD=LabelB25| CALL ZZJS %CheckButton%
- _END
- _SUB ZZFF
- //这个好像是用不到了!
- _END
- _SUB ZZJS *
- ENVI @FROM.Cur=?;;L;T
- CALC L=int(%L%/40)*40
- CALC T=int(%T%/40)*40
- FIND $%ZZF%=R,!! FIND $%YZF%=R,ENVI ZZF=B //判断是否走子完成
- FIND $%ZZF%=B,!! FIND $%YZF%=B,ENVI ZZF=R
- ENVI @%BCD%.Visible=0
- ENVI @%~1.POS=%L%:%T%
- ENVI @%~1.Visible=1
- ENVI CheckButton=
- ENVI @FROM=%L%:%T%$%BCD%%YZF%@%YZZ%%ZZF% //如果出现错误可以在标题栏查看哪个变量有问题
- _END
复制代码
这样似乎更合理一些,你慢慢调整吧。
MiniBoard.7z
(1.58 KB, 下载次数: 4)
|
|