remove unused dependencies, and fix replay saving bug after quick respawn

This commit is contained in:
RandomityGuy 2022-12-06 18:12:40 +05:30
parent dd6a0be20d
commit f22cce9825
5 changed files with 5 additions and 10 deletions

View file

@ -1,7 +1,6 @@
-cp src -cp src
-lib heaps -lib heaps
-lib hlsdl -lib hlsdl
-lib zyheaps
-hl marblegame.hl -hl marblegame.hl
-D windowSize=1280x720 -D windowSize=1280x720
-D keep-inline-positions -D keep-inline-positions

View file

@ -1103,7 +1103,7 @@ class MarbleWorld extends Scheduler {
ProfilerUI.measure("updateTimer"); ProfilerUI.measure("updateTimer");
this.updateTimer(dt); this.updateTimer(dt);
if (Key.isPressed(Settings.controlsSettings.respawn)) { if (Key.isPressed(Settings.controlsSettings.respawn) && this.finishTime == null) {
this.respawnPressedTime = timeState.timeSinceLoad; this.respawnPressedTime = timeState.timeSinceLoad;
this.restart(); this.restart();
if (!this.isWatching) { if (!this.isWatching) {
@ -1118,15 +1118,11 @@ class MarbleWorld extends Scheduler {
} else { } else {
Settings.levelStatistics[mission.path].respawns++; Settings.levelStatistics[mission.path].respawns++;
} }
if (this.isRecording) {
this.replay.endFrame();
}
} }
return; return;
} }
if (Key.isDown(Settings.controlsSettings.respawn) && !this.isWatching) { if (Key.isDown(Settings.controlsSettings.respawn) && !this.isWatching && this.finishTime == null) {
if (timeState.timeSinceLoad - this.respawnPressedTime > 1.5) { if (timeState.timeSinceLoad - this.respawnPressedTime > 1.5) {
this.restart(true); this.restart(true);
this.respawnPressedTime = Math.POSITIVE_INFINITY; this.respawnPressedTime = Math.POSITIVE_INFINITY;

View file

@ -258,7 +258,8 @@ class Replay {
} }
public function endFrame() { public function endFrame() {
frames.push(currentRecordFrame); if (currentRecordFrame != null)
frames.push(currentRecordFrame);
currentRecordFrame = null; currentRecordFrame = null;
} }

View file

@ -6,7 +6,6 @@ import h2d.Tile;
import h2d.Bitmap; import h2d.Bitmap;
import h3d.Engine; import h3d.Engine;
import h3d.Vector; import h3d.Vector;
import shaders.GuiRender;
import gui.GuiText.Justification; import gui.GuiText.Justification;
import h2d.HtmlText; import h2d.HtmlText;
import h2d.Scene; import h2d.Scene;

View file

@ -154,7 +154,7 @@ class MainMenuGui extends GuiImage {
versionText.vertSizing = Bottom; versionText.vertSizing = Bottom;
versionText.position = new Vector(502, 66); versionText.position = new Vector(502, 66);
versionText.extent = new Vector(97, 72); versionText.extent = new Vector(97, 72);
versionText.text.text = "<p align=\"center\">1.2.0</p>"; versionText.text.text = "<p align=\"center\">1.2.1</p>";
this.addChild(versionText); this.addChild(versionText);
} }
} }