mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
chore: make profiles category visible by default, ask before enabling
This commit is contained in:
parent
412d94e437
commit
3a922e4d58
4 changed files with 35 additions and 10 deletions
|
|
@ -28,7 +28,7 @@ internal class PluginCategoryManager
|
||||||
new(11, "special.devIconTester", () => Locs.Category_IconTester),
|
new(11, "special.devIconTester", () => Locs.Category_IconTester),
|
||||||
new(12, "special.dalamud", () => Locs.Category_Dalamud),
|
new(12, "special.dalamud", () => Locs.Category_Dalamud),
|
||||||
new(13, "special.plugins", () => Locs.Category_Plugins),
|
new(13, "special.plugins", () => Locs.Category_Plugins),
|
||||||
new(14, "special.profiles", () => Locs.Category_PluginProfiles, CategoryInfo.AppearCondition.ProfilesEnabled),
|
new(14, "special.profiles", () => Locs.Category_PluginProfiles),
|
||||||
new(FirstTagBasedCategoryId + 0, "other", () => Locs.Category_Other),
|
new(FirstTagBasedCategoryId + 0, "other", () => Locs.Category_Other),
|
||||||
new(FirstTagBasedCategoryId + 1, "jobs", () => Locs.Category_Jobs),
|
new(FirstTagBasedCategoryId + 1, "jobs", () => Locs.Category_Jobs),
|
||||||
new(FirstTagBasedCategoryId + 2, "ui", () => Locs.Category_UI),
|
new(FirstTagBasedCategoryId + 2, "ui", () => Locs.Category_UI),
|
||||||
|
|
@ -353,11 +353,6 @@ internal class PluginCategoryManager
|
||||||
/// Check if plugin testing is enabled.
|
/// Check if plugin testing is enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
DoPluginTest,
|
DoPluginTest,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Check if plugin profiles are enabled.
|
|
||||||
/// </summary>
|
|
||||||
ProfilesEnabled,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -1218,10 +1218,6 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
if (!Service<DalamudConfiguration>.Get().DoPluginTest)
|
if (!Service<DalamudConfiguration>.Get().DoPluginTest)
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
case PluginCategoryManager.CategoryInfo.AppearCondition.ProfilesEnabled:
|
|
||||||
if (!Service<DalamudConfiguration>.Get().ProfilesEnabled)
|
|
||||||
continue;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
throw new ArgumentOutOfRangeException();
|
throw new ArgumentOutOfRangeException();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,12 @@ internal class ProfileManagerWidget
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Draw()
|
public void Draw()
|
||||||
{
|
{
|
||||||
|
if (!Service<DalamudConfiguration>.Get().ProfilesEnabled)
|
||||||
|
{
|
||||||
|
this.DrawChoice();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var tutorialTitle = Locs.TutorialTitle + "###collectionsTutorWindow";
|
var tutorialTitle = Locs.TutorialTitle + "###collectionsTutorWindow";
|
||||||
var tutorialId = ImGui.GetID(tutorialTitle);
|
var tutorialId = ImGui.GetID(tutorialTitle);
|
||||||
this.DrawTutorial(tutorialTitle);
|
this.DrawTutorial(tutorialTitle);
|
||||||
|
|
@ -76,6 +82,23 @@ internal class ProfileManagerWidget
|
||||||
this.pickerSearch = string.Empty;
|
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)
|
private void DrawTutorial(string modalTitle)
|
||||||
{
|
{
|
||||||
var open = true;
|
var open = true;
|
||||||
|
|
@ -606,6 +629,15 @@ internal class ProfileManagerWidget
|
||||||
public static string TutorialCommandsEnd =>
|
public static string TutorialCommandsEnd =>
|
||||||
Loc.Localize("ProfileManagerTutorialCommandsEnd", "If you run multiple of these commands, they will be executed in order.");
|
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) =>
|
public static string NotInstalled(string name) =>
|
||||||
Loc.Localize("ProfileManagerNotInstalled", "{0} (Not Installed)").Format(name);
|
Loc.Localize("ProfileManagerNotInstalled", "{0} (Not Installed)").Format(name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ public class SettingsTabExperimental : SettingsTab
|
||||||
|
|
||||||
new ThirdRepoSettingsEntry(),
|
new ThirdRepoSettingsEntry(),
|
||||||
|
|
||||||
|
/* Disabling profiles after they've been enabled doesn't make much sense, at least not if the user has already created profiles.
|
||||||
new GapSettingsEntry(5, true),
|
new GapSettingsEntry(5, true),
|
||||||
|
|
||||||
new SettingsEntry<bool>(
|
new SettingsEntry<bool>(
|
||||||
|
|
@ -55,6 +56,7 @@ public class SettingsTabExperimental : SettingsTab
|
||||||
Loc.Localize("DalamudSettingsEnableProfilesHint", "Enables plugin collections, which lets you create toggleable lists of plugins."),
|
Loc.Localize("DalamudSettingsEnableProfilesHint", "Enables plugin collections, which lets you create toggleable lists of plugins."),
|
||||||
c => c.ProfilesEnabled,
|
c => c.ProfilesEnabled,
|
||||||
(v, c) => c.ProfilesEnabled = v),
|
(v, c) => c.ProfilesEnabled = v),
|
||||||
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
public override string Title => Loc.Localize("DalamudSettingsExperimental", "Experimental");
|
public override string Title => Loc.Localize("DalamudSettingsExperimental", "Experimental");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue