using System; using System.Collections.Generic; using ProjectM.Simulation; using UnityEngine; using UnityEngine.UIElements; namespace ProjectM.Client { /// /// The replayable "How to Play" reference card (UI Toolkit), built on like /// and reachable from BOTH the main menu and the in-game pause overlay. Tabbed, /// one glanceable page each: Controls (for the chosen class), The Loop (the annotated win-condition diagram — /// the single highest-value page, since the inverted goal "clear expeditions to win" is the #1 new-player /// confusion), Build & Economy, Threats, Win/Lose. Static + stateless: returns a fresh /// full-screen panel each call; the caller owns its lifetime (RemoveFromHierarchy on close). /// public static class HowToPlayPanel { static readonly string[] Tabs = { "Controls", "The Loop", "Build & Economy", "Threats", "Win / Lose" }; public static VisualElement Build(Action onClose) { var root = MenuUi.FullScreenRoot(true); var card = MenuUi.Card("HOW TO PLAY"); card.style.minWidth = 640; card.style.maxWidth = 780; root.Add(card); var tabBar = new VisualElement(); tabBar.style.flexDirection = FlexDirection.Row; tabBar.style.justifyContent = Justify.Center; tabBar.style.marginBottom = 12; card.Add(tabBar); var content = new VisualElement(); content.style.minHeight = 230; card.Add(content); var tabButtons = new List