Cogs.Core
AboutCommand.cpp
1#include "imgui.h"
2
3#include "AboutCommand.h"
4#include "Commands/EditorCommand.h"
5#include "CogsVersion.h"
6
7Cogs::Core::AboutCommand::AboutCommand(EditorState* state) : ModalEditorCommand(state)
8{
9}
10
12{
13 modal = true;
14}
15
17{
18 assert(modal);
19
20 //ImGui::SetNextWindowSizeConstraints(ImVec2(120, 120), ImVec2(FLT_MAX, FLT_MAX));
21 ImGui::OpenPopup("About Cogs.Core.Runtime");
22 // Passing modal as p_open parameter would convenietly perform modal = false if window was closed on X button.
23 if (ImGui::BeginPopupModal("About Cogs.Core.Runtime", &modal, ImGuiWindowFlags_AlwaysAutoResize)) {
24 ImGui::TextUnformatted("Cogs.Core.Runtime");
25 ImGui::Text("Build %s", COGS_VERSION_STRING);
26 ImGui::TextUnformatted(COGS_REVISION_STRING);
27 ImGui::Text("Build Date/Time: %s, %s", __DATE__, __TIME__);
28 ImGui::Text(COGS_LEGAL_COPYRIGHT);
29
30 ImGui::Separator();
31
32 if (ImGui::Button("OK", ImVec2(120, 20))) {
33 modal = false;
34 ImGui::CloseCurrentPopup();
35 }
36
37 ImGui::EndPopup();
38 }
39
40}
41
43{
44 return modal;
45}
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.