Restructured for new direction.

This commit is contained in:
2026-05-12 12:01:09 +01:00
parent 0439b6c1d2
commit c203f836b1
1134 changed files with 125569 additions and 213519 deletions

View File

@@ -7,10 +7,22 @@ namespace BriarQueen.Framework.Managers.Player.Data.Codex
{
public class Codex
{
public Codex(bool unlocked = false)
{
CodexUnlocked = unlocked;
}
public bool CodexUnlocked { get; private set; }
private readonly List<CodexEntrySo> _entries = new();
public IReadOnlyList<CodexEntrySo> Entries => _entries;
public void UnlockCodex()
{
CodexUnlocked = true;
}
public void AddEntry(CodexEntrySo entry)
{
if (entry == null)
@@ -66,7 +78,7 @@ namespace BriarQueen.Framework.Managers.Player.Data.Codex
public IEnumerable<CodexEntrySo> GetBookEntries()
{
return GetEntriesByType(CodexType.BookEntry);
return GetEntriesByType(CodexType.DocumentEntry);
}
public IEnumerable<CodexEntrySo> GetPuzzleClues()

View File

@@ -1,3 +1,8 @@
using System.Collections.Generic;
using BriarQueen.Data.Identifiers;
using BriarQueen.Data.IO.Saves;
using BriarQueen.Framework.Events.Save;
using BriarQueen.Framework.Events.UI;
using BriarQueen.Framework.Managers.Levels.Data;
using BriarQueen.Framework.Managers.UI;
using Cysharp.Threading.Tasks;
@@ -28,6 +33,12 @@ namespace BriarQueen.Framework.Managers.Player.Data.Codex
{
if (!CheckEmptyHands())
return;
if (!PlayerManager.CodexUnlocked())
{
EventCoordinator.PublishImmediate(new DisplayInteractEvent(InteractEventIDs.Get(ItemInteractKey.CodexLocked)));
return;
}
PlayerManager.UnlockCodexEntry(_codexEntry);
@@ -36,5 +47,20 @@ namespace BriarQueen.Framework.Managers.Player.Data.Codex
await Remove();
}
}
protected override void UpdateSaveGameOnRemoval()
{
var save = SaveManager.CurrentSave;
Debug.Log($"[Base Item] Found save - {save.SaveFileName}");
save.RemovedItems ??= new List<ItemSaveData>();
save.RemovedItems.Add(new ItemSaveData
{
UniqueIdentifier = _codexEntry.UniqueID
});
EventCoordinator.PublishImmediate(new RequestGameSaveEvent());
}
}
}

View File

@@ -15,7 +15,7 @@ namespace BriarQueen.Framework.Managers.Player.Data
[Header("Codex ID")]
[SerializeField]
[ShowIf(nameof(IsBookEntry))]
private BookEntryID _bookEntryID;
private DocumentEntryID _documentEntryID;
[SerializeField]
[ShowIf(nameof(IsPuzzleClue))]
@@ -66,11 +66,11 @@ namespace BriarQueen.Framework.Managers.Player.Data
public CodexType EntryType => _codexType;
public Location Location => _location;
public bool IsBookEntry => _codexType == CodexType.BookEntry;
public bool IsBookEntry => _codexType == CodexType.DocumentEntry;
public bool IsPuzzleClue => _codexType == CodexType.PuzzleClue;
public bool IsPhoto => _codexType == CodexType.Photo;
public BookEntryID BookEntryID => _bookEntryID;
public DocumentEntryID DocumentEntryID => _documentEntryID;
public ClueEntryID ClueEntryID => _clueEntryID;
public PhotoEntryID PhotoEntryID => _photoEntryID;
@@ -92,8 +92,8 @@ namespace BriarQueen.Framework.Managers.Player.Data
{
return _codexType switch
{
CodexType.BookEntry when _bookEntryID != BookEntryID.None =>
CodexEntryIDs.Get(_bookEntryID),
CodexType.DocumentEntry when _documentEntryID != DocumentEntryID.None =>
CodexEntryIDs.Get(_documentEntryID),
CodexType.PuzzleClue when _clueEntryID != ClueEntryID.None =>
CodexEntryIDs.Get(_clueEntryID),

View File

@@ -7,7 +7,6 @@ using BriarQueen.Framework.Events.Gameplay;
using BriarQueen.Framework.Events.UI;
using BriarQueen.Framework.Managers.UI;
using BriarQueen.Framework.Services.Tutorials;
using NUnit.Framework;
using UnityEngine;
namespace BriarQueen.Framework.Managers.Player.Data.Tools