mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-31 21:03:48 +01:00
Change Redrawing to be simpler and not use a queue or settings.
This commit is contained in:
parent
7540694050
commit
b08bf388cc
7 changed files with 182 additions and 428 deletions
|
|
@ -63,107 +63,6 @@ public partial class SettingsInterface
|
|||
PrintValue( "Mod Manager Valid", manager.Valid.ToString() );
|
||||
//PrintValue( "Resource Loader Enabled", _penumbra.ResourceLoader.IsEnabled.ToString() );
|
||||
}
|
||||
|
||||
private unsafe void DrawDebugTabRedraw()
|
||||
{
|
||||
if( !ImGui.CollapsingHeader( "Redrawing##Debug" ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var queue = ( Queue< (int, string, RedrawType) >? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_objectIds", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader )
|
||||
?? new Queue< (int, string, RedrawType) >();
|
||||
|
||||
var currentFrame = ( int? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_currentFrame", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var changedSettings = ( bool? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_changedSettings", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var currentObjectId = ( uint? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_currentObjectId", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var currentObjectName = ( string? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_currentObjectName", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var currentObjectStartState = ( DrawState? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_currentObjectStartState", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var currentRedrawType = ( RedrawType? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_currentRedrawType", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var (currentObject, currentObjectIdx) = ( (GameObject?, int) )_penumbra.ObjectReloader.GetType()
|
||||
.GetMethod( "FindCurrentObject", BindingFlags.NonPublic | BindingFlags.Instance )?
|
||||
.Invoke( _penumbra.ObjectReloader, Array.Empty< object >() )!;
|
||||
|
||||
var currentRender = currentObject != null
|
||||
? ObjectReloader.ActorDrawState( currentObject )
|
||||
: null;
|
||||
|
||||
var waitFrames = ( int? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_waitFrames", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var wasTarget = ( bool? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_wasTarget", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
var gPose = ( bool? )_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_inGPose", BindingFlags.Instance | BindingFlags.NonPublic )
|
||||
?.GetValue( _penumbra.ObjectReloader );
|
||||
|
||||
using var raii = new ImGuiRaii.EndStack();
|
||||
if( ImGui.BeginTable( "##RedrawData", 2, ImGuiTableFlags.SizingFixedFit,
|
||||
new Vector2( -1, ImGui.GetTextLineHeightWithSpacing() * 7 ) ) )
|
||||
{
|
||||
raii.Push( ImGui.EndTable );
|
||||
PrintValue( "Current Wait Frame", waitFrames?.ToString() ?? "null" );
|
||||
PrintValue( "Current Frame", currentFrame?.ToString() ?? "null" );
|
||||
PrintValue( "Currently in GPose", gPose?.ToString() ?? "null" );
|
||||
PrintValue( "Current Changed Settings", changedSettings?.ToString() ?? "null" );
|
||||
PrintValue( "Current Object Id", currentObjectId?.ToString( "X8" ) ?? "null" );
|
||||
PrintValue( "Current Object Name", currentObjectName ?? "null" );
|
||||
PrintValue( "Current Object Start State", ( ( int? )currentObjectStartState )?.ToString( "X8" ) ?? "null" );
|
||||
PrintValue( "Current Object Was Target", wasTarget?.ToString() ?? "null" );
|
||||
PrintValue( "Current Object Redraw", currentRedrawType?.ToString() ?? "null" );
|
||||
PrintValue( "Current Object Address", currentObject?.Address.ToString( "X16" ) ?? "null" );
|
||||
PrintValue( "Current Object Index", currentObjectIdx >= 0 ? currentObjectIdx.ToString() : "null" );
|
||||
PrintValue( "Current Object Render Flags", ( ( int? )currentRender )?.ToString( "X8" ) ?? "null" );
|
||||
}
|
||||
|
||||
if( queue.Any()
|
||||
&& ImGui.BeginTable( "##RedrawTable", 3, ImGuiTableFlags.SizingFixedFit | ImGuiTableFlags.ScrollX,
|
||||
new Vector2( -1, ImGui.GetTextLineHeightWithSpacing() * queue.Count ) ) )
|
||||
{
|
||||
raii.Push( ImGui.EndTable );
|
||||
foreach( var (objectId, objectName, redraw) in queue )
|
||||
{
|
||||
ImGui.TableNextRow();
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.Text( objectName );
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.Text( $"0x{objectId:X8}" );
|
||||
ImGui.TableNextColumn();
|
||||
ImGui.Text( redraw.ToString() );
|
||||
}
|
||||
}
|
||||
|
||||
if( queue.Any() && ImGui.Button( "Clear" ) )
|
||||
{
|
||||
queue.Clear();
|
||||
_penumbra.ObjectReloader.GetType()
|
||||
.GetField( "_currentFrame", BindingFlags.Instance | BindingFlags.NonPublic )?.SetValue( _penumbra.ObjectReloader, 0 );
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawDebugTabIpc()
|
||||
{
|
||||
if( !ImGui.CollapsingHeader( "IPC##Debug" ) )
|
||||
|
|
@ -436,8 +335,6 @@ public partial class SettingsInterface
|
|||
ImGui.NewLine();
|
||||
DrawDebugResidentResources();
|
||||
ImGui.NewLine();
|
||||
DrawDebugTabRedraw();
|
||||
ImGui.NewLine();
|
||||
DrawDebugTabIpc();
|
||||
ImGui.NewLine();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue