From f99bfae4bb586a2f1425a8c4afd7bf2ca71d3795 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Sat, 2 Jul 2022 16:37:44 +0200 Subject: [PATCH] Use temporary mechanism to add main menu button. --- Penumbra/UI/LaunchButton.cs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Penumbra/UI/LaunchButton.cs b/Penumbra/UI/LaunchButton.cs index 84d89e3e..b25e4646 100644 --- a/Penumbra/UI/LaunchButton.cs +++ b/Penumbra/UI/LaunchButton.cs @@ -18,15 +18,20 @@ public class LaunchButton : IDisposable _configWindow = ui; _icon = null; _entry = null; - //Dalamud.Framework.RunOnTick( () => - //{ - // _icon = Dalamud.PluginInterface.UiBuilder.LoadImage( Path.Combine( Dalamud.PluginInterface.AssemblyLocation.DirectoryName!, - // "tsmLogo.png" ) ); - // if( _icon != null ) - // { - // _entry = Dalamud.TitleScreenMenu.AddEntry( "Manage Penumbra", _icon, OnTriggered ); - // } - //} ); + + void CreateEntry() + { + _icon = Dalamud.PluginInterface.UiBuilder.LoadImage( Path.Combine( Dalamud.PluginInterface.AssemblyLocation.DirectoryName!, + "tsmLogo.png" ) ); + if( _icon != null ) + { + _entry = Dalamud.TitleScreenMenu.AddEntry( "Manage Penumbra", _icon, OnTriggered ); + } + + Dalamud.PluginInterface.UiBuilder.Draw -= CreateEntry; + } + + Dalamud.PluginInterface.UiBuilder.Draw += CreateEntry; } private void OnTriggered()