Skip to content

Archived on 2026-10-24. This is a historical implementation note, not current setup instructions or an active task list. Original claims, code examples, file paths, and completion statements have not all been revalidated. Use the current documentation and issue register for maintenance decisions.

UI File Reorganization Summary

Date

December 29, 2025

Overview

Reorganized UI files from feature-based structure (Achievement/, Collection/, Shop/) to type-based structure (Controllers/, Views/, Buttons/, Shared/). Removed old Panel.cs script and integrated its logic into Page and MenuController.

New Folder Structure

Assets/Script/App/UI/

├── Controllers/          # All UI controller scripts
├── Views/               # All UI view scripts
├── Buttons/              # All UI button scripts
└── Shared/              # Shared UI components

Assets/Script/App/Misc/

└── Misc/               # Miscellaneous UI-related scripts

Files Moved

Controllers (→ Assets/Script/App/UI/Controllers/)

  • AchievementUIController.cs (from Mainmenu/Achievement/)
  • CharacterSelectionUIController.cs (from Mainmenu/)
  • CollectionUIController.cs (from Mainmenu/Collection/)
  • LeaderboardUIController.cs (from Mainmenu/)
  • MenuController.cs (from Core/)
  • ShopUIController.cs (from Mainmenu/Shop/)

Views (→ Assets/Script/App/UI/Views/)

  • AchievementCardView.cs (from Mainmenu/Achievement/)
  • AchievementView.cs (from Mainmenu/Achievement/)
  • CollectionButtonView.cs (from Mainmenu/Collection/)
  • CollectionView.cs (from Mainmenu/Collection/)
  • MenuView.cs (from Mainmenu/)
  • ShopButtonView.cs (from Mainmenu/Shop/)
  • ShopView.cs (from Mainmenu/Shop/)

Buttons (→ Assets/Script/App/UI/Buttons/)

  • CollectionButton.cs (from Mainmenu/Collection/)
  • LeaderboardButton.cs (from Mainmenu/)
  • LevelSelectButton.cs (from Mainmenu/)
  • ShopButton.cs (from Mainmenu/Shop/)

Shared Components (→ Assets/Script/App/UI/Shared/)

  • Page.cs (from Mainmenu/) - Updated with IsRootPage property
  • AutoScrollNavigation.cs (from Mainmenu/)
  • TabsManager.cs (from Mainmenu/)
  • Tooltip.cs (from Mainmenu/)
  • TooltipSystem.cs (from Mainmenu/)
  • TooltipTrigger.cs (from Mainmenu/)
  • TooltipTrigger_AchievementLock.cs (from Mainmenu/)
  • TooltipTrigger_AchievementReward.cs (from Mainmenu/)
  • TooltipTrigger_Button.cs (from Mainmenu/)
  • VersionListButton.cs (from Mainmenu/)
  • NEW: GamePanel.cs - Replacement for Panel.cs in game contexts

Misc (→ Assets/Script/App/Misc/)

  • ChangeLogReader.cs (from Mainmenu/)
  • Statistic.cs (from Mainmenu/)

Files Deleted

  • Assets/Script/App/UI/Mainmenu/Panel.cs
  • Assets/Script/App/UI/Mainmenu/Panel.cs.meta
  • Assets/Script/App/UI/Mainmenu/Achievement/ (entire folder)
  • Assets/Script/App/UI/Mainmenu/Collection/ (entire folder)
  • Assets/Script/App/UI/Mainmenu/Shop/ (entire folder)
  • Assets/Script/App/UI/Mainmenu.meta (folder meta)

Code Changes

1. Page.cs

Added: IsRootPage property to identify root pages

public bool IsRootPage = false;

2. MenuController.cs

Changes: - Moved from Core/ to UI/Controllers/ - Added UpdateBackQuitText() method to handle back/quit button logic - Updated PopPage() to call UpdateBackQuitText() - Updated Start() to call UpdateBackQuitText() instead of separate string refresh calls

