/******************************************************************************
*	File		-	about.cpp
*	Author		-	Joey Pollack
*	Date		-	2021/11/03 (y/m/d)
*	Mod Date	-	2021/11/03 (y/m/d)
*	Description	-	The About panel
******************************************************************************/

#include "about.h"
#include <dearimgui/imgui.h>
#include <core/version.h>
#include <editor/editor.h>

namespace lunarium
{
namespace editor
{
    AboutPanel::AboutPanel()
        : Panel("About", gui::PanelDockZone::DDZ_NONE)
    {

    }

    bool AboutPanel::DoFrame()
    {
        if (!mIsOpen)
            return false;

        ImGui::SetNextWindowSize(ImVec2(300, ImGui::GetFrameHeight() * 20));
        if (!ImGui::Begin(GetName(), &mIsOpen, ImGuiWindowFlags_NoCollapse ))
        {
            ImGui::End();
            return false;
        }

        ImGui::TextWrapped("Lunarium Editor Version %s - Written by Joey Pollack", Version::GetVersion().ToString().c_str());

        ImGui::End();
        return true;
    }
}
}