Skip to content

Commit a7afe5e

Browse files
committed
Add attribution str to the text and also update the output with file name
1 parent 317aafe commit a7afe5e

File tree

6 files changed

+69
-14
lines changed

6 files changed

+69
-14
lines changed

Diff for: Attribution.txt

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
//=============================================================================
3+
// Contact Information
4+
//=============================================================================
5+
/*
6+
*
7+
* Contact me via twitter: EISKino, or on the rpg maker forums.
8+
* Username on forums: Kino.
9+
*
10+
* Forum Link: http://forums.rpgmakerweb.com/index.php?/profile/75879-kino/
11+
* Old Website Link: http://endlessillusoft.com/
12+
* New Website Link: https://kinocreates.io/
13+
* Twitter Link: https://twitter.com/EISKino
14+
* Patreon Link: https://www.patreon.com/EISKino
15+
*
16+
* Hope this plugin helps, and enjoy!
17+
* --Kino
18+
*/

Diff for: CleanJs.hx

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,26 @@ macro function pipe(exprs:Array<Expr>) :Expr {
1111
}
1212

1313
function main() {
14+
final attributionStr = File.read("Attribution.txt")
15+
.readAll().toString();
1416
final distDir = "dist";
1517
final allFiles = FileSystem.readDirectory(distDir);
1618
allFiles
1719
.filter((file) -> !file.contains(".map"))
1820
.iter((file) -> {
21+
final fileNameStr =
22+
'//=============================================================================
23+
// $file
24+
//=============================================================================\n';
1925
final filePath = '$distDir/$file';
2026
final contents = File.read(filePath).readAll().toString();
2127
final cleanContents = pipe(
2228
~/(\*\/);/g.replace(contents,"$1"),
2329
~/(==);/g.replace(_, "$1"),
2430
~/(\/\/.+\s*);/g.replace(_, "$1")
2531
);
26-
File.write(filePath).writeString(cleanContents);
32+
final newContent = fileNameStr + attributionStr + "\n" + cleanContents;
33+
File.write(filePath).writeString(newContent);
2734
trace("Cleaned Output File: " + filePath);
2835
});
2936
}

Diff for: dist/kiniita.js

+29-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: dist/kiniita.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: src/Main.hx

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import js.Syntax;
2-
import core.TestScene;
3-
import mz.scenes.Scene_Title;
1+
import js.html.Window;
2+
import js.lib.Function;
43
import mz.scenes.Scene_Base;
54
import utils.Fn;
65
import utils.Comment;
7-
import macros.FnMacros;
86
import macros.MacroTools;
97

108
class Main {
@@ -15,10 +13,13 @@ class Main {
1513
Comment.pluginParams("@author Kino
1614
@plugindesc This plugin allows you to use Haxe in your RPGMakerMV code.
1715
@param haxeVersion");
18-
var SceneBaseFn = Fn.setPrProp(Scene_Base, "update", () -> {
16+
var sceneTitleStart:Function = Fn.getPrProp(Scene_Base, "start");
17+
var SceneBaseFn = Fn.setPrProp(Scene_Base, "start", () -> {
1918
var self:Scene_Base = Fn.self;
20-
self.create();
21-
trace("Creating Windows");
19+
sceneTitleStart.call(self);
20+
Fn.setField(Window, "Haxe", "Version 4.2.0");
21+
trace("Running Console Log From Haxe Added haxe Version");
2222
});
2323
}
24+
2425
}

Diff for: src/utils/Fn.hx

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class Fn {
2424
return Syntax.code("{0}.{1} = {2}", prototype(obj), Syntax.plainCode(fieldName), value);
2525
}
2626

27+
public static inline function getPrProp(obj, fieldName:String):Any {
28+
return Syntax.code("{0}.{1}", prototype(obj), Syntax.plainCode(fieldName));
29+
}
30+
2731
@:analyzer(local_dce)
2832
public static inline function setField(obj, fieldName:String, value:Any) {
2933
return Syntax.code("{0} = {1}",Syntax.field(obj, fieldName), value);

0 commit comments

Comments
 (0)