mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-03 01:30:16 +01:00
refactor(editor): the structure gauge is a tool of its own
The first step of taking the tools out of editor_mode: a tool keeps its own state and reaches the editor through editor_services, the few things it needs from it, instead of through every member of the editor. The editor holds its tools in a list for the hooks they share: a deleted node is forgotten by all of them in one place, and a self-test command the editor doesn't know goes to each of them. The gauge moves with its state, its window and its self-test command; the ImGui ids and the texts stay the same, and the self-test gives the same hits on the test scenery as before.
This commit is contained in:
@@ -52,6 +52,21 @@ TTrack *editor_mode::selected_track() const
|
||||
return dynamic_cast<TTrack *>(m_node);
|
||||
}
|
||||
|
||||
bool editor_mode::track_editing() const
|
||||
{
|
||||
return m_track_gizmo_using || m_dragging;
|
||||
}
|
||||
|
||||
std::size_t editor_mode::history_size() const
|
||||
{
|
||||
return m_history.size();
|
||||
}
|
||||
|
||||
glm::dvec3 editor_mode::camera_position() const
|
||||
{
|
||||
return Camera.Pos;
|
||||
}
|
||||
|
||||
void editor_mode::select_track(scene::basic_node *Node)
|
||||
{
|
||||
auto *track = dynamic_cast<TTrack *>(Node);
|
||||
|
||||
Reference in New Issue
Block a user