1 /* 2 Copyright © 2020, Inochi2D Project 3 Distributed under the 2-Clause BSD License, see LICENSE file. 4 5 Authors: Luna Nielsen 6 */ 7 module creator.windows.notice; 8 import creator.windows; 9 import creator.core; 10 import std.string; 11 import creator.utils.link; 12 import i18n; 13 14 class NoticeWindow : Window { 15 private: 16 bool doNotShowAgain = false; 17 18 protected: 19 override 20 void onBeginUpdate() { 21 flags |= ImGuiWindowFlags.NoResize; 22 igSetNextWindowSize(ImVec2(512, 384), ImGuiCond.Appearing); 23 igSetNextWindowSizeConstraints(ImVec2(512, 384), ImVec2(float.max, float.max)); 24 super.onBeginUpdate(); 25 } 26 27 override 28 void onUpdate() { 29 30 igBeginChild("##LogoArea", ImVec2(0, 72)); 31 32 version (InBranding) { 33 igImage( 34 cast(void*)incGetLogo(), 35 ImVec2(64, 64), 36 ImVec2(0, 0), 37 ImVec2(1, 1), 38 ImVec4(1, 1, 1, 1), 39 ImVec4(0, 0, 0, 0) 40 ); 41 } 42 43 igSameLine(0, 8); 44 igSeparatorEx(ImGuiSeparatorFlags.Vertical); 45 igSameLine(0, 8); 46 47 igPushFont(incBiggerFont()); 48 igText("Inochi Creator"); 49 igPopFont(); 50 igEndChild(); 51 igBeginChild("##CreditsArea", ImVec2(0, -48)); 52 53 igPushFont(incBiggerFont()); 54 igTextColored(ImVec4(1, 0, 0, 1), _("THIS IS BETA SOFTWARE!").toStringz); 55 igPopFont(); 56 igSpacing(); 57 igText(__("Inochi2D and Inochi Creator is currently under heavy development\nUsing Inochi Creator in production is not advised, it *will* crash\nout of nowhere and there's still plenty of bugs to fix.\n\nThe Inochi2D project is not to be held liable for broken\npuppet files or crashes resulting from using this beta \nsoftware.\n\nIf you accept this press the \"Close\" button to continue")); 58 59 igEndChild(); 60 61 if (igCheckbox(__("Don't show again"), &doNotShowAgain)) { 62 incSettingsSet("ShowWarning", !doNotShowAgain); 63 } 64 65 if (igButton(__("Close"), ImVec2(0, 0))) { 66 this.close(); 67 } 68 69 } 70 71 public: 72 this() { 73 super(_("Under Construction")); 74 } 75 }