mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-29 20:03:41 +01:00
Avoid re-creating title version string every frame (#2117)
* Avoid re-creating title version string every frame * Marked title version string that it has been changed by Dalamud by appending a newline payload with a string expression embedded within, which the game will ignore (effectively `<br(!Dalamud!)>`.) * Added `PluginManager.LoadedPluginCount` which will count the number of loaded plugin without making a copy of the plugin list. * Made TitleScreenMenuWindow.OnVersionStringDraw` update the title version text addon only if number of loaded plugin changes or the text is missing the custom suffix from the first point. * Use OriginalTextPointer to determine if SetText(ROS) has been called
This commit is contained in:
parent
4c9b2a1577
commit
db4b6cea2c
2 changed files with 48 additions and 16 deletions
|
|
@ -162,6 +162,27 @@ internal class PluginManager : IInternalDisposableService
|
|||
/// </summary>
|
||||
public static int DalamudApiLevel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of loaded plugins.
|
||||
/// </summary>
|
||||
public int LoadedPluginCount
|
||||
{
|
||||
get
|
||||
{
|
||||
var res = 0;
|
||||
lock (this.pluginListLock)
|
||||
{
|
||||
foreach (var p in this.installedPluginsList)
|
||||
{
|
||||
if (p.State == PluginState.Loaded)
|
||||
res++;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a copy of the list of all loaded plugins.
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue