Commit 75d0a0b 1 parent 8562c0e commit 75d0a0b Copy full SHA for 75d0a0b
File tree 5 files changed +42
-1
lines changed
5 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 33
33
chart_basic_setting :
34
34
title : Chart Basic Setting
35
35
offset : Offset (ms)
36
+ line_list :
37
+ title : Line List
Original file line number Diff line number Diff line change 33
33
chart_basic_setting :
34
34
title : 谱面基本设置
35
35
offset : 延迟 (毫秒)
36
+ line_list :
37
+ title : 判定线列表
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ impl UiState {
156
156
EditorTab :: TimelineSetting ,
157
157
EditorTab :: AudioSetting ,
158
158
EditorTab :: ChartBasicSetting ,
159
+ EditorTab :: LineList ,
159
160
] ,
160
161
) ;
161
162
Original file line number Diff line number Diff line change
1
+ use crate :: chart:: event:: LineEvent ;
2
+ use crate :: chart:: line:: Line ;
3
+ use crate :: chart:: note:: Note ;
4
+ use bevy:: prelude:: * ;
5
+ use egui:: Ui ;
6
+
7
+ // use crate::translation::Translator;
8
+
9
+ pub fn line_list_tab (
10
+ In ( ui) : In < & mut Ui > ,
11
+ line_query : Query < & Children , With < Line > > ,
12
+ note_query : Query < & Note > ,
13
+ event_query : Query < & LineEvent > ,
14
+ // translator: Translator,
15
+ ) {
16
+ for ( index, line) in line_query. iter ( ) . enumerate ( ) {
17
+ let notes = line
18
+ . iter ( )
19
+ . filter ( |child| note_query. get ( * * child) . is_ok ( ) )
20
+ . collect :: < Vec < _ > > ( )
21
+ . len ( ) ;
22
+ let events = line
23
+ . iter ( )
24
+ . filter ( |child| event_query. get ( * * child) . is_ok ( ) )
25
+ . collect :: < Vec < _ > > ( )
26
+ . len ( ) ;
27
+ ui. label ( format ! (
28
+ "Line #{}: {} notes, {} events" ,
29
+ index, notes, events
30
+ ) ) ;
31
+ }
32
+ }
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ pub mod audio_setting;
2
2
pub mod chart_basic_setting;
3
3
pub mod game;
4
4
pub mod inspector;
5
+ pub mod line_list;
5
6
pub mod timeline;
6
7
pub mod timeline_setting;
7
8
8
9
use crate :: tab:: audio_setting:: audio_setting_tab;
9
10
use crate :: tab:: chart_basic_setting:: chart_basic_setting_tab;
10
11
use crate :: tab:: inspector:: inspector_ui_system;
12
+ use crate :: tab:: line_list:: line_list_tab;
11
13
use crate :: tab:: timeline:: timeline_ui_system;
12
14
use crate :: tab:: timeline_setting:: timeline_setting_tab;
13
15
use bevy:: { prelude:: * , utils:: HashMap } ;
@@ -53,6 +55,7 @@ pub enum EditorTab {
53
55
TimelineSetting ,
54
56
AudioSetting ,
55
57
ChartBasicSetting ,
58
+ LineList ,
56
59
}
57
60
58
61
pub struct TabPlugin ;
@@ -85,7 +88,8 @@ impl Plugin for TabPlugin {
85
88
EditorTab :: ChartBasicSetting ,
86
89
"tab.chart_basic_setting.title" ,
87
90
chart_basic_setting_tab,
88
- ) ;
91
+ )
92
+ . register_tab ( EditorTab :: LineList , "tab.line_list.title" , line_list_tab) ;
89
93
}
90
94
}
91
95
You can’t perform that action at this time.
0 commit comments