Skip to content

Commit

Permalink
added lots of editing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tolik518 committed Feb 25, 2024
1 parent c96cd12 commit 97b1dd2
Show file tree
Hide file tree
Showing 17 changed files with 1,008 additions and 187 deletions.
31 changes: 12 additions & 19 deletions SoG_SGreader/DataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
ItemCount = readBinary.ReadInt32()
});
}


txtConsole.AppendText("\r\nItemCountMerchant: " + playerObject.MerchantItemsCount);

Expand All @@ -127,7 +126,7 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
{
playerObject.TreasureMaps.Add(new TreasureMap
{
TreasureMapID = readBinary.ReadInt16()
TreasureMapID = (SogTreasureMap) readBinary.ReadInt16()
});
}

Expand Down Expand Up @@ -250,12 +249,6 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
txtConsole.AppendText("\r\n" + "EnemiesSeenCount: " + playerObject.EnemiesSeenCount);
txtConsole.AppendText("\r\n" + "> EnemiesSeenCount Position: " + readBinary.BaseStream.Position.ToString("X"));

// | //
// | //
// new stuff //
// we're not editing //
// yet //

playerObject.UnknownVariable02Count = (UInt16)(readBinary.ReadUInt16() * 16); // there are X sequences, each 10 bytes long
txtConsole.AppendText("\r\n" + "UnknownVariable02Count: " + playerObject.UnknownVariable02Count);
txtConsole.AppendText("\r\n" + "> UnknownVariable02Count Position: " + readBinary.BaseStream.Position.ToString("X"));
Expand All @@ -275,13 +268,13 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
txtConsole.AppendText("\r\n" + "RobinBowHighscore: " + playerObject.RobinBowHighscore);
txtConsole.AppendText("\r\n" + "> RobinBowHighscore Position: " + readBinary.BaseStream.Position.ToString("X"));

playerObject.TrophiesCount = (UInt16)(readBinary.ReadUInt16());
playerObject.TrophiesCount = (ushort)(readBinary.ReadUInt16());
playerObject.Trophies = new List<Trophy>(playerObject.TrophiesCount);
for (int i = 0; i != playerObject.TrophiesCount; i++)
{
playerObject.Trophies.Add(new Trophy
{
TrophyID = readBinary.ReadUInt16()
TrophyID = (SogTrophy) readBinary.ReadUInt16()
});
}
txtConsole.AppendText("\r\n" + "TrophiesCount: " + playerObject.TrophiesCount);
Expand All @@ -291,12 +284,12 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
txtConsole.AppendText("\r\n" + "ItemsSeenCount: " + playerObject.ItemsSeenCount);
txtConsole.AppendText("\r\n" + "> ItemsSeenCount Position: " + readBinary.BaseStream.Position.ToString("X"));

