-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for facewear changing (#64)
* Add support for facewear changing * Cleanup * Facewear icon
- Loading branch information
Showing
13 changed files
with
251 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using FFXIVClientStructs.FFXIV.Client.Game.Character; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Brio.Game.Actor.Interop; | ||
|
||
[StructLayout(LayoutKind.Explicit)] | ||
internal unsafe struct BrioDrawData | ||
{ | ||
[FieldOffset(0x0)] | ||
public DrawDataContainer DawData; | ||
|
||
[FieldOffset(0x1D0)] | ||
public byte Facewear; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Brio.Resources; | ||
using Lumina.Excel.GeneratedSheets2; | ||
using OneOf; | ||
using OneOf.Types; | ||
|
||
namespace Brio.Game.Types; | ||
|
||
[GenerateOneOf] | ||
internal partial class FacewearUnion : OneOfBase<Glasses, None> | ||
{ | ||
public static implicit operator FacewearUnion(FacewearId facewearId) | ||
{ | ||
if(facewearId.Id != 0 && GameDataProvider.Instance.Glasses.TryGetValue(facewearId.Id, out var glasses)) | ||
return new FacewearUnion(glasses); | ||
|
||
return new None(); | ||
} | ||
} | ||
|
||
internal record struct FacewearId(byte Id) | ||
{ | ||
public static FacewearId None { get; } = new(0); | ||
|
||
public static implicit operator FacewearId(DyeUnion dyeUnion) => dyeUnion.Match( | ||
dyeRow => new FacewearId((byte)dyeRow.RowId), | ||
none => None | ||
); | ||
|
||
public static implicit operator FacewearId(int dye) => new((byte)dye); | ||
public static implicit operator FacewearId(byte dye) => new(dye); | ||
public static implicit operator byte(FacewearId id) => id.Id; | ||
public static implicit operator int(FacewearId id) => id.Id; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.