mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 20:24:16 +01:00
feat: plugin info command
This commit is contained in:
parent
24cb7f014e
commit
bfbdaa5fc6
2 changed files with 16 additions and 10 deletions
|
|
@ -169,8 +169,6 @@ namespace Dalamud {
|
||||||
private bool isImguiDrawLogWindow = false;
|
private bool isImguiDrawLogWindow = false;
|
||||||
private bool isImguiDrawDataWindow = false;
|
private bool isImguiDrawDataWindow = false;
|
||||||
|
|
||||||
private bool neverDrawWelcome = false;
|
|
||||||
|
|
||||||
private DalamudLogWindow logWindow;
|
private DalamudLogWindow logWindow;
|
||||||
private DalamudDataWindow dataWindow;
|
private DalamudDataWindow dataWindow;
|
||||||
|
|
||||||
|
|
@ -204,12 +202,20 @@ namespace Dalamud {
|
||||||
{
|
{
|
||||||
Process.GetCurrentProcess().Kill();
|
Process.GetCurrentProcess().Kill();
|
||||||
}
|
}
|
||||||
|
ImGui.Separator();
|
||||||
|
ImGui.MenuItem(this.assemblyVersion, false);
|
||||||
|
|
||||||
ImGui.EndMenu();
|
ImGui.EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui.BeginMenu("Plugins"))
|
if (ImGui.BeginMenu("Plugins"))
|
||||||
{
|
{
|
||||||
|
if (ImGui.MenuItem("Print plugin info")) {
|
||||||
|
foreach (var plugin in this.PluginManager.Plugins) {
|
||||||
|
// TODO: some more here, state maybe?
|
||||||
|
Log.Information($"{plugin.Name}");
|
||||||
|
}
|
||||||
|
}
|
||||||
if (ImGui.MenuItem("Reload plugins"))
|
if (ImGui.MenuItem("Reload plugins"))
|
||||||
{
|
{
|
||||||
OnPluginReloadCommand(string.Empty, string.Empty);
|
OnPluginReloadCommand(string.Empty, string.Empty);
|
||||||
|
|
@ -217,7 +223,7 @@ namespace Dalamud {
|
||||||
ImGui.EndMenu();
|
ImGui.EndMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
//ImGui.EndMainMenuBar();
|
ImGui.EndMainMenuBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ namespace Dalamud.Plugin
|
||||||
private readonly string pluginDirectory;
|
private readonly string pluginDirectory;
|
||||||
private readonly string defaultPluginDirectory;
|
private readonly string defaultPluginDirectory;
|
||||||
|
|
||||||
private List<IDalamudPlugin> plugins;
|
public List<IDalamudPlugin> Plugins;
|
||||||
|
|
||||||
public PluginManager(Dalamud dalamud, string pluginDirectory, string defaultPluginDirectory) {
|
public PluginManager(Dalamud dalamud, string pluginDirectory, string defaultPluginDirectory) {
|
||||||
this.dalamud = dalamud;
|
this.dalamud = dalamud;
|
||||||
|
|
@ -23,12 +23,12 @@ namespace Dalamud.Plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnloadPlugins() {
|
public void UnloadPlugins() {
|
||||||
if (this.plugins == null)
|
if (this.Plugins == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (var i = 0; i < this.plugins.Count; i++) {
|
for (var i = 0; i < this.Plugins.Count; i++) {
|
||||||
this.plugins[i].Dispose();
|
this.Plugins[i].Dispose();
|
||||||
this.plugins[i] = null;
|
this.Plugins[i] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ namespace Dalamud.Plugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.plugins = new List<IDalamudPlugin>(foundImplementations.Count);
|
this.Plugins = new List<IDalamudPlugin>(foundImplementations.Count);
|
||||||
foreach (var pluginType in foundImplementations)
|
foreach (var pluginType in foundImplementations)
|
||||||
{
|
{
|
||||||
var plugin = (IDalamudPlugin)Activator.CreateInstance(pluginType);
|
var plugin = (IDalamudPlugin)Activator.CreateInstance(pluginType);
|
||||||
|
|
@ -80,7 +80,7 @@ namespace Dalamud.Plugin
|
||||||
|
|
||||||
plugin.Initialize(dalamudInterface);
|
plugin.Initialize(dalamudInterface);
|
||||||
Log.Information("Loaded plugin: {0}", plugin.Name);
|
Log.Information("Loaded plugin: {0}", plugin.Name);
|
||||||
this.plugins.Add(plugin);
|
this.Plugins.Add(plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue