feat: setting for buttons in system menu

This commit is contained in:
Aireil 2021-04-30 17:17:30 +02:00
parent 287cc0b84f
commit 11938722b7
3 changed files with 17 additions and 0 deletions

View file

@ -97,6 +97,11 @@ namespace Dalamud.Configuration
/// </summary>
public bool AutoUpdatePlugins { get; set; }
/// <summary>
/// Gets or sets a value indicating whether or not Dalamud should add buttons to the system menu.
/// </summary>
public bool DoButtonsSystemMenu { get; set; } = true;
/// <summary>
/// Gets or sets a value indicating whether or not the debug log should scroll automatically.
/// </summary>

View file

@ -71,6 +71,12 @@ namespace Dalamud.Game.Addon
private void AgentHudOpenSystemMenuDetour(void* thisPtr, AtkValue* atkValueArgs, uint menuSize)
{
if (!this.dalamud.Configuration.DoButtonsSystemMenu)
{
this.hookAgentHudOpenSystemMenu.Original(thisPtr, atkValueArgs, menuSize);
return;
}
// the max size (hardcoded) is 0xE/15, but the system menu currently uses 0xC/12
// this is a just in case that doesnt really matter
// see if we can add 2 entries

View file

@ -44,6 +44,7 @@ namespace Dalamud.Interface
this.printPluginsWelcomeMsg = this.dalamud.Configuration.PrintPluginsWelcomeMsg;
this.autoUpdatePlugins = this.dalamud.Configuration.AutoUpdatePlugins;
this.doButtonsSystemMenu = this.dalamud.Configuration.DoButtonsSystemMenu;
this.languages = Localization.ApplicableLangCodes.Prepend("en").ToArray();
try
@ -136,6 +137,7 @@ namespace Dalamud.Interface
private bool printPluginsWelcomeMsg;
private bool autoUpdatePlugins;
private bool doButtonsSystemMenu;
private string thirdRepoTempUrl = string.Empty;
private string thirdRepoAddError = string.Empty;
@ -184,6 +186,9 @@ namespace Dalamud.Interface
ImGui.Checkbox(Loc.Localize("DalamudSettingsAutoUpdatePlugins", "Auto-update plugins"), ref this.autoUpdatePlugins);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsAutoUpdatePluginsMsgHint", "Automatically update plugins when logging in with a character."));
ImGui.Checkbox(Loc.Localize("DalamudSettingsSystemMenu", "Dalamud buttons in system menu"), ref this.doButtonsSystemMenu);
ImGui.TextColored(this.hintTextColor, Loc.Localize("DalamudSettingsSystemMenuMsgHint", "Add buttons for Dalamud plugins and settings to the system menu."));
ImGui.EndTabItem();
}
@ -392,6 +397,7 @@ namespace Dalamud.Interface
this.dalamud.Configuration.PrintPluginsWelcomeMsg = this.printPluginsWelcomeMsg;
this.dalamud.Configuration.AutoUpdatePlugins = this.autoUpdatePlugins;
this.dalamud.Configuration.DoButtonsSystemMenu = this.doButtonsSystemMenu;
this.dalamud.Configuration.Save();