Mask name edit field in automated designs as readonly password in incognito mode.

This commit is contained in:
Ottermandias 2023-07-17 18:35:28 +02:00
parent b47164ad4f
commit df35e287e4

View file

@ -39,8 +39,8 @@ public class SetPanel
private Action? _endAction;
public SetPanel(SetSelector selector, AutoDesignManager manager, DesignManager designs, JobService jobs, ItemUnlockManager itemUnlocks,
CustomizeUnlockManager customizeUnlocks, CustomizationService customizations, IdentifierDrawer identifierDrawer, Configuration config, DesignCombo designCombo)
public SetPanel(SetSelector selector, AutoDesignManager manager, JobService jobs, ItemUnlockManager itemUnlocks, DesignCombo designCombo,
CustomizeUnlockManager customizeUnlocks, CustomizationService customizations, IdentifierDrawer identifierDrawer, Configuration config)
{
_selector = selector;
_manager = manager;
@ -73,8 +73,9 @@ public class SetPanel
if (!child || !_selector.HasSelection)
return;
var name = _tempName ?? Selection.Name;
if (ImGui.InputText("##Name", ref name, 64))
var name = _tempName ?? Selection.Name;
var flags = _selector.IncognitoMode ? ImGuiInputTextFlags.ReadOnly | ImGuiInputTextFlags.Password : ImGuiInputTextFlags.None;
if (ImGui.InputText("##Name", ref name, 128, flags))
_tempName = name;
if (ImGui.IsItemDeactivated())
@ -365,4 +366,4 @@ public class SetPanel
protected override string ToString(JobGroup obj)
=> obj.Name;
}
}
}