Skip to content

Commit

Permalink
Merge pull request #16 from Infiziert90/PackedBoolFix
Browse files Browse the repository at this point in the history
Update Lumina deps to fix PackedBool display issue
  • Loading branch information
NotNite authored Jan 13, 2025
2 parents c4070c5 + d0a653d commit a09fa1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Alpha/Alpha.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="4.11.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>

<PackageReference Include="Lumina" Version="5.2.1"/>
<PackageReference Include="Lumina.Excel" Version="7.0.3"/>
<PackageReference Include="Lumina" Version="5.6.1"/>
<PackageReference Include="Lumina.Excel" Version="7.1.3" />

<PackageReference Include="Serilog.Extensions.Hosting" Version="8.0.0"/>
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0"/>
Expand Down
19 changes: 1 addition & 18 deletions Alpha/Services/Excel/AlphaSheet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,7 @@ public record AlphaSubrow(RawSubrow RawSubrow) : IAlphaRow {
public uint Row => this.RawSubrow.RowId;
public ushort? Subrow => this.RawSubrow.SubrowId;

// They forgot to implement ReadColumn lol
public object ReadColumn(uint columnIdx) {
var data = this.RawSubrow.Page.Sheet.Columns[(int) columnIdx];
return data.Type switch {
ExcelColumnDataType.String => this.RawSubrow.ReadString(data.Offset),
ExcelColumnDataType.Bool => this.RawSubrow.ReadBool(data.Offset),
ExcelColumnDataType.Int8 => this.RawSubrow.ReadInt8(data.Offset),
ExcelColumnDataType.UInt8 => this.RawSubrow.ReadUInt8(data.Offset),
ExcelColumnDataType.Int16 => this.RawSubrow.ReadInt16(data.Offset),
ExcelColumnDataType.UInt16 => this.RawSubrow.ReadUInt16(data.Offset),
ExcelColumnDataType.Int32 => this.RawSubrow.ReadInt32(data.Offset),
ExcelColumnDataType.UInt32 => this.RawSubrow.ReadUInt32(data.Offset),
ExcelColumnDataType.Float32 => this.RawSubrow.ReadFloat32(data.Offset),
ExcelColumnDataType.Int64 => this.RawSubrow.ReadInt64(data.Offset),
ExcelColumnDataType.UInt64 => this.RawSubrow.ReadUInt64(data.Offset),
>= ExcelColumnDataType.PackedBool0 and <= ExcelColumnDataType.PackedBool7 =>
this.RawSubrow.Page.ReadPackedBool(data.Offset, (byte) (data.Type - ExcelColumnDataType.PackedBool0)),
_ => throw new InvalidOperationException($"Unknown column type {data.Type}")
};
return this.RawSubrow.ReadColumn((int) columnIdx);
}
}

0 comments on commit a09fa1d

Please sign in to comment.