Skip to content

Commit 117dfc2

Browse files
Hello!
0 parents  commit 117dfc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1976
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin

.vscode/tasks.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "haxe",
6+
"args": "active configuration",
7+
"problemMatcher": [
8+
"$haxe-absolute",
9+
"$haxe",
10+
"$haxe-error",
11+
"$haxe-trace"
12+
],
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
},
17+
"label": "haxe: active configuration"
18+
}
19+
]
20+
}

AseConfig.hx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package ;
2+
import haxe.Json;
3+
import sys.FileSystem;
4+
import sys.io.File;
5+
6+
/**
7+
* ...
8+
* @author YellowAfterlife
9+
*/
10+
class AseConfig {
11+
public static var path:String;
12+
public static var current:AseConfigData = null;
13+
14+
public static function load() {
15+
current = {};
16+
if (!FileSystem.exists(path)) return;
17+
18+
var jsonStr = try {
19+
File.getContent(path);
20+
} catch (x:Dynamic) {
21+
Sys.println('Error reading "$path": $x');
22+
return;
23+
}
24+
25+
try {
26+
current = Json.parse(jsonStr);
27+
} catch (x:Dynamic) {
28+
Sys.println('Error parsing configuration: $x');
29+
}
30+
}
31+
public static function save() {
32+
try {
33+
File.saveContent(path, Json.stringify(current, null, "\t"));
34+
} catch (x:Dynamic) {
35+
Sys.println('Error saving config: $x');
36+
}
37+
}
38+
public static function init() {
39+
path = AseSync.executableDir + "/config.json";
40+
load();
41+
}
42+
}
43+
typedef AseConfigData = {
44+
?asepritePath:String,
45+
?lastProjectPath:String,
46+
?lastWatchPath:String,
47+
?consent:Bool,
48+
}

AseData.hx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package ;
2+
import haxe.DynamicAccess;
3+
4+
/**
5+
* Aseprite's --data format
6+
* @author YellowAfterlife
7+
*/
8+
typedef AseData = {
9+
frames:DynamicAccess<{
10+
frame:{
11+
x:Int,
12+
y:Int,
13+
w:Int,
14+
h:Int
15+
},
16+
rotated:Bool,
17+
trimmed:Bool,
18+
spriteSourceSize:{
19+
x:Int,
20+
y:Int,
21+
w:Int,
22+
h:Int
23+
},
24+
sourceSize:{
25+
w:Int,
26+
h:Int
27+
},
28+
duration:Int
29+
}>,
30+
meta:{
31+
app:String,
32+
version:String,
33+
format:String,
34+
size:{
35+
w:Int,
36+
h:Int
37+
},
38+
scale:String
39+
}
40+
}

AseSync-cs.hxproj

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project version="2">
3+
<!-- Output SWF options -->
4+
<output>
5+
<movie outputType="Application" />
6+
<movie input="" />
7+
<movie path="bin\cs" />
8+
<movie fps="0" />
9+
<movie width="0" />
10+
<movie height="0" />
11+
<movie version="0" />
12+
<movie minorVersion="0" />
13+
<movie platform="C#" />
14+
<movie background="#FFFFFF" />
15+
</output>
16+
<!-- Other classes to be compiled into your SWF -->
17+
<classpaths>
18+
<class path="." />
19+
</classpaths>
20+
<!-- Build options -->
21+
<build>
22+
<option directives="" />
23+
<option flashStrict="False" />
24+
<option noInlineOnDebug="False" />
25+
<option mainClass="AseSync" />
26+
<option enabledebug="False" />
27+
<option additional="" />
28+
</build>
29+
<!-- haxelib libraries -->
30+
<haxelib>
31+
<library name="yyjson" />
32+
<library name="haxe-files" />
33+
<library name="format" />
34+
</haxelib>
35+
<!-- Class files to compile (other referenced classes will automatically be included) -->
36+
<compileTargets>
37+
<compile path="AseSync.hx" />
38+
</compileTargets>
39+
<!-- Paths to exclude from the Project Explorer tree -->
40+
<hiddenPaths>
41+
<hidden path="obj" />
42+
</hiddenPaths>
43+
<!-- Executed before build -->
44+
<preBuildCommand />
45+
<!-- Executed after build -->
46+
<postBuildCommand alwaysRun="False">DEBUG: cmd /C copy /Y $(OutputDir)\cs\bin\AseSync-Debug.exe $(OutputDir)\AseSync.exe
47+
RELEASE: cmd /C copy /Y $(OutputDir)\cs\bin\AseSync.exe $(OutputDir)\AseSync.exe</postBuildCommand>
48+
<!-- Other project options -->
49+
<options>
50+
<option showHiddenPaths="True" />
51+
<option testMovie="Custom" />
52+
<option testMovieCommand="run-cs.bat" />
53+
</options>
54+
<!-- Plugin storage -->
55+
<storage />
56+
</project>

AseSync-neko.hxproj

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<project version="2">
3+
<!-- Output SWF options -->
4+
<output>
5+
<movie outputType="Application" />
6+
<movie input="" />
7+
<movie path="bin\AseSync.n" />
8+
<movie fps="0" />
9+
<movie width="0" />
10+
<movie height="0" />
11+
<movie version="0" />
12+
<movie minorVersion="0" />
13+
<movie platform="Neko" />
14+
<movie background="#FFFFFF" />
15+
</output>
16+
<!-- Other classes to be compiled into your SWF -->
17+
<classpaths>
18+
<class path="." />
19+
</classpaths>
20+
<!-- Build options -->
21+
<build>
22+
<option directives="" />
23+
<option flashStrict="False" />
24+
<option noInlineOnDebug="False" />
25+
<option mainClass="AseSync" />
26+
<option enabledebug="False" />
27+
<option additional="" />
28+
</build>
29+
<!-- haxelib libraries -->
30+
<haxelib>
31+
<library name="yyjson" />
32+
<library name="haxe-files" />
33+
<library name="format" />
34+
</haxelib>
35+
<!-- Class files to compile (other referenced classes will automatically be included) -->
36+
<compileTargets>
37+
<compile path="AseSync.hx" />
38+
</compileTargets>
39+
<!-- Paths to exclude from the Project Explorer tree -->
40+
<hiddenPaths>
41+
<hidden path="obj" />
42+
</hiddenPaths>
43+
<!-- Executed before build -->
44+
<preBuildCommand />
45+
<!-- Executed after build -->
46+
<postBuildCommand alwaysRun="False" />
47+
<!-- Other project options -->
48+
<options>
49+
<option showHiddenPaths="False" />
50+
<option testMovie="Custom" />
51+
<option testMovieCommand="run-neko.bat" />
52+
</options>
53+
<!-- Plugin storage -->
54+
<storage />
55+
</project>

0 commit comments

Comments
 (0)