Skip to content

Commit

Permalink
Fixed #4, #5 - GM2022 sprite structure is now supported.
Browse files Browse the repository at this point in the history
  • Loading branch information
YellowAfterlife committed Nov 5, 2022
1 parent 1e3915f commit bc323b3
Show file tree
Hide file tree
Showing 10 changed files with 187 additions and 115 deletions.
2 changes: 1 addition & 1 deletion AseSync.hx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class AseSync {
ex = Executor.create();
fw = new PollingFileWatcher(ex, 500);
fw.subscribe(function(e) {
trace(e);
//trace(e);
switch (e) {
case FILE_MODIFIED(file, _, _), FILE_CREATED(file):
var path = file.path.toString();
Expand Down
27 changes: 16 additions & 11 deletions AseSyncSprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -174,17 +174,21 @@ class AseSyncSprite {
if (sf == null) {
sf = YyJson.parse(baseSpriteFrameText);
var guid = createGUID();
sf.parent = { name: name, path: yyRel };
var img = sf.images[0];
img.FrameId.name = guid;
img.FrameId.path = yyRel;
img.LayerId.name = spr.layers[0].name;
img.LayerId.path = yyRel;
sf.parent.name = name;
sf.parent.path = yyRel;
if (sf.parent != null) {
sf.parent = { name: name, path: yyRel };
}
if (sf.images != null) {
var img = sf.images[0];
img.FrameId.name = guid;
img.FrameId.path = yyRel;
img.LayerId.name = spr.layers[0].name;
img.LayerId.path = yyRel;
}
sf.name = guid;
sf.compositeImage.FrameId.name = guid;
sf.compositeImage.FrameId.path = yyRel;
if (sf.compositeImage != null) {
sf.compositeImage.FrameId.name = guid;
sf.compositeImage.FrameId.path = yyRel;
}
spr.frames.push(sf);
//
kf = YyJson.parse(baseSpriteKeyFrameText);
Expand All @@ -201,7 +205,8 @@ class AseSyncSprite {
save = true;
}
var src = '$tmp/$i.png';
var dst = yyDir + "/" + sf.compositeImage.FrameId.name + ".png";
var dstName = sf.compositeImage != null ? sf.compositeImage.FrameId.name : sf.name;
var dst = yyDir + "/" + dstName + ".png";
if (!FileTools.compare(src, dst)) {
Sys.println('Copying $src to $dst...');
File.copy(src, dst);
Expand Down
49 changes: 24 additions & 25 deletions asetest23/asetest23.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions asetest23/options/main/options_main.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions asetest23/options/operagx/options_operagx.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions asetest23/options/ps5/options_ps5.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions asetest23/options/xboxseriesxs/options_xboxseriesxs.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 11 additions & 16 deletions asetest23/sprites/spr_asebase/spr_asebase.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bc323b3

Please sign in to comment.