3.2 KiB
TH1 Main Menu Logic Summary
Entry
UIManager.OnGameStart() publishes ShowUIOutsideMenu.
UIEventManagerBinder.HandleShowUIOutsideMenu() receives it and calls:
UIOutsideManager.StartNewTask(new UIOutsideTask(ViewControllerManager.UIOutsideMenuController, evt))
UIOutsideManager.StartNewTask() closes the previous current Outside task, assigns the new task, and opens the controller.
UIOutsideMenuController.OnOpen() calls WindowScript.SetContent(evt) and hides the startup fallback image once.
Main Menu Setup
UIOutsideMenuView.SetContent() performs the runtime setup:
- Randomizes
ButtonListicons by selecting uniqueGiantTypevalues from the implemented force/chess combinations. - Binds click listeners for every menu button.
- Hides
ResumeButtonby default, then shows it only whenGameArchiveManager.Instance.HasQuickResumeArchive(NetMode.Single)is true. - Sets
QQHintVersionfromConfigManager.Instance.VersionCfg.CurVersionInfo.FullVersion. - Configures the Traditional Chinese Discord hint.
- Plays the
MainBGM throughAudioManager.Instance.PlayMusic("Main", 1f, 2f, true).
Button Flow
| Button | Runtime action |
|---|---|
StartButton |
Publishes ShowUIOutsideSelect. |
ResumeButton |
Loads the quick single-player archive, opens loading UI, calls Main.Instance.ResumeMatch(record, preread), then hides menu/all outside UI. |
MultiplayButton |
Publishes ShowUIOutsideMultiplay. |
LibraryButton |
Publishes ShowUIOutsideLibrary. |
HistoryButton |
Publishes ShowUIOutsideHistory. |
TutorButton |
Publishes ShowUIOutsideTutor. |
StoryButton |
Publishes ShowUIOutsideStory; binder opens the independent Story controller through UIOutsideManager.OpenStory(). |
TransReportButton |
Publishes ShowUIGlobalBugReport. |
QuestionnaireButton |
Found or runtime-created, then publishes ShowUIOutsideQuestionnaire. |
AnnouncementButton |
Opens AnnouncementPanel locally. |
AboutButton |
Opens AboutPanel locally. |
SettingButton |
Opens SettingPanel locally. |
ShutdownButton |
Opens ShutdownPanel locally. |
Local Child Panels
AnnouncementPanel:
- Close by close button or blocking area.
- Builds version tabs from
ConfigManager.Instance.VersionCfg.Versions. - Shows selected version content through multilingual text.
AboutPanel:
- Displays current version.
- Binds external links: Bilibili, website, X, YouTube, Discord.
- Builds staff rows from
Table.Instance.StaffDataAssets.StaffList.
SettingPanel:
- Initializes
LanguageOptionGroupto the current language. - Treats ZH, TDZH, JP, EN, KR as primary language options.
- Uses option index
5forMoreLanguageModule. ManageButtonhides the local setting panel and publishesShowUIOutsideMod.
ShutdownPanel:
- Cancel and block close the panel.
- Confirm calls
Application.Quit()in build or stops Play Mode in editor.
Important UI Layer Behavior
Most Outside screens use UIOutsideManager.StartNewTask(), so opening another normal Outside screen closes the previous one.
Loading is separate from the current Outside task.
Story, Invited, and Wiki are independent controllers in UIOutsideManager and do not follow the ordinary single current-task replacement path.