mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-02-28 09:01:06 +00:00
some more replaying loading shenanigans and append zlib header to web replays pls
This commit is contained in:
parent
a99534c529
commit
ed4384b168
2 changed files with 17 additions and 5 deletions
|
|
@ -356,7 +356,7 @@ class Replay {
|
|||
var compressed = haxe.zip.Compress.run(bw.getBuffer(), 9);
|
||||
#end
|
||||
#if js
|
||||
var stream = zip.DeflateStream.create(zip.DeflateStream.CompressionLevel.GOOD, false);
|
||||
var stream = zip.DeflateStream.create(zip.DeflateStream.CompressionLevel.GOOD, true);
|
||||
stream.write(new BytesInput(bw.getBuffer()));
|
||||
var compressed = stream.finalize();
|
||||
#end
|
||||
|
|
|
|||
|
|
@ -156,10 +156,22 @@ class PlayMissionGui extends GuiImage {
|
|||
// Idk do something to notify the user here
|
||||
} else {
|
||||
var repmis = replay.mission;
|
||||
#if js
|
||||
repmis = StringTools.replace(repmis, "data/", "");
|
||||
#end
|
||||
var playMis = MissionList.missions.get(repmis);
|
||||
|
||||
// Strip data/ from the mission name
|
||||
if (StringTools.startsWith(repmis, "data/")) {
|
||||
repmis = repmis.substr(5);
|
||||
}
|
||||
|
||||
var mi = MissionList.missions.get(repmis);
|
||||
|
||||
// try with data/ added
|
||||
if (mi == null) {
|
||||
if (!StringTools.contains(repmis, "data/"))
|
||||
repmis = "data/" + repmis;
|
||||
mi = MissionList.missions.get(repmis);
|
||||
}
|
||||
|
||||
var playMis = mi;
|
||||
if (playMis != null) {
|
||||
cast(this.parent, Canvas).marbleGame.watchMissionReplay(playMis, replay);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue