diff --git a/neothesia-core/src/render/keyboard/key_state.rs b/neothesia-core/src/render/keyboard/key_state.rs index 1dcc284d..7fb695cb 100644 --- a/neothesia-core/src/render/keyboard/key_state.rs +++ b/neothesia-core/src/render/keyboard/key_state.rs @@ -9,7 +9,7 @@ use wgpu_jumpstart::Color; pub struct KeyState { is_sharp: bool, - pub pressed_by_file: Option, + pressed_by_file: Option, pressed_by_user: bool, } @@ -23,6 +23,10 @@ impl KeyState { } } + pub fn pressed_by_file(&self) -> Option<&Color> { + self.pressed_by_file.as_ref() + } + pub fn set_pressed_by_user(&mut self, is: bool) { self.pressed_by_user = is; } diff --git a/neothesia/src/scene/playing_scene/mod.rs b/neothesia/src/scene/playing_scene/mod.rs index d0e20071..c24a19fa 100644 --- a/neothesia/src/scene/playing_scene/mod.rs +++ b/neothesia/src/scene/playing_scene/mod.rs @@ -126,7 +126,7 @@ impl PlayingScene { let glow_h = 150.0 + glow_state.time.sin() * 10.0; let y = self.keyboard.pos().y; - if let Some(color) = &key_states[key.id()].pressed_by_file { + if let Some(color) = key_states[key.id()].pressed_by_file() { glow_state.time += 0.1; let mut color = color.into_linear_rgba(); let v = 0.2 * glow_state.time.cos().abs();