|
|
@ -156,7 +156,10 @@ void EditorState::enter()
|
|
|
|
|
|
|
|
|
|
|
|
callbacks.onInput = [&editor, &music](const sf::Event& event)
|
|
|
|
callbacks.onInput = [&editor, &music](const sf::Event& event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
editor->input(PlayerInput{music.fetchOffset(), event});
|
|
|
|
if (event.type == sf::Event::MouseWheelScrolled)
|
|
|
|
|
|
|
|
music.moveOffset(event.mouseWheelScroll.delta > 0 ? 500000 : -500000);
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
editor->input(PlayerInput{music.fetchOffset(), event});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
callbacks.onUpdate = [&editor, &music](const sf::Time& dt)
|
|
|
|
callbacks.onUpdate = [&editor, &music](const sf::Time& dt)
|
|
|
@ -167,9 +170,9 @@ void EditorState::enter()
|
|
|
|
auto editor_widget = std::make_shared<EditorWidget>(std::move(callbacks));
|
|
|
|
auto editor_widget = std::make_shared<EditorWidget>(std::move(callbacks));
|
|
|
|
|
|
|
|
|
|
|
|
_group = std::make_shared<Group>();
|
|
|
|
_group = std::make_shared<Group>();
|
|
|
|
|
|
|
|
_group->addChild(editor_widget);
|
|
|
|
_group->addChild(menu_bar);
|
|
|
|
_group->addChild(menu_bar);
|
|
|
|
_group->addChild(bpm_widget);
|
|
|
|
_group->addChild(bpm_widget);
|
|
|
|
_group->addChild(editor_widget);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void EditorState::leave()
|
|
|
|
void EditorState::leave()
|
|
|
@ -177,4 +180,3 @@ void EditorState::leave()
|
|
|
|
_group.reset();
|
|
|
|
_group.reset();
|
|
|
|
_bpm_calculator.reset();
|
|
|
|
_bpm_calculator.reset();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|