split individual ui to visible/group/online/offline

This commit is contained in:
Stanley Dimant
2023-01-30 10:35:49 +01:00
parent d218d06230
commit 246dbeb9b6
5 changed files with 47 additions and 79 deletions

View File

@@ -67,7 +67,7 @@ public class SelectGroupForPairUi
var tags = _tagHandler.GetAllTagsSorted();
var childHeight = tags.Count != 0 ? tags.Count * 25 : 1;
var childSize = new Vector2(0, childHeight > 100 ? 100 : childHeight) * ImGuiHelpers.GlobalScale;
UiShared.FontText($"Select the groups you want {name} to be in.", UiBuilder.DefaultFont);
if (ImGui.BeginChild(name + "##listGroups", childSize))
{
@@ -115,7 +115,7 @@ public class SelectGroupForPairUi
private void HandleAddTag()
{
if (!_tagNameToAdd.IsNullOrWhitespace())
if (!_tagNameToAdd.IsNullOrWhitespace() && _tagNameToAdd is not (TagHandler.CustomOfflineTag or TagHandler.CustomOnlineTag or TagHandler.CustomVisibleTag))
{
_tagHandler.AddTag(_tagNameToAdd);
if (_pair != null)
@@ -124,6 +124,10 @@ public class SelectGroupForPairUi
}
_tagNameToAdd = string.Empty;
}
else
{
_tagNameToAdd = string.Empty;
}
}
private string PairName(Dictionary<string, bool> showUidForEntry, Pair pair)