feat: add "plugin testing" settings to /xlsettings

This commit is contained in:
goat 2020-06-08 14:19:09 +02:00
parent 7ae3a92968
commit cf08eaee87
6 changed files with 55 additions and 9 deletions

View file

@ -9,7 +9,7 @@ using Newtonsoft.Json;
namespace Dalamud namespace Dalamud
{ {
[Serializable] [Serializable]
public class DalamudConfiguration internal class DalamudConfiguration
{ {
public DiscordFeatureConfiguration DiscordFeatureConfig { get; set; } public DiscordFeatureConfiguration DiscordFeatureConfig { get; set; }
@ -36,6 +36,9 @@ namespace Dalamud
public XivChatType GeneralChatType { get; set; } = XivChatType.Debug; public XivChatType GeneralChatType { get; set; } = XivChatType.Debug;
public bool DoPluginTest { get; set; } = false;
public bool DoDalamudTest { get; set; } = false;
[JsonIgnore] [JsonIgnore]
public string ConfigPath; public string ConfigPath;

View file

@ -59,11 +59,11 @@ namespace Dalamud {
public readonly DalamudStartInfo StartInfo; public readonly DalamudStartInfo StartInfo;
private readonly LoggingLevelSwitch loggingLevelSwitch; private readonly LoggingLevelSwitch loggingLevelSwitch;
public readonly DalamudConfiguration Configuration; internal readonly DalamudConfiguration Configuration;
private readonly WinSockHandlers WinSock2; private readonly WinSockHandlers WinSock2;
public InterfaceManager InterfaceManager { get; private set; } internal InterfaceManager InterfaceManager { get; private set; }
public DataManager Data { get; private set; } public DataManager Data { get; private set; }
@ -507,14 +507,13 @@ namespace Dalamud {
this.CommandManager.AddHandler("/xlsettings", new CommandInfo(OnOpenSettingsCommand) this.CommandManager.AddHandler("/xlsettings", new CommandInfo(OnOpenSettingsCommand)
{ {
HelpMessage = Loc.Localize("DalamudSettingsHelp", "Change various In-Game-Addon settings like chat channels and the discord bot setup."), HelpMessage = Loc.Localize("DalamudSettingsHelp", "Change various In-Game-Addon settings like chat channels and the discord bot setup.")
ShowInHelp = false // Not quite ready yet
}); });
this.CommandManager.AddHandler("/xlbugreport", new CommandInfo(OnBugReportCommand) this.CommandManager.AddHandler("/xlbugreport", new CommandInfo(OnBugReportCommand)
{ {
HelpMessage = Loc.Localize("DalamudBugReport", "Upload a log to be analyzed by our professional development team."), HelpMessage = Loc.Localize("DalamudBugReport", "Upload a log to be analyzed by our professional development team."),
ShowInHelp = false // Not quite ready yet ShowInHelp = false
}); });

View file

@ -25,6 +25,11 @@ namespace Dalamud.Interface
this.chatTypes = Enum.GetValues(typeof(XivChatType)).Cast<XivChatType>().Select(x => x.ToString()).ToArray(); this.chatTypes = Enum.GetValues(typeof(XivChatType)).Cast<XivChatType>().Select(x => x.ToString()).ToArray();
this.dalamudMessagesChatType = (int) this.dalamud.Configuration.GeneralChatType; this.dalamudMessagesChatType = (int) this.dalamud.Configuration.GeneralChatType;
this.doCfTaskBarFlash = this.dalamud.Configuration.DutyFinderTaskbarFlash;
this.doPluginTest = this.dalamud.Configuration.DoPluginTest;
this.doDalamudTest = this.dalamud.Configuration.DoDalamudTest;
} }
private string[] chatTypes; private string[] chatTypes;
@ -33,6 +38,15 @@ namespace Dalamud.Interface
private int dalamudMessagesChatType; private int dalamudMessagesChatType;
private bool doCfTaskBarFlash;
#region Experimental
private bool doPluginTest;
private bool doDalamudTest;
#endregion
public bool Draw() { public bool Draw() {
ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.Always); ImGui.SetNextWindowSize(new Vector2(500, 500), ImGuiCond.Always);
@ -51,7 +65,31 @@ namespace Dalamud.Interface
ImGui.Combo("##XlChatTypeCombo", ref this.dalamudMessagesChatType, this.chatTypes, ImGui.Combo("##XlChatTypeCombo", ref this.dalamudMessagesChatType, this.chatTypes,
this.chatTypes.Length); this.chatTypes.Length);
ImGui.TextColored(this.hintTextColor, "Select the chat channel that is to be used for general XIVLauncher messages."); ImGui.TextColored(this.hintTextColor, "Select the chat channel that is to be used for general XIVLauncher messages.");
ImGui.Dummy(new Vector2(5f, 5f));
ImGui.Checkbox("Flash FFXIV window on duty pop", ref this.doCfTaskBarFlash);
ImGui.TextColored(this.hintTextColor, "Select, if the FFXIV window should be flashed in your task bar when a duty is ready.");
ImGui.EndTabItem();
} }
if (ImGui.BeginTabItem("Experimental"))
{
ImGui.Text("All of these settings require a restart of the game to take effect.");
ImGui.Dummy(new Vector2(10f, 10f));
ImGui.Checkbox("Get plugin testing builds", ref this.doPluginTest);
ImGui.TextColored(this.hintTextColor, "Check this box to receive testing prereleases for plugins.");
ImGui.Checkbox("Get Dalamud testing builds", ref this.doDalamudTest);
ImGui.TextColored(this.hintTextColor, "Check this box to receive testing prereleases for Dalamud.");
ImGui.EndTabItem();
}
ImGui.EndTabBar();
} }
ImGui.EndChild(); ImGui.EndChild();
@ -73,6 +111,12 @@ namespace Dalamud.Interface
private void Save() { private void Save() {
this.dalamud.Configuration.GeneralChatType = (XivChatType) this.dalamudMessagesChatType; this.dalamud.Configuration.GeneralChatType = (XivChatType) this.dalamudMessagesChatType;
this.dalamud.Configuration.DutyFinderTaskbarFlash = this.doCfTaskBarFlash;
this.dalamud.Configuration.DoPluginTest = this.doPluginTest;
this.dalamud.Configuration.DoDalamudTest = this.doDalamudTest;
this.dalamud.Configuration.Save(); this.dalamud.Configuration.Save();
} }
} }

