chore: make profiles category visible by default, ask before enabling

This commit is contained in:
goat 2023-10-05 21:03:24 +02:00
parent 412d94e437
commit 3a922e4d58
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
4 changed files with 35 additions and 10 deletions

View file

@ -50,6 +50,12 @@ internal class ProfileManagerWidget
/// </summary>
public void Draw()
{
if (!Service<DalamudConfiguration>.Get().ProfilesEnabled)
{
this.DrawChoice();
return;
}
var tutorialTitle = Locs.TutorialTitle + "###collectionsTutorWindow";
var tutorialId = ImGui.GetID(tutorialTitle);
this.DrawTutorial(tutorialTitle);
@ -76,6 +82,23 @@ internal class ProfileManagerWidget
this.pickerSearch = string.Empty;
}
private void DrawChoice()
{
ImGuiHelpers.ScaledDummy(60);
ImGuiHelpers.CenteredText(Locs.Choice1);
ImGuiHelpers.CenteredText(Locs.Choice2);
ImGuiHelpers.ScaledDummy(20);
var buttonWidth = ImGui.GetWindowWidth() / 3;
ImGuiHelpers.CenterCursorFor((int)buttonWidth);
if (ImGui.Button(Locs.ChoiceConfirmation, new Vector2(buttonWidth, 40 * ImGuiHelpers.GlobalScale)))
{
var config = Service<DalamudConfiguration>.Get();
config.ProfilesEnabled = true;
config.QueueSave();
}
}
private void DrawTutorial(string modalTitle)
{
var open = true;
@ -606,6 +629,15 @@ internal class ProfileManagerWidget
public static string TutorialCommandsEnd =>
Loc.Localize("ProfileManagerTutorialCommandsEnd", "If you run multiple of these commands, they will be executed in order.");
public static string Choice1 =>
Loc.Localize("ProfileManagerChoice1", "Plugin collections are a new feature that allow you to group plugins into collections which can be toggled and shared.");
public static string Choice2 =>
Loc.Localize("ProfileManagerChoice2", "They are experimental and may still contain bugs. Do you want to enable them now?");
public static string ChoiceConfirmation =>
Loc.Localize("ProfileManagerChoiceConfirmation", "Yes, enable Plugin Collections");
public static string NotInstalled(string name) =>
Loc.Localize("ProfileManagerNotInstalled", "{0} (Not Installed)").Format(name);
}