feat: add credits

This commit is contained in:
goat 2020-03-22 00:48:42 +09:00
parent 3503299fff
commit 50e1e30b2a
3 changed files with 128 additions and 0 deletions

View file

@ -165,9 +165,11 @@ namespace Dalamud {
private bool isImguiDrawLogWindow = false;
private bool isImguiDrawDataWindow = false;
private bool isImguiDrawPluginWindow = false;
private bool isImguiDrawCreditsWindow = false;
private DalamudLogWindow logWindow;
private DalamudDataWindow dataWindow;
private DalamudCreditsWindow creditsWindow;
private PluginInstallerWindow pluginWindow;
private void BuildDalamudUi()
@ -190,6 +192,13 @@ namespace Dalamud {
this.dataWindow = new DalamudDataWindow(this.Data);
this.isImguiDrawDataWindow = true;
}
if (ImGui.MenuItem("Open Credits window")) {
var logoGraphic =
this.InterfaceManager.LoadImage(
Path.Combine(this.StartInfo.WorkingDirectory, "UIRes", "logo.png"));
this.creditsWindow = new DalamudCreditsWindow(logoGraphic, this.Framework);
this.isImguiDrawCreditsWindow = true;
}
ImGui.MenuItem("Draw ImGui demo", "", ref this.isImguiDrawDemoWindow);
ImGui.Separator();
if (ImGui.MenuItem("Unload Dalamud"))
@ -238,6 +247,7 @@ namespace Dalamud {
if (this.isImguiDrawLogWindow == false)
{
this.logWindow?.Dispose();
this.logWindow = null;
}
}
@ -251,6 +261,17 @@ namespace Dalamud {
this.isImguiDrawPluginWindow = this.pluginWindow != null && this.pluginWindow.Draw();
}
if (this.isImguiDrawCreditsWindow)
{
this.isImguiDrawCreditsWindow = this.creditsWindow != null && this.creditsWindow.Draw();
if (this.isImguiDrawCreditsWindow == false)
{
this.creditsWindow?.Dispose();
this.creditsWindow = null;
}
}
if (this.isImguiDrawDemoWindow)
ImGui.ShowDemoWindow();
}
@ -334,6 +355,11 @@ namespace Dalamud {
{
HelpMessage = "Open the plugin installer"
});
this.CommandManager.AddHandler("/xlcredits", new CommandInfo(OnOpenCreditsCommand) {
HelpMessage = "Opens the credits for dalamud.",
ShowInHelp = false
});
}
private void OnUnloadCommand(string command, string arguments) {
@ -560,6 +586,15 @@ namespace Dalamud {
this.isImguiDrawPluginWindow = true;
}
private void OnOpenCreditsCommand(string command, string arguments)
{
var logoGraphic =
this.InterfaceManager.LoadImage(
Path.Combine(this.StartInfo.WorkingDirectory, "UIRes", "logo.png"));
this.creditsWindow = new DalamudCreditsWindow(logoGraphic, this.Framework);
this.isImguiDrawCreditsWindow = true;
}
private int RouletteSlugToKey(string slug) => slug.ToLower() switch {
"leveling" => 1,
"506070" => 2,