fix compile

This commit is contained in:
RandomityGuy 2023-05-17 01:22:32 +05:30
parent b73fe67c04
commit cee4731766
4 changed files with 6 additions and 61 deletions

View file

@ -344,14 +344,6 @@ class Replay {
curframe = this.frames[this.frames.length - 1]; curframe = this.frames[this.frames.length - 1];
} }
} }
if (this.initialState.randomGenTimes.length > 0) {
var rtimeIdx = this.initialState.randomGenTimes.length - 1;
while (this.initialState.randomGenTimes[rtimeIdx] > cutAfterTime && this.initialState.randomGenTimes.length > 0) {
this.initialState.randomGenTimes.pop();
this.initialState.randomGens.pop();
rtimeIdx = this.initialState.randomGenTimes.length - 1;
}
}
} }
public function write() { public function write() {

View file

@ -268,12 +268,14 @@ class Settings {
if (gamepadSettings.rewind == null) { if (gamepadSettings.rewind == null) {
gamepadSettings.rewind = ["Y"]; gamepadSettings.rewind = ["Y"];
} }
#if js
if (controlsSettings.rewind == null) { if (controlsSettings.rewind == null) {
controlsSettings.rewind = Key.R; controlsSettings.rewind = Key.R;
} }
if (optionsSettings.rewindEnabled == null) { if (optionsSettings.rewindEnabled == null) {
optionsSettings.rewindEnabled = false; optionsSettings.rewindEnabled = false;
} }
#end
progression = json.progression; progression = json.progression;
highscoreName = json.highscoreName; highscoreName = json.highscoreName;
} else { } else {

View file

@ -1,7 +1,6 @@
package rewind; package rewind;
import mis.MissionElement.MissionElementBase; import mis.MissionElement.MissionElementBase;
import triggers.CheckpointTrigger;
import src.PathedInterior.PIState; import src.PathedInterior.PIState;
import shapes.PowerUp; import shapes.PowerUp;
import h3d.Vector; import h3d.Vector;
@ -33,21 +32,11 @@ class RewindFrame {
var currentUp:Vector; var currentUp:Vector;
var trapdoorStates:Array<{lastContactTime:Float, lastDirection:Int, lastCompletion:Float}>; var trapdoorStates:Array<{lastContactTime:Float, lastDirection:Int, lastCompletion:Float}>;
var lastContactNormal:Vector; var lastContactNormal:Vector;
var blastAmt:Float;
var oobState:{ var oobState:{
oob:Bool, oob:Bool,
timeState:TimeState timeState:TimeState
}; };
var checkpointState:{
currentCheckpoint:{obj:DtsObject, elem:MissionElementBase},
currentCheckpointTrigger:CheckpointTrigger,
checkpointCollectedGems:Map<Gem, Bool>,
checkpointHeldPowerup:PowerUp,
checkpointUp:Vector,
checkpointBlast:Float
};
public function new() {} public function new() {}
public function clone() { public function clone() {
@ -97,21 +86,9 @@ class RewindFrame {
lastCompletion: s.lastCompletion, lastCompletion: s.lastCompletion,
}); });
} }
c.blastAmt = blastAmt;
c.oobState = { c.oobState = {
oob: oobState.oob, oob: oobState.oob,
timeState: oobState.timeState.clone() timeState: oobState.timeState.clone()
}; };
c.checkpointState = {
currentCheckpoint: checkpointState.currentCheckpoint != null ? {
obj: checkpointState.currentCheckpoint.obj,
elem: checkpointState.currentCheckpoint.elem,
} : null,
currentCheckpointTrigger: checkpointState.currentCheckpointTrigger,
checkpointCollectedGems: checkpointState.checkpointCollectedGems.copy(),
checkpointHeldPowerup: checkpointState.checkpointHeldPowerup,
checkpointUp: checkpointState.checkpointUp != null ? checkpointState.checkpointUp.clone() : null,
checkpointBlast: checkpointState.checkpointBlast,
};
} }
} }

View file

