Index Screen
In short
INDEX on the title screen’s top bar opens a full-screen list of everything in the game and what’s coming. It is rebuilt from the
ContentDatabaseevery time it opens, so new content shows up with no index work. Only things that are not built yet are written by hand, as “coming soon” lines inIndexCatalog.AddPlanned.
How it works
- The top bar (
LobbyNav) has PLAY, CUSTOMIZE, PERKS, BATTING CAGE and INDEX. INDEX callsGameRoot.EnterIndex(stateGameState.Index). The top bar stays up with INDEX raised; PERKS and BATTING CAGE still open their popups over it. - On opening,
IndexView.OpencallsIndexCatalog.Build(content)and starts on the first tab, first sub tab, first entry. Nothing is remembered between visits. - Tabs (one per
IndexCategory, in this order): BATTERS, PITCHERS, BALLPARKS, EQUIPMENT, FOOD, SPECIAL BALLS. Pitchers and Equipment get a second row of sub tabs. - Left: the tab’s entries as cards, two per row, scrolling when needed. Each card shows a coloured circle, the name and a subtitle. Right: the picked entry’s name, subtitle, description and bullet details.
- A “coming soon” entry has a ”?” in a grey circle, the subtitle COMING SOON and a purple COMING SOON pill. A tab with no entries at all (Food today) shows COMING SOON and “Food will be listed here as they’re added.”
- Esc (or PLAY on the top bar) goes back to the title screen. Esc first closes an open popup.
Where each tab gets its data (IndexCatalog.Build):
| Tab | Source | Sub tabs | Subtitle | Details |
|---|---|---|---|---|
| Batters | db.batters | none | Starter, “Account level n”, or Unlockable | The batter’s stat modifiers |
| Pitchers | db.pitchers | Pitchers, Bosses (isBoss) | The pitch names in their mix | ”Throws: …”, batter modifiers, their own special balls and decoys (DescribeBalls) |
| Ballparks | db.practiceParks first (subtitle “Batting cage”), then db.ballparks | none | ”Batting cage” or blank | The park’s modifiers (DescribeModifiers), “n targets past the wall” |
| Equipment | db.upgrades, Common then Rare then Epic | Bats, Cleats, Gloves, Charms (by slot) | The rarity | Stat modifiers, “Tags: …” |
| Food | nothing yet | none | ||
| Special Balls | every BallEffect value except None | none | The parks and pitchers that throw it, or “Special ball” | Description from IndexCatalog.BallDescription |
Planned entries today (AddPlanned): Special Balls Heavy, Ice, Fire. Food has only a commented
example (hot_dog).
Adding an entry:
- Real content: add it to the
ContentDatabase(see Add a Pitcher or Boss, Add an Upgrade, Add a Map, Add a Batter, Add a Special Ball). It is listed automatically. - A planned item: add
Planned(entries, IndexCategory.X, "id", "Name", "What it does.", colour)inAddPlanned. Delete the line once the real thing exists, or it shows twice. - A new special ball kind: give it a line in
BallDescription, or it reads “A special ball.” - A new tab: add an
IndexCategoryvalue (and its sub tabs inSubTabsif it needs them).IndexViewneeds no change.
Numbers
| What | Value | Where to tune |
|---|---|---|
| Columns of cards | 2 | IndexView.Columns |
| Card height / gap | 74 / 10 px | IndexView.CardH, CardGap |
| List width | 58% of the panel | IndexView.Draw |
| Rarity colours | Common grey, Rare blue, Epic purple | IndexCatalog.RarityColor |
In the code
| File | What it does |
|---|---|
Assets/_Project/Scripts/Data/IndexCatalog.cs | IndexCategory, IndexEntry, Build, SubTabs, AddPlanned, Planned, BallDescription |
Assets/_Project/Scripts/UI/IndexView.cs | The screen: Open, DrawTabs, DrawSubTabs, DrawGrid, DrawDetail |
Assets/_Project/Scripts/UI/LobbyNav.cs | The INDEX tab (LobbyTab.Index) |
Assets/_Project/Scripts/Core/GameRoot.cs | EnterIndex |
Assets/_Project/Scripts/UI/UIRoot.cs | Draws IndexView in GameState.Index |
Gotchas
- The index lists everything, locked or not: it is a catalogue, not a progress tracker. It shows no prices, levels you own, or what you have unlocked.
- Equipment means shop upgrades, not cosmetics; cosmetics are not listed (see Customization).
- Ballpark card colour is just day (green) or night (blue), from
isNight. - Pitchers’ arsenal subtitle can be long; it is shrunk to fit (
FitText). README.mddocuments the same “add an index entry” rule in its How to add things table.
Related
- Pitchers and Bosses: the Pitchers tab
- Ballparks: the Ballparks tab
- Upgrades: the Equipment tab
- Special Balls: the Special Balls tab
- Batters: the Batters tab
- Game States and Screens: the
Indexstate - Add a Screen: how screens like this are wired