Skip to content

Commit

Permalink
Add support for 0.8.7 features
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed Oct 2, 2024
1 parent ed472e7 commit 7d94731
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 21 deletions.
2 changes: 1 addition & 1 deletion dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependency "bindbc-sdl" version="~>1.1.2"
dependency "dcv:core" version="~>0.3.0"
dependency "i18n-d" version="~>1.0.2"
dependency "i2d-imgui" version="~>0.8.0"
dependency "inochi2d" version="~>0.8.6"
dependency "inochi2d" version="~>0.8.7"
dependency "mir-linux-kernel" version="~>1.0.1"
targetPath "out/"
workingDirectory "out/"
Expand Down
2 changes: 1 addition & 1 deletion source/creator/atlas/atlas.d
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void incInitAtlassing() {
glGenVertexArrays(1, &writeVAO);
glGenBuffers(1, &writeVBO);

atlasShader = new Shader(import("shaders/atlassing.vert"), import("shaders/atlassing.frag"));
atlasShader = new Shader("atlassing", import("shaders/atlassing.vert"), import("shaders/atlassing.frag"));
atlasMVP = atlasShader.getUniformLocation("mvp");
atlasRenderOpacity = atlasShader.getUniformLocation("opacity");
}
Expand Down
2 changes: 1 addition & 1 deletion source/creator/core/egg.d
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ version(InBranding) {
}

void incInitAda() {
adaShader = new Shader(import("shaders/ada.vert"), import("shaders/ada.frag"));
adaShader = new Shader("ada", import("shaders/ada.vert"), import("shaders/ada.frag"));

cam = new Camera();
cam.position = vec2(0, 0);
Expand Down
4 changes: 2 additions & 2 deletions source/creator/ext/param.d
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public:
}

override
FghjException deserializeFromFghj(Fghj data) {
SerdeException deserializeFromFghj(Fghj data) {
data["groupUUID"].deserializeValue(this.uuid);
if (!data["name"].isEmpty) data["name"].deserializeValue(this.name);
if (!data["color"].isEmpty) data["color"].deserializeValue(this.color.vector);
Expand Down Expand Up @@ -92,7 +92,7 @@ public:
this.parent = parent;
}
override
FghjException deserializeFromFghj(Fghj data) {
SerdeException deserializeFromFghj(Fghj data) {
if (!data["parentUUID"].isEmpty)
data["parentUUID"].deserializeValue(this.parentUUID);
return super.deserializeFromFghj(data);
Expand Down
7 changes: 0 additions & 7 deletions source/creator/panels/nodes.d
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ protected:
igSameLine(0, 2);
if (igMenuItem(__("Node"), "", false, true)) incAddChildWithHistory(new Node(cast(Node)null), n);

incText(incTypeIdToIcon("Mask"));
igSameLine(0, 2);
if (igMenuItem(__("Mask"), "", false, true)) {
MeshData empty;
incAddChildWithHistory(new Mask(empty, cast(Node)null), n);
}

incText(incTypeIdToIcon("Composite"));
igSameLine(0, 2);
if (igMenuItem(__("Composite"), "", false, true)) {
Expand Down
14 changes: 14 additions & 0 deletions source/creator/panels/scene.d
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import inochi2d;
import std.conv;
import i18n;
import std.string;
import inmath;


/**
Expand All @@ -31,6 +32,19 @@ protected:
ImGuiColorEditFlags.PickerHueWheel |
ImGuiColorEditFlags.NoInputs
);

igColorEdit3(
__("Scene Light Color"),
&inSceneLightColor.vector,
ImGuiColorEditFlags.PickerHueWheel |
ImGuiColorEditFlags.NoInputs
);

igSliderFloat3(
__("Light Direction"),
cast(float[3]*)inSceneLightDirection.ptr,
-1, 1
);
}

public:
Expand Down
14 changes: 9 additions & 5 deletions source/creator/viewport/common/mesheditor/tools/lasso.d
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ enum LassoType {
}

private {
const char* [LassoType] lassoTypeIcons = [
LassoType.PolyLasso: "\ue922", // google material icon "timeline"
LassoType.RegularLasso: "\ue155", // google material icon "gesture"
];
const(char)* getLassoIcon(LassoType type) {
final switch(type) {
case LassoType.PolyLasso:
return "\ue922";
case LassoType.RegularLasso:
return "\ue155";
}
}

string getLassoHint(LassoType lassoType) {
switch (lassoType) {
Expand Down Expand Up @@ -333,7 +337,7 @@ class LassoToolInfo : ToolInfoBase!LassoTool {
bool displayToolOptions(bool deformOnly, VertexToolMode toolMode, IncMeshEditorOne[Node] editors) {
auto lassoTool = cast(LassoTool)(editors.length == 0 ? null: editors.values()[0].getTool());
igBeginGroup();
auto current_icon = lassoTypeIcons[lassoTool.lassoType];
auto current_icon = getLassoIcon(lassoTool.lassoType);
if (incButtonColored(current_icon, ImVec2(0, 0), ImVec4.init)) {
foreach (e; editors) {
auto lt = cast(LassoTool)(e.getTool());
Expand Down
8 changes: 4 additions & 4 deletions source/creator/windows/flipconfig.d
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class FlipPair : ISerializable {
}

void serialize(S)(ref S serializer) {
auto state = serializer.objectBegin();
auto state = serializer.structBegin();
serializer.putKey("uuid1");
serializer.putValue(parts[0]? parts[0].uuid: InInvalidUUID);
serializer.putKey("uuid2");
serializer.putValue(parts[1]? parts[1].uuid: InInvalidUUID);
serializer.objectEnd(state);
serializer.structEnd(state);
}

SerdeException deserializeFromFghj(Fghj data) {
Expand Down Expand Up @@ -105,12 +105,12 @@ void incDumpFlipConfig(Puppet puppet) {
if (flipPairs.length > 0) {
auto app = appender!(char[]);
auto serializer = inCreateSerializer(app);
auto i = serializer.arrayBegin();
auto i = serializer.listBegin();
foreach (pair; flipPairs) {
serializer.elemBegin;
serializer.serializeValue(pair);
}
serializer.arrayEnd(i);
serializer.listEnd(i);
serializer.flush();
puppet.extData[FlipConfigPath] = cast(ubyte[])app.data;

Expand Down

0 comments on commit 7d94731

Please sign in to comment.