Skip to content

Commit

Permalink
functional saves
Browse files Browse the repository at this point in the history
  • Loading branch information
BinaryConstruct committed Sep 30, 2022
1 parent a141b97 commit 31023b7
Show file tree
Hide file tree
Showing 12 changed files with 257 additions and 30 deletions.
54 changes: 54 additions & 0 deletions src/TEdit/Properties/Language.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.ar-BH.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>لا الفخاخ</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>بعد حفلة الموت</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>فانوس ليلة التبريد</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>ليلة الفانوس</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>ليلة فانوس حقيقية</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>دليل ليلة الفانوس</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>ليلة الفانوس التالية حقيقية</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.de-DE.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@ Klicke auf „Wiederholen“, um einen neuen Ordner auszuwählen, oder auf „Ab
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>Keine Fallen</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>Nach Party of Doom</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>Laternennacht Cooldown</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>Laternennacht</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>Laternennacht echt</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>Lantern Night Handbuch</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>Lantern Night Next ist echt</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@ Press retry to pick a new folder or cancel to use {0} as your terraria path.</va
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>No Traps</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>After Party of Doom</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>Lantern Night Cooldown</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>Lantern Night</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>Lantern Night Genuine</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>Lantern Night Manual</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>Lantern Night Next Is Genuine</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.pl-PL.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@ Naciśnij spróbuj ponownie aby wybrać nowy folder lub anuluj aby użyć {0} ja
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>Bez pułapek</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>After Party of Doom</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>Nocny czas odnowienia latarni</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>Noc Latarni</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>Latarnia Noc Autentyczna</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>Podręcznik Lantern Night</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>Noc Latarni Next jest autentyczna</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.pt-BR.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@ Clique em tentar novamente para escolher uma nova pasta ou cancelar para usar {0
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>Sem armadilhas</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>Depois do Partido da Perdição</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>Resfriamento noturno da lanterna</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>Noite das Lanternas</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>Noite de Lanterna Genuína</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>Manual noturno da lanterna</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>Noite de Lanterna Em seguida é genuína</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@ Press retry to pick a new folder or cancel to use {0} as your terraria path.</va
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>No Traps</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>After Party of Doom</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>Lantern Night Cooldown</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>Lantern Night</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>Lantern Night Genuine</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>Lantern Night Manual</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>Lantern Night Next Is Genuine</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.ru-RU.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>Без ловушек</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>После Вечеринки Судьбы</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>Фонарь Ночное охлаждение</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>Ночь фонарей</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>Фонарь Ночной Подлинный</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>Ночное руководство по фонарю</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>Ночь фонаря следующая подлинная</value>
</data>
</root>
18 changes: 18 additions & 0 deletions src/TEdit/Properties/Language.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,22 @@
<data name="tool_wp_seed_notraps" xml:space="preserve">
<value>无陷阱</value>
</data>
<data name="tool_wp_afterpartyofdoom" xml:space="preserve">
<value>末日派对之后</value>
</data>
<data name="tool_wp_lanternnight_cooldown" xml:space="preserve">
<value>灯笼之夜冷却时间</value>
</data>
<data name="tool_wp_lanternnight" xml:space="preserve">
<value>灯笼之夜</value>
</data>
<data name="tool_wp_lanternnight_genuine" xml:space="preserve">
<value>灯笼之夜正版</value>
</data>
<data name="tool_wp_lanternnight_manual" xml:space="preserve">
<value>灯笼之夜手册</value>
</data>
<data name="tool_wp_lanternnight_nextgenuine" xml:space="preserve">
<value>灯笼之夜接下来是真的</value>
</data>
</root>
36 changes: 22 additions & 14 deletions src/TEdit/Terraria/World.FileV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,13 @@ public static int SaveHeaderFlags(World world, BinaryWriter bw, int version, Tex
debugger?.WriteLine("\"AltarCount\": {0},", world.AltarCount);
bw.Write(world.HardMode);
debugger?.WriteLine("\"HardMode\": {0},", world.HardMode);

if (world.Version >= 257)
{
bw.Write(world.AfterPartyOfDoom);
debugger?.WriteLine("\"AfterPartyOfDoom\": {0},", world.AfterPartyOfDoom);
}

bw.Write(world.InvasionDelay);
debugger?.WriteLine("\"InvasionDelay\": {0},", world.InvasionDelay);
bw.Write(world.InvasionSize);
Expand Down Expand Up @@ -1268,14 +1275,14 @@ public static int SaveHeaderFlags(World world, BinaryWriter bw, int version, Tex

if (world.Version >= 207)
{
bw.Write(world.TempLanternNightCooldown);
debugger?.WriteLine("\"TempLanternNightCooldown\": {0},", world.TempLanternNightCooldown);
bw.Write(world.TempLanternNightGenuine);
debugger?.WriteLine("\"TempLanternNightGenuine\": {0},", world.TempLanternNightGenuine);
bw.Write(world.TempLanternNightManual);
debugger?.WriteLine("\"TempLanternNightManual\": {0},", world.TempLanternNightManual);
bw.Write(world.TempLanternNightNextNightIsGenuine);
debugger?.WriteLine("\"TempLanternNightNextNightIsGenuine\": {0},", world.TempLanternNightNextNightIsGenuine);
bw.Write(world.LanternNightCooldown);
debugger?.WriteLine("\"TempLanternNightCooldown\": {0},", world.LanternNightCooldown);
bw.Write(world.LanternNightGenuine);
debugger?.WriteLine("\"TempLanternNightGenuine\": {0},", world.LanternNightGenuine);
bw.Write(world.LanternNightManual);
debugger?.WriteLine("\"TempLanternNightManual\": {0},", world.LanternNightManual);
bw.Write(world.LanternNightNextNightIsGenuine);
debugger?.WriteLine("\"TempLanternNightNextNightIsGenuine\": {0},", world.LanternNightNextNightIsGenuine);
}

if (world.Version >= 211)
Expand Down Expand Up @@ -1686,7 +1693,7 @@ public static Tile DeserializeTileData(BinaryReader r, bool[] tileFrameImportant
tile.LiquidAmount = r.ReadByte();
tile.LiquidType = (LiquidType)liquidType;


if (version >= 269 && (header3 & 0b_1000_0000) == 0b_1000_0000)
{
tile.LiquidType = LiquidType.Shimmer;
Expand Down Expand Up @@ -2137,6 +2144,7 @@ public static void LoadHeaderFlags(BinaryReader r, World w, int expectedPosition
w.ShadowOrbCount = (int)r.ReadByte();
w.AltarCount = r.ReadInt32();
w.HardMode = r.ReadBoolean();
if (w.Version >= 257) { w.AfterPartyOfDoom = r.ReadBoolean(); }
w.InvasionDelay = r.ReadInt32();
w.InvasionSize = r.ReadInt32();
w.InvasionType = r.ReadInt32();
Expand Down Expand Up @@ -2309,10 +2317,10 @@ public static void LoadHeaderFlags(BinaryReader r, World w, int expectedPosition

if (w.Version >= 207)
{
w.TempLanternNightCooldown = r.ReadInt32();
w.TempLanternNightGenuine = r.ReadBoolean();
w.TempLanternNightManual = r.ReadBoolean();
w.TempLanternNightNextNightIsGenuine = r.ReadBoolean();
w.LanternNightCooldown = r.ReadInt32();
w.LanternNightGenuine = r.ReadBoolean();
w.LanternNightManual = r.ReadBoolean();
w.LanternNightNextNightIsGenuine = r.ReadBoolean();
}

// tree tops
Expand Down Expand Up @@ -2438,7 +2446,7 @@ public static bool LoadSectionHeader(BinaryReader r, out bool[] tileFrameImporta
sectionPointers = null;
int versionNumber = r.ReadInt32();

if (versionNumber >= 140)
if (versionNumber >= 140) // 135
{
// check for android

Expand Down
Loading

0 comments on commit 31023b7

Please sign in to comment.