@ -7,7 +7,6 @@ import src.MarbleWorld;
import shapes.Trapdoor; import shapes.Trapdoor;
import shapes.PushButton; import shapes.PushButton;
import src.Util; import src.Util;
import shapes.Nuke;
class RewindManager { class RewindManager {
var frames:Array<RewindFrame> = []; var frames:Array<RewindFrame> = [];
@ -29,12 +28,11 @@ class RewindManager {
rf.marblePowerup = level.marble.heldPowerup; rf.marblePowerup = level.marble.heldPowerup;
rf.bonusTime = level.bonusTime; rf.bonusTime = level.bonusTime;
rf.gemCount = level.gemCount; rf.gemCount = level.gemCount;
rf.gemStates = level.gems.map(x -> x.pickedUp); rf.gemStates = level.dtsObjects.filter(x -> x is shapes.Gem).map(x -> cast(x, shapes.Gem).pickedUp);
rf.activePowerupStates = [@:privateAccess rf.activePowerupStates = [@:privateAccess
level.marble.superBounceEnableTime, @:privateAccess level.marble.superBounceEnableTime, @:privateAccess
level.marble.shockAbsorberEnableTime, @:privateAccess level.marble.shockAbsorberEnableTime, @:privateAccess
level.marble.helicopterEnableTime, @:privateAccess level.marble.helicopterEnableTime,
level.marble.megaMarbleEnableTime
]; ];
rf.currentUp = level.currentUp.clone(); rf.currentUp = level.currentUp.clone();
rf.lastContactNormal = level.marble.lastContactNormal.clone(); rf.lastContactNormal = level.marble.lastContactNormal.clone();
@ -76,10 +74,6 @@ class RewindManager {
var lm:LandMine = cast dts; var lm:LandMine = cast dts;
rf.landMineStates.push(lm.disappearTime); rf.landMineStates.push(lm.disappearTime);
} }
if (dts is Nuke) {
var lm:Nuke = cast dts;
rf.landMineStates.push(lm.disappearTime);
}
if (dts is Trapdoor) { if (dts is Trapdoor) {
var td:Trapdoor = cast dts; var td:Trapdoor = cast dts;
rf.trapdoorStates.push({ rf.trapdoorStates.push({
@ -93,19 +87,10 @@ class RewindManager {
rf.powerupStates.push(ab.lastContactTime); rf.powerupStates.push(ab.lastContactTime);
} }
} }
rf.blastAmt = level.blastAmount;
rf.oobState = { rf.oobState = {
oob: level.outOfBounds, oob: level.outOfBounds,
timeState: level.outOfBoundsTime != null ? level.outOfBoundsTime.clone() : null timeState: level.outOfBoundsTime != null ? level.outOfBoundsTime.clone() : null
}; };
rf.checkpointState = {
currentCheckpoint: @:privateAccess level.currentCheckpoint,
currentCheckpointTrigger: @:privateAccess level.currentCheckpointTrigger,
checkpointBlast: @:privateAccess level.cheeckpointBlast,
checkpointCollectedGems: @:privateAccess level.checkpointCollectedGems.copy(),
checkpointHeldPowerup: @:privateAccess level.checkpointHeldPowerup,
checkpointUp: @:privateAccess level.checkpointUp != null ? @:privateAccess level.checkpointUp.clone() : null,
};
frames.push(rf); frames.push(rf);
} }
@ -131,13 +116,13 @@ class RewindManager {
level.bonusTime = rf.bonusTime; level.bonusTime = rf.bonusTime;
level.gemCount = rf.gemCount; level.gemCount = rf.gemCount;
@:privateAccess level.playGui.formatGemCounter(level.gemCount, level.totalGems); @:privateAccess level.playGui.formatGemCounter(level.gemCount, level.totalGems);
var gems = level.dtsObjects.filter(x -> x is shapes.Gem);
for (i in 0...rf.gemStates.length) { for (i in 0...rf.gemStates.length) {
level.gems[i].setHide(rf.gemStates[i]); gems[i].setHide(rf.gemStates[i]);
} }
@:privateAccess level.marble.superBounceEnableTime = rf.activePowerupStates[0]; @:privateAccess level.marble.superBounceEnableTime = rf.activePowerupStates[0];
@:privateAccess level.marble.shockAbsorberEnableTime = rf.activePowerupStates[1]; @:privateAccess level.marble.shockAbsorberEnableTime = rf.activePowerupStates[1];
@:privateAccess level.marble.helicopterEnableTime = rf.activePowerupStates[2]; @:privateAccess level.marble.helicopterEnableTime = rf.activePowerupStates[2];
@:privateAccess level.marble.megaMarbleEnableTime = rf.activePowerupStates[3];
if (level.currentUp.x != rf.currentUp.x || level.currentUp.y != rf.currentUp.y || level.currentUp.z != rf.currentUp.z) { if (level.currentUp.x != rf.currentUp.x || level.currentUp.y != rf.currentUp.y || level.currentUp.z != rf.currentUp.z) {
level.setUp(rf.currentUp, level.timeState); level.setUp(rf.currentUp, level.timeState);
@ -197,10 +182,6 @@ class RewindManager {
var lm:LandMine = cast dts; var lm:LandMine = cast dts;
lm.disappearTime = lmstates.shift(); lm.disappearTime = lmstates.shift();
} }
if (dts is Nuke) {
var lm:Nuke = cast dts;
lm.disappearTime = lmstates.shift();
}
if (dts is Trapdoor) { if (dts is Trapdoor) {
var td:Trapdoor = cast dts; var td:Trapdoor = cast dts;
var tdState = tstates.shift(); var tdState = tstates.shift();
@ -224,13 +205,6 @@ class RewindManager {
level.outOfBounds = rf.oobState.oob; level.outOfBounds = rf.oobState.oob;
level.marble.camera.oob = rf.oobState.oob; level.marble.camera.oob = rf.oobState.oob;
level.outOfBoundsTime = rf.oobState.timeState != null ? rf.oobState.timeState.clone() : null; level.outOfBoundsTime = rf.oobState.timeState != null ? rf.oobState.timeState.clone() : null;
level.blastAmount = rf.blastAmt;
@:privateAccess level.checkpointUp = rf.checkpointState.checkpointUp;
@:privateAccess level.checkpointCollectedGems = rf.checkpointState.checkpointCollectedGems;
@:privateAccess level.cheeckpointBlast = rf.checkpointState.checkpointBlast;
@:privateAccess level.checkpointHeldPowerup = rf.checkpointState.checkpointHeldPowerup;
@:privateAccess level.currentCheckpoint = rf.checkpointState.currentCheckpoint;
@:privateAccess level.currentCheckpointTrigger = rf.checkpointState.currentCheckpointTrigger;
} }
public function getNextRewindFrame(absTime:Float):RewindFrame { public function getNextRewindFrame(absTime:Float):RewindFrame {