Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
turtle-insect committed May 21, 2023
1 parent b9d6c53 commit ba32cf7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ZeldaTOTK/Basic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public float Battery
set
{
if (value < 3000) value = 3000;
if (value > 24000) value = 24000;
if (value > 48000) value = 48000;
SaveData.Instance().WriteValue(0x34FC4, BitConverter.GetBytes(value));
}
}
Expand Down
12 changes: 8 additions & 4 deletions ZeldaTOTK/ViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ private void LoadFile(Object? obj)
Armors.Add(item);
}

for (uint index = 0; index < 400; index++)
uint count = SaveData.Instance().ReadNumber(0x477DC, 4);
for (uint index = 0; index < count; index++)
{
Item item = new Item(0x477E0 + index * 4, 0xAFC30 + index * 64);
if (item.Count == 0xFFFFFFFF) break;
Expand All @@ -64,7 +65,8 @@ private void LoadFile(Object? obj)
Materials.Add(item);
}

for (uint index = 0; index < 400; index++)
count = SaveData.Instance().ReadNumber(0x4E9BC, 4);
for (uint index = 0; index < count; index++)
{
Item item = new Item(0x4E9C0 + index * 4, 0x87CE0 + index * 64);
if (item.Count == 0xFFFFFFFF) break;
Expand All @@ -73,7 +75,8 @@ private void LoadFile(Object? obj)
Foods.Add(item);
}

for (uint index = 0; index < 400; index++)
count = SaveData.Instance().ReadNumber(0x46180, 4);
for (uint index = 0; index < count; index++)
{
Item item = new Item(0x46184 + index * 4, 0x9CBAC + index * 64);
if (item.Count == 0xFFFFFFFF) break;
Expand All @@ -82,7 +85,8 @@ private void LoadFile(Object? obj)
Capsules.Add(item);
}

for (uint index = 0; index < 400; index++)
count = SaveData.Instance().ReadNumber(0x4EBD0, 4);
for (uint index = 0; index < count; index++)
{
Item item = new Item(0x4EBD4 + index * 4, 0xB94C4 + index * 64);
if (String.IsNullOrWhiteSpace(item.Name) && item.Count == 0xFFFFFFFF) break;
Expand Down

0 comments on commit ba32cf7

Please sign in to comment.