lightfinder!
This commit is contained in:
@@ -6,6 +6,8 @@ using LightlessSync.LightlessConfiguration;
|
||||
using LightlessSync.PlayerData.Pairs;
|
||||
using LightlessSync.Services.Mediator;
|
||||
using LightlessSync.Services.ServerConfiguration;
|
||||
using LightlessSync.Utils;
|
||||
using System.Numerics;
|
||||
|
||||
namespace LightlessSync.UI.Handlers;
|
||||
|
||||
@@ -89,11 +91,37 @@ public class IdDisplayHandler
|
||||
{
|
||||
ImGui.SameLine(textPosX);
|
||||
(bool textIsUid, string playerText) = GetPlayerText(pair);
|
||||
|
||||
if (!string.Equals(_editEntry, pair.UserData.UID, StringComparison.Ordinal))
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using (ImRaii.PushFont(UiBuilder.MonoFont, textIsUid)) ImGui.TextUnformatted(playerText);
|
||||
var font = UiBuilder.MonoFont;
|
||||
|
||||
var isAdmin = pair.UserData.IsAdmin;
|
||||
var isModerator = pair.UserData.IsModerator;
|
||||
|
||||
Vector4? textColor = isAdmin
|
||||
? UIColors.Get("LightlessAdminText")
|
||||
: isModerator
|
||||
? UIColors.Get("LightlessModeratorText")
|
||||
: null;
|
||||
|
||||
Vector4? glowColor = isAdmin
|
||||
? UIColors.Get("LightlessAdminGlow")
|
||||
: isModerator
|
||||
? UIColors.Get("LightlessModeratorGlow")
|
||||
: null;
|
||||
|
||||
var seString = (textColor != null || glowColor != null)
|
||||
? SeStringUtils.BuildFormattedPlayerName(playerText, textColor, glowColor)
|
||||
: SeStringUtils.BuildPlain(playerText);
|
||||
|
||||
using (ImRaii.PushFont(font, textIsUid))
|
||||
{
|
||||
var pos = ImGui.GetCursorScreenPos();
|
||||
SeStringUtils.RenderSeStringWithHitbox(seString, pos, font);
|
||||
}
|
||||
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
@@ -173,10 +201,12 @@ public class IdDisplayHandler
|
||||
{
|
||||
_editEntry = string.Empty;
|
||||
}
|
||||
|
||||
UiSharedService.AttachToolTip("Hit ENTER to save\nRight click to cancel");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public (bool isGid, string text) GetGroupText(GroupFullInfoDto group)
|
||||
{
|
||||
var textIsGid = true;
|
||||
|
||||
Reference in New Issue
Block a user