Skip to content

Commit

Permalink
Extended inventory view
Browse files Browse the repository at this point in the history
  • Loading branch information
Zachary Canann committed Jan 16, 2023
1 parent 598d39e commit dc1613a
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 18 deletions.
5 changes: 2 additions & 3 deletions GES/Source/CraftListViewer/CraftEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,16 +410,15 @@ public Boolean IsChest(Int32 index)
{
return this.HasProperties
&& !this.IsWeapon(index)
&& ((this.Properties[index] & 0b0100) != 0 // Higher priority flag (4)
|| (((this.Properties[index] & 0b1000) != 0) && (this.Properties[index] & 0b0010) == 0)); // Lower priority flag (8), contingent on no tribal flag (2)
&& (this.Properties[index] & 0b0100) != 0;
}

public Boolean IsTribal(Int32 index)
{
return this.HasProperties
&& !this.IsWeapon(index)
&& !this.IsChest(index)
&& (this.Properties[index] & 0b0010) != 0;
&& ((this.Properties[index] & 0b0010) != 0 || (this.Properties[index] & 0b1000) != 0);
}

public Boolean IsAccessory(Int32 index)
Expand Down
12 changes: 9 additions & 3 deletions GES/Source/ItemCatalogViewer/ItemCatalogData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ protected void RaisePropertyChanged(String propertyName)
}
}

[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x04B5 * 72)]
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0xFFFF * 72)] // Intended is 0x4B5
public class ItemCatalogDataSerializable
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x04B5 * 72)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xFFFF * 72)] // Intended is 0x4B5
public Byte[] rawItemCatalogSlots;
}

Expand Down Expand Up @@ -234,11 +234,17 @@ public void Refresh(UInt64 address, UInt64 rawAddress, Byte[] bytes)
this.rawItems[index].YukeCraftedItem = BinaryPrimitives.ReverseEndianness(BitConverter.ToUInt16(bytes, index * StructSize + 60));
this.rawItems[index].SelkieCraftedItem = BinaryPrimitives.ReverseEndianness(BitConverter.ToUInt16(bytes, index * StructSize + 62));

/*
if (this.rawItems[index].LiltyCraftedItem == 557)
{
int bp = 5;
}*/

// EXTERNAL
this.rawItems[index].Index = (UInt16)index;
this.rawItems[index].Address = address + (UInt64)(index * StructSize);
this.rawItems[index].RawAddress = rawAddress + (UInt64)(index * StructSize);
this.rawItems[index].Refresh();
// this.rawItems[index].Refresh();

// DERIVATIE
Int16 bonusValue = this.rawItems[index].BonusValue;
Expand Down
1 change: 0 additions & 1 deletion GES/Source/MonsterTableViewer/MonsterTableData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace GES.Source.MonsterTableViewer
{
using GES.Engine.Common.DataStructures;
using GES.Source.EquipmentListViewer;
using System;
using System.Buffers.Binary;
using System.ComponentModel;
Expand Down
1 change: 0 additions & 1 deletion GES/Source/MonsterTableViewer/MonsterTableDataView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
namespace GES.Source.MonsterTableViewer
{
using GES.Engine.Common.DataStructures;
using GES.Source.Mvvm.Converters;
using System;
using System.ComponentModel;

Expand Down
3 changes: 0 additions & 3 deletions GES/Source/MonsterTableViewer/MonsterTableViewerViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
namespace GES.Source.MonsterTableViewer
{
using GES.Engine.Common;
using GES.Engine.Common.DataStructures;
using GES.Engine.Common.Logging;
using GES.Engine.Memory;
using GES.Source;
using GES.Source.CraftListViewer;
using GES.Source.Docking;
using GES.Source.EquipmentListViewer;
using GES.Source.Main;
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
Expand Down
19 changes: 18 additions & 1 deletion GES/Source/Mvvm/Converters/FFCC/AddressToNotesConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ private string GetNotes(UInt32 address)
{
return (isEn ? "Artifact Slot " : "アーティファクトスロット ") + (offset - 64).ToString() + this.GetSlotSuffix(inventoryAddress);
}
else if (offset >= 160 && offset <= 163)
{
UInt16 commandListOffset = (UInt16)(4 - (163 - offset));
return (isEn ? "Treasure slot " : "宝スロット ") + commandListOffset.ToString() + this.GetSlotSuffix(inventoryAddress);
}
else if (offset == 163)
{
return this.Constant(isEn, 0xFFFF) + this.GetSlotSuffix(inventoryAddress);
Expand Down Expand Up @@ -479,9 +484,21 @@ private string GetNotes(UInt32 address)
{
return (isEn ? "Hitbox 2 (Big Chungus Glitch)" : "ヒットボックス 2") + this.GetSlotSuffix(inventoryAddress);
}
else if (offset == 1555)
{
return (isEn ? "Equipped Weapon" : "装備武器") + this.GetSlotSuffix(inventoryAddress);
}
else if (offset == 1556)
{
return (isEn ? "Equipped Armor" : "装備された装甲") + this.GetSlotSuffix(inventoryAddress);
}
else if (offset == 1557)
{
return (isEn ? "Equipped Tribal" : "装備された部族") + this.GetSlotSuffix(inventoryAddress);
}
else if (offset == 1558)
{
return this.Constant(isEn, 0xFFFF) + this.GetSlotSuffix(inventoryAddress);
return (isEn ? "Equipped Accessory" : "装備アクセサリー") + this.GetSlotSuffix(inventoryAddress);
}
else if (offset == 1559)
{
Expand Down
12 changes: 6 additions & 6 deletions GES/Source/Mvvm/Converters/FFCC/CraftSlotIconConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (CraftEntry.IsLiltyWeapon)
{
return Images.Icon_WeaponClavat;
return Images.Icon_WeaponLilty;
}
else if (CraftEntry.IsLiltyChest)
{
return Images.Icon_Chest;
}
else if (CraftEntry.IsLiltyTribal)
{
return Images.Icon_TribalClavat;
return Images.Icon_TribalLilty;
}
else if (CraftEntry.IsLiltyAccessory)
{
Expand All @@ -58,15 +58,15 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (CraftEntry.IsYukeWeapon)
{
return Images.Icon_WeaponClavat;
return Images.Icon_WeaponYuke;
}
else if (CraftEntry.IsYukeChest)
{
return Images.Icon_Chest;
}
else if (CraftEntry.IsYukeTribal)
{
return Images.Icon_TribalClavat;
return Images.Icon_TribalYuke;
}
else if (CraftEntry.IsYukeAccessory)
{
Expand All @@ -77,15 +77,15 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
{
if (CraftEntry.IsSelkieWeapon)
{
return Images.Icon_WeaponClavat;
return Images.Icon_WeaponSelkie;
}
else if (CraftEntry.IsSelkieChest)
{
return Images.Icon_Chest;
}
else if (CraftEntry.IsSelkieTribal)
{
return Images.Icon_TribalClavat;
return Images.Icon_TribalSelkie;
}
else if (CraftEntry.IsSelkieAccessory)
{
Expand Down

0 comments on commit dc1613a

Please sign in to comment.