-
Notifications
You must be signed in to change notification settings - Fork 0
/
unity_menu.mac
50 lines (42 loc) · 1.19 KB
/
unity_menu.mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* unity呼び出しメニュー(全部入り版)
全ソースをメニュー表示します。
*/
debuginfo 1;
call main;
endmacro;
main:
call LoadSources;
setmenudelay 500;
menuarray $g_source_menu,#g_source_names_num;
if(result==0){
return false;
}
##index=result-1;
$sources=$g_source_names[##index];
execmacro currentmacrodirectory+"\\internal\\main.mac",currentmacrodirectory,$sources;
return getresultex(-1);
LoadSources:
$$dir=currentmacrodirectory+"\\sources";
##objFSO = createobject("Scripting.FileSystemObject");
##objFolder = callmethod_returnobj(##objFSO,"GetFolder",$$dir);
##objFiles = getpropobj(##objFolder,"Files");
while(1){
##objFile = getcollection(##objFiles);
if(##objFile==0){
break;
}
$$name=getpropstr(##objFile,"Name");
$$basename=member( ##objFSO, "GetBaseName", $$name );
$$ext=tolower(member( ##objFSO, "GetExtensionName", $$name ));
releaseobject ##objFile;
if($$ext!="mac"){
continue;
}
$g_source_menu[#g_source_names_num]=$$basename;
$g_source_names[#g_source_names_num]=$$basename;
#g_source_names_num = #g_source_names_num + 1;
}
releaseobject ##objFiles;
releaseobject ##objFolder;
releaseobject ##objFSO;
return ;