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 ContentDatabase every 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 in IndexCatalog.AddPlanned.

How it works

  1. The top bar (LobbyNav) has PLAY, CUSTOMIZE, PERKS, BATTING CAGE and INDEX. INDEX calls GameRoot.EnterIndex (state GameState.Index). The top bar stays up with INDEX raised; PERKS and BATTING CAGE still open their popups over it.
  2. On opening, IndexView.Open calls IndexCatalog.Build(content) and starts on the first tab, first sub tab, first entry. Nothing is remembered between visits.
  3. Tabs (one per IndexCategory, in this order): BATTERS, PITCHERS, BALLPARKS, EQUIPMENT, FOOD, SPECIAL BALLS. Pitchers and Equipment get a second row of sub tabs.
  4. 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.
  5. 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.”
  6. 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):

TabSourceSub tabsSubtitleDetails
Battersdb.battersnoneStarter, “Account level n”, or UnlockableThe batter’s stat modifiers
Pitchersdb.pitchersPitchers, Bosses (isBoss)The pitch names in their mix”Throws: …”, batter modifiers, their own special balls and decoys (DescribeBalls)
Ballparksdb.practiceParks first (subtitle “Batting cage”), then db.ballparksnone”Batting cage” or blankThe park’s modifiers (DescribeModifiers), “n targets past the wall”
Equipmentdb.upgrades, Common then Rare then EpicBats, Cleats, Gloves, Charms (by slot)The rarityStat modifiers, “Tags: …”
Foodnothing yetnone
Special Ballsevery BallEffect value except NonenoneThe 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) in AddPlanned. 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 IndexCategory value (and its sub tabs in SubTabs if it needs them). IndexView needs no change.

Numbers

WhatValueWhere to tune
Columns of cards2IndexView.Columns
Card height / gap74 / 10 pxIndexView.CardH, CardGap
List width58% of the panelIndexView.Draw
Rarity coloursCommon grey, Rare blue, Epic purpleIndexCatalog.RarityColor

In the code

FileWhat it does
Assets/_Project/Scripts/Data/IndexCatalog.csIndexCategory, IndexEntry, Build, SubTabs, AddPlanned, Planned, BallDescription
Assets/_Project/Scripts/UI/IndexView.csThe screen: Open, DrawTabs, DrawSubTabs, DrawGrid, DrawDetail
Assets/_Project/Scripts/UI/LobbyNav.csThe INDEX tab (LobbyTab.Index)
Assets/_Project/Scripts/Core/GameRoot.csEnterIndex
Assets/_Project/Scripts/UI/UIRoot.csDraws 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.md documents the same “add an index entry” rule in its How to add things table.