Make cutscene editor dock properly
This commit is contained in:
parent
71fe041691
commit
4ce486b0bc
1 changed files with 8 additions and 4 deletions
|
@ -30,20 +30,22 @@ void app_main(prism::engine* engine) {
|
|||
|
||||
CutsceneEditor::CutsceneEditor() : CommonEditor("CutsceneEditor") {}
|
||||
|
||||
static bool has_been_docked = false;
|
||||
|
||||
void CutsceneEditor::drawUI() {
|
||||
createDockArea();
|
||||
|
||||
|
||||
const ImGuiID editor_dockspace = ImGui::GetID("dockspace");
|
||||
|
||||
ImGui::End();
|
||||
|
||||
if(ImGui::DockBuilderGetNode(editor_dockspace) == nullptr) {
|
||||
|
||||
if(!has_been_docked) {
|
||||
const auto size = ImGui::GetMainViewport()->Size;
|
||||
|
||||
ImGui::DockBuilderRemoveNode(editor_dockspace);
|
||||
ImGui::DockBuilderAddNode(editor_dockspace, ImGuiDockNodeFlags_DockSpace);
|
||||
ImGui::DockBuilderSetNodeSize(editor_dockspace, size);
|
||||
|
||||
|
||||
ImGuiID outline_parent, view;
|
||||
ImGui::DockBuilderSplitNode(editor_dockspace, ImGuiDir_Left, 0.2f, &outline_parent, &view);
|
||||
|
||||
|
@ -67,6 +69,8 @@ void CutsceneEditor::drawUI() {
|
|||
ImGui::DockBuilderDockWindow("Animation Editor", lowerbar);
|
||||
|
||||
ImGui::DockBuilderFinish(editor_dockspace);
|
||||
|
||||
has_been_docked =true;
|
||||
}
|
||||
|
||||
if (ImGui::BeginMainMenuBar())
|
||||
|
|
Reference in a new issue