Merge branch 'main' of https://github.com/Penumbra-Sync/client
This commit is contained in:
@@ -289,27 +289,27 @@ namespace MareSynchronos.UI
|
|||||||
|
|
||||||
private void DrawServerStatus()
|
private void DrawServerStatus()
|
||||||
{
|
{
|
||||||
var originalY = ImGui.GetCursorPosY();
|
|
||||||
var buttonSize = UiShared.GetIconButtonSize(FontAwesomeIcon.Link);
|
var buttonSize = UiShared.GetIconButtonSize(FontAwesomeIcon.Link);
|
||||||
var textSize = ImGui.CalcTextSize("%");
|
var userCount = _apiController.OnlineUsers.ToString();
|
||||||
var textPos = originalY + buttonSize.Y / 2 - textSize.Y / 2;
|
var userSize = ImGui.CalcTextSize(userCount);
|
||||||
|
var textSize = ImGui.CalcTextSize("Users Online");
|
||||||
|
|
||||||
if (_apiController.ServerState is ServerState.Connected)
|
if (_apiController.ServerState is ServerState.Connected)
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPos);
|
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X) / 2 - (userSize.X + textSize.X) / 2);
|
||||||
ImGui.TextColored(ImGuiColors.ParsedGreen, _apiController.OnlineUsers.ToString());
|
ImGui.AlignTextToFramePadding();
|
||||||
|
ImGui.TextColored(ImGuiColors.ParsedGreen, userCount);
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
ImGui.SetCursorPosY(textPos);
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.Text("Users Online");
|
ImGui.Text("Users Online");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImGui.SetCursorPosY(textPos);
|
ImGui.AlignTextToFramePadding();
|
||||||
ImGui.TextColored(ImGuiColors.DalamudRed, "Not connected to any server");
|
ImGui.TextColored(ImGuiColors.DalamudRed, "Not connected to any server");
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X);
|
ImGui.SameLine(ImGui.GetWindowContentRegionMin().X + UiShared.GetWindowContentRegionWidth() - buttonSize.X);
|
||||||
ImGui.SetCursorPosY(originalY);
|
|
||||||
var color = UiShared.GetBoolColor(!_configuration.FullPause);
|
var color = UiShared.GetBoolColor(!_configuration.FullPause);
|
||||||
var connectedIcon = !_configuration.FullPause ? FontAwesomeIcon.Link : FontAwesomeIcon.Unlink;
|
var connectedIcon = !_configuration.FullPause ? FontAwesomeIcon.Link : FontAwesomeIcon.Unlink;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user