static void DoButtons() { float y = 10f; const float btnHeight = 27f; const float btnWidth = 80f; float x = UI.screenWidth - btnWidth - 10f; var session = Multiplayer.session; if (session != null && !Multiplayer.IsReplay) { var btnRect = new Rect(x, y, btnWidth, btnHeight); var chatColor = session.players.Any(p => p.status == PlayerStatus.Desynced) ? "#ff5555" : "#dddddd"; var hasUnread = session.hasUnread ? "*" : ""; var chatLabel = $"{"MpChatButton".Translate()} <color={chatColor}>({session.players.Count})</color>{hasUnread}"; if (Widgets.ButtonText(btnRect, chatLabel)) { ChatWindow.OpenChat(); } if (!TickPatch.Skipping) { IndicatorInfo(out Color color, out string text, out bool slow); var indRect = new Rect(btnRect.x - 25f - 5f + 6f / 2f, btnRect.y + 6f / 2f, 19f, 19f); var biggerRect = new Rect(btnRect.x - 25f - 5f + 2f / 2f, btnRect.y + 2f / 2f, 23f, 23f); if (slow && Widgets.ButtonInvisible(biggerRect)) { TickPatch.SkipTo(toTickUntil: true, canESC: true); } Widgets.DrawRectFast(biggerRect, new Color(color.r * 0.6f, color.g * 0.6f, color.b * 0.6f)); Widgets.DrawRectFast(indRect, color); TooltipHandler.TipRegion(indRect, new TipSignal(text, 31641624)); } y += btnHeight; } if (Multiplayer.ShowDevInfo && Multiplayer.WriterLog != null) { if (Widgets.ButtonText(new Rect(x, y, 80f, 27f), $"Write ({Multiplayer.WriterLog.nodes.Count})")) { Find.WindowStack.Add(Multiplayer.WriterLog); } y += btnHeight; if (Widgets.ButtonText(new Rect(x, y, 80f, 27f), $"Read ({Multiplayer.ReaderLog.nodes.Count})")) { Find.WindowStack.Add(Multiplayer.ReaderLog); } y += btnHeight; } if (Multiplayer.Client != null && Multiplayer.WorldComp.trading.Any()) { if (Widgets.ButtonText(new Rect(x, y, btnWidth, btnHeight), "MpTradingButton".Translate())) { Find.WindowStack.Add(new TradingWindow()); } y += btnHeight; } if (Multiplayer.Client != null && Multiplayer.WorldComp.debugMode) { Text.Font = GameFont.Tiny; Text.Anchor = TextAnchor.MiddleCenter; Widgets.Label(new Rect(x, y, btnWidth, 30f), $"Debug mode"); Text.Anchor = TextAnchor.UpperLeft; Text.Font = GameFont.Small; } }