mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 10:17:22 +01:00
Include a number of frames to wait after zone changes before redrawing, configurable in advanced settings.
This commit is contained in:
parent
12ee42df8e
commit
7793b9beec
4 changed files with 42 additions and 4 deletions
|
|
@ -22,6 +22,7 @@ namespace Penumbra
|
|||
|
||||
public bool EnableHttpApi { get; set; }
|
||||
public bool EnableActorWatch { get; set; } = false;
|
||||
public int WaitFrames { get; set; } = 30;
|
||||
|
||||
public string ModDirectory { get; set; } = string.Empty;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ namespace Penumbra.Interop
|
|||
private readonly ModManager _mods;
|
||||
private readonly Queue< (int actorId, string name, RedrawType s) > _actorIds = new();
|
||||
|
||||
internal int DefaultWaitFrames;
|
||||
|
||||
private int _waitFrames = 0;
|
||||
private int _currentFrame = 0;
|
||||
private bool _changedSettings = false;
|
||||
private int _currentActorId = -1;
|
||||
|
|
@ -46,10 +49,11 @@ namespace Penumbra.Interop
|
|||
public static IntPtr RenderPtr( Actor actor )
|
||||
=> actor.Address + RenderModeOffset;
|
||||
|
||||
public ActorRefresher( DalamudPluginInterface pi, ModManager mods )
|
||||
public ActorRefresher( DalamudPluginInterface pi, ModManager mods, int defaultWaitFrames )
|
||||
{
|
||||
_pi = pi;
|
||||
_mods = mods;
|
||||
DefaultWaitFrames = defaultWaitFrames;
|
||||
}
|
||||
|
||||
private void ChangeSettings()
|
||||
|
|
@ -251,6 +255,13 @@ namespace Penumbra.Interop
|
|||
{
|
||||
if( _pi.ClientState.Condition[ ConditionFlag.BetweenAreas51 ] || _pi.ClientState.Condition[ ConditionFlag.BetweenAreas ] )
|
||||
{
|
||||
_waitFrames = DefaultWaitFrames;
|
||||
return;
|
||||
}
|
||||
|
||||
if( _waitFrames > 0 )
|
||||
{
|
||||
--_waitFrames;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ namespace Penumbra
|
|||
|
||||
modManager.DiscoverMods();
|
||||
|
||||
ActorRefresher = new ActorRefresher( PluginInterface, modManager );
|
||||
ActorRefresher = new ActorRefresher( PluginInterface, modManager, Configuration.WaitFrames );
|
||||
|
||||
ResourceLoader = new ResourceLoader( this );
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ namespace Penumbra.UI
|
|||
private const string LabelOpenFolder = "Open Mods Folder";
|
||||
private const string LabelEnabled = "Enable Mods";
|
||||
private const string LabelEnabledPlayerWatch = "Enable automatic Character Redraws";
|
||||
private const string LabelWaitFrames = "Wait Frames";
|
||||
private const string LabelScaleModSelector = "Scale Mod Selector With Window Size";
|
||||
private const string LabelShowAdvanced = "Show Advanced Settings";
|
||||
private const string LabelLogLoadedFiles = "Log all loaded files";
|
||||
|
|
@ -174,6 +175,31 @@ namespace Penumbra.UI
|
|||
"If this setting is enabled, penumbra will keep tabs on characters that have a corresponding collection setup in the Collections tab.\n"
|
||||
+ "Penumbra will try to automatically redraw those characters using their collection when they first appear in an instance, or when they change their current equip." );
|
||||
}
|
||||
|
||||
if( _config.EnableActorWatch && _config.ShowAdvanced )
|
||||
{
|
||||
var waitFrames = _config.WaitFrames;
|
||||
ImGui.SameLine();
|
||||
ImGui.SetNextItemWidth( 50 );
|
||||
if( ImGui.InputInt( LabelWaitFrames, ref waitFrames, 0, 0 )
|
||||
&& waitFrames != _config.WaitFrames
|
||||
&& waitFrames > 0
|
||||
&& waitFrames < 3000 )
|
||||
{
|
||||
_base._plugin.ActorRefresher.DefaultWaitFrames = waitFrames;
|
||||
_config.WaitFrames = waitFrames;
|
||||
_configChanged = true;
|
||||
}
|
||||
|
||||
if( ImGui.IsItemHovered() )
|
||||
{
|
||||
ImGui.SetTooltip(
|
||||
"The number of frames penumbra waits after some events (like zone changes) until it starts trying to redraw actors again, in a range of [1, 3001].\n"
|
||||
+ "Keep this as low as possible while producing stable results." );
|
||||
}
|
||||
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawReloadResourceButton()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue