mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:07:21 +01:00
fix empty comment crashing mare main UI
This commit is contained in:
parent
32788be43b
commit
1125077be3
2 changed files with 14 additions and 10 deletions
|
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<Authors></Authors>
|
||||
<Company></Company>
|
||||
<Version>0.1.2.0</Version>
|
||||
<Version>0.1.3.0</Version>
|
||||
<Description></Description>
|
||||
<Copyright></Copyright>
|
||||
<PackageProjectUrl>https://github.com/Penumbra-Sync/client</PackageProjectUrl>
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ namespace MareSynchronos.UI
|
|||
|
||||
var buttonSize = GetIconButtonSize(pauseIcon);
|
||||
var trashButtonSize = GetIconButtonSize(FontAwesomeIcon.Trash);
|
||||
var textSize = ImGui.CalcTextSize(_apiController.SystemInfoDto.CpuUsage.ToString("0.00") + "%");
|
||||
var textSize = ImGui.CalcTextSize(entry.OtherUID);
|
||||
var originalY = ImGui.GetCursorPosY();
|
||||
|
||||
var textPos = originalY + buttonSize.Y / 2 - textSize.Y / 2;
|
||||
|
|
@ -178,22 +178,26 @@ namespace MareSynchronos.UI
|
|||
_showUidForEntry.TryGetValue(entry.OtherUID, out bool showUidInsteadOfName);
|
||||
if (!showUidInsteadOfName && _configuration.GetCurrentServerUidComments().TryGetValue(entry.OtherUID, out playerText))
|
||||
{
|
||||
if (!playerText.IsNullOrEmpty())
|
||||
if (playerText.IsNullOrEmpty())
|
||||
{
|
||||
playerText = entry.OtherUID;
|
||||
}
|
||||
else
|
||||
{
|
||||
textIsUid = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
playerText = entry.OtherUID;
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
if (_editNickEntry != entry.OtherUID)
|
||||
{
|
||||
ImGui.SetCursorPosY(textPos);
|
||||
if (textIsUid) ImGui.PushFont(UiBuilder.MonoFont);
|
||||
ImGui.Text(playerText);
|
||||
ImGui.TextUnformatted(playerText);
|
||||
if (textIsUid) ImGui.PopFont();
|
||||
AttachToolTip("Left click to switch between UID display and nick" + Environment.NewLine +
|
||||
"Right click to change nick for " + entry.OtherUID);
|
||||
|
|
@ -244,7 +248,7 @@ namespace MareSynchronos.UI
|
|||
}
|
||||
AttachToolTip("Hold CTRL and click to unpair permanently from " + entry.OtherUID);
|
||||
|
||||
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + ImGui.GetWindowContentRegionWidth() - buttonSize.X - trashButtonSize.X);
|
||||
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + ImGui.GetWindowContentRegionWidth() - buttonSize.X - ImGui.GetStyle().ItemSpacing.X - trashButtonSize.X);
|
||||
ImGui.SetCursorPosY(originalY);
|
||||
if (ImGuiComponents.IconButton(pauseIcon))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue