Skip to content

Commit

Permalink
Various fixes and auto-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Jun 6, 2021
1 parent 923688d commit 220052d
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 3 deletions.
2 changes: 2 additions & 0 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ versions "GL_42" "GL_AllowDeprecated" "USE_SDL2" "USE_GL"
stringImportPaths "res/"
stringImportPaths "./"

preBuildCommands "dub run gitver -- --prefix INC --file source/creator/ver.d --mod creator.ver --appname Inochi Creator"

configuration "posix" {
targetType "executable"
}
Expand Down
5 changes: 5 additions & 0 deletions source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import std.stdio;
import std.string;
import creator.core;
import creator.core.settings;
import creator.frames;
import creator.windows;
import creator.core.actionstack;
Expand All @@ -22,6 +23,10 @@ int main(string[] args)
incOpenWindow();
incNewProject();

if (incSettingsGet!bool("ShowWarning", true)) {
incPushWindow(new NoticeWindow());
}

while(!incIsCloseRequested()) {

// Update Inochi2D
Expand Down
2 changes: 2 additions & 0 deletions source/creator/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import inochi2d;
import inochi2d.core.dbg;
import creator.core.actionstack;

public import creator.ver;

/**
A project
*/
Expand Down
9 changes: 9 additions & 0 deletions source/creator/ver.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// AUTOGENERATED BY GITVER, DO NOT MODIFY
module creator.ver;

/**
Inochi Version, autogenerated with gitver
*/
enum INC_VERSION = "commit+923688d";

// trans rights
13 changes: 10 additions & 3 deletions source/creator/windows/about.d
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module creator.windows.about;
import creator.windows;
import creator.core;
import creator;
import std.string;
import creator.utils.link;
import inochi2d;

class AboutWindow : Window {
protected:
Expand All @@ -28,10 +30,15 @@ protected:
igSameLine(0, 8);
igSeparatorEx(ImGuiSeparatorFlags_Vertical);
igSameLine(0, 8);
igBeginChildStr("##LogoTextArea", ImVec2(0, 0), false, 0);

igPushFont(incBiggerFont());
igText("Inochi Creator");
igPopFont();
igPushFont(incBiggerFont());
igText("Inochi Creator");
igPopFont();
igText("%s", (INC_VERSION~"\0").ptr);
igSeparator();
igTextColored(ImVec4(0.5, 0.5, 0.5, 1), "I2D v. %s", (IN_VERSION~"\0").ptr);
igEndChild();
igEndChild();
igBeginChildStr("##CreditsArea", ImVec2(512, 256), false, 0);

Expand Down
71 changes: 71 additions & 0 deletions source/creator/windows/notice.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
module creator.windows.notice;
import creator.windows;
import creator.core;
import std.string;
import creator.utils.link;

class NoticeWindow : Window {
private:
bool doNotShowAgain = false;

protected:
override
void onBeginUpdate(int id) {
flags |= ImGuiWindowFlags_NoResize;
super.onBeginUpdate(0);
}

override
void onUpdate() {

igBeginChildStr("##LogoArea", ImVec2(512, 72), false, 0);
igImage(
cast(void*)incGetLogo(),
ImVec2(64, 64),
ImVec2(0, 0),
ImVec2(1, 1),
ImVec4(1, 1, 1, 1),
ImVec4(0, 0, 0, 0)
);

igSameLine(0, 8);
igSeparatorEx(ImGuiSeparatorFlags_Vertical);
igSameLine(0, 8);

igPushFont(incBiggerFont());
igText("Inochi Creator");
igPopFont();
igEndChild();
igBeginChildStr("##CreditsArea", ImVec2(512, 232), false, 0);

igPushFont(incBiggerFont());
igTextColored(ImVec4(1, 0, 0, 1), "THIS IS BETA SOFTWARE!");
igPopFont();
igSpacing();
igText("Inochi2D and Inochi Creator is currently under heavy development
Using Inochi Creator in production is not advised, it *will* crash
out of nowhere and there's still plenty of bugs to fix.
The Inochi2D project is not to be held liable for broken
puppet files or crashes resulting from using this beta
software.
If you accept this press the \"Close\" button to continue");

igEndChild();

if (igCheckbox("Don't show again", &doNotShowAgain)) {
incSettingsSet("ShowWarning", !doNotShowAgain);
}

if (igButton("Close", ImVec2(0, 0))) {
this.close();
}

}

public:
this() {
super("Under Construction");
}
}
1 change: 1 addition & 0 deletions source/creator/windows/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import std.conv;
public import creator.windows.about;
public import creator.windows.settings;
public import creator.windows.texviewer;
public import creator.windows.notice;

/**
A Widget
Expand Down

0 comments on commit 220052d

Please sign in to comment.