View file

@ -28,7 +28,7 @@ using Serilog;
namespace Dalamud.Interface namespace Dalamud.Interface
{ {
public class InterfaceManager : IDisposable internal class InterfaceManager : IDisposable
{ {
[UnmanagedFunctionPointer(CallingConvention.ThisCall)] [UnmanagedFunctionPointer(CallingConvention.ThisCall)]
private delegate IntPtr PresentDelegate(IntPtr swapChain, uint syncInterval, uint presentFlags); private delegate IntPtr PresentDelegate(IntPtr swapChain, uint syncInterval, uint presentFlags);

View file

@ -11,7 +11,7 @@ using Serilog.Events;
namespace Dalamud.Interface namespace Dalamud.Interface
{ {
public class SerilogEventSink : ILogEventSink internal class SerilogEventSink : ILogEventSink
{ {
private readonly IFormatProvider _formatProvider; private readonly IFormatProvider _formatProvider;

View file

@ -47,7 +47,7 @@ namespace Dalamud.Interface
/// </summary> /// </summary>
/// <param name="interfaceManager">The interface manager to register on.</param> /// <param name="interfaceManager">The interface manager to register on.</param>
/// <param name="namespaceName">The plugin namespace.</param> /// <param name="namespaceName">The plugin namespace.</param>
public UiBuilder(InterfaceManager interfaceManager, string namespaceName) { internal UiBuilder(InterfaceManager interfaceManager, string namespaceName) {
this.namespaceName = namespaceName; this.namespaceName = namespaceName;
this.interfaceManager = interfaceManager; this.interfaceManager = interfaceManager;