playerObject.ItemsSeen = new List<ItemsSeen>(playerObject.ItemsSeenCount);
playerObject.ItemsSeen = new List<ItemSeen>(playerObject.ItemsSeenCount);
for (int i = 0; i != playerObject.ItemsSeenCount; i++)
{
playerObject.ItemsSeen.Add(new ItemsSeen
playerObject.ItemsSeen.Add(new ItemSeen
{
ItemID = (SogItem)readBinary.ReadInt32()
ItemID = (SogItem) readBinary.ReadInt32()
});
}

Expand All @@ -309,20 +302,20 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
{
playerObject.ItemsCrafted.Add(new ItemCrafted
{
ItemID = (SogItem)readBinary.ReadInt32()
ItemID = (SogItem) readBinary.ReadInt32()
});
}

playerObject.FishiesCaughtCount = (UInt16)(readBinary.ReadUInt16());
playerObject.FishiesCaught = new List<FishCaught>(playerObject.FishiesCaughtCount);
playerObject.FishCaught = new List<FishCaught>(playerObject.FishiesCaughtCount);
txtConsole.AppendText("\r\n" + "FishiesCaughtCount: " + playerObject.FishiesCaughtCount);
txtConsole.AppendText("\r\n" + "> FishiesCaughtCount Position: " + readBinary.BaseStream.Position.ToString("X"));

for (int i = 0; i != playerObject.FishiesCaughtCount; i++)
{
playerObject.FishiesCaught.Add(new FishCaught
playerObject.FishCaught.Add(new FishCaught
{
FishID = (SogItem)readBinary.ReadInt32()
FishID = (SogItem) readBinary.ReadInt32()
});
}

Expand All @@ -335,7 +328,7 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
{
playerObject.KilledEnemies.Add(new KilledEnemy
{
EnemyID = readBinary.ReadInt32(),
EnemyID = (SogEnemy) readBinary.ReadInt32(),
KillCount = readBinary.ReadInt32()
});
}
Expand Down Expand Up @@ -395,7 +388,7 @@ public static Player ReadFromFile(string fileName, ITextBoxWrapper txtConsole)
{
playerObject.Flags.Add(new Flag
{
FlagID = readBinary.ReadUInt16()
FlagID = (SogFlag) readBinary.ReadUInt16()
});
}
txtConsole.AppendText("\r\nFlagsCount: " + playerObject.FlagsCount);
Expand Down
16 changes: 8 additions & 8 deletions SoG_SGreader/DataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void WriteToFile(string fileName)
writeBinary.Write((int) playerObject.TreasureMaps.Count);
for (var i = 0; i != playerObject.TreasureMaps.Count; i++)
{
writeBinary.Write(playerObject.TreasureMaps[i].TreasureMapID);
writeBinary.Write((ushort) playerObject.TreasureMaps[i].TreasureMapID);
}

writeBinary.Write((int) playerObject.UnknownVariables01.Count);
Expand Down Expand Up @@ -167,10 +167,10 @@ public void WriteToFile(string fileName)
writeBinary.Write((ushort) playerObject.Trophies.Count);
for (int i = 0; i != playerObject.Trophies.Count; i++)
{
writeBinary.Write(playerObject.Trophies[i].TrophyID);
writeBinary.Write((ushort) playerObject.Trophies[i].TrophyID);
}

writeBinary.Write((ushort)playerObject.ItemsSeen.Count);
writeBinary.Write((ushort) playerObject.ItemsSeen.Count);
for (int i = 0; i != playerObject.ItemsSeen.Count; i++)
{
writeBinary.Write((int) playerObject.ItemsSeen[i].ItemID);
Expand All @@ -182,16 +182,16 @@ public void WriteToFile(string fileName)
writeBinary.Write((int) playerObject.ItemsCrafted[i].ItemID);
}

writeBinary.Write((ushort) playerObject.FishiesCaught.Count);
for (int i = 0; i != playerObject.FishiesCaught.Count; i++)
writeBinary.Write((ushort) playerObject.FishCaught.Count);
for (int i = 0; i != playerObject.FishCaught.Count; i++)
{
writeBinary.Write((int) playerObject.FishiesCaught[i].FishID);
writeBinary.Write((int) playerObject.FishCaught[i].FishID);
}

writeBinary.Write((ushort) playerObject.KilledEnemies.Count);
for (int i = 0; i != playerObject.KilledEnemies.Count; i++)
{
writeBinary.Write((int)playerObject.KilledEnemies[i].EnemyID);
writeBinary.Write((int) playerObject.KilledEnemies[i].EnemyID);
writeBinary.Write(playerObject.KilledEnemies[i].KillCount);
}

Expand Down Expand Up @@ -223,7 +223,7 @@ public void WriteToFile(string fileName)
writeBinary.Write((ushort) playerObject.Flags.Count);
for (int i = 0; i != playerObject.Flags.Count; i++)
{
writeBinary.Write(playerObject.Flags[i].FlagID);
writeBinary.Write((ushort) playerObject.Flags[i].FlagID);
}

writeBinary.Write((byte) playerObject.HouseStyles.Count);
Expand Down
2 changes: 1 addition & 1 deletion SoG_SGreader/Forms/FrmAbout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public partial class FrmAbout : Form
public FrmAbout()
{
InitializeComponent();
lblBuild.Text = lblBuild.Text.Replace("0.0.000.000",FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion); //AssemblyFileVersion
lblBuild.Text = lblBuild.Text.Replace("0.0.000.000", FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion); //AssemblyFileVersion
lblVersion.Text = lblVersion.Text.Replace("0.0.0", Application.ProductVersion);
lblCurrentPatch.Text = lblCurrentPatch.Text.Replace("0.000a", FrmMain.SupportedPatch);
}
Expand Down
6 changes: 0 additions & 6 deletions SoG_SGreader/Forms/FrmColorSelect.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SoG_SGreader
Expand Down
7 changes: 3 additions & 4 deletions SoG_SGreader/Forms/FrmLoadSaveGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Drawing;
using System.IO;
using System.Windows.Forms;
using SoG_SGreader.Wrapper;

namespace SoG_SGreader
{
Expand All @@ -28,7 +27,7 @@ private void BtnLoadSaveGame_Click(object sender, EventArgs e)
frmMain.ShowDialog();
Close();
}

private void GetSaveGameFiles(string sFilePath)
{
lstvSaveGames.Items.Clear();
Expand All @@ -37,7 +36,7 @@ private void GetSaveGameFiles(string sFilePath)
string savegame = Path.Combine(sFilePath, i + ".cha");
if (File.Exists(savegame))
{
string[] item = new string[] { i + ".cha", DataReader.GetCharName(savegame)};
string[] item = new string[] { i + ".cha", DataReader.GetCharName(savegame) };
lstvSaveGames.Items.Add(new ListViewItem(item, 0));
}
}
Expand All @@ -55,7 +54,7 @@ private void GetSaveGameFiles(string sFilePath)

private string GetSaveGamePath()
{
return filePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + Path.Combine("Secrets of Grindea","Characters");
return filePath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + Path.Combine("Secrets of Grindea", "Characters");
}

private void BtnChooseFolder_Click(object sender, EventArgs e)
Expand Down
Loading

0 comments on commit 97b1dd2

Please sign in to comment.