Skip to content

Commit aded9b5

Browse files
committed
can hide pos and bar indicators, for screenshots
1 parent e7774fa commit aded9b5

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

crates/notation_bevy/src/notation/control.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl Control {
9696
state: &mut NotationState,
9797
settings: &mut NotationSettings,
9898
theme: &mut NotationTheme,
99-
window_resized_evts: &mut EventWriter<WindowResizedEvent>,
99+
_window_resized_evts: &mut EventWriter<WindowResizedEvent>,
100100
preset: &'static str,
101101
) {
102102
match preset {
@@ -105,7 +105,8 @@ impl Control {
105105
settings.hide_shapes_lane = true;
106106
theme.sizes.strings.string_space = 20.0;
107107
theme.sizes.strings.note_height = 9.0;
108-
window_resized_evts.send(WindowResizedEvent::new(&state));
108+
theme.texts.strings.text_y = 6.0;
109+
Self::reload_tab(state, theme);
109110
},
110111
_ => {},
111112
}

crates/notation_bevy/src/notation/control_panel.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ impl ControlPanel {
217217
if hide_bar_number != settings.hide_bar_number {
218218
Control::reload_tab(state, theme);
219219
}
220+
let hide_indicators = settings.hide_indicators;
221+
ui.checkbox(&mut settings.hide_indicators, "Hide Indicators");
222+
if hide_indicators != settings.hide_indicators {
223+
Control::reload_tab(state, theme);
224+
}
220225
let always_show_fret = settings.always_show_fret;
221226
ui.checkbox(&mut settings.always_show_fret, "Always Show Fret");
222227
if always_show_fret != settings.always_show_fret {

crates/notation_bevy/src/play/play_plugin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ fn update_indicators(
8181
bar_playing: &BarPlaying,
8282
bar_layout: LayoutData,
8383
) {
84+
if settings.hide_indicators {
85+
return;
86+
}
8487
let bar_props = bar_playing.bar_props;
8588
let mut in_bar_pos = None;
8689
for (entity, mut data) in pos_indicator_query.iter_mut() {

crates/notation_bevy/src/settings/notation_settings.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub struct NotationSettings {
1313
pub should_loop: bool,
1414
pub speed_factor: f32,
1515
pub hide_bar_number: bool,
16+
pub hide_indicators: bool,
1617
pub show_guitar_syllable: bool,
1718
pub show_melody_syllable: bool,
1819
pub show_syllable_as_pitch: bool,
@@ -42,6 +43,7 @@ impl Default for NotationSettings {
4243
should_loop: false,
4344
speed_factor: 1.0,
4445
hide_bar_number: false,
46+
hide_indicators: false,
4547
show_guitar_syllable: true,
4648
show_melody_syllable: true,
4749
show_syllable_as_pitch: false,

0 commit comments

Comments
 (0)