Commit Graph

84 Commits

Author SHA1 Message Date
Michal Pikulski
4d7c48a681 Update Cinematic Manager, Hud Manager, fix log verbosity issue, update PauseMenu 2025-11-08 12:07:45 +01:00
Michal Pikulski
6e466cd7aa Add dev options ot the minigame menu 2025-11-07 17:50:46 +01:00
ea12766cf7 Fixed button issue 2025-11-07 17:21:38 +01:00
41c71f07fd Fixed compile error 2025-11-07 17:08:02 +01:00
d2e79f058b Merge branch 'ui-overhaul' 2025-11-07 16:56:51 +01:00
de2966fb1e Cinematics and UI overhaul 2025-11-07 16:47:10 +01:00
e27bb7bfb6 Refactor interactions, introduce template-method lifecycle management, work on save-load system (#51)
# Lifecycle Management & Save System Revamp

## Overview
Complete overhaul of game lifecycle management, interactable system, and save/load architecture. Introduces centralized `ManagedBehaviour` base class for consistent initialization ordering and lifecycle hooks across all systems.

## Core Architecture

### New Lifecycle System
- **`LifecycleManager`**: Centralized coordinator for all managed objects
- **`ManagedBehaviour`**: Base class replacing ad-hoc initialization patterns
  - `OnManagedAwake()`: Priority-based initialization (0-100, lower = earlier)
  - `OnSceneReady()`: Scene-specific setup after managers ready
  - Replaces `BootCompletionService` (deleted)
- **Priority groups**: Infrastructure (0-20) → Game Systems (30-50) → Data (60-80) → UI/Gameplay (90-100)
- **Editor support**: `EditorLifecycleBootstrap` ensures lifecycle works in editor mode

### Unified SaveID System
- Consistent format: `{ParentName}_{ComponentType}`
- Auto-registration via `AutoRegisterForSave = true`
- New `DebugSaveIds` editor tool for inspection

## Save/Load Improvements

### Enhanced State Management
- **Extended SaveLoadData**: Unlocked minigames, card collection states, combination items, slot occupancy
- **Async loading**: `ApplyCardCollectionState()` waits for card definitions before restoring
- **New `SaveablePlayableDirector`**: Timeline sequences save/restore playback state
- **Fixed race conditions**: Proper initialization ordering prevents data corruption

## Interactable & Pickup System

- Migrated to `OnManagedAwake()` for consistent initialization
- Template method pattern for state restoration (`RestoreInteractionState()`)
- Fixed combination item save/load bugs (items in slots vs. follower hand)
- Dynamic spawning support for combined items on load
- **Breaking**: `Interactable.Awake()` now sealed, use `OnManagedAwake()` instead

##  UI System Changes

- **AlbumViewPage** and **BoosterNotificationDot**: Migrated to `ManagedBehaviour`
- **Fixed menu persistence bug**: Menus no longer reappear after scene transitions
- **Pause Menu**: Now reacts to all scene loads (not just first scene)
- **Orientation Enforcer**: Enforces per-scene via `SceneManagementService`
- **Loading Screen**: Integrated with new lifecycle

## ⚠️ Breaking Changes

1. **`BootCompletionService` removed** → Use `ManagedBehaviour.OnManagedAwake()` with priority
2. **`Interactable.Awake()` sealed** → Override `OnManagedAwake()` instead
3. **SaveID format changed** → Now `{ParentName}_{ComponentType}` consistently
4. **MonoBehaviours needing init ordering** → Must inherit from `ManagedBehaviour`

Co-authored-by: Michal Pikulski <michal.a.pikulski@gmail.com>
Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #51
2025-11-07 15:38:31 +00:00
Michal Pikulski
32a477b843 WOrking card dragging, slotting, previewing 2025-11-07 12:51:45 +01:00
Michal Pikulski
77f7d1ee97 Working card dragging into album slots, persistent slots 2025-11-07 11:24:19 +01:00
Michal Pikulski
3e607f3857 Slotting cards in album after revealing 2025-11-07 01:51:03 +01:00
Michal Pikulski
debe70c9b1 Hammer out some last flows of the booster opening page 2025-11-06 23:52:02 +01:00
Michal Pikulski
a705b3a829 Semi-working rarity upgrades 2025-11-06 23:18:02 +01:00
Michal Pikulski
d23c000347 Working flipping cards 2025-11-06 23:17:55 +01:00
Michal Pikulski
774f27410a Working drag, tap, open sequence, looking pretty OK 2025-11-06 23:17:46 +01:00
Michal Pikulski
1b1ea65744 Fire off impulses on booster taps 2025-11-06 23:17:36 +01:00
Michal Pikulski
d01859cec0 More snappy tap animation 2025-11-06 23:17:35 +01:00
journaliciouz
f576dad677 New and crispy apple map 2025-11-06 22:28:38 +01:00
Michal Pikulski
1c9d0333ea Fix editor compilation issue 2025-11-06 18:23:21 +01:00
7fb0b14337 Merge branch 'ui-animation' 2025-11-06 17:49:57 +01:00
eba2befc5f Good-enough-for-now appswitcher 2025-11-06 17:49:44 +01:00
78d0bf6441 AppSwitcher work 2025-11-06 15:36:02 +01:00
Michal Pikulski
2d10d92bf5 Add a semi-finished booster opening sequence 2025-11-06 15:27:08 +01:00
Michal Pikulski
4e0c9cb4c4 Working visual part 2025-11-06 15:27:08 +01:00
Michal Pikulski
95daea8d34 Code up the card part 2025-11-06 15:27:08 +01:00
Michal Pikulski
b6d8586eab Setup booster page opening 2025-11-06 15:27:08 +01:00
e7ff137d57 Implemented new Lottie plugin, added AppSwitcher icon 2025-11-06 14:27:44 +01:00
Michal Pikulski
b17ba7bd98 Finish setting up the basic album layout 2025-11-06 01:25:13 +01:00
Michal Pikulski
50c0a12391 New card UI, new visual config, new card definitions, new working editor window for authoring! 2025-11-05 23:50:15 +01:00
journaliciouz
949bd6d32b You can close the card album again 2025-11-05 16:36:00 +01:00
journaliciouz
041159a02a Implemented scrapbook assets into book plugin 2025-11-05 14:48:10 +01:00
Michal Pikulski
c24c5df881 Update minigame switcher to only unlock when all puzzles completed 2025-10-29 11:19:17 +01:00
Michal Pikulski
43779c560e Cleanup compile warnings, cleanup logs, spruce up level selection menu 2025-10-28 14:31:17 +01:00
Michal Pikulski
548c5118ae Update render settings, add lighting settings and update some scripts 2025-10-28 10:08:49 +01:00
Michal Pikulski
dad1f6498d Pause timescale when game is paused 2025-10-27 15:21:23 +01:00
Michal Pikulski
7005b70a0d Default tutorial to auto-progress 2025-10-27 14:56:59 +01:00
Michal Pikulski
3ea161c987 Auto vs Manual progression of the tutorial 2025-10-27 14:55:42 +01:00
Michal Pikulski
f5c1ae51cd MPV of save/load system 2025-10-27 14:00:37 +01:00
5a85a602bd Revamp game pausing and input handling. Fix minigame tutorial and end sequence. (#39)
- Revamp pausing and centralize management in GameManager
- Switch Pause implementation to be counter-based to solve corner case of multiple pause requests
- Remove duplicated Pause logic from other components
- Add pausing when browsing the card album
- Fully deliver the exclusive UI implementation
- Spruce up the MiniGame tutorial with correct pausing, hiding other UI
- Correctly unpause after showing tutorial
- Fix minigame ending sequence. The cinematic correctly plays only once now
- Replaying the minigame works

Co-authored-by: Michal Adam Pikulski <michal@foolhardyhorizons.com>
Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #39
2025-10-24 11:09:32 +00:00
Michal Adam Pikulski
35acaddca5 FIx the issue of end game screen appearing twice 2025-10-22 11:50:24 +02:00
Michal Adam Pikulski
8591490cb2 Make the score display a UIPage as well 2025-10-22 10:37:59 +02:00
Michal Adam Pikulski
68886aafd4 Roll the pause menu into the UI page system 2025-10-22 09:35:34 +02:00
Michal Adam Pikulski
357f942e0d Moved UIPageController out of the card system and into a dedicated prefab 2025-10-22 09:20:18 +02:00
Michal Adam Pikulski
faed21edab Make the Backpack UI visible in the AppleHillsLevel as well 2025-10-22 09:05:18 +02:00
Michal Adam Pikulski
3aed47b183 Fix input issues 2025-10-21 15:58:13 +02:00
Michal Adam Pikulski
00f6d2c6c6 Add a dirty booster pack opening sequence 2025-10-21 15:40:47 +02:00
Michal Adam Pikulski
bb43c552b0 Block input on first loop 2025-10-21 12:51:28 +02:00
Michal Adam Pikulski
2fb77e1040 Cleanup the card implementation, add some readme files and update namespaces 2025-10-21 12:10:16 +02:00
Michal Adam Pikulski
3e833b8991 Working card system 2025-10-20 16:33:58 +02:00
Michal Adam Pikulski
83b5c8994d Kind of working booster packs 2025-10-20 16:33:58 +02:00
Michal Adam Pikulski
32f726d229 Second draft of the consolidated card system 2025-10-20 16:33:58 +02:00