fixes
This commit is contained in:
@@ -36,11 +36,12 @@ class PauseSubState extends MusicBeatSubstate
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var parentDisabler:FunkinParentDisabler;
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
super.create();
|
super.create();
|
||||||
|
|
||||||
add(new FunkinParentDisabler());
|
add(parentDisabler = new FunkinParentDisabler());
|
||||||
|
|
||||||
pauseScript = Script.create(Paths.script(script));
|
pauseScript = Script.create(Paths.script(script));
|
||||||
pauseScript.setParent(this);
|
pauseScript.setParent(this);
|
||||||
@@ -140,6 +141,7 @@ class PauseSubState extends MusicBeatSubstate
|
|||||||
case "Resume":
|
case "Resume":
|
||||||
close();
|
close();
|
||||||
case "Restart Song":
|
case "Restart Song":
|
||||||
|
parentDisabler.reset();
|
||||||
PlayState.instance.registerSmoothTransition();
|
PlayState.instance.registerSmoothTransition();
|
||||||
FlxG.resetState();
|
FlxG.resetState();
|
||||||
case "Change Controls":
|
case "Change Controls":
|
||||||
@@ -154,6 +156,7 @@ class PauseSubState extends MusicBeatSubstate
|
|||||||
}
|
}
|
||||||
override function destroy()
|
override function destroy()
|
||||||
{
|
{
|
||||||
|
|
||||||
if(FlxG.cameras.list.contains(camera))
|
if(FlxG.cameras.list.contains(camera))
|
||||||
FlxG.cameras.remove(camera, true);
|
FlxG.cameras.remove(camera, true);
|
||||||
pauseScript.call("onDestroy");
|
pauseScript.call("onDestroy");
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ class ScriptsMacro {
|
|||||||
"flixel.addons.plugin", "flixel.addons.text", "flixel.addons.tile", "flixel.addons.transition",
|
"flixel.addons.plugin", "flixel.addons.text", "flixel.addons.tile", "flixel.addons.transition",
|
||||||
"flixel.addons.util",
|
"flixel.addons.util",
|
||||||
// OTHER LIBRARIES & STUFF
|
// OTHER LIBRARIES & STUFF
|
||||||
"away3d", "flx3d", #if sys "sys", #end
|
"away3d", "flx3d", #if sys "sys", #end "openfl.net",
|
||||||
|
"funkin.system.net",
|
||||||
// BASE HAXE
|
// BASE HAXE
|
||||||
"DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting"
|
"DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting"
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package funkin.system.net;
|
||||||
|
|
||||||
|
#if sys
|
||||||
|
import sys.net.Host;
|
||||||
|
import sys.net.Socket as SysSocket;
|
||||||
|
|
||||||
|
@:keep
|
||||||
|
class Socket implements IFlxDestroyable {
|
||||||
|
public var socket:SysSocket;
|
||||||
|
|
||||||
|
public function new(?socket:SysSocket) {
|
||||||
|
this.socket = socket;
|
||||||
|
if (this.socket == null)
|
||||||
|
this.socket = new SysSocket();
|
||||||
|
this.socket.setFastSend(true);
|
||||||
|
this.socket.setBlocking(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function read():String {
|
||||||
|
try {
|
||||||
|
return this.socket.input.readUntil(('\n').charCodeAt(0)).replace("\\n", "\n");
|
||||||
|
} catch(e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function write(str:String):Bool {
|
||||||
|
try {
|
||||||
|
this.socket.output.writeString(str.replace("\n", "\\n"));
|
||||||
|
return true;
|
||||||
|
} catch(e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function host(host:Host, port:Int, nbConnections:Int = 1) {
|
||||||
|
socket.bind(host, port);
|
||||||
|
socket.listen(nbConnections);
|
||||||
|
socket.setFastSend(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hostAndWait(h:Host, port:Int) {
|
||||||
|
host(h, port);
|
||||||
|
return acceptConnection();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function acceptConnection():Socket {
|
||||||
|
socket.setBlocking(true);
|
||||||
|
var accept = new Socket(socket.accept());
|
||||||
|
socket.setBlocking(false);
|
||||||
|
return accept;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function connect(host:Host, port:Int) {
|
||||||
|
socket.connect(host, port);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy() {
|
||||||
|
if (socket != null)
|
||||||
|
socket.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#end
|
||||||
@@ -44,6 +44,13 @@ class FunkinParentDisabler extends FlxBasic {
|
|||||||
public override function update(elapsed:Float) {}
|
public override function update(elapsed:Float) {}
|
||||||
public override function draw() {}
|
public override function draw() {}
|
||||||
|
|
||||||
|
public function reset() {
|
||||||
|
__tweens = [];
|
||||||
|
__cameras = [];
|
||||||
|
__timers = [];
|
||||||
|
__sounds = [];
|
||||||
|
}
|
||||||
|
|
||||||
public override function destroy() {
|
public override function destroy() {
|
||||||
super.destroy();
|
super.destroy();
|
||||||
@:privateAccess {
|
@:privateAccess {
|
||||||
|
|||||||
@@ -117,5 +117,5 @@ class HiddenProcess {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
typedef HiddenProcess = Dynamic;
|
typedef HiddenProcess = #if sys sys.io.Process #else Dynamic #end;
|
||||||
#end
|
#end
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user