Skip to content

Commit cb928a9

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents b13d259 + 1a2300a commit cb928a9

28 files changed

Lines changed: 1816 additions & 510 deletions

FFXIVClientStructs/FFXIV/Client/Game/Character/ActionEffectHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ public partial struct Header {
6868
[FieldOffset(0x21)] public byte NumTargets;
6969

7070
/// <remarks> If this flag is set, the message will be printed to the action log when processing the action. </remarks>
71-
public partial bool ShowInLog { get; set; }
71+
public partial bool ShowInLog { readonly get; set; }
7272

7373
/// <remarks> If this flag is set, the animation lock is applied to caster even though <c>SourceSequence == 0</c>. </remarks>
74-
public partial bool ForceAnimationLock { get; set; }
74+
public partial bool ForceAnimationLock { readonly get; set; }
7575
}
7676

7777
/// <summary>

FFXIVClientStructs/FFXIV/Client/Game/Character/Character.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using FFXIVClientStructs.FFXIV.Client.Game.Control;
2+
using FFXIVClientStructs.FFXIV.Client.Game.Control.MoveControl;
23
using FFXIVClientStructs.FFXIV.Client.Game.Object;
34

45
namespace FFXIVClientStructs.FFXIV.Client.Game.Character;
@@ -11,10 +12,7 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.Character;
1112
[StructLayout(LayoutKind.Explicit, Size = 0x2370)]
1213
[VirtualTable("48 8D 05 ?? ?? ?? ?? 48 89 07 48 8D 8F ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 87 ?? ?? ?? ?? E8 ?? ?? ?? ?? 48 8D 8F ?? ?? ?? ?? 33 ED 48 8D 05 ?? ?? ?? ??", 3, 87)]
1314
public unsafe partial struct Character {
14-
[FieldOffset(0x600)] public MovementStateOptions MovementState;
15-
[BitField<bool>(nameof(IsSwimming), 5)] // found in Client::Game::Event::EventSceneModuleUsualImpl.IsSwimming
16-
[FieldOffset(0x628)] public byte Flags628;
17-
15+
[FieldOffset(0x1F0)] public MoveController MoveController;
1816
[FieldOffset(0x630)] public EmoteController EmoteController;
1917
[FieldOffset(0x670)] public MountContainer Mount;
2018
[FieldOffset(0x6D8)] public CompanionContainer CompanionData;
@@ -91,6 +89,15 @@ public unsafe partial struct Character {
9189
[FieldOffset(0x236A)] public byte SoundVolumeCategoryOverride;
9290
[FieldOffset(0x236B)] private byte SoundFlags; // 0x40 = SoundVolumeCategory determined
9391

92+
[FieldOffset(0x600), Obsolete("Moved to MoveController.MovementState")] public MovementStateOptions MovementState;
93+
[FieldOffset(0x628), Obsolete] public byte Flags628;
94+
95+
[Obsolete("Moved to MoveController.IsSwimming")]
96+
public bool IsSwimming {
97+
get => MoveController.IsSwimming;
98+
set => MoveController.IsSwimming = value;
99+
}
100+
94101
public bool IsWeaponDrawn => Timeline.IsWeaponDrawn;
95102
public bool IsCasting => VirtualTable != null && GetCastInfo() is var info && info != null && info->IsCasting;
96103

@@ -179,6 +186,7 @@ public unsafe partial struct Character {
179186
public partial ForayInfo* GetForayInfo();
180187
}
181188

189+
// TODO: move to FFXIVClientStructs.FFXIV.Client.Game.Control.MoveControl
182190
public enum MovementStateOptions : byte {
183191
Normal = 0,
184192
Flying = 1,

FFXIVClientStructs/FFXIV/Client/Game/Character/DrawDataContainer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ public enum EquipmentSlot : uint {
9191
LFinger = 9,
9292
}
9393

94+
// TODO: do we rename MainHand to Main and OffHand to Sub?
9495
public enum WeaponSlot : uint {
95-
MainHand = 0,
96-
OffHand = 1,
97-
Unk = 2, // TODO: CraftTool?
96+
MainHand = 0, // WEAPON_SLOT_MAIN
97+
OffHand = 1, // WEAPON_SLOT_SUB
98+
System = 2, // WEAPON_SLOT_SYSTEM - used for crafter's tool
9899
}
99100
}
100101

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using FFXIVClientStructs.FFXIV.Client.Game.Character;
2+
3+
namespace FFXIVClientStructs.FFXIV.Client.Game.Control.MoveControl;
4+
5+
// Client::Game::Control::MoveControl::MoveController
6+
[GenerateInterop]
7+
[StructLayout(LayoutKind.Explicit, Size = 0x440)]
8+
public unsafe partial struct MoveController {
9+
[FieldOffset(0x3E0)] public BattleChara* OwnerObject;
10+
11+
[FieldOffset(0x410)] public MovementStateOptions MovementState;
12+
[BitField<bool>(nameof(IsSwimming), 5)] // found in Client::Game::Event::EventSceneModuleUsualImpl.IsSwimming
13+
[FieldOffset(0x438)] private byte Flags438;
14+
}

FFXIVClientStructs/FFXIV/Client/Game/Event/Director.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public unsafe partial struct Director {
1515
[FieldOffset(0x2E0)] public uint ContentId;
1616
[FieldOffset(0x2E4)] public byte ContentFlags; // 1 = Tourism (Explorer Mode)
1717
[FieldOffset(0x2E8)] public byte Sequence;
18-
[FieldOffset(0x2EA), FixedSizeArray] internal FixedSizeArray10<byte> _unionData; // I8A-I8J, UI8A-UI8J, Branch etc.
18+
[FieldOffset(0x2E9)] public byte Unknown2E9; // Set in EventFramework.SetDirectorData
19+
[FieldOffset(0x2EA), FixedSizeArray] internal FixedSizeArray12<byte> _unionData; // I8A-I8J, UI8A-UI8J, Branch etc.
1920
[FieldOffset(0x2F8)] public Utf8String Title;
2021
[FieldOffset(0x360)] public Utf8String Objective; // name based on the Lua function "SetDirectorObjective"
2122
[FieldOffset(0x3C8)] public Utf8String ReliefText;

FFXIVClientStructs/FFXIV/Client/Game/Event/EventFramework.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public unsafe partial struct EventFramework {
4343
[FieldOffset(0x4478)] public StdList<QueuedActionTimelineCallback> QueuedActionTimelineCallbacks;
4444

4545
[FieldOffset(0x45D8)] public DailyQuestMap DailyQuests;
46+
[FieldOffset(0x45E8)] public Utf8String DailySelectTitle; // Addon#102442 for SelectIconString
47+
[FieldOffset(0x4650)] public Utf8String DailySelectSubTitle; // Addon#102443 for SelectIconString
48+
[FieldOffset(0x46B8)] public Utf8String DailySelectAllowance; // formatted Addon#102444 for SelectIconString
4649

4750
[FieldOffset(0x476A), FixedSizeArray] internal FixedSizeArray8<Festival> _festivals; // copied from PlayerState, used by GPose (maybe more) to check if Fan Festival frames/stamps should be displayed
4851

@@ -118,6 +121,19 @@ public void MaterializeItem(InventoryItem* itemSlot, MaterializeEntryId entryId)
118121
[MemberFunction("40 53 57 48 83 EC ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 44 24 ?? 41 8B F9")]
119122
public partial void ProcessDirectorUpdate(EventId eventId, uint category, uint arg1, uint arg2, uint arg3, uint arg4, uint arg5, uint arg6);
120123

124+
/// <summary>
125+
/// Finds one or more <see cref="Director"/>(s) in <see cref="DirectorModule.DirectorList"/>
126+
/// with a matching <paramref name="eventId"/>, and sets the data to the values provided
127+
/// before calling <see cref="Director"/>.SetSequence and <see cref="Director"/>.Synchronize.
128+
/// </summary>
129+
/// <param name="eventId"><see cref="EventId"/> to look for in <see cref="DirectorModule.DirectorList"/>.</param>
130+
/// <param name="sequence">Value to set in <see cref="Director.Sequence"/>.</param>
131+
/// <param name="unknown">Value to set in <see cref="Director.Unknown2E9"/></param>
132+
/// <param name="unionDataBuffer">Buffer that will be copied to <see cref="Director.UnionData"/>.</param>
133+
/// <param name="length">The number of bytes that will be copied from <paramref name="unionDataBuffer"/>. The game always provides a value of 12, but it supports other values.</param>
134+
[MemberFunction("89 54 24 10 48 89 4C 24 ?? 53 56 57 41 55 41 57 48 83 EC 30 48 8B 99")]
135+
public partial void SetDirectorData(EventId eventId, byte sequence, byte unknown, byte* unionDataBuffer, ulong length);
136+
121137
private T* GetInstanceContentDirector<T>(InstanceContentType instanceContentType) where T : unmanaged {
122138
var instanceDirector = GetInstanceContentDirector();
123139
if (instanceDirector == null || instanceDirector->InstanceContentType != instanceContentType)

FFXIVClientStructs/FFXIV/Client/Game/Event/EventState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace FFXIVClientStructs.FFXIV.Client.Game.Event;
77
public struct EventState {
88
[FieldOffset(0x08)] public EventId EventId;
99
[FieldOffset(0x10)] public GameObjectId ObjectId;
10-
[FieldOffset(0x18)] private byte Unk18;
10+
[FieldOffset(0x18)] public byte CurrentEvent;
1111
[FieldOffset(0x1C)] private int Unk1C;
1212
[FieldOffset(0x20)] private byte Unk20;
1313
[FieldOffset(0x24)] public int OccupiedConditionId;

FFXIVClientStructs/FFXIV/Client/Game/Object/GameObject.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public partial struct ObjectType : IEquatable<ObjectType>, IComparable<ObjectTyp
294294
[FieldOffset(0x00)] public uint Value;
295295

296296
/// <remarks> Only valid if <see cref="GameObject.ObjectKind"/> is <see cref="ObjectKind.BattleNpc"/> and <see cref="GameObject.BattleNpcSubKind"/> is <see cref="BattleNpcSubKind.Pet"/>. </remarks>
297-
public partial byte PetMirageId { get; set; }
297+
public partial byte PetMirageId { readonly get; set; }
298298

299299
public static implicit operator uint(ObjectType ot) => ot.Value;
300300
public static unsafe implicit operator ObjectType(uint ot) => *(ObjectType*)&ot;

FFXIVClientStructs/FFXIV/Client/Game/WKS/WKSManager.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public partial struct WKSJobState {
115115

116116
[FieldOffset(0x110), FixedSizeArray] internal FixedSizeArray3<WKSMasterMissionState> _masterMissions;
117117

118+
[FieldOffset(0x140)] public ushort BonusMasterMissionUnitId;
119+
118120
[FieldOffset(0x108), Obsolete("Wrongly documented field as this is most likely a timestamp", true)] public uint CriticalMissionData;
119121
}
120122

@@ -147,6 +149,8 @@ public partial struct WKSState {
147149
[FieldOffset(0xE46), Obsolete("Use CurrentMission.CollectedTotal")] public ushort CollectedTotal;
148150
[FieldOffset(0xE48), Obsolete("Use CurrentMission.CollectedIndividual")] public byte CollectedIndividual;
149151

152+
[FieldOffset(0xE70)] public byte ConsecutiveGoldCount;
153+
150154
[FieldOffset(0xE74)] public uint FishingBait;
151155

152156
[FieldOffset(0xE81), FixedSizeArray(isBitArray: true, bitCount: 1704)] internal FixedSizeArray213<byte> _missionCompletionFlags;

FFXIVClientStructs/FFXIV/Client/Game/WKS/WKSMissionModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public unsafe partial struct MissionState {
2020
/// <remarks> RowId of WKSMissionUnit sheet. </remarks>
2121
[FieldOffset(0x00)] public ushort MissionUnitRowId;
2222

23-
[FieldOffset(0x0C)] public ushort Score;
23+
[FieldOffset(0x0C)] public ushort Score; // TODO: uint
2424

2525
[FieldOffset(0x10)] public MissionRank Rank;
2626
[FieldOffset(0x14)] private byte Unk14; // bool? status?

0 commit comments

Comments
 (0)