generated from ShadowMario/FNF-PsychEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
367 additions
and
107,469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
*.hxs linguist-language=Haxe | ||
*.hsc linguist-language=Haxe | ||
*.hscript linguist-language=Haxe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@haxe -cp commandline -D analyzer-optimize --run Main %* | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
haxe -cp commandline -D analyzer-optimize --run Main $@ | ||
pause |
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
package; | ||
|
||
import backend.*; | ||
|
||
class Main { | ||
public static var commands:Array<Command> = []; | ||
|
||
public static function initCommands() { | ||
commands = [ | ||
{ | ||
names: ["setup"], | ||
doc: "Setups (or updates) all libraries required for the engine.", | ||
func: Update.main, | ||
dDoc: "This command runs through all libraries in libs.xml, and install them.\nIf they're already installed, they will be updated." | ||
}, | ||
{ | ||
names: ["help", null], | ||
doc: "Shows help. Pass a command name to get additional help.", | ||
func: help, | ||
dDoc: "Usage: help <cmd>\n\nFor example, use \"cne help test\" to get additional help on the test command." | ||
}, | ||
{ | ||
names: ["test"], | ||
doc: "Creates a non final test build, then runs it.", | ||
func: Compiler.test, | ||
dDoc: "Usage: test <optional args>\n" + | ||
"\nThis will create a quick debug build binded to the source then run it, which means:" + | ||
"\n- The assets WON'T be copied over - Assets will be read from the game's source." + | ||
"\n- This build WON'T be ready for release - Running anywhere else than in the bin folder will result in a crash from missing assets" + | ||
"\n- This build will also use the mods folder from the source directory." + | ||
"\n\nIf you want a full build which contains all assets, run \"cne release\" or \"cne test-release\"" + | ||
"\nAdditional arguments will be sent to the lime compiler." | ||
}, | ||
{ | ||
names: ["build"], | ||
doc: "Creates a non final test build, without running it.", | ||
func: Compiler.build, | ||
dDoc: "Usage: build <optional arguments>\n" + | ||
"\nThis will create a quick debug build binded to the source then run it, which means:" + | ||
"\n- The assets WON'T be copied over - Assets will be read from the game's source." + | ||
"\n- This build WON'T be ready for release - Running anywhere else than in the bin folder will result in a crash from missing assets" + | ||
"\n- This build will also use the mods folder from the source directory." + | ||
"\n\nIf you want a full build which contains all assets, run \"cne release\" or \"cne test-release\"" + | ||
"\nAdditional arguments will be sent to the lime compiler." | ||
}, | ||
{ | ||
names: ["release"], | ||
doc: "Creates a final non debug build, containing all assets.", | ||
func: Compiler.release, | ||
dDoc: "Usage: release <optional arguments>\n" + | ||
"\nThis will create a final ready-for-release build, which means this build will be able to be release on websites such as GameBanana without worrying about source-dependant stuff." | ||
}, | ||
{ | ||
names: ["test-release"], | ||
doc: "Creates a final non debug build, containing all assets.", | ||
func: Compiler.testRelease, | ||
dDoc: "Usage: release <optional arguments>\n" + | ||
"\nThis will create and run a final ready-for-release build, which means this build will be able to be release on websites such as GameBanana without worrying about source-dependant stuff." | ||
} | ||
]; | ||
} | ||
|
||
public static function main() { | ||
initCommands(); | ||
var args = Sys.args(); | ||
var commandName = args.shift(); | ||
if (commandName != null) | ||
commandName = commandName.toLowerCase(); | ||
for(c in commands) { | ||
if (c.names.contains(commandName)) { | ||
c.func(args); | ||
return; | ||
} | ||
} | ||
} | ||
|
||
public static function help(args:Array<String>) { | ||
var cmdName = args.shift(); | ||
if (cmdName != null) { | ||
cmdName = cmdName.toLowerCase(); | ||
|
||
var matchingCommand = null; | ||
for(c in commands) if (c.names.contains(cmdName)) { | ||
matchingCommand = c; | ||
break; | ||
} | ||
|
||
if (matchingCommand == null) { | ||
Sys.println('help - Command named ${cmdName} not found.'); | ||
return; | ||
} | ||
|
||
Sys.println('${matchingCommand.names.join(", ")}'); | ||
Sys.println("---"); | ||
Sys.println(matchingCommand.dDoc); | ||
|
||
return; | ||
} | ||
// shows help | ||
Sys.println("Codename Engine Command Line utility"); | ||
Sys.println('Available commands (${commands.length}):\n'); | ||
for(line in commands) { | ||
Sys.println('${line.names.join(", ")} - ${line.doc}'); | ||
} | ||
} | ||
} | ||
|
||
typedef Command = { | ||
var names:Array<String>; | ||
var func:Array<String>->Void; | ||
var ?doc:String; | ||
var ?dDoc:String; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package backend; | ||
|
||
class Compiler { | ||
public static function test(args:Array<String>) { | ||
__build(args, ["test", getBuildTarget(), "-D", "TEST_BUILD"]); | ||
} | ||
public static function build(args:Array<String>) { | ||
__build(args, ["build", getBuildTarget(), "-D", "TEST_BUILD"]); | ||
} | ||
public static function release(args:Array<String>) { | ||
__build(args, ["build", getBuildTarget()]); | ||
} | ||
public static function testRelease(args:Array<String>) { | ||
__build(args, ["test", getBuildTarget()]); | ||
} | ||
|
||
/** | ||
* i genuinely don't know how im meant to explain this - orbl | ||
* @param args Args | ||
* @param arg Arg | ||
*/ | ||
private static function __build(args:Array<String>, arg:Array<String>) { | ||
for(a in args) | ||
arg.push(a); | ||
Sys.command("lime", arg); | ||
} | ||
|
||
public static function getBuildTarget() { | ||
return switch(Sys.systemName()) { | ||
case "Windows" | "Linux": | ||
Sys.systemName().toLowerCase(); | ||
case "Mac": | ||
"macos"; | ||
case def: | ||
def.toLowerCase(); | ||
} | ||
} | ||
} |
Oops, something went wrong.