Skip to content

Commit bc323b3

Browse files
Fixed #4, #5 - GM2022 sprite structure is now supported.
1 parent 1e3915f commit bc323b3

File tree

10 files changed

+187
-115
lines changed

10 files changed

+187
-115
lines changed

AseSync.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class AseSync {
209209
ex = Executor.create();
210210
fw = new PollingFileWatcher(ex, 500);
211211
fw.subscribe(function(e) {
212-
trace(e);
212+
//trace(e);
213213
switch (e) {
214214
case FILE_MODIFIED(file, _, _), FILE_CREATED(file):
215215
var path = file.path.toString();

AseSyncSprite.hx

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,21 @@ class AseSyncSprite {
174174
if (sf == null) {
175175
sf = YyJson.parse(baseSpriteFrameText);
176176
var guid = createGUID();
177-
sf.parent = { name: name, path: yyRel };
178-
var img = sf.images[0];
179-
img.FrameId.name = guid;
180-
img.FrameId.path = yyRel;
181-
img.LayerId.name = spr.layers[0].name;
182-
img.LayerId.path = yyRel;
183-
sf.parent.name = name;
184-
sf.parent.path = yyRel;
177+
if (sf.parent != null) {
178+
sf.parent = { name: name, path: yyRel };
179+
}
180+
if (sf.images != null) {
181+
var img = sf.images[0];
182+
img.FrameId.name = guid;
183+
img.FrameId.path = yyRel;
184+
img.LayerId.name = spr.layers[0].name;
185+
img.LayerId.path = yyRel;
186+
}
185187
sf.name = guid;
186-
sf.compositeImage.FrameId.name = guid;
187-
sf.compositeImage.FrameId.path = yyRel;
188+
if (sf.compositeImage != null) {
189+
sf.compositeImage.FrameId.name = guid;
190+
sf.compositeImage.FrameId.path = yyRel;
191+
}
188192
spr.frames.push(sf);
189193
//
190194
kf = YyJson.parse(baseSpriteKeyFrameText);
@@ -201,7 +205,8 @@ class AseSyncSprite {
201205
save = true;
202206
}
203207
var src = '$tmp/$i.png';
204-
var dst = yyDir + "/" + sf.compositeImage.FrameId.name + ".png";
208+
var dstName = sf.compositeImage != null ? sf.compositeImage.FrameId.name : sf.name;
209+
var dst = yyDir + "/" + dstName + ".png";
205210
if (!FileTools.compare(src, dst)) {
206211
Sys.println('Copying $src to $dst...');
207212
File.copy(src, dst);

asetest23/asetest23.yyp

Lines changed: 24 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asetest23/options/main/options_main.yy

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asetest23/options/operagx/options_operagx.yy

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asetest23/options/ps5/options_ps5.yy

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asetest23/options/xboxseriesxs/options_xboxseriesxs.yy

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asetest23/sprites/spr_asebase/spr_asebase.yy

Lines changed: 11 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)