Back/Quit Logic: - Shows "Quit" when on root page (stack count == 1 or IsRootPage == true) - Shows "Back" when navigating deeper in the menu

3. MenuView.cs

Changes: - Removed redundant LocalizedString references (now handled by MenuController) - Simplified OnPagePopped() method with comment explaining back/quit text is handled by MenuController - Removed Unity.Localization import (no longer needed)

4. GameMenuManager.cs

Changes: - Updated all Panel references to GamePanel - Updated Panel.PanelType enum references to GamePanel.GamePanelType - Updated method signatures: - OpenPanel(Panel panel) → OpenPanel(GamePanel panel) - ClosePanel(Panel panel) → ClosePanel(GamePanel panel)

5. TutorialManager.cs

Changes: - Updated all Panel references to GamePanel - Updated Panel.PanelType enum references to GamePanel.GamePanelType - Updated method signatures: - OpenPanel(Panel panel) → OpenPanel(GamePanel panel) - ClosePanel(Panel panel) → ClosePanel(GamePanel panel)

6. GamePanel.cs (NEW)

Purpose: Replacement for Panel.cs in in-game contexts Contains: - panelName field with GamePanelType enum - isMainPanel boolean - firstSelected GameObject reference - Same enum values as original PanelType for compatibility

Architecture Improvements

Separation of Concerns

  1. Controllers - Handle UI logic and data management
  2. Views - Handle UI display and user interaction
  3. Buttons - Handle button-specific behavior
  4. Shared - Reusable UI components

Panel Logic Consolidation

  • Main Menu Navigation: Uses Page system with MenuController
  • Page.cs handles animations and element management
  • MenuController handles page stack and transitions
  • Back/Quit logic based on page stack state

  • In-Game Menus: Uses GamePanel system

  • GameMenuManager handles in-game pause/settings menus
  • TutorialManager handles tutorial UI panels
  • GamePanel replaces old Panel.cs for in-game contexts

Benefits

  1. Better Organization: Files grouped by type rather than feature
  2. Easier Navigation: Clear separation between controllers, views, and buttons
  3. Reduced Duplication: Shared components in one location
  4. Clearer Architecture: MVC-like structure with Controllers, Views, and Buttons
  5. Back/Quit Logic Simplification: Logic centralized in MenuController
  6. Maintainability: Easier to find and update related files

Migration Notes

For Developers

  1. Finding Files: Look in type-based folders rather than feature folders
  2. Controllers: Assets/Script/App/UI/Controllers/
  3. Views: Assets/Script/App/UI/Views/
  4. Buttons: Assets/Script/App/UI/Buttons/
  5. Shared: Assets/Script/App/UI/Shared/

  6. Creating New UI Features:

  7. Controller logic → Controllers/YourFeatureController.cs
  8. View logic → Views/YourFeatureView.cs
  9. Button logic → Buttons/YourFeatureButton.cs

  10. Using Page System:

  11. Set IsRootPage = true on main menu pages
  12. MenuController automatically handles back/quit text

  13. Using GamePanel System:

  14. For in-game pause/settings menus
  15. Use GamePanel.GamePanelType enum for panel identification

Testing Checklist

  • [ ] Main menu navigation works correctly
  • [ ] Back button shows "Back" when not on root page
  • [ ] Back button shows "Quit" when on root page
  • [ ] All sub-pages (Shop, Collection, Achievement, etc.) navigate correctly
  • [ ] In-game pause menu works correctly
  • [ ] Tutorial UI panels work correctly
  • [ ] No broken references in Unity scenes
  • [ ] All scripts compile without errors

Future Considerations

  1. Consider renaming Misc/ folder to better describe its contents
  2. Consider moving GamePanel.cs to a more appropriate location if needed
  3. Document best practices for creating new UI features
  4. Consider adding namespaces to prevent conflicts