Commit Graph

18 Commits

Author SHA1 Message Date
Michal Pikulski
75cd70a18a Play intro audio only once 2025-11-10 11:09:06 +01:00
Michal Pikulski
0c9a388433 Move buttons to HUD Manager 2025-11-09 13:23:03 +01:00
Michal Pikulski
4d7c48a681 Update Cinematic Manager, Hud Manager, fix log verbosity issue, update PauseMenu 2025-11-08 12:07:45 +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
0dc3f3e803 Added New Menu Background Textures 2025-11-05 17:25:26 +01:00
journaliciouz
ae840a4b2f Changed Awake/Start to OnAwake 2025-11-03 14:44:15 +01:00
journaliciouz
d317fffad7 Added audio data to the item pickups 2025-10-31 16:22:48 +01:00
journaliciouz
cdbb2e0d3f Added audio of Pulver combining stuff 2025-10-31 15:45:28 +01:00
journaliciouz
d0da5d76cd Fixed a bug where state machines and auto play audio on awake fucked me 2025-10-31 11:19:47 +01:00
journaliciouz
d48b459fea Audio refactor almost done 2025-10-30 16:31:01 +01:00
journaliciouz
2b41a9f200 Gardener audio refactor 2025-10-30 15:25:07 +01:00
journaliciouz
e81879959e Properly queue critical VO clips 2025-10-30 14:17:47 +01:00
988bc53ec8 Finally, priority VO 2025-10-29 17:01:02 +01:00
86bee75578 Implemented pauses on AudioManager 2025-10-28 13:19:33 +01:00
MacBuilder
1a04f2a3d2 FIxed annoying compiler error 2025-10-21 13:37:14 +02:00
1b0a206be7 Wolter sound FX 2025-10-20 17:05:24 +02:00
c07f64ea4f Spatial lawnmower audio implemented 2025-10-20 16:21:32 +02:00
b49bb43f79 AnneLise bird counter implemented 2025-10-20 13:57:38 +02:00