diff --git a/HudSwap/PluginUI.cs b/HudSwap/PluginUI.cs index 535136c..4b863e2 100644 --- a/HudSwap/PluginUI.cs +++ b/HudSwap/PluginUI.cs @@ -31,6 +31,7 @@ namespace HudSwap { } private string importName = ""; + private string renameName = ""; private Guid selectedLayout = Guid.Empty; private static bool configErrorOpen = true; @@ -93,6 +94,7 @@ namespace HudSwap { foreach (KeyValuePair> entry in this.plugin.config.Layouts) { if (ImGui.Selectable(entry.Value.Item1, this.selectedLayout == entry.Key)) { this.selectedLayout = entry.Key; + this.renameName = entry.Value.Item1; } } ImGui.ListBoxFooter(); @@ -113,6 +115,14 @@ namespace HudSwap { this.selectedLayout = Guid.Empty; this.plugin.config.Save(); } + + ImGui.InputText("##rename-input", ref this.renameName, 100); + ImGui.SameLine(); + if (ImGui.Button("Rename") && this.renameName != "" && this.selectedLayout != null) { + Tuple entry = this.plugin.config.Layouts[this.selectedLayout]; ; + this.plugin.config.Layouts[this.selectedLayout] = new Tuple(this.renameName, entry.Item2); + this.plugin.config.Save(); + } } ImGui.Separator();