Skip to content

Commit

Permalink
#14 TRGE Level Change
Browse files Browse the repository at this point in the history
Update to reflect separation of TR2 and TR3 scripted levels - minor preparation for actual TR3 support.
  • Loading branch information
lahm86 committed Mar 15, 2022
1 parent 784ee79 commit 3783139
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion TR2RandoTracker.Core/Extensions/TRScriptExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace TR2RandoTracker.Core.Extensions
{
public static class TRScriptExtensions
{
public static string GetDecodedName(this TR23ScriptedLevel level)
public static string GetDecodedName(this TR2ScriptedLevel level)
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < level.Name.Length; i++)
Expand Down
4 changes: 2 additions & 2 deletions TR2RandoTracker.Core/Tracker/Tomp2Tracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Tomp2Tracker

public event EventHandler<TrackingEventArgs> TrackingChanged;

private List<TR23ScriptedLevel> _scriptLevels;
private List<TR2ScriptedLevel> _scriptLevels;

public Tomp2Tracker()
{
Expand Down Expand Up @@ -98,7 +98,7 @@ private bool LoadScriptLevels(Process process)
Thread.Sleep(1000); // try to allow the game to access the dat file first
File.Copy(datFile, tmpDatFile, true);
TR23Script script = TRScriptFactory.OpenScript(tmpDatFile) as TR23Script;
_scriptLevels = script.Levels.Cast<TR23ScriptedLevel>().ToList();
_scriptLevels = script.Levels.Cast<TR2ScriptedLevel>().ToList();
}
finally
{
Expand Down
4 changes: 2 additions & 2 deletions TR2RandoTracker.Core/Tracker/TrackingEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ public class TrackingEventArgs : EventArgs
{
public AbstractTomp2Exe Exe { get; internal set; }
public TrackingStatus Status { get; internal set; }
public IReadOnlyList<TR23ScriptedLevel> Levels { get; internal set; }
public IReadOnlyList<TR2ScriptedLevel> Levels { get; internal set; }
public int CurrentSequence { get; internal set; }
public TR23ScriptedLevel CurrentLevel { get; internal set; }
public TR2ScriptedLevel CurrentLevel { get; internal set; }

public override string ToString()
{
Expand Down
4 changes: 2 additions & 2 deletions TR2RandoTracker/Model/LevelView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public class LevelView
public bool Unarmed => _level.RemovesWeapons;
public bool Ammoless => _level.RemovesAmmo;

private readonly TR23ScriptedLevel _level;
private readonly TR2ScriptedLevel _level;

public LevelView(TR23ScriptedLevel level)
public LevelView(TR2ScriptedLevel level)
{
_level = level;
LevelName = _level.GetDecodedName();
Expand Down
2 changes: 1 addition & 1 deletion TR2RandoTracker/Model/LevelViewList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace TR2RandoTracker.Model
{
public class LevelViewList : List<LevelView>
{
public static LevelViewList Get(IReadOnlyList<TR23ScriptedLevel> allLevels, int currentLevel)
public static LevelViewList Get(IReadOnlyList<TR2ScriptedLevel> allLevels, int currentLevel)
{
LevelViewList list = new LevelViewList();
for (int i = 0; i < allLevels.Count; i++)
Expand Down

0 comments on commit 3783139

Please sign in to comment.