| 1 | /* |
| 2 | # 076 License |
| 3 | |
| 4 | Copyright (c) 076 Studio LLC |
| 5 | |
| 6 | Permission is hereby granted to any person obtaining a copy of the software |
| 7 | Shader Playground (the "Software") to use, modify, merge, copy, publish, distribute, |
| 8 | sublicense, and/or sell copies of the Software, subject to the following conditions: |
| 9 | |
| 10 | 1. **Origin Attribution**: |
| 11 | - You must not misrepresent the origin of the Software; you must not claim |
| 12 | you created the original Software. |
| 13 | - If the Software is used in a product, you must either: |
| 14 | a. Provide clear attribution in the product's documentation, user interface, |
| 15 | or other visible areas, **OR** |
| 16 | b. Pay the original developers a fee they specify in writing. |
| 17 | 2. **Usage Restriction**: |
| 18 | - The Software, or any derivative works, dependencies, or libraries |
| 19 | incorporating it, must not be used for censorship or to suppress freedom of |
| 20 | speech, expression, or creativity. Prohibited uses include, but are not |
| 21 | limited to: |
| 22 | - Censorship of so-called "hate speech", visuals, non-mainstream opinions, |
| 23 | ideas, or objective reality. |
| 24 | - Tools or systems designed to restrict access to information or |
| 25 | artistic works. |
| 26 | 3. **Notice Preservation**: |
| 27 | - This license and the above copyright notice must remain intact in all copies |
| 28 | of the source code. |
| 29 | |
| 30 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
| 31 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A |
| 32 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
| 33 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| 34 | CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE |
| 35 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 36 | */ |
| 37 | #include <gui/about.hh> |
| 38 | #include <imgui.h> |
| 39 | #include <database/locale.hh> |
| 40 | #include <gui/guiengine.hh> |
| 41 | |
| 42 | namespace gui { |
| 43 | void About::Draw(Info &info) { |
| 44 | if (!info.isAbout) return; |
| 45 | |
| 46 | ImGuiWindowFlags flags = 0; |
| 47 | ImGui::SetNextWindowSize({400, 300}, ImGuiCond_Appearing); |
| 48 | ImGui::Begin(info.i18n->GetWord("helpabout").c_str(), &info.isAbout, flags); |
| 49 | if (GuiEngine::ShouldCloseWindowOnEscape()) info.isAbout = false; |
| 50 | string name = "Shader Playground " + info.version; |
| 51 | string copyright; |
| 52 | string developer; |
| 53 | if (info.i18n->GetCurrentLanguage().code == "ja_JP") { |
| 54 | copyright = "© 2026 - 076スタジオ合同会社"; |
| 55 | developer = "開発者:テクニカル諏訪子"; |
| 56 | } else { |
| 57 | copyright = "© 2026 - 076 Studio LLC"; |
| 58 | developer = "Developer: TechnicalSuwako"; |
| 59 | } |
| 60 | |
| 61 | ImGui::SetWindowFontScale(1.8f); |
| 62 | ImGui::Text(name.c_str()); |
| 63 | ImGui::SetWindowFontScale(1.2f); |
| 64 | ImGui::Separator(); |
| 65 | ImGui::Text(copyright.c_str()); |
| 66 | ImGui::Text(developer.c_str()); |
| 67 | |
| 68 | f32 btnW = 80.f; |
| 69 | f32 btnH = 0.f; |
| 70 | |
| 71 | ImVec2 winSize = ImGui::GetWindowSize(); |
| 72 | ImVec2 cursorPos = ImGui::GetCursorPos(); |
| 73 | |
| 74 | ImGui::SetCursorPos({ |
| 75 | (winSize.x - btnW) * .5f, |
| 76 | winSize.y - 40.f |
| 77 | }); |
| 78 | |
| 79 | if (ImGui::Button("OK", { btnW, btnH })) info.isAbout = false; |
| 80 | ImGui::End(); |
| 81 | } |
| 82 | } // namespace gui |