Can boot into the UI
This commit is contained in:
@@ -19,7 +19,7 @@ public sealed unsafe class CopyCharacter : EventWrapperPtr<Character, Character,
|
||||
private readonly Task<Hook<Delegate>> _task;
|
||||
|
||||
public nint Address
|
||||
=> (nint)CharacterSetup.MemberFunctionPointers.CopyFromCharacter;
|
||||
=> (nint)CharacterSetupContainer.MemberFunctionPointers.CopyFromCharacter;
|
||||
|
||||
public void Enable()
|
||||
=> _task.Result.Enable();
|
||||
@@ -33,9 +33,9 @@ public sealed unsafe class CopyCharacter : EventWrapperPtr<Character, Character,
|
||||
public bool Finished
|
||||
=> _task.IsCompletedSuccessfully;
|
||||
|
||||
private delegate ulong Delegate(CharacterSetup* target, Character* source, uint unk);
|
||||
private delegate ulong Delegate(CharacterSetupContainer* target, Character* source, uint unk);
|
||||
|
||||
private ulong Detour(CharacterSetup* target, Character* source, uint unk)
|
||||
private ulong Detour(CharacterSetupContainer* target, Character* source, uint unk)
|
||||
{
|
||||
// TODO: update when CS updated.
|
||||
var character = ((Character**)target)[1];
|
||||
|
||||
@@ -20,7 +20,7 @@ public class CutsceneService : IService, IDisposable
|
||||
private readonly CharacterDestructor _characterDestructor;
|
||||
private readonly short[] _copiedCharacters = Enumerable.Repeat((short)-1, CutsceneSlots).ToArray();
|
||||
|
||||
public IEnumerable<KeyValuePair<int, Dalamud.Game.ClientState.Objects.Types.GameObject>> Actors
|
||||
public IEnumerable<KeyValuePair<int, Dalamud.Game.ClientState.Objects.Types.IGameObject>> Actors
|
||||
=> Enumerable.Range(CutsceneStartIdx, CutsceneSlots)
|
||||
.Where(i => _objects[i] != null)
|
||||
.Select(i => KeyValuePair.Create(i, this[i] ?? _objects[i]!));
|
||||
@@ -43,7 +43,7 @@ public class CutsceneService : IService, IDisposable
|
||||
/// Does not check for valid input index.
|
||||
/// Returns null if no connected actor is set or the actor does not exist anymore.
|
||||
/// </summary>
|
||||
public Dalamud.Game.ClientState.Objects.Types.GameObject? this[int idx]
|
||||
public Dalamud.Game.ClientState.Objects.Types.IGameObject? this[int idx]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -101,7 +101,7 @@ public class CutsceneService : IService, IDisposable
|
||||
// A hack to deal with GPose actors leaving and thus losing the link, we just set the home world instead.
|
||||
// I do not think this breaks anything?
|
||||
var address = (GameObject*)_objects.GetObjectAddress(i + CutsceneStartIdx);
|
||||
if (address != null && address->GetObjectKind() is (byte)ObjectKind.Pc)
|
||||
if (address != null && address->GetObjectKind() is ObjectKind.Pc)
|
||||
((Character*)address)->HomeWorld = character->HomeWorld;
|
||||
|
||||
_copiedCharacters[i] = -1;
|
||||
|
||||
@@ -29,7 +29,7 @@ public unsafe class GameEventManager : IDisposable
|
||||
interop.InitializeFromAttributes(this);
|
||||
|
||||
_copyCharacterHook =
|
||||
interop.HookFromAddress<CopyCharacterDelegate>((nint)CharacterSetup.MemberFunctionPointers.CopyFromCharacter, CopyCharacterDetour);
|
||||
interop.HookFromAddress<CopyCharacterDelegate>((nint)CharacterSetupContainer.MemberFunctionPointers.CopyFromCharacter, CopyCharacterDetour);
|
||||
_characterBaseCreateHook =
|
||||
interop.HookFromAddress<CharacterBaseCreateDelegate>((nint)CharacterBase.MemberFunctionPointers.Create, CharacterBaseCreateDetour);
|
||||
_characterBaseDestructorHook =
|
||||
@@ -83,11 +83,11 @@ public unsafe class GameEventManager : IDisposable
|
||||
|
||||
#region Copy Character
|
||||
|
||||
private delegate ulong CopyCharacterDelegate(CharacterSetup* target, GameObject* source, uint unk);
|
||||
private delegate ulong CopyCharacterDelegate(CharacterSetupContainer* target, GameObject* source, uint unk);
|
||||
|
||||
private readonly Hook<CopyCharacterDelegate> _copyCharacterHook;
|
||||
|
||||
private ulong CopyCharacterDetour(CharacterSetup* target, GameObject* source, uint unk)
|
||||
private ulong CopyCharacterDetour(CharacterSetupContainer* target, GameObject* source, uint unk)
|
||||
{
|
||||
// TODO: update when CS updated.
|
||||
var character = ((Character**)target)[1];
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ObjectManager(
|
||||
IFramework framework,
|
||||
IClientState clientState,
|
||||
IObjectTable objects,
|
||||
DalamudPluginInterface pi,
|
||||
IDalamudPluginInterface pi,
|
||||
Logger log,
|
||||
ActorManager actors,
|
||||
ITargetManager targets)
|
||||
@@ -218,13 +218,16 @@ public class ObjectManager(
|
||||
}
|
||||
|
||||
//c+ custom
|
||||
[Obsolete("To be updated for DT")]
|
||||
private unsafe bool AddLobbyCharacter()
|
||||
{
|
||||
return false;
|
||||
/*
|
||||
var agent = AgentLobby.Instance();
|
||||
if (agent == null || agent->LobbyData.CharaSelectEntries.Size() == 0)
|
||||
if (agent == null || agent->LobbyData.CharaSelectEntries.LongCount() == 0)
|
||||
return false;
|
||||
|
||||
var chara = agent->LobbyData.CharaSelectEntries.Get((ulong)agent->SelectedCharacterIndex).Value;
|
||||
var chara = agent->LobbyData.CharaSelectEntries.Get((ulong)agent->SelectedCharacterContentId).Value;
|
||||
if (chara == null)
|
||||
return false;
|
||||
|
||||
@@ -235,6 +238,6 @@ public class ObjectManager(
|
||||
|
||||
HandleIdentifier(actors.CreatePlayer(new ByteString(chara->Name), chara->HomeWorldId), actor);
|
||||
|
||||
return true;
|
||||
return true;*/
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user