-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbmx2wav_searcher.nut
63 lines (53 loc) · 2 KB
/
bmx2wav_searcher.nut
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
51
52
53
54
55
56
57
58
59
60
61
62
63
// ----- ColumnGroup 関連 ------------------------------------------------
{
local group = ColumnGroup( "フォルダ分け用" );
group.columns.append( HeaderColumn( "TITLE", HeaderColumn.compare_as_string ) );
group.columns.append( HeaderColumn( "ARTIST", HeaderColumn.compare_as_string ) );
group.columns.append( ParentDirectoryColumn() );
group.columns.append( ParentsParentDirectoryColumn() );
Searcher.column_groups.append( group );
}
// ----- SearchMethod 関連 -----------------------------------------------
// -- LeastPlaylevelSearchMethod (more than zero, exclude only one chart )
class LeastPlaylevelSearchMethod extends SearchMethod {
constructor() {
base.constructor( "フォルダ毎最低LEVEL(>0)のみ" );
}
function search( entry ) {
return this.filter.filtering( entry );
}
function by_each_directory( directory_entry, entry_array ) {
if ( entry_array.len() > 0 ) {
Searcher.add_directory_entry_to_list( directory_entry );
}
local key = "PLAYLEVEL";
local current = null;
foreach ( entry in entry_array ) {
entry.parse_as_bms_data_once();
if ( key in entry.bms_data.headers ) {
try {
if ( current == null ) {
current = entry;
}
else if ( current.bms_data.headers[key].tointeger() <= 0 ){
current.search_hit = false;
current = entry;
}
else if ( current.bms_data.headers[key].tointeger() < entry.bms_data.headers[key].tointeger() || entry.bms_data.headers[key].tointeger() <= 0 ) {
entry.search_hit = false;
}
else {
current.search_hit = false;
current = entry;
}
}
catch ( e ) {
// continue;
}
}
}
}
filter = ExtensionsFilter( StrT.Searcher.Main.Toolbar.SearchMethodFilterBmsGeneral.get(), "bms", "bme", "bml", "pms" );
}
// -- 登録
Searcher.search_methods.append( LeastPlaylevelSearchMethod() );