private void DoTileTooltips() { if (Mouse.IsInputBlockedNow) { return; } int num = GenWorld.MouseTile(snapToExpandableWorldObjects: true); if (num == -1) { return; } for (int i = 0; i < paths.Count; i++) { if (paths[i].NodesReversed.Contains(num)) { string str = GetTileTip(num, i); Text.Font = GameFont.Small; Vector2 size = Text.CalcSize(str); size.x += 20f; size.y += 20f; Vector2 mouseAttachedWindowPos = GenUI.GetMouseAttachedWindowPos(size.x, size.y); Rect rect = new Rect(mouseAttachedWindowPos, size); Find.WindowStack.ImmediateWindow(1859615246, rect, WindowLayer.Super, delegate { Text.Font = GameFont.Small; Widgets.Label(rect.AtZero().ContractedBy(10f), str); }); break; } } }
private static void DrawImmediateTooltip(string tipText) { if (Event.current.type != EventType.Repaint) { return; } var tip = new ActiveTip(tipText); var tipRect = tip.TipRect; var tipPosition = GenUI.GetMouseAttachedWindowPos(tipRect.width, tipRect.height); tipPosition = GUIPositionLocalToGlobal(tipPosition); tip.DrawTooltip(tipPosition); }