|
|
|
|
@ -20,13 +20,13 @@ namespace lunarium
|
|
|
|
|
: Panel(PT_MAIN, true), mpEditor(nullptr), mSetFocus(false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Core::MainWindow().GetFramebufferSize(&mStartWidth, &mStartHeight);
|
|
|
|
|
Core::MainWindow().GetPosition(&mStartX, &mStartY);
|
|
|
|
|
Core::MainWindow().GetFramebufferSize(&mWidth, &mHeight);
|
|
|
|
|
Core::MainWindow().GetPosition(&mX, &mY);
|
|
|
|
|
|
|
|
|
|
// Make the application window small so that the imgui window will start outside of
|
|
|
|
|
// it's bounds and be detached from it. This prevents the window from disappearing
|
|
|
|
|
// and/or losing focus when the application window disappears.
|
|
|
|
|
Core::MainWindow().ChangeDisplayMode(false, mStartX + 10, mStartY + 10, 10, 10);
|
|
|
|
|
// Core::MainWindow().ChangeDisplayMode(false, mX + 10, mY + 10, 10, 10);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -62,20 +62,7 @@ namespace lunarium
|
|
|
|
|
if (!mIsOpen)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (mSetFocus)
|
|
|
|
|
{
|
|
|
|
|
ImGui::SetNextWindowFocus();
|
|
|
|
|
mSetFocus = false;
|
|
|
|
|
}
|
|
|
|
|
ImGui::SetNextWindowSize(ImVec2(mStartWidth, mStartHeight), ImGuiCond_Appearing);
|
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(mStartX, mStartY), ImGuiCond_Appearing);
|
|
|
|
|
if (!ImGui::Begin("Lunarium Editor", &mIsOpen, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking))
|
|
|
|
|
{
|
|
|
|
|
ImGui::End();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGui::BeginMenuBar();
|
|
|
|
|
ImGui::BeginMainMenuBar();
|
|
|
|
|
|
|
|
|
|
// File
|
|
|
|
|
if (ImGui::BeginMenu("File"))
|
|
|
|
|
@ -92,7 +79,27 @@ namespace lunarium
|
|
|
|
|
ImGui::EndMenu();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGui::EndMenuBar();
|
|
|
|
|
ImGui::EndMainMenuBar();
|
|
|
|
|
|
|
|
|
|
if (mSetFocus)
|
|
|
|
|
{
|
|
|
|
|
ImGui::SetNextWindowFocus();
|
|
|
|
|
mSetFocus = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Core::MainWindow().GetFramebufferSize(&mWidth, &mHeight);
|
|
|
|
|
Core::MainWindow().GetPosition(&mX, &mY);
|
|
|
|
|
|
|
|
|
|
ImGui::SetNextWindowSize(ImVec2(mWidth, mHeight - ImGui::GetFrameHeight()), ImGuiCond_Always);
|
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(mX, mY + ImGui::GetFrameHeight()), ImGuiCond_Always);
|
|
|
|
|
if (!ImGui::Begin("Lunarium Editor", &mIsOpen, ImGuiWindowFlags_NoCollapse
|
|
|
|
|
| ImGuiWindowFlags_NoMove
|
|
|
|
|
| ImGuiWindowFlags_NoTitleBar ))
|
|
|
|
|
{
|
|
|
|
|
ImGui::End();
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NOTE: Must always update these values!
|
|
|
|
|
Panel::UpdateMetaInfo();
|
|
|
|
|
|