Work on hooking the character system into the character creation

This commit is contained in:
Sebastian Bularca
2026-04-05 15:55:48 +02:00
parent 43dc5e68be
commit 4d83483034
18 changed files with 107 additions and 180 deletions

View File

@@ -4,7 +4,6 @@ using Jovian.SaveSystem;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;
using PlayMode = Nox.Core.PlayMode;
namespace Nox.UI {
/// <summary>
@@ -14,15 +13,28 @@ namespace Nox.UI {
private readonly MenuPrefabsContainer menuPrefabsContainer;
private readonly MenuGameStateData menuGameStateData;
private readonly ISaveSystem saveSystem;
private readonly GameDataState gameDataState;
private readonly PartySettings partySettings;
private readonly ICharacterSystems characterSystems;
private MainMenuReference mainMenuReference;
private CharacterCreationReference characterCreationReference;
private CharacterCreationView characterCreationView;
private AsyncOperationHandle<GameObject> charCreationHandle;
public MainMenuView(MenuPrefabsContainer menuPrefabsContainer, MenuGameStateData menuGameStateData, ISaveSystem saveSystem) {
public MainMenuView(
MenuPrefabsContainer menuPrefabsContainer,
MenuGameStateData menuGameStateData,
ISaveSystem saveSystem,
GameDataState gameDataState,
PartySettings partySettings,
ICharacterSystems characterSystems
) {
this.menuPrefabsContainer = menuPrefabsContainer;
this.menuGameStateData = menuGameStateData;
this.saveSystem = saveSystem;
this.gameDataState = gameDataState;
this.partySettings = partySettings;
this.characterSystems = characterSystems;
}
public void Initialize() {
if(mainMenuReference == null) {
@@ -39,14 +51,14 @@ namespace Nox.UI {
}
}
public void InitializeCharacterCreation() {
private void InitializeCharacterCreation() {
charCreationHandle = Addressables.InstantiateAsync(menuPrefabsContainer.characterCreationReference);
charCreationHandle.Task.ContinueWith(t => {
if(t.IsFaulted) {
Debug.LogError(t.Exception);
}
characterCreationReference =t.Result.GetComponent<CharacterCreationReference>();
characterCreationView = new CharacterCreationView(characterCreationReference, menuGameStateData);
characterCreationView = new CharacterCreationView(characterCreationReference, menuGameStateData, saveSystem, gameDataState, partySettings, characterSystems);
characterCreationView.Show();
});
}