mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
style editor: don't allow rename/delete of Dalamud Classic
This commit is contained in:
parent
d1d72f2aef
commit
fb60ac5b4b
1 changed files with 8 additions and 1 deletions
|
|
@ -82,6 +82,7 @@ public class StyleEditorWindow : Window
|
|||
var workStyle = config.SavedStyles[this.currentSel];
|
||||
workStyle.BuiltInColors ??= StyleModelV1.DalamudStandard.BuiltInColors;
|
||||
|
||||
var isBuiltinStyle = this.currentSel < 2;
|
||||
var appliedThisFrame = false;
|
||||
|
||||
var styleAry = config.SavedStyles.Select(x => x.Name).ToArray();
|
||||
|
|
@ -111,6 +112,9 @@ public class StyleEditorWindow : Window
|
|||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (isBuiltinStyle)
|
||||
ImGui.BeginDisabled();
|
||||
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Trash) && this.currentSel != 0)
|
||||
{
|
||||
this.currentSel--;
|
||||
|
|
@ -156,6 +160,9 @@ public class StyleEditorWindow : Window
|
|||
if (ImGui.IsItemHovered())
|
||||
ImGui.SetTooltip(Loc.Localize("StyleEditorCopy", "Copy style to clipboard for sharing"));
|
||||
|
||||
if (isBuiltinStyle)
|
||||
ImGui.EndDisabled();
|
||||
|
||||
ImGui.SameLine();
|
||||
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.FileImport))
|
||||
|
|
@ -196,7 +203,7 @@ public class StyleEditorWindow : Window
|
|||
|
||||
ImGui.PushItemWidth(ImGui.GetWindowWidth() * 0.50f);
|
||||
|
||||
if (this.currentSel < 2)
|
||||
if (isBuiltinStyle)
|
||||
{
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed, Loc.Localize("StyleEditorNotAllowed", "You cannot edit built-in styles. Please add a new style first."));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue