|
8 | 8 |
|
9 | 9 | std::string editor_text = "Bread Developer Suite"; |
10 | 10 |
|
| 11 | +bool open_about; |
| 12 | +bool open_credits; |
| 13 | +bool open_load; |
| 14 | +bool open_save; |
| 15 | + |
11 | 16 | static int string_resize(ImGuiInputTextCallbackData* data) { |
12 | 17 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) { |
13 | 18 | std::string* str = (std::string*)data->UserData; |
@@ -51,7 +56,46 @@ int main() { |
51 | 56 | ImGui::DockSpaceOverViewport(0, ImGui::GetMainViewport()); |
52 | 57 | ImGui::SetNextWindowPos(ImGui::GetMainViewport()->WorkPos); |
53 | 58 | ImGui::SetNextWindowSize(ImGui::GetMainViewport()->WorkSize); |
54 | | - ImGui::Begin("Bread Developer Suite"); |
| 59 | + ImGui::Begin("Bread Developer Suite", NULL, ImGuiWindowFlags_MenuBar); |
| 60 | + if (ImGui::BeginMenuBar()) { |
| 61 | + if (ImGui::BeginMenu("About")) { |
| 62 | + if (ImGui::MenuItem("About")) { |
| 63 | + open_about = true; |
| 64 | + } |
| 65 | + if (ImGui::MenuItem("Credits")) { |
| 66 | + open_credits = true; |
| 67 | + } |
| 68 | + if (ImGui::MenuItem("Exit")) { |
| 69 | + break; |
| 70 | + } |
| 71 | + ImGui::EndMenu(); |
| 72 | + } |
| 73 | + if (ImGui::BeginMenu("File")) { |
| 74 | + if (ImGui::MenuItem("Load")) { |
| 75 | + open_load = true; |
| 76 | + } |
| 77 | + if (ImGui::MenuItem("Save")) { |
| 78 | + open_save = true; |
| 79 | + } |
| 80 | + ImGui::EndMenu(); |
| 81 | + } |
| 82 | + ImGui::EndMenuBar(); |
| 83 | + } |
| 84 | + if (open_about == true) { |
| 85 | + ImGui::OpenPopup("about_popup"); |
| 86 | + open_about = false; |
| 87 | + } |
| 88 | + if (ImGui::BeginPopupModal("about_popup", NULL, ImGuiWindowFlags_AlwaysAutoResize)) { |
| 89 | + ImGui::Text("Bread Developer Suite"); |
| 90 | + ImGui::Text("Part of the bread compiler"); |
| 91 | + ImGui::Text("Licensed under the MIT License, see license for more information"); |
| 92 | + ImGui::Text("The developer suite was made possible with external libraries, see credits for more info"); |
| 93 | + ImGui::Text("By angrypig555"); |
| 94 | + if (ImGui::Button("Close")) { |
| 95 | + ImGui::CloseCurrentPopup(); |
| 96 | + } |
| 97 | + ImGui::EndPopup(); |
| 98 | + } |
55 | 99 | ImGui::Text("Welcome to the Bread Developer Suite"); |
56 | 100 | if (compiler == 2) { |
57 | 101 | ImGui::Text("Using compiler clang"); |
|
0 commit comments