2#include "markdown/imgui_markdown.h"
4#include "ShowLicensesCommand.h"
5#include "Bridge/Bridge.h"
6#include "Commands/EditorCommand.h"
7#include "Foundation/Logging/Logger.h"
14Cogs::Core::ShowLicensesCommand::ShowLicensesCommand(EditorState* state) : ModalEditorCommand(state)
16 licensesText = ::getLicenseText(context);
18 LOG_ERROR(logger,
"Cannot open the License.md file from Resources.");
31 ImGui::SetNextWindowSizeConstraints(ImVec2(300, 200), ImVec2(FLT_MAX, FLT_MAX));
32 ImGui::OpenPopup(
"Show Licenses");
34 if (ImGui::BeginPopupModal(
"Show Licenses", &modal, ImGuiWindowFlags_None)) {
36 ImGui::BeginChild(
"Markdown", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y - 30),
false, ImGuiWindowFlags_None);
37 ImGui::Markdown(licensesText, std::strlen(licensesText), config);
43 if (ImGui::Button(
"OK", ImVec2(120, 20))) {
45 ImGui::CloseCurrentPopup();
Log implementation class.
constexpr Log getLogger(const char(&name)[LEN]) noexcept
void beginModal() override
Called when the command is initiated.
void showGui() override
Display custom ImGUI.
bool continueModal() override
Shall return true while the GUI should still be shown. False when.