|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
#include "graphics/classicgraphicsmanager.h"
|
|
|
|
|
#include "graphics/classicnotegraphics.h"
|
|
|
|
|
|
|
|
|
|
EditorContext::EditorContext(const std::shared_ptr<SelectionManager<ClassicNote>>& selection_manager,
|
|
|
|
|
EditorContext::EditorContext(const std::shared_ptr<SelectionManager>& selection_manager,
|
|
|
|
|
std::vector<std::shared_ptr<ClassicGraphicsManager>>&& graphics_managers) :
|
|
|
|
|
_selection_manager(selection_manager),
|
|
|
|
|
_graphics_managers(std::move(graphics_managers))
|
|
|
|
@ -12,40 +12,26 @@ EditorContext::EditorContext(const std::shared_ptr<SelectionManager<ClassicNote>
|
|
|
|
|
|
|
|
|
|
void EditorContext::input(ClassicArrowNote *note, kku::GameEvent&& input) const
|
|
|
|
|
{
|
|
|
|
|
(void)note;
|
|
|
|
|
switch (input.event.type)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/*case kku::SystemEvent::Type::MousePress:
|
|
|
|
|
case kku::SystemEvent::Type::MousePress:
|
|
|
|
|
{
|
|
|
|
|
bool selection_changed = false;
|
|
|
|
|
std::size_t amount_selected = 0;
|
|
|
|
|
|
|
|
|
|
const auto position = std::get<kku::SystemEvent::Mouse>(input.event.data).position;
|
|
|
|
|
const auto clicked_position = std::get<kku::SystemEvent::Mouse>(input.event.data).position;
|
|
|
|
|
for (auto& element : note->getElements())
|
|
|
|
|
{
|
|
|
|
|
if (element.sprite->getRectangle()->contains(position))
|
|
|
|
|
if (element.sprite->getRectangle()->contains(clicked_position))
|
|
|
|
|
{
|
|
|
|
|
element.selected = !element.selected;
|
|
|
|
|
selection_changed = true;
|
|
|
|
|
if (element.selected)
|
|
|
|
|
++amount_selected;
|
|
|
|
|
if (_selection_manager->isSelected(note->getId(), element.id))
|
|
|
|
|
_selection_manager->remove(note->getId(), element.id);
|
|
|
|
|
else
|
|
|
|
|
_selection_manager->fetch(note->getId(), element.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selection_changed)
|
|
|
|
|
{
|
|
|
|
|
if (amount_selected > 0)
|
|
|
|
|
_selection_manager->fetch(note);
|
|
|
|
|
else
|
|
|
|
|
_selection_manager->remove(note);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -56,7 +42,8 @@ void EditorContext::update(ClassicArrowNote *note, const kku::microsec& music_of
|
|
|
|
|
|
|
|
|
|
switch (note->getState())
|
|
|
|
|
{
|
|
|
|
|
default: return;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ClassicArrowNote::State::INITIAL:
|
|
|
|
@ -89,7 +76,7 @@ void EditorContext::update(ClassicArrowNote *note, const kku::microsec& music_of
|
|
|
|
|
element.animations[note->getState()]->update(music_offset);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<SelectionManager<ClassicNote>> EditorContext::getSelectionManager() const
|
|
|
|
|
std::shared_ptr<SelectionManager> EditorContext::getSelectionManager() const
|
|
|
|
|
{
|
|
|
|
|
return _selection_manager;
|
|
|
|
|
}
|
|
|
|
|