home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 October
/
VPR9710A.ISO
/
Ffilly
/
TFYW111
/
RTW_CAST.MAC
< prev
next >
Wrap
Text File
|
1997-06-05
|
11KB
|
450 lines
//キャラクタ関連関数
main:
menu
"&MoveCast...\tCastの内容を変更",
"&PutCast...\tCastをピクチャーと関連付け",
"&DelCast...\tCastとピクチャーの関連付けを破棄",
"&ChaLCast...\tCast同士の前後関係を変更",
"&HitCast...\t指定の座標値にあるキャストを調べる",
"&RepaintCast...\t指定の領域を再描画";
if(result == 0) goto macro_cancel;
else if(result == 1) goto MoveCast;
else if(result == 2) goto PutCast;
else if(result == 3) goto DelCast;
else if(result == 4) goto ChaLCast;
else if(result == 5) goto HitCast;
else if(result == 6) goto RepaintCast;
macro_end:
endmacro;
macro_cancel:
writeininum "tfywrite.ini", "Control", "MenuCancel", 1;
endmacro;
MoveCast:
escape;
call MacSrvInit;
ddepoke "newdialog", "35,MoveCast";
ddepoke "newcontrol", "text,,Cast番号(&C)";
ddepoke "part", "19";
ddepoke "newcontrol", "edit,Cast,";
ddepoke "newcontrol", "text,,Castのピクチャー番号(&P)";
ddepoke "part", "19";
ddepoke "newcontrol", "edit,Pic,";
ddepoke "newcontrol", "text,,表示先";
ddepoke "part", "7";
ddepoke "newcontrol", "text,,X座標(&X)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,X,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,Y,";
ddepoke "newcontrol", "text,,サイズ";
ddepoke "part", "7";
ddepoke "newcontrol", "text,,幅(&W)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,W,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,高さ(&H)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,H,";
ddepoke "newcontrol", "text,,CastPic内のキャストの左上の座標";
ddepoke "newcontrol", "text,,";
ddepoke "part", "7";
ddepoke "newcontrol", "text,,X座標(&R)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,CX,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&D)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,CY,";
ddepoke "newcontrol", "text,,透明色(16進数)(&T)";
ddepoke "part", "17";
ddepoke "newcontrol", "edit,TransCol,";
ddepoke "newcontrol", "check,Imm,すぐに書き換えしない(&I)";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "15";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Cast = dderequest("getstring Cast");
$Pic = dderequest("getstring Pic");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$W = dderequest("getstring W");
$H = dderequest("getstring H");
$CX = dderequest("getstring CX");
$CY = dderequest("getstring CY");
$TransCol = dderequest("getstring TransCol");
$Imm = dderequest("getstate Imm");
if($TransCol != "") $TransCol = ","+$TransCol;
$Cmd = "MoveCast(" +$Cast+ "," +$Pic+ "," +$X+ "," +$Y+ "," +$Imm+ "," +$W+ "," +$H+ "," +$CX+ "," +$CY+$TransCol+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
PutCast:
escape;
call MacSrvInit;
ddepoke "newdialog", "35,PutCast";
ddepoke "newcontrol", "text,,Cast番号(&C)";
ddepoke "part", "21";
ddepoke "newcontrol", "edit,Cast,";
ddepoke "newcontrol", "text,,表示先のピクチャー番号(&P)";
ddepoke "part", "21";
ddepoke "newcontrol", "edit,Pic,";
ddepoke "newcontrol", "text,,表示先";
ddepoke "part", "7";
ddepoke "newcontrol", "text,,X座標(&X)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,X,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,Y,";
ddepoke "newcontrol", "text,,透明色(16進数)(&T)";
ddepoke "part", "25";
ddepoke "newcontrol", "edit,TransCol,";
ddepoke "newcontrol", "text,,前後関係のレベル(背面=0)(&L)";
ddepoke "part", "25";
ddepoke "newcontrol", "edit,Level,0";
ddepoke "newcontrol", "check,Pos,同一レベルで最背面にする(&S)";
ddepoke "newcontrol", "check,Imm,すぐに書き換えしない(&I)";
ddepoke "newcontrol", "text,,サイズ";
ddepoke "part", "7";
ddepoke "newcontrol", "text,,幅(&W)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,W,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,高さ(&H)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,H,";
ddepoke "newcontrol", "text,,CastPic内のキャストの左上の座標";
ddepoke "newcontrol", "text,,";
ddepoke "part", "7";
ddepoke "newcontrol", "text,,X座標(&R)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,CX,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&D)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,CY,";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "15";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Cast = dderequest("getstring Cast");
$Pic = dderequest("getstring Pic");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$TransCol = dderequest("getstring TransCol");
$Level = dderequest("getstring Level");
$Pos = dderequest("getstate Pos");
$Imm = dderequest("getstate Imm");
$W = dderequest("getstring W");
$H = dderequest("getstring H");
$CX = dderequest("getstring CX");
$CY = dderequest("getstring CY");
if($TransCol == "") $TransCol = "0x80000000";
if($W == "" && $H == "" && $CX == "" && $CY == "")
$Cmd = "PutCast(" +$Cast+ "," +$Pic+ "," +$X+ "," +$Y+ "," +$TransCol+ "," +$Pos+ "," +$Level+ "," +$Imm+ ");";
else
$Cmd = "PutCast(" +$Cast+ "," +$Pic+ "," +$X+ "," +$Y+ "," +$TransCol+ "," +$Pos+ "," +$Level+ "," +$Imm+ "," +$W+ "," +$H+ "," +$CX+ "," +$CY+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
DelCast:
escape;
call MacSrvInit;
ddepoke "newdialog", "24,DelCast";
ddepoke "newcontrol", "text,,Cast番号(&C)";
ddepoke "part", "11";
ddepoke "newcontrol", "edit,Cast,";
ddepoke "newcontrol", "check,Imm,すぐに書き換えしない(&I)";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Cast = dderequest("getstring Cast");
$Imm = dderequest("getstate Imm");
$Cmd = "DelCast(" +$Cast+ "," +$Imm+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
ChaLCast:
escape;
call MacSrvInit;
ddepoke "newdialog", "32,ChaLCast";
ddepoke "newcontrol", "text,,Cast番号(&C)";
ddepoke "part", "11";
ddepoke "newcontrol", "edit,Cast,";
ddepoke "newcontrol", "radio,Pos,同一レベルでの指定(&S)";
ddepoke "item", "最全面";
ddepoke "item", "最背面";
ddepoke "item", "最最全面";
ddepoke "item", "最最背面";
ddepoke "newcontrol", "check,Imm,すぐに書き換えしない(&I)";
ddepoke "newcontrol", "text,,前後関係のレベル(背面=0)(&L)";
ddepoke "part", "25";
ddepoke "newcontrol", "edit,Level,0";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "12";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Cast = dderequest("getstring Cast");
$Pos = dderequest("getstate Pos");
$Imm = dderequest("getstate Imm");
$Level = dderequest("getstring Level");
#Pos = val($Pos);
#Pos = #Pos - 1;
$Pos = str(#Pos);
$Cmd = "ChaLCast(" +$Cast+ "," +$Pos+ "," +$Imm+ "," +$Level+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
HitCast:
escape;
call MacSrvInit;
ddepoke "newdialog", "20,HitCast";
ddepoke "newcontrol", "text,,ピクチャー番号(&P)";
ddepoke "part", "13";
ddepoke "newcontrol", "edit,Pic,";
ddepoke "newcontrol", "text,,調べる位置";
ddepoke "newcontrol", "text,,";
ddepoke "part", "5";
ddepoke "newcontrol", "text,,X座標(&X)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,X,";
ddepoke "newcontrol", "text,,";
ddepoke "part", "5";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,Y,";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Pic = dderequest("getstring Pic");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$Cmd = "HitCast(" +$Pic+ "," +$X+ "," +$Y+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
RepaintCast:
escape;
call MacSrvInit;
ddepoke "newdialog", "33,RepaintCast";
ddepoke "newcontrol", "text,,ピクチャー番号(&P)";
ddepoke "part", "13";
ddepoke "newcontrol", "edit,Pic,";
ddepoke "newcontrol", "text,,左上";
ddepoke "part", "5";
ddepoke "newcontrol", "text,,X座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,X,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,Y,";
ddepoke "newcontrol", "text,,右下";
ddepoke "part", "5";
ddepoke "newcontrol", "text,,X座標(&R)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,R,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&D)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,D,";
ddepoke "newcontrol", "text,,";
ddepoke "part", "13";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0")goto macro_end;
$Pic = dderequest("getstring Pic");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$R = dderequest("getstring R");
$D = dderequest("getstring D");
$Cmd = "RepaintCast(" +$Pic+ "," +$X+ "," +$Y+ "," +$R+ "," +$D+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
//関数の挿入
InsFunc:
//第1引数 str 関数名
//第2引数 str 関数の引数のタイプ
// (0=なし、1=数値型、2=文字列型、3=配列変数)
if(##2 == 0){
escape;
insert $$1 + "();";
return;
}
#Select = selecting;
$SText = "";
if(#Select == 1){
#STopX = seltopx;
#STopY = seltopy;
#SEndX = selendx;
#SEndY = selendy;
$SText = gettext(#STopX,#STopY,#SEndX,#SEndY);
#SLength = strlen($SText);
moveto #STopX,#STopY;
beginsel;
right #SLength;
delete;
}
if(##2 == 1){
insertfix $$1 + "(" + $SText + ");";
if($SText == ""){
gowordend;
right;
}
}
else if(##2 == 2){
insertfix $$1 + "(\"" + $SText + "\");";
if($SText == ""){
gowordend;
right 2;
}
}
else if(##2 == 3){
if(rightstr($SText,2) != "[]") $SText = $SText + "[]";
insertfix $$1 + "(\"" + $SText + "\");";
if($SText == ""){
gowordend;
right;
}
}
return;
//ダイアログボックス関連サブルーチン
MacSrvInit:
run "macserv.exe /h";
ddeinitiate "HideMacroServer", "DlgService";
if( !result ) {
message "ddeinitiate failed";
endmacro;
}
ddeexecute "setcurdir " + directory;
return;
MakeDialog:
#hwnd = hidemaruhandle(0);
ddeexecute "dialog " + str(#hwnd);
$$a = "";
ddestartadvice "dlgresult", $$a;
while( strlen($$a) == 0 ) {
ddewaitadvice $$a, 100;
}
ddestopadvice "dlgresult";
ddeexecute "enddialog";
return